poppler-rs-0.25.0/.cargo_vcs_info.json0000644000000001450000000000100132230ustar { "git": { "sha1": "c8059f264b09a8f69b94a5e68f430b55e600ab48" }, "path_in_vcs": "poppler" }poppler-rs-0.25.0/Cargo.lock0000644000000314660000000000100112100ustar # This file is automatically @generated by Cargo. # It is not intended for manual editing. version = 3 [[package]] name = "autocfg" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "bitflags" version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" [[package]] name = "cairo-rs" version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6466a563dea2e99f59f6ffbb749fd0bdf75764f5e6e93976b5e7bd73c4c9efb" dependencies = [ "bitflags", "cairo-sys-rs", "glib", "libc", ] [[package]] name = "cairo-sys-rs" version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cab7e9f13c802625aad1ad2b4ae3989f4ce9339ff388f335a6f109f9338705e2" dependencies = [ "glib-sys", "libc", "system-deps", ] [[package]] name = "cfg-expr" version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d0390889d58f934f01cd49736275b4c2da15bcfc328c78ff2349907e6cabf22" dependencies = [ "smallvec", "target-lexicon", ] [[package]] name = "equivalent" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "futures-channel" version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" dependencies = [ "futures-core", ] [[package]] name = "futures-core" version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" [[package]] name = "futures-executor" version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7acc85df6714c176ab5edf386123fafe217be88c0840ec11f199441134a074e2" dependencies = [ "futures-core", "futures-task", "futures-util", ] [[package]] name = "futures-io" version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" [[package]] name = "futures-macro" version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d" dependencies = [ "proc-macro2", "quote", "syn 1.0.103", ] [[package]] name = "futures-task" version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" [[package]] name = "futures-util" version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" dependencies = [ "futures-core", "futures-macro", "futures-task", "pin-project-lite", "pin-utils", "slab", ] [[package]] name = "gio" version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "273d64c833fbbf7cd86c4cdced893c5d3f2f5d6aeb30fd0c30d172456ce8be2e" dependencies = [ "futures-channel", "futures-core", "futures-io", "futures-util", "gio-sys", "glib", "libc", "pin-project-lite", "smallvec", ] [[package]] name = "gio-sys" version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c8130f5810a839d74afc3a929c34a700bf194972bb034f2ecfe639682dd13cc" dependencies = [ "glib-sys", "gobject-sys", "libc", "system-deps", "windows-sys", ] [[package]] name = "glib" version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "690e8bcf8a819b5911d6ae79879226191d01253a4f602748072603defd5b9553" dependencies = [ "bitflags", "futures-channel", "futures-core", "futures-executor", "futures-task", "futures-util", "gio-sys", "glib-macros", "glib-sys", "gobject-sys", "libc", "memchr", "smallvec", ] [[package]] name = "glib-macros" version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e772291ebea14c28eb11bb75741f62f4a4894f25e60ce80100797b6b010ef0f9" dependencies = [ "heck", "proc-macro-crate", "proc-macro2", "quote", "syn 2.0.104", ] [[package]] name = "glib-sys" version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b2be4c74454fb4a6bd3328320737d0fa3d6939e2d570f5d846da00cb222f6a0" dependencies = [ "libc", "system-deps", ] [[package]] name = "gobject-sys" version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab318a786f9abd49d388013b9161fa0ef8218ea6118ee7111c95e62186f7d31f" dependencies = [ "glib-sys", "libc", "system-deps", ] [[package]] name = "hashbrown" version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" [[package]] name = "heck" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "indexmap" version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661" dependencies = [ "equivalent", "hashbrown", ] [[package]] name = "libc" version = "0.2.135" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68783febc7782c6c5cb401fbda4de5a9898be1762314da0bb2c10ced61f18b0c" [[package]] name = "memchr" version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" [[package]] name = "pin-project-lite" version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" [[package]] name = "pin-utils" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" [[package]] name = "poppler-rs" version = "0.25.0" dependencies = [ "cairo-rs", "gio", "glib", "libc", "poppler-sys-rs", ] [[package]] name = "poppler-sys-rs" version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f59d8616943cf71be2a33d866dee973eaaa3e507eb21eb102c6424f773ea6ad" dependencies = [ "cairo-sys-rs", "gio-sys", "glib-sys", "gobject-sys", "libc", "system-deps", ] [[package]] name = "proc-macro-crate" version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edce586971a4dfaa28950c6f18ed55e0406c1ab88bbce2c6f6293a7aaba73d35" dependencies = [ "toml_edit", ] [[package]] name = "proc-macro2" version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" dependencies = [ "unicode-ident", ] [[package]] name = "quote" version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] [[package]] name = "serde" version = "1.0.147" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d193d69bae983fc11a79df82342761dfbf28a99fc8d203dca4c3c1b590948965" [[package]] name = "serde_spanned" version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" dependencies = [ "serde", ] [[package]] name = "slab" version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" dependencies = [ "autocfg", ] [[package]] name = "smallvec" version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] name = "syn" version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] [[package]] name = "syn" version = "2.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] [[package]] name = "system-deps" version = "7.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4be53aa0cba896d2dc615bd42bbc130acdcffa239e0a2d965ea5b3b2a86ffdb" dependencies = [ "cfg-expr", "heck", "pkg-config", "toml", "version-compare", ] [[package]] name = "target-lexicon" version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e502f78cdbb8ba4718f566c418c52bc729126ffd16baee5baa718cf25dd5a69a" [[package]] name = "toml" version = "0.8.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" dependencies = [ "serde", "serde_spanned", "toml_datetime", "toml_edit", ] [[package]] name = "toml_datetime" version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" dependencies = [ "serde", ] [[package]] name = "toml_edit" version = "0.22.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" dependencies = [ "indexmap", "serde", "serde_spanned", "toml_datetime", "winnow", ] [[package]] name = "unicode-ident" version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" [[package]] name = "version-compare" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "852e951cb7832cb45cb1169900d19760cfa39b82bc0ea9c0e5a14ae88411c98b" [[package]] name = "windows-sys" version = "0.60.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" dependencies = [ "windows-targets", ] [[package]] name = "windows-targets" version = "0.53.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", "windows_i686_gnu", "windows_i686_gnullvm", "windows_i686_msvc", "windows_x86_64_gnu", "windows_x86_64_gnullvm", "windows_x86_64_msvc", ] [[package]] name = "windows_aarch64_gnullvm" version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" [[package]] name = "windows_aarch64_msvc" version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" [[package]] name = "windows_i686_gnu" version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" [[package]] name = "windows_i686_gnullvm" version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" [[package]] name = "windows_i686_msvc" version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" [[package]] name = "windows_x86_64_gnu" version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" [[package]] name = "windows_x86_64_gnullvm" version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" [[package]] name = "windows_x86_64_msvc" version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" [[package]] name = "winnow" version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3edebf492c8125044983378ecb5766203ad3b4c2f7a922bd7dd207f6d443e95" dependencies = [ "memchr", ] poppler-rs-0.25.0/Cargo.toml0000644000000046060000000000100112270ustar # 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 are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2021" rust-version = "1.70.0" name = "poppler-rs" version = "0.25.0" build = false autolib = false autobins = false autoexamples = false autotests = false autobenches = false description = "High-level (safe) bindings for poppler-glib" documentation = "https://world.pages.gitlab.gnome.org/Rust/poppler-rs/stable/latest/docs/poppler" readme = "README.md" keywords = [ "poppler", "pdf", ] categories = [ "api-bindings", "graphics", "rendering::data-formats", ] license = "MIT" repository = "https://gitlab.gnome.org/World/Rust/poppler-rs" [package.metadata.docs.rs] all-features = true rustc-args = [ "--cfg", "docsrs", ] rustdoc-args = [ "--cfg", "docsrs", ] [features] v0_72 = ["poppler-sys-rs/v0_72"] v0_73 = [ "v0_72", "poppler-sys-rs/v0_73", ] v0_78 = [ "v0_73", "poppler-sys-rs/v0_78", ] v0_80 = [ "v0_78", "poppler-sys-rs/v0_80", ] v0_82 = [ "v0_80", "poppler-sys-rs/v0_82", ] v0_88 = [ "v0_82", "poppler-sys-rs/v0_88", ] v0_89 = [ "v0_88", "poppler-sys-rs/v0_89", ] v0_90 = [ "v0_89", "poppler-sys-rs/v0_90", ] v20_4 = [ "v0_90", "poppler-sys-rs/v20_4", ] v20_9 = [ "v20_4", "poppler-sys-rs/v20_9", ] v21_12 = [ "v21_5", "poppler-sys-rs/v21_12", ] v21_5 = [ "v20_9", "poppler-sys-rs/v21_5", ] v22_2 = [ "v21_12", "poppler-sys-rs/v22_2", ] v22_7 = [ "v22_2", "poppler-sys-rs/v22_7", ] v23_7 = [ "v22_7", "poppler-sys-rs/v23_7", ] v23_8 = [ "v23_7", "poppler-sys-rs/v23_8", ] v24_12 = [ "v23_8", "poppler-sys-rs/v24_12", ] v25_2 = [ "v24_12", "poppler-sys-rs/v25_2", ] v25_6 = [ "v25_2", "poppler-sys-rs/v25_6", ] [lib] name = "poppler" path = "src/lib.rs" [dependencies.cairo-rs] version = "0.21" [dependencies.gio] version = "0.21" [dependencies.glib] version = "0.21" [dependencies.libc] version = "0.2.107" [dependencies.poppler-sys-rs] version = "0.25" poppler-rs-0.25.0/Cargo.toml.orig000064400000000000000000000034011046102023000147000ustar 00000000000000[package] name = "poppler-rs" license = "MIT" keywords = ["poppler", "pdf"] categories = ["api-bindings", "graphics", "rendering::data-formats"] description = "High-level (safe) bindings for poppler-glib" readme = "README.md" version = "0.25.0" edition = "2021" rust-version = "1.70.0" repository = "https://gitlab.gnome.org/World/Rust/poppler-rs" documentation = "https://world.pages.gitlab.gnome.org/Rust/poppler-rs/stable/latest/docs/poppler" [lib] name = "poppler" [dependencies] libc = "0.2.107" [dependencies.glib] git = "https://github.com/gtk-rs/gtk-rs-core" version = "0.21" branch = "0.21" [dependencies.gio] git = "https://github.com/gtk-rs/gtk-rs-core" version = "0.21" branch = "0.21" [dependencies.cairo-rs] git = "https://github.com/gtk-rs/gtk-rs-core" version = "0.21" branch = "0.21" [dependencies.poppler-sys-rs] version = "0.25" path = "../sys" [package.metadata.docs.rs] all-features = true rustc-args = ["--cfg", "docsrs"] rustdoc-args = ["--cfg", "docsrs"] [features] v0_72 = ["poppler-sys-rs/v0_72"] v0_73 = ["v0_72", "poppler-sys-rs/v0_73"] v0_78 = ["v0_73", "poppler-sys-rs/v0_78"] v0_80 = ["v0_78", "poppler-sys-rs/v0_80"] v0_82 = ["v0_80", "poppler-sys-rs/v0_82"] v0_88 = ["v0_82", "poppler-sys-rs/v0_88"] v0_89 = ["v0_88", "poppler-sys-rs/v0_89"] v0_90 = ["v0_89", "poppler-sys-rs/v0_90"] v20_4 = ["v0_90", "poppler-sys-rs/v20_4"] v20_9 = ["v20_4", "poppler-sys-rs/v20_9"] v21_5 = ["v20_9", "poppler-sys-rs/v21_5"] v21_12 = ["v21_5", "poppler-sys-rs/v21_12"] v22_2 = ["v21_12", "poppler-sys-rs/v22_2"] v22_7 = ["v22_2", "poppler-sys-rs/v22_7"] v23_7 = ["v22_7", "poppler-sys-rs/v23_7"] v23_8 = ["v23_7", "poppler-sys-rs/v23_8"] v24_12 = ["v23_8", "poppler-sys-rs/v24_12"] v25_2 = ["v24_12", "poppler-sys-rs/v25_2"] v25_6 = ["v25_2", "poppler-sys-rs/v25_6"] poppler-rs-0.25.0/Gir.toml000064400000000000000000000131351046102023000134340ustar 00000000000000[options] library = "Poppler" version = "0.18" target_path = "." min_cfg_version = "0.70" girs_directories = ["../gir-files", "../"] work_mode = "normal" deprecate_by_min_version = true single_version_file = true external_libraries = [ "Gio", "GLib", "GObject", "Cairo", ] manual = [ "Gio.Cancellable", "Gio.File", "Gio.InputStream", "GLib.Bytes", "GLib.Date", "GLib.DateTime", "GLib.Error", "cairo.Context", "cairo.Surface", "cairo.Region", "Poppler.PageRange", ] generate = [ "Poppler.ActionLayerAction", "Poppler.ActionMovieOperation", "Poppler.ActionType", "Poppler.AdditionalActionType", "Poppler.AnnotCalloutLine", "Poppler.AnnotExternalDataType", "Poppler.AnnotFileAttachment", "Poppler.AnnotFlag", "Poppler.AnnotFreeText", "Poppler.AnnotFreeTextQuadding", "Poppler.AnnotMapping", "Poppler.AnnotMarkup", "Poppler.AnnotMarkupReplyType", "Poppler.AnnotTextState", "Poppler.AnnotType", "Poppler.Attachment", "Poppler.Backend", "Poppler.CertificateStatus", "Poppler.Dest", "Poppler.DestType", "Poppler.FindFlags", "Poppler.FontInfo", "Poppler.FontType", "Poppler.FontsIter", "Poppler.FormButtonType", "Poppler.FormChoiceType", "Poppler.FormField", "Poppler.FormFieldMapping", "Poppler.FormFieldType", "Poppler.FormTextType", "Poppler.ImageMapping", "Poppler.IndexIter", "Poppler.Layer", "Poppler.LayersIter", "Poppler.LinkMapping", "Poppler.MoviePlayMode", "Poppler.PageLayout", "Poppler.PageMode", "Poppler.PageTransition", "Poppler.PageTransitionType", "Poppler.PageTransitionAlignment", "Poppler.PageTransitionDirection", "Poppler.Permissions", "Poppler.PDFConformance", "Poppler.PDFPart", "Poppler.PDFSubtype", "Poppler.PrintDuplex", "Poppler.PrintFlags", "Poppler.PrintScaling", "Poppler.SelectionStyle", "Poppler.SignatureInfo", "Poppler.SignatureValidationFlags", "Poppler.SignatureStatus", "Poppler.StructureBlockAlign", "Poppler.StructureBorderStyle", "Poppler.StructureElement", "Poppler.StructureFormRole", "Poppler.StructureFormState", "Poppler.StructureGlyphOrientation", "Poppler.StructureInlineAlign", "Poppler.StructureElementKind", "Poppler.StructureListNumbering", "Poppler.StructurePlacement", "Poppler.StructureRubyAlign", "Poppler.StructureRubyPosition", "Poppler.StructureTableScope", "Poppler.StructureGetTextFlags", "Poppler.StructureTextAlign", "Poppler.StructureTextDecoration", "Poppler.StructureWritingMode", "Poppler.StructureElementIter", "Poppler.TextAttributes", "Poppler.TextSpan", "Poppler.ViewerPreferences", ] [[object]] name = "Poppler.*" status = "generate" [[object.function]] name = "date_parse" ignore = true [[object.function]] name = "get_available_signing_certificates" version = "23.7" [[object]] name = "Poppler.Annot" status = "generate" [[object.function]] name = "set_color" [[object.function.parameter]] name = "poppler_color" const = true [[object.function]] name = "get_border_width" ignore = true # Needs manual impl [[object]] name = "Poppler.AnnotCircle" status = "generate" [[object.function]] name = "set_interior_color" [[object.function.parameter]] name = "poppler_color" const = true [[object]] name = "Poppler.AnnotInk" status = "generate" version = "25.6" [[object.function]] name = "new" [[object.function.parameter]] name = "rect" const = true [[object]] name = "Poppler.Color" status = "generate" boxed_inline = true [[object]] name = "Poppler.Document" status = "generate" generate_builder = true [[object.function]] pattern = "(new_from_fd|save_to_fd)" cfg_condition = "target_os = \"linux\"" [[object.function]] name = "get_print_page_ranges" manual = true [[object]] name = "Poppler.Movie" status = "generate" [[object.function]] name = "get_aspect" manual = true # wrong in-out annotations [[object]] name = "Poppler.Page" status = "generate" [[object.function]] pattern = "(render|render_for_printing|render_for_printing_with_options|render_selection)" [[object.function.parameter]] name = "cairo" const = true [[object.function]] name = "get_text_layout" ignore = true [[object.function]] name = "get_text_layout_for_area" ignore = true [[object.function]] name = "get_crop_box" ignore = true [[object.function]] name = "get_bounding_box" rename = "get_bounding_box" [[object.function]] pattern = "(free_annot_mapping|free_text_attributes|free_image_mapping|free_form_field_mapping|free_link_mapping)" ignore = true # unsafe probably [[object]] name = "Poppler.Point" status = "generate" boxed_inline = true [[object]] name = "Poppler.Quadrilateral" status = "generate" boxed_inline = true [[object]] name = "Poppler.Rectangle" status = "generate" boxed_inline = true [[object]] name = "Poppler.Error" status = "generate" [[object.member]] name = "signing" version = "23.7" [[object]] name = "Poppler.CertificateInfo" status = "generate" version = "23.7" [[object]] name = "Poppler.SigningData" status = "generate" version = "23.7" [[object]] name = "Poppler.Attachement" [[object.function]] name = "save_to_fd" cfg_condition = "target_os = \"linux\"" [[object]] name = "Poppler.Media" status = "generate" [[object.function]] name = "save_to_fd" cfg_condition = "target_os = \"linux\"" [[object]] name = "Poppler.PSFile" status = "generate" [[object.function]] name = "new_fd" cfg_condition = "target_os = \"linux\"" [[object]] name = "Poppler.Path" status = "generate" version = "25.6" [[object.function]] name = "new_from_array" [[object.function.parameter]] name = "points" const = true [[object.function]] name = "get_points" [[object.function.parameter]] name = "path" const = true poppler-rs-0.25.0/README.md000064400000000000000000000006661046102023000133020ustar 00000000000000# poppler-rs A high-level (safe) set of Rust bindings for [poppler](https://poppler.freedesktop.org/)'s glib interface. poppler is a PDF rendering library with a cairo backend. ## Usage There's no nice tutorial or sample code for now: check out the rustdoc to see what types are available. But generally, usage involves: * Creating a `Document`, maybe from a `&[u8]` slice. * Enumerating pages, rendering them to a cairo surface poppler-rs-0.25.0/src/auto/annot.rs000064400000000000000000000100271046102023000152370ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, AnnotFlag, AnnotType, Color, Rectangle}; use glib::{prelude::*, translate::*}; glib::wrapper! { #[doc(alias = "PopplerAnnot")] pub struct Annot(Object); match fn { type_ => || ffi::poppler_annot_get_type(), } } impl Annot { pub const NONE: Option<&'static Annot> = None; } pub trait AnnotExt: IsA + 'static { #[doc(alias = "poppler_annot_get_annot_type")] #[doc(alias = "get_annot_type")] fn annot_type(&self) -> AnnotType { unsafe { from_glib(ffi::poppler_annot_get_annot_type( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "poppler_annot_get_color")] #[doc(alias = "get_color")] fn color(&self) -> Option { unsafe { from_glib_full(ffi::poppler_annot_get_color(self.as_ref().to_glib_none().0)) } } #[doc(alias = "poppler_annot_get_contents")] #[doc(alias = "get_contents")] fn contents(&self) -> Option { unsafe { from_glib_full(ffi::poppler_annot_get_contents( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "poppler_annot_get_flags")] #[doc(alias = "get_flags")] fn flags(&self) -> AnnotFlag { unsafe { from_glib(ffi::poppler_annot_get_flags(self.as_ref().to_glib_none().0)) } } #[doc(alias = "poppler_annot_get_modified")] #[doc(alias = "get_modified")] fn modified(&self) -> Option { unsafe { from_glib_full(ffi::poppler_annot_get_modified( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "poppler_annot_get_name")] #[doc(alias = "get_name")] fn name(&self) -> Option { unsafe { from_glib_full(ffi::poppler_annot_get_name(self.as_ref().to_glib_none().0)) } } #[doc(alias = "poppler_annot_get_page_index")] #[doc(alias = "get_page_index")] fn page_index(&self) -> i32 { unsafe { ffi::poppler_annot_get_page_index(self.as_ref().to_glib_none().0) } } #[doc(alias = "poppler_annot_get_rectangle")] #[doc(alias = "get_rectangle")] fn rectangle(&self) -> Rectangle { unsafe { let mut poppler_rect = Rectangle::uninitialized(); ffi::poppler_annot_get_rectangle( self.as_ref().to_glib_none().0, poppler_rect.to_glib_none_mut().0, ); poppler_rect } } #[cfg(feature = "v24_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v24_12")))] #[doc(alias = "poppler_annot_set_border_width")] fn set_border_width(&self, width: f64) { unsafe { ffi::poppler_annot_set_border_width(self.as_ref().to_glib_none().0, width); } } #[doc(alias = "poppler_annot_set_color")] fn set_color(&self, poppler_color: Option<&Color>) { unsafe { ffi::poppler_annot_set_color( self.as_ref().to_glib_none().0, mut_override(poppler_color.to_glib_none().0), ); } } #[doc(alias = "poppler_annot_set_contents")] fn set_contents(&self, contents: &str) { unsafe { ffi::poppler_annot_set_contents( self.as_ref().to_glib_none().0, contents.to_glib_none().0, ); } } #[doc(alias = "poppler_annot_set_flags")] fn set_flags(&self, flags: AnnotFlag) { unsafe { ffi::poppler_annot_set_flags(self.as_ref().to_glib_none().0, flags.into_glib()); } } #[doc(alias = "poppler_annot_set_rectangle")] fn set_rectangle(&self, poppler_rect: &mut Rectangle) { unsafe { ffi::poppler_annot_set_rectangle( self.as_ref().to_glib_none().0, poppler_rect.to_glib_none_mut().0, ); } } } impl> AnnotExt for O {} poppler-rs-0.25.0/src/auto/annot_callout_line.rs000064400000000000000000000015271046102023000177760ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::ffi; use glib::translate::*; glib::wrapper! { #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct AnnotCalloutLine(Boxed); match fn { copy => |ptr| ffi::poppler_annot_callout_line_copy(mut_override(ptr)), free => |ptr| ffi::poppler_annot_callout_line_free(ptr), type_ => || ffi::poppler_annot_callout_line_get_type(), } } impl AnnotCalloutLine { #[doc(alias = "poppler_annot_callout_line_new")] pub fn new() -> AnnotCalloutLine { unsafe { from_glib_full(ffi::poppler_annot_callout_line_new()) } } } impl Default for AnnotCalloutLine { fn default() -> Self { Self::new() } } poppler-rs-0.25.0/src/auto/annot_circle.rs000064400000000000000000000027301046102023000165620ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, Annot, AnnotMarkup, Color, Document, Rectangle}; use glib::{prelude::*, translate::*}; glib::wrapper! { #[doc(alias = "PopplerAnnotCircle")] pub struct AnnotCircle(Object) @extends AnnotMarkup, Annot; match fn { type_ => || ffi::poppler_annot_circle_get_type(), } } impl AnnotCircle { #[doc(alias = "poppler_annot_circle_new")] pub fn new(doc: &Document, rect: &mut Rectangle) -> AnnotCircle { unsafe { Annot::from_glib_full(ffi::poppler_annot_circle_new( doc.to_glib_none().0, rect.to_glib_none_mut().0, )) .unsafe_cast() } } #[doc(alias = "poppler_annot_circle_get_interior_color")] #[doc(alias = "get_interior_color")] pub fn interior_color(&self) -> Option { unsafe { from_glib_full(ffi::poppler_annot_circle_get_interior_color( self.to_glib_none().0, )) } } #[doc(alias = "poppler_annot_circle_set_interior_color")] pub fn set_interior_color(&self, poppler_color: Option<&Color>) { unsafe { ffi::poppler_annot_circle_set_interior_color( self.to_glib_none().0, mut_override(poppler_color.to_glib_none().0), ); } } } poppler-rs-0.25.0/src/auto/annot_file_attachment.rs000064400000000000000000000021611046102023000204460ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, Annot, AnnotMarkup, Attachment}; use glib::translate::*; glib::wrapper! { #[doc(alias = "PopplerAnnotFileAttachment")] pub struct AnnotFileAttachment(Object) @extends AnnotMarkup, Annot; match fn { type_ => || ffi::poppler_annot_file_attachment_get_type(), } } impl AnnotFileAttachment { #[doc(alias = "poppler_annot_file_attachment_get_attachment")] #[doc(alias = "get_attachment")] pub fn attachment(&self) -> Option { unsafe { from_glib_full(ffi::poppler_annot_file_attachment_get_attachment( self.to_glib_none().0, )) } } #[doc(alias = "poppler_annot_file_attachment_get_name")] #[doc(alias = "get_name")] pub fn name(&self) -> Option { unsafe { from_glib_full(ffi::poppler_annot_file_attachment_get_name( self.to_glib_none().0, )) } } } poppler-rs-0.25.0/src/auto/annot_free_text.rs000064400000000000000000000057651046102023000173210ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT #[cfg(feature = "v24_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v24_12")))] use crate::Color; use crate::{ ffi, Annot, AnnotCalloutLine, AnnotFreeTextQuadding, AnnotMarkup, Document, Rectangle, }; use glib::{prelude::*, translate::*}; glib::wrapper! { #[doc(alias = "PopplerAnnotFreeText")] pub struct AnnotFreeText(Object) @extends AnnotMarkup, Annot; match fn { type_ => || ffi::poppler_annot_free_text_get_type(), } } impl AnnotFreeText { #[doc(alias = "poppler_annot_free_text_new")] pub fn new(doc: &Document, rect: &mut Rectangle) -> AnnotFreeText { unsafe { Annot::from_glib_full(ffi::poppler_annot_free_text_new( doc.to_glib_none().0, rect.to_glib_none_mut().0, )) .unsafe_cast() } } #[doc(alias = "poppler_annot_free_text_get_callout_line")] #[doc(alias = "get_callout_line")] pub fn callout_line(&self) -> Option { unsafe { from_glib_full(ffi::poppler_annot_free_text_get_callout_line( self.to_glib_none().0, )) } } #[cfg(feature = "v24_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v24_12")))] #[doc(alias = "poppler_annot_free_text_get_font_color")] #[doc(alias = "get_font_color")] pub fn font_color(&self) -> Option { unsafe { from_glib_full(ffi::poppler_annot_free_text_get_font_color( self.to_glib_none().0, )) } } //#[cfg(feature = "v24_12")] //#[cfg_attr(docsrs, doc(cfg(feature = "v24_12")))] //#[doc(alias = "poppler_annot_free_text_get_font_desc")] //#[doc(alias = "get_font_desc")] //pub fn font_desc(&self) -> /*Ignored*/Option { // unsafe { TODO: call ffi:poppler_annot_free_text_get_font_desc() } //} #[doc(alias = "poppler_annot_free_text_get_quadding")] #[doc(alias = "get_quadding")] pub fn quadding(&self) -> AnnotFreeTextQuadding { unsafe { from_glib(ffi::poppler_annot_free_text_get_quadding( self.to_glib_none().0, )) } } #[cfg(feature = "v24_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v24_12")))] #[doc(alias = "poppler_annot_free_text_set_font_color")] pub fn set_font_color(&self, color: &mut Color) { unsafe { ffi::poppler_annot_free_text_set_font_color( self.to_glib_none().0, color.to_glib_none_mut().0, ); } } //#[cfg(feature = "v24_12")] //#[cfg_attr(docsrs, doc(cfg(feature = "v24_12")))] //#[doc(alias = "poppler_annot_free_text_set_font_desc")] //pub fn set_font_desc(&self, font_desc: /*Ignored*/&mut FontDescription) { // unsafe { TODO: call ffi:poppler_annot_free_text_set_font_desc() } //} } poppler-rs-0.25.0/src/auto/annot_ink.rs000064400000000000000000000031431046102023000161010ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, Annot, AnnotMarkup, Document, Path, Rectangle}; use glib::{prelude::*, translate::*}; glib::wrapper! { #[doc(alias = "PopplerAnnotInk")] pub struct AnnotInk(Object) @extends AnnotMarkup, Annot; match fn { type_ => || ffi::poppler_annot_ink_get_type(), } } impl AnnotInk { #[doc(alias = "poppler_annot_ink_new")] pub fn new(doc: &Document, rect: &Rectangle) -> AnnotInk { unsafe { Annot::from_glib_full(ffi::poppler_annot_ink_new( doc.to_glib_none().0, mut_override(rect.to_glib_none().0), )) .unsafe_cast() } } #[doc(alias = "poppler_annot_ink_get_ink_list")] #[doc(alias = "get_ink_list")] pub fn ink_list(&self) -> Vec { unsafe { let mut n_paths = std::mem::MaybeUninit::uninit(); let ret = FromGlibContainer::from_glib_full_num( ffi::poppler_annot_ink_get_ink_list(self.to_glib_none().0, n_paths.as_mut_ptr()), n_paths.assume_init() as _, ); ret } } #[doc(alias = "poppler_annot_ink_set_ink_list")] pub fn set_ink_list(&self, ink_list: &[Path]) { let n_paths = ink_list.len() as _; unsafe { ffi::poppler_annot_ink_set_ink_list( self.to_glib_none().0, ink_list.to_glib_none().0, n_paths, ); } } } poppler-rs-0.25.0/src/auto/annot_mapping.rs000064400000000000000000000014521046102023000167540ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::ffi; use glib::translate::*; glib::wrapper! { #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct AnnotMapping(Boxed); match fn { copy => |ptr| ffi::poppler_annot_mapping_copy(mut_override(ptr)), free => |ptr| ffi::poppler_annot_mapping_free(ptr), type_ => || ffi::poppler_annot_mapping_get_type(), } } impl AnnotMapping { #[doc(alias = "poppler_annot_mapping_new")] pub fn new() -> AnnotMapping { unsafe { from_glib_full(ffi::poppler_annot_mapping_new()) } } } impl Default for AnnotMapping { fn default() -> Self { Self::new() } } poppler-rs-0.25.0/src/auto/annot_markup.rs000064400000000000000000000115161046102023000166220ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, Annot, AnnotExternalDataType, AnnotMarkupReplyType, Rectangle}; use glib::{prelude::*, translate::*}; glib::wrapper! { #[doc(alias = "PopplerAnnotMarkup")] pub struct AnnotMarkup(Object) @extends Annot; match fn { type_ => || ffi::poppler_annot_markup_get_type(), } } impl AnnotMarkup { pub const NONE: Option<&'static AnnotMarkup> = None; } pub trait AnnotMarkupExt: IsA + 'static { #[doc(alias = "poppler_annot_markup_get_date")] #[doc(alias = "get_date")] fn date(&self) -> Option { unsafe { from_glib_full(ffi::poppler_annot_markup_get_date( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "poppler_annot_markup_get_external_data")] #[doc(alias = "get_external_data")] fn external_data(&self) -> AnnotExternalDataType { unsafe { from_glib(ffi::poppler_annot_markup_get_external_data( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "poppler_annot_markup_get_label")] #[doc(alias = "get_label")] fn label(&self) -> Option { unsafe { from_glib_full(ffi::poppler_annot_markup_get_label( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "poppler_annot_markup_get_opacity")] #[doc(alias = "get_opacity")] fn opacity(&self) -> f64 { unsafe { ffi::poppler_annot_markup_get_opacity(self.as_ref().to_glib_none().0) } } #[doc(alias = "poppler_annot_markup_get_popup_is_open")] #[doc(alias = "get_popup_is_open")] fn is_popup_is_open(&self) -> bool { unsafe { from_glib(ffi::poppler_annot_markup_get_popup_is_open( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "poppler_annot_markup_get_popup_rectangle")] #[doc(alias = "get_popup_rectangle")] fn popup_rectangle(&self) -> Option { unsafe { let mut poppler_rect = Rectangle::uninitialized(); let ret = from_glib(ffi::poppler_annot_markup_get_popup_rectangle( self.as_ref().to_glib_none().0, poppler_rect.to_glib_none_mut().0, )); if ret { Some(poppler_rect) } else { None } } } #[doc(alias = "poppler_annot_markup_get_reply_to")] #[doc(alias = "get_reply_to")] fn reply_to(&self) -> AnnotMarkupReplyType { unsafe { from_glib(ffi::poppler_annot_markup_get_reply_to( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "poppler_annot_markup_get_subject")] #[doc(alias = "get_subject")] fn subject(&self) -> Option { unsafe { from_glib_full(ffi::poppler_annot_markup_get_subject( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "poppler_annot_markup_has_popup")] fn has_popup(&self) -> bool { unsafe { from_glib(ffi::poppler_annot_markup_has_popup( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "poppler_annot_markup_set_label")] fn set_label(&self, label: Option<&str>) { unsafe { ffi::poppler_annot_markup_set_label( self.as_ref().to_glib_none().0, label.to_glib_none().0, ); } } #[doc(alias = "poppler_annot_markup_set_opacity")] fn set_opacity(&self, opacity: f64) { unsafe { ffi::poppler_annot_markup_set_opacity(self.as_ref().to_glib_none().0, opacity); } } #[doc(alias = "poppler_annot_markup_set_popup")] fn set_popup(&self, popup_rect: &mut Rectangle) { unsafe { ffi::poppler_annot_markup_set_popup( self.as_ref().to_glib_none().0, popup_rect.to_glib_none_mut().0, ); } } #[doc(alias = "poppler_annot_markup_set_popup_is_open")] fn set_popup_is_open(&self, is_open: bool) { unsafe { ffi::poppler_annot_markup_set_popup_is_open( self.as_ref().to_glib_none().0, is_open.into_glib(), ); } } #[doc(alias = "poppler_annot_markup_set_popup_rectangle")] fn set_popup_rectangle(&self, poppler_rect: &mut Rectangle) { unsafe { ffi::poppler_annot_markup_set_popup_rectangle( self.as_ref().to_glib_none().0, poppler_rect.to_glib_none_mut().0, ); } } } impl> AnnotMarkupExt for O {} poppler-rs-0.25.0/src/auto/attachment.rs000064400000000000000000000101611046102023000162470ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::ffi; use glib::{prelude::*, translate::*}; glib::wrapper! { #[doc(alias = "PopplerAttachment")] pub struct Attachment(Object); match fn { type_ => || ffi::poppler_attachment_get_type(), } } impl Attachment { pub const NONE: Option<&'static Attachment> = None; } pub trait AttachmentExt: IsA + 'static { //#[cfg(feature = "v20_9")] //#[cfg_attr(docsrs, doc(cfg(feature = "v20_9")))] //#[doc(alias = "poppler_attachment_get_checksum")] //#[doc(alias = "get_checksum")] //fn checksum(&self) -> /*Ignored*/Option { // unsafe { TODO: call ffi:poppler_attachment_get_checksum() } //} #[cfg(feature = "v20_9")] #[cfg_attr(docsrs, doc(cfg(feature = "v20_9")))] #[doc(alias = "poppler_attachment_get_ctime")] #[doc(alias = "get_ctime")] fn ctime(&self) -> Option { unsafe { from_glib_none(ffi::poppler_attachment_get_ctime( self.as_ref().to_glib_none().0, )) } } #[cfg(feature = "v20_9")] #[cfg_attr(docsrs, doc(cfg(feature = "v20_9")))] #[doc(alias = "poppler_attachment_get_description")] #[doc(alias = "get_description")] fn description(&self) -> Option { unsafe { from_glib_none(ffi::poppler_attachment_get_description( self.as_ref().to_glib_none().0, )) } } #[cfg(feature = "v20_9")] #[cfg_attr(docsrs, doc(cfg(feature = "v20_9")))] #[doc(alias = "poppler_attachment_get_mtime")] #[doc(alias = "get_mtime")] fn mtime(&self) -> Option { unsafe { from_glib_none(ffi::poppler_attachment_get_mtime( self.as_ref().to_glib_none().0, )) } } #[cfg(feature = "v20_9")] #[cfg_attr(docsrs, doc(cfg(feature = "v20_9")))] #[doc(alias = "poppler_attachment_get_name")] #[doc(alias = "get_name")] fn name(&self) -> Option { unsafe { from_glib_none(ffi::poppler_attachment_get_name( self.as_ref().to_glib_none().0, )) } } #[cfg(feature = "v20_9")] #[cfg_attr(docsrs, doc(cfg(feature = "v20_9")))] #[doc(alias = "poppler_attachment_get_size")] #[doc(alias = "get_size")] fn size(&self) -> usize { unsafe { ffi::poppler_attachment_get_size(self.as_ref().to_glib_none().0) } } #[doc(alias = "poppler_attachment_save")] fn save(&self, filename: &str) -> Result<(), glib::Error> { unsafe { let mut error = std::ptr::null_mut(); let is_ok = ffi::poppler_attachment_save( self.as_ref().to_glib_none().0, filename.to_glib_none().0, &mut error, ); debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } //#[doc(alias = "poppler_attachment_save_to_callback")] //fn save_to_callback, usize, Option<&glib::Error>) -> bool>(&self, save_func: P) -> Result<(), glib::Error> { // unsafe { TODO: call ffi:poppler_attachment_save_to_callback() } //} #[cfg(feature = "v21_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v21_12")))] #[doc(alias = "poppler_attachment_save_to_fd")] fn save_to_fd(&self, fd: i32) -> Result<(), glib::Error> { unsafe { let mut error = std::ptr::null_mut(); let is_ok = ffi::poppler_attachment_save_to_fd(self.as_ref().to_glib_none().0, fd, &mut error); debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } } impl> AttachmentExt for O {} poppler-rs-0.25.0/src/auto/certificate_info.rs000064400000000000000000000105311046102023000174150ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::ffi; use glib::translate::*; glib::wrapper! { #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct CertificateInfo(Boxed); match fn { copy => |ptr| ffi::poppler_certificate_info_copy(ptr), free => |ptr| ffi::poppler_certificate_info_free(ptr), type_ => || ffi::poppler_certificate_info_get_type(), } } impl CertificateInfo { #[doc(alias = "poppler_certificate_info_new")] pub fn new() -> CertificateInfo { unsafe { from_glib_full(ffi::poppler_certificate_info_new()) } } #[cfg(feature = "v23_8")] #[cfg_attr(docsrs, doc(cfg(feature = "v23_8")))] #[doc(alias = "poppler_certificate_info_get_expiration_time")] #[doc(alias = "get_expiration_time")] pub fn expiration_time(&self) -> Option { unsafe { from_glib_none(ffi::poppler_certificate_info_get_expiration_time( self.to_glib_none().0, )) } } #[doc(alias = "poppler_certificate_info_get_id")] #[doc(alias = "get_id")] pub fn id(&self) -> Option { unsafe { from_glib_none(ffi::poppler_certificate_info_get_id(self.to_glib_none().0)) } } #[cfg(feature = "v23_8")] #[cfg_attr(docsrs, doc(cfg(feature = "v23_8")))] #[doc(alias = "poppler_certificate_info_get_issuance_time")] #[doc(alias = "get_issuance_time")] pub fn issuance_time(&self) -> Option { unsafe { from_glib_none(ffi::poppler_certificate_info_get_issuance_time( self.to_glib_none().0, )) } } #[cfg(feature = "v23_8")] #[cfg_attr(docsrs, doc(cfg(feature = "v23_8")))] #[doc(alias = "poppler_certificate_info_get_issuer_common_name")] #[doc(alias = "get_issuer_common_name")] pub fn issuer_common_name(&self) -> Option { unsafe { from_glib_none(ffi::poppler_certificate_info_get_issuer_common_name( self.to_glib_none().0, )) } } #[cfg(feature = "v23_8")] #[cfg_attr(docsrs, doc(cfg(feature = "v23_8")))] #[doc(alias = "poppler_certificate_info_get_issuer_email")] #[doc(alias = "get_issuer_email")] pub fn issuer_email(&self) -> Option { unsafe { from_glib_none(ffi::poppler_certificate_info_get_issuer_email( self.to_glib_none().0, )) } } #[cfg(feature = "v23_8")] #[cfg_attr(docsrs, doc(cfg(feature = "v23_8")))] #[doc(alias = "poppler_certificate_info_get_issuer_organization")] #[doc(alias = "get_issuer_organization")] pub fn issuer_organization(&self) -> Option { unsafe { from_glib_none(ffi::poppler_certificate_info_get_issuer_organization( self.to_glib_none().0, )) } } #[doc(alias = "poppler_certificate_info_get_subject_common_name")] #[doc(alias = "get_subject_common_name")] pub fn subject_common_name(&self) -> Option { unsafe { from_glib_none(ffi::poppler_certificate_info_get_subject_common_name( self.to_glib_none().0, )) } } #[cfg(feature = "v23_8")] #[cfg_attr(docsrs, doc(cfg(feature = "v23_8")))] #[doc(alias = "poppler_certificate_info_get_subject_email")] #[doc(alias = "get_subject_email")] pub fn subject_email(&self) -> Option { unsafe { from_glib_none(ffi::poppler_certificate_info_get_subject_email( self.to_glib_none().0, )) } } #[cfg(feature = "v23_8")] #[cfg_attr(docsrs, doc(cfg(feature = "v23_8")))] #[doc(alias = "poppler_certificate_info_get_subject_organization")] #[doc(alias = "get_subject_organization")] pub fn subject_organization(&self) -> Option { unsafe { from_glib_none(ffi::poppler_certificate_info_get_subject_organization( self.to_glib_none().0, )) } } } #[cfg(feature = "v23_7")] #[cfg_attr(docsrs, doc(cfg(feature = "v23_7")))] impl Default for CertificateInfo { fn default() -> Self { Self::new() } } poppler-rs-0.25.0/src/auto/color.rs000064400000000000000000000012521046102023000152360ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::ffi; use glib::translate::*; glib::wrapper! { pub struct Color(BoxedInline); match fn { copy => |ptr| ffi::poppler_color_copy(mut_override(ptr)), free => |ptr| ffi::poppler_color_free(ptr), type_ => || ffi::poppler_color_get_type(), } } impl Color { #[doc(alias = "poppler_color_new")] pub fn new() -> Color { unsafe { from_glib_full(ffi::poppler_color_new()) } } } impl Default for Color { fn default() -> Self { Self::new() } } poppler-rs-0.25.0/src/auto/constants.rs000064400000000000000000000034201046102023000161330ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::ffi; use glib::GStr; #[doc(alias = "POPPLER_ANNOT_TEXT_ICON_CIRCLE")] pub static ANNOT_TEXT_ICON_CIRCLE: &GStr = unsafe { GStr::from_utf8_with_nul_unchecked(ffi::POPPLER_ANNOT_TEXT_ICON_CIRCLE) }; #[doc(alias = "POPPLER_ANNOT_TEXT_ICON_COMMENT")] pub static ANNOT_TEXT_ICON_COMMENT: &GStr = unsafe { GStr::from_utf8_with_nul_unchecked(ffi::POPPLER_ANNOT_TEXT_ICON_COMMENT) }; #[doc(alias = "POPPLER_ANNOT_TEXT_ICON_CROSS")] pub static ANNOT_TEXT_ICON_CROSS: &GStr = unsafe { GStr::from_utf8_with_nul_unchecked(ffi::POPPLER_ANNOT_TEXT_ICON_CROSS) }; #[doc(alias = "POPPLER_ANNOT_TEXT_ICON_HELP")] pub static ANNOT_TEXT_ICON_HELP: &GStr = unsafe { GStr::from_utf8_with_nul_unchecked(ffi::POPPLER_ANNOT_TEXT_ICON_HELP) }; #[doc(alias = "POPPLER_ANNOT_TEXT_ICON_INSERT")] pub static ANNOT_TEXT_ICON_INSERT: &GStr = unsafe { GStr::from_utf8_with_nul_unchecked(ffi::POPPLER_ANNOT_TEXT_ICON_INSERT) }; #[doc(alias = "POPPLER_ANNOT_TEXT_ICON_KEY")] pub static ANNOT_TEXT_ICON_KEY: &GStr = unsafe { GStr::from_utf8_with_nul_unchecked(ffi::POPPLER_ANNOT_TEXT_ICON_KEY) }; #[doc(alias = "POPPLER_ANNOT_TEXT_ICON_NEW_PARAGRAPH")] pub static ANNOT_TEXT_ICON_NEW_PARAGRAPH: &GStr = unsafe { GStr::from_utf8_with_nul_unchecked(ffi::POPPLER_ANNOT_TEXT_ICON_NEW_PARAGRAPH) }; #[doc(alias = "POPPLER_ANNOT_TEXT_ICON_NOTE")] pub static ANNOT_TEXT_ICON_NOTE: &GStr = unsafe { GStr::from_utf8_with_nul_unchecked(ffi::POPPLER_ANNOT_TEXT_ICON_NOTE) }; #[doc(alias = "POPPLER_ANNOT_TEXT_ICON_PARAGRAPH")] pub static ANNOT_TEXT_ICON_PARAGRAPH: &GStr = unsafe { GStr::from_utf8_with_nul_unchecked(ffi::POPPLER_ANNOT_TEXT_ICON_PARAGRAPH) }; poppler-rs-0.25.0/src/auto/dest.rs000064400000000000000000000007631046102023000150650ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::ffi; use glib::translate::*; glib::wrapper! { #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct Dest(Boxed); match fn { copy => |ptr| ffi::poppler_dest_copy(mut_override(ptr)), free => |ptr| ffi::poppler_dest_free(ptr), type_ => || ffi::poppler_dest_get_type(), } } poppler-rs-0.25.0/src/auto/document.rs000064400000000000000000001503261046102023000157450ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT #![allow(deprecated)] #[cfg(feature = "v0_80")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_80")))] use crate::PrintDuplex; #[cfg(feature = "v0_73")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_73")))] use crate::PrintScaling; #[cfg(feature = "v23_7")] #[cfg_attr(docsrs, doc(cfg(feature = "v23_7")))] use crate::SigningData; use crate::{ ffi, Attachment, Dest, FormField, PDFConformance, PDFPart, PDFSubtype, Page, PageLayout, PageMode, Permissions, ViewerPreferences, }; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::boxed::Box as Box_; #[cfg(feature = "v23_7")] #[cfg_attr(docsrs, doc(cfg(feature = "v23_7")))] use std::pin::Pin; glib::wrapper! { #[doc(alias = "PopplerDocument")] pub struct Document(Object); match fn { type_ => || ffi::poppler_document_get_type(), } } impl Document { #[cfg(feature = "v0_82")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_82")))] #[doc(alias = "poppler_document_new_from_bytes")] #[doc(alias = "new_from_bytes")] pub fn from_bytes( bytes: &glib::Bytes, password: Option<&str>, ) -> Result { unsafe { let mut error = std::ptr::null_mut(); let ret = ffi::poppler_document_new_from_bytes( bytes.to_glib_none().0, password.to_glib_none().0, &mut error, ); if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) } } } #[cfg_attr(feature = "v0_82", deprecated = "Since 0.82")] #[allow(deprecated)] #[doc(alias = "poppler_document_new_from_data")] #[doc(alias = "new_from_data")] pub fn from_data(data: &[u8], password: Option<&str>) -> Result { let length = data.len() as _; unsafe { let mut error = std::ptr::null_mut(); let ret = ffi::poppler_document_new_from_data( data.to_glib_none().0, length, password.to_glib_none().0, &mut error, ); if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) } } } #[cfg(target_os = "linux")] #[cfg_attr(docsrs, doc(cfg(target_os = "linux")))] #[cfg(feature = "v21_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v21_12")))] #[doc(alias = "poppler_document_new_from_fd")] #[doc(alias = "new_from_fd")] pub fn from_fd(fd: i32, password: Option<&str>) -> Result { unsafe { let mut error = std::ptr::null_mut(); let ret = ffi::poppler_document_new_from_fd(fd, password.to_glib_none().0, &mut error); if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) } } } #[doc(alias = "poppler_document_new_from_file")] #[doc(alias = "new_from_file")] pub fn from_file(uri: &str, password: Option<&str>) -> Result { unsafe { let mut error = std::ptr::null_mut(); let ret = ffi::poppler_document_new_from_file( uri.to_glib_none().0, password.to_glib_none().0, &mut error, ); if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) } } } #[doc(alias = "poppler_document_new_from_gfile")] #[doc(alias = "new_from_gfile")] pub fn from_gfile( file: &impl IsA, password: Option<&str>, cancellable: Option<&impl IsA>, ) -> Result { unsafe { let mut error = std::ptr::null_mut(); let ret = ffi::poppler_document_new_from_gfile( file.as_ref().to_glib_none().0, password.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error, ); if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) } } } #[doc(alias = "poppler_document_new_from_stream")] #[doc(alias = "new_from_stream")] pub fn from_stream( stream: &impl IsA, length: i64, password: Option<&str>, cancellable: Option<&impl IsA>, ) -> Result { unsafe { let mut error = std::ptr::null_mut(); let ret = ffi::poppler_document_new_from_stream( stream.as_ref().to_glib_none().0, length, password.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error, ); if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) } } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`Document`] objects. /// /// This method returns an instance of [`DocumentBuilder`](crate::builders::DocumentBuilder) which can be used to create [`Document`] objects. pub fn builder() -> DocumentBuilder { DocumentBuilder::new() } //#[cfg(feature = "v0_78")] //#[cfg_attr(docsrs, doc(cfg(feature = "v0_78")))] //#[doc(alias = "poppler_document_create_dests_tree")] //pub fn create_dests_tree(&self) -> /*Ignored*/Option { // unsafe { TODO: call ffi:poppler_document_create_dests_tree() } //} #[doc(alias = "poppler_document_find_dest")] pub fn find_dest(&self, link_name: &str) -> Option { unsafe { from_glib_full(ffi::poppler_document_find_dest( self.to_glib_none().0, link_name.to_glib_none().0, )) } } #[doc(alias = "poppler_document_get_attachments")] #[doc(alias = "get_attachments")] pub fn attachments(&self) -> Vec { unsafe { FromGlibPtrContainer::from_glib_full(ffi::poppler_document_get_attachments( self.to_glib_none().0, )) } } #[doc(alias = "poppler_document_get_author")] #[doc(alias = "get_author")] pub fn author(&self) -> Option { unsafe { from_glib_full(ffi::poppler_document_get_author(self.to_glib_none().0)) } } #[doc(alias = "poppler_document_get_creation_date")] #[doc(alias = "get_creation_date")] #[doc(alias = "creation-date")] pub fn creation_date(&self) -> libc::time_t { unsafe { ffi::poppler_document_get_creation_date(self.to_glib_none().0) } } #[cfg(feature = "v20_9")] #[cfg_attr(docsrs, doc(cfg(feature = "v20_9")))] #[doc(alias = "poppler_document_get_creation_date_time")] #[doc(alias = "get_creation_date_time")] pub fn creation_date_time(&self) -> Option { unsafe { from_glib_full(ffi::poppler_document_get_creation_date_time( self.to_glib_none().0, )) } } #[doc(alias = "poppler_document_get_creator")] #[doc(alias = "get_creator")] pub fn creator(&self) -> Option { unsafe { from_glib_full(ffi::poppler_document_get_creator(self.to_glib_none().0)) } } #[doc(alias = "poppler_document_get_form_field")] #[doc(alias = "get_form_field")] pub fn form_field(&self, id: i32) -> Option { unsafe { from_glib_full(ffi::poppler_document_get_form_field( self.to_glib_none().0, id, )) } } #[doc(alias = "poppler_document_get_id")] #[doc(alias = "get_id")] pub fn id(&self) -> Option<(glib::GString, glib::GString)> { unsafe { let mut permanent_id = std::ptr::null_mut(); let mut update_id = std::ptr::null_mut(); let ret = from_glib(ffi::poppler_document_get_id( self.to_glib_none().0, &mut permanent_id, &mut update_id, )); if ret { Some((from_glib_full(permanent_id), from_glib_full(update_id))) } else { None } } } #[doc(alias = "poppler_document_get_keywords")] #[doc(alias = "get_keywords")] pub fn keywords(&self) -> Option { unsafe { from_glib_full(ffi::poppler_document_get_keywords(self.to_glib_none().0)) } } #[doc(alias = "poppler_document_get_metadata")] #[doc(alias = "get_metadata")] pub fn metadata(&self) -> Option { unsafe { from_glib_full(ffi::poppler_document_get_metadata(self.to_glib_none().0)) } } #[doc(alias = "poppler_document_get_modification_date")] #[doc(alias = "get_modification_date")] pub fn modification_date(&self) -> libc::time_t { unsafe { ffi::poppler_document_get_modification_date(self.to_glib_none().0) } } #[cfg(feature = "v20_9")] #[cfg_attr(docsrs, doc(cfg(feature = "v20_9")))] #[doc(alias = "poppler_document_get_modification_date_time")] #[doc(alias = "get_modification_date_time")] pub fn modification_date_time(&self) -> Option { unsafe { from_glib_full(ffi::poppler_document_get_modification_date_time( self.to_glib_none().0, )) } } #[doc(alias = "poppler_document_get_n_attachments")] #[doc(alias = "get_n_attachments")] pub fn n_attachments(&self) -> u32 { unsafe { ffi::poppler_document_get_n_attachments(self.to_glib_none().0) } } #[doc(alias = "poppler_document_get_n_pages")] #[doc(alias = "get_n_pages")] pub fn n_pages(&self) -> i32 { unsafe { ffi::poppler_document_get_n_pages(self.to_glib_none().0) } } #[cfg(feature = "v21_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v21_12")))] #[doc(alias = "poppler_document_get_n_signatures")] #[doc(alias = "get_n_signatures")] pub fn n_signatures(&self) -> i32 { unsafe { ffi::poppler_document_get_n_signatures(self.to_glib_none().0) } } #[doc(alias = "poppler_document_get_page")] #[doc(alias = "get_page")] pub fn page(&self, index: i32) -> Option { unsafe { from_glib_full(ffi::poppler_document_get_page(self.to_glib_none().0, index)) } } #[doc(alias = "poppler_document_get_page_by_label")] #[doc(alias = "get_page_by_label")] pub fn page_by_label(&self, label: &str) -> Option { unsafe { from_glib_full(ffi::poppler_document_get_page_by_label( self.to_glib_none().0, label.to_glib_none().0, )) } } #[doc(alias = "poppler_document_get_page_layout")] #[doc(alias = "get_page_layout")] #[doc(alias = "page-layout")] pub fn page_layout(&self) -> PageLayout { unsafe { from_glib(ffi::poppler_document_get_page_layout(self.to_glib_none().0)) } } #[doc(alias = "poppler_document_get_page_mode")] #[doc(alias = "get_page_mode")] #[doc(alias = "page-mode")] pub fn page_mode(&self) -> PageMode { unsafe { from_glib(ffi::poppler_document_get_page_mode(self.to_glib_none().0)) } } #[doc(alias = "poppler_document_get_pdf_conformance")] #[doc(alias = "get_pdf_conformance")] pub fn pdf_conformance(&self) -> PDFConformance { unsafe { from_glib(ffi::poppler_document_get_pdf_conformance( self.to_glib_none().0, )) } } #[doc(alias = "poppler_document_get_pdf_part")] #[doc(alias = "get_pdf_part")] pub fn pdf_part(&self) -> PDFPart { unsafe { from_glib(ffi::poppler_document_get_pdf_part(self.to_glib_none().0)) } } #[doc(alias = "poppler_document_get_pdf_subtype")] #[doc(alias = "get_pdf_subtype")] pub fn pdf_subtype(&self) -> PDFSubtype { unsafe { from_glib(ffi::poppler_document_get_pdf_subtype(self.to_glib_none().0)) } } #[doc(alias = "poppler_document_get_pdf_subtype_string")] #[doc(alias = "get_pdf_subtype_string")] pub fn pdf_subtype_string(&self) -> Option { unsafe { from_glib_full(ffi::poppler_document_get_pdf_subtype_string( self.to_glib_none().0, )) } } #[doc(alias = "poppler_document_get_pdf_version")] #[doc(alias = "get_pdf_version")] pub fn pdf_version(&self) -> (u32, u32) { unsafe { let mut major_version = std::mem::MaybeUninit::uninit(); let mut minor_version = std::mem::MaybeUninit::uninit(); ffi::poppler_document_get_pdf_version( self.to_glib_none().0, major_version.as_mut_ptr(), minor_version.as_mut_ptr(), ); (major_version.assume_init(), minor_version.assume_init()) } } #[doc(alias = "poppler_document_get_pdf_version_string")] #[doc(alias = "get_pdf_version_string")] pub fn pdf_version_string(&self) -> Option { unsafe { from_glib_full(ffi::poppler_document_get_pdf_version_string( self.to_glib_none().0, )) } } #[doc(alias = "poppler_document_get_permissions")] #[doc(alias = "get_permissions")] pub fn permissions(&self) -> Permissions { unsafe { from_glib(ffi::poppler_document_get_permissions(self.to_glib_none().0)) } } #[cfg(feature = "v0_80")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_80")))] #[doc(alias = "poppler_document_get_print_duplex")] #[doc(alias = "get_print_duplex")] #[doc(alias = "print-duplex")] pub fn print_duplex(&self) -> PrintDuplex { unsafe { from_glib(ffi::poppler_document_get_print_duplex( self.to_glib_none().0, )) } } #[cfg(feature = "v0_80")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_80")))] #[doc(alias = "poppler_document_get_print_n_copies")] #[doc(alias = "get_print_n_copies")] #[doc(alias = "print-n-copies")] pub fn print_n_copies(&self) -> i32 { unsafe { ffi::poppler_document_get_print_n_copies(self.to_glib_none().0) } } #[cfg(feature = "v0_73")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_73")))] #[doc(alias = "poppler_document_get_print_scaling")] #[doc(alias = "get_print_scaling")] #[doc(alias = "print-scaling")] pub fn print_scaling(&self) -> PrintScaling { unsafe { from_glib(ffi::poppler_document_get_print_scaling( self.to_glib_none().0, )) } } #[doc(alias = "poppler_document_get_producer")] #[doc(alias = "get_producer")] pub fn producer(&self) -> Option { unsafe { from_glib_full(ffi::poppler_document_get_producer(self.to_glib_none().0)) } } #[cfg(feature = "v22_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v22_2")))] #[doc(alias = "poppler_document_get_signature_fields")] #[doc(alias = "get_signature_fields")] pub fn signature_fields(&self) -> Vec { unsafe { FromGlibPtrContainer::from_glib_full(ffi::poppler_document_get_signature_fields( self.to_glib_none().0, )) } } #[doc(alias = "poppler_document_get_subject")] #[doc(alias = "get_subject")] pub fn subject(&self) -> Option { unsafe { from_glib_full(ffi::poppler_document_get_subject(self.to_glib_none().0)) } } #[doc(alias = "poppler_document_get_title")] #[doc(alias = "get_title")] pub fn title(&self) -> Option { unsafe { from_glib_full(ffi::poppler_document_get_title(self.to_glib_none().0)) } } #[doc(alias = "poppler_document_has_attachments")] pub fn has_attachments(&self) -> bool { unsafe { from_glib(ffi::poppler_document_has_attachments(self.to_glib_none().0)) } } #[cfg(feature = "v0_90")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_90")))] #[doc(alias = "poppler_document_has_javascript")] pub fn has_javascript(&self) -> bool { unsafe { from_glib(ffi::poppler_document_has_javascript(self.to_glib_none().0)) } } #[doc(alias = "poppler_document_is_linearized")] #[doc(alias = "linearized")] pub fn is_linearized(&self) -> bool { unsafe { from_glib(ffi::poppler_document_is_linearized(self.to_glib_none().0)) } } #[cfg(feature = "v0_90")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_90")))] #[doc(alias = "poppler_document_reset_form")] pub fn reset_form(&self, fields: &[&str], exclude_fields: bool) { unsafe { ffi::poppler_document_reset_form( self.to_glib_none().0, fields.to_glib_none().0, exclude_fields.into_glib(), ); } } #[doc(alias = "poppler_document_save")] pub fn save(&self, uri: &str) -> Result<(), glib::Error> { unsafe { let mut error = std::ptr::null_mut(); let is_ok = ffi::poppler_document_save(self.to_glib_none().0, uri.to_glib_none().0, &mut error); debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } #[doc(alias = "poppler_document_save_a_copy")] pub fn save_a_copy(&self, uri: &str) -> Result<(), glib::Error> { unsafe { let mut error = std::ptr::null_mut(); let is_ok = ffi::poppler_document_save_a_copy( self.to_glib_none().0, uri.to_glib_none().0, &mut error, ); debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } #[cfg(target_os = "linux")] #[cfg_attr(docsrs, doc(cfg(target_os = "linux")))] #[cfg(feature = "v21_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v21_12")))] #[doc(alias = "poppler_document_save_to_fd")] pub fn save_to_fd(&self, fd: i32, include_changes: bool) -> Result<(), glib::Error> { unsafe { let mut error = std::ptr::null_mut(); let is_ok = ffi::poppler_document_save_to_fd( self.to_glib_none().0, fd, include_changes.into_glib(), &mut error, ); debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } #[doc(alias = "poppler_document_set_author")] #[doc(alias = "author")] pub fn set_author(&self, author: &str) { unsafe { ffi::poppler_document_set_author(self.to_glib_none().0, author.to_glib_none().0); } } #[doc(alias = "poppler_document_set_creation_date")] #[doc(alias = "creation-date")] pub fn set_creation_date(&self, creation_date: libc::time_t) { unsafe { ffi::poppler_document_set_creation_date(self.to_glib_none().0, creation_date); } } #[cfg(feature = "v20_9")] #[cfg_attr(docsrs, doc(cfg(feature = "v20_9")))] #[doc(alias = "poppler_document_set_creation_date_time")] pub fn set_creation_date_time(&self, creation_datetime: Option<&glib::DateTime>) { unsafe { ffi::poppler_document_set_creation_date_time( self.to_glib_none().0, creation_datetime.to_glib_none().0, ); } } #[doc(alias = "poppler_document_set_creator")] #[doc(alias = "creator")] pub fn set_creator(&self, creator: &str) { unsafe { ffi::poppler_document_set_creator(self.to_glib_none().0, creator.to_glib_none().0); } } #[doc(alias = "poppler_document_set_keywords")] #[doc(alias = "keywords")] pub fn set_keywords(&self, keywords: &str) { unsafe { ffi::poppler_document_set_keywords(self.to_glib_none().0, keywords.to_glib_none().0); } } #[doc(alias = "poppler_document_set_modification_date")] pub fn set_modification_date(&self, modification_date: libc::time_t) { unsafe { ffi::poppler_document_set_modification_date(self.to_glib_none().0, modification_date); } } #[cfg(feature = "v20_9")] #[cfg_attr(docsrs, doc(cfg(feature = "v20_9")))] #[doc(alias = "poppler_document_set_modification_date_time")] pub fn set_modification_date_time(&self, modification_datetime: Option<&glib::DateTime>) { unsafe { ffi::poppler_document_set_modification_date_time( self.to_glib_none().0, modification_datetime.to_glib_none().0, ); } } #[doc(alias = "poppler_document_set_producer")] #[doc(alias = "producer")] pub fn set_producer(&self, producer: &str) { unsafe { ffi::poppler_document_set_producer(self.to_glib_none().0, producer.to_glib_none().0); } } #[doc(alias = "poppler_document_set_subject")] #[doc(alias = "subject")] pub fn set_subject(&self, subject: &str) { unsafe { ffi::poppler_document_set_subject(self.to_glib_none().0, subject.to_glib_none().0); } } #[doc(alias = "poppler_document_set_title")] #[doc(alias = "title")] pub fn set_title(&self, title: &str) { unsafe { ffi::poppler_document_set_title(self.to_glib_none().0, title.to_glib_none().0); } } #[cfg(feature = "v23_7")] #[cfg_attr(docsrs, doc(cfg(feature = "v23_7")))] #[doc(alias = "poppler_document_sign")] pub fn sign) + 'static>( &self, signing_data: &SigningData, cancellable: Option<&impl IsA>, callback: P, ) { let main_context = glib::MainContext::ref_thread_default(); let is_main_context_owner = main_context.is_owner(); let has_acquired_main_context = (!is_main_context_owner) .then(|| main_context.acquire().ok()) .flatten(); assert!( is_main_context_owner || has_acquired_main_context.is_some(), "Async operations only allowed if the thread is owning the MainContext" ); let user_data: Box_> = Box_::new(glib::thread_guard::ThreadGuard::new(callback)); unsafe extern "C" fn sign_trampoline) + 'static>( _source_object: *mut glib::gobject_ffi::GObject, res: *mut gio::ffi::GAsyncResult, user_data: glib::ffi::gpointer, ) { let mut error = std::ptr::null_mut(); ffi::poppler_document_sign_finish(_source_object as *mut _, res, &mut error); let result = if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }; let callback: Box_> = Box_::from_raw(user_data as *mut _); let callback: P = callback.into_inner(); callback(result); } let callback = sign_trampoline::

; unsafe { ffi::poppler_document_sign( self.to_glib_none().0, signing_data.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, Some(callback), Box_::into_raw(user_data) as *mut _, ); } } #[cfg(feature = "v23_7")] #[cfg_attr(docsrs, doc(cfg(feature = "v23_7")))] pub fn sign_future( &self, signing_data: &SigningData, ) -> Pin> + 'static>> { let signing_data = signing_data.clone(); Box_::pin(gio::GioFuture::new(self, move |obj, cancellable, send| { obj.sign(&signing_data, Some(cancellable), move |res| { send.resolve(res); }); })) } #[cfg(feature = "v20_9")] #[cfg_attr(docsrs, doc(cfg(feature = "v20_9")))] #[doc(alias = "creation-datetime")] pub fn creation_datetime(&self) -> Option { ObjectExt::property(self, "creation-datetime") } #[cfg(feature = "v20_9")] #[cfg_attr(docsrs, doc(cfg(feature = "v20_9")))] #[doc(alias = "creation-datetime")] pub fn set_creation_datetime(&self, creation_datetime: Option<&glib::DateTime>) { ObjectExt::set_property(self, "creation-datetime", creation_datetime) } pub fn format(&self) -> Option { ObjectExt::property(self, "format") } #[doc(alias = "format-major")] pub fn format_major(&self) -> u32 { ObjectExt::property(self, "format-major") } #[doc(alias = "format-minor")] pub fn format_minor(&self) -> u32 { ObjectExt::property(self, "format-minor") } #[cfg_attr(feature = "v20_9", deprecated = "Since 20.9")] #[doc(alias = "mod-date")] pub fn mod_date(&self) -> i32 { ObjectExt::property(self, "mod-date") } #[cfg_attr(feature = "v20_9", deprecated = "Since 20.9")] #[doc(alias = "mod-date")] pub fn set_mod_date(&self, mod_date: i32) { ObjectExt::set_property(self, "mod-date", mod_date) } #[cfg(feature = "v20_9")] #[cfg_attr(docsrs, doc(cfg(feature = "v20_9")))] #[doc(alias = "mod-datetime")] pub fn mod_datetime(&self) -> Option { ObjectExt::property(self, "mod-datetime") } #[cfg(feature = "v20_9")] #[cfg_attr(docsrs, doc(cfg(feature = "v20_9")))] #[doc(alias = "mod-datetime")] pub fn set_mod_datetime(&self, mod_datetime: Option<&glib::DateTime>) { ObjectExt::set_property(self, "mod-datetime", mod_datetime) } pub fn subtype(&self) -> PDFSubtype { ObjectExt::property(self, "subtype") } #[doc(alias = "subtype-conformance")] pub fn subtype_conformance(&self) -> PDFConformance { ObjectExt::property(self, "subtype-conformance") } #[doc(alias = "subtype-part")] pub fn subtype_part(&self) -> PDFPart { ObjectExt::property(self, "subtype-part") } #[doc(alias = "subtype-string")] pub fn subtype_string(&self) -> Option { ObjectExt::property(self, "subtype-string") } #[doc(alias = "viewer-preferences")] pub fn viewer_preferences(&self) -> ViewerPreferences { ObjectExt::property(self, "viewer-preferences") } #[doc(alias = "author")] pub fn connect_author_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_author_trampoline( this: *mut ffi::PopplerDocument, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, c"notify::author".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_author_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg_attr(feature = "v20_9", deprecated = "Since 20.9")] #[doc(alias = "creation-date")] pub fn connect_creation_date_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_creation_date_trampoline( this: *mut ffi::PopplerDocument, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, c"notify::creation-date".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_creation_date_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v20_9")] #[cfg_attr(docsrs, doc(cfg(feature = "v20_9")))] #[doc(alias = "creation-datetime")] pub fn connect_creation_datetime_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_creation_datetime_trampoline( this: *mut ffi::PopplerDocument, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, c"notify::creation-datetime".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_creation_datetime_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "creator")] pub fn connect_creator_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_creator_trampoline( this: *mut ffi::PopplerDocument, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, c"notify::creator".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_creator_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "format")] pub fn connect_format_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_format_trampoline( this: *mut ffi::PopplerDocument, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, c"notify::format".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_format_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "format-major")] pub fn connect_format_major_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_format_major_trampoline( this: *mut ffi::PopplerDocument, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, c"notify::format-major".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_format_major_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "format-minor")] pub fn connect_format_minor_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_format_minor_trampoline( this: *mut ffi::PopplerDocument, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, c"notify::format-minor".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_format_minor_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "keywords")] pub fn connect_keywords_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_keywords_trampoline( this: *mut ffi::PopplerDocument, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, c"notify::keywords".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_keywords_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "linearized")] pub fn connect_linearized_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_linearized_trampoline( this: *mut ffi::PopplerDocument, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, c"notify::linearized".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_linearized_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "metadata")] pub fn connect_metadata_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_metadata_trampoline( this: *mut ffi::PopplerDocument, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, c"notify::metadata".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_metadata_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg_attr(feature = "v20_9", deprecated = "Since 20.9")] #[doc(alias = "mod-date")] pub fn connect_mod_date_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_mod_date_trampoline( this: *mut ffi::PopplerDocument, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, c"notify::mod-date".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_mod_date_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v20_9")] #[cfg_attr(docsrs, doc(cfg(feature = "v20_9")))] #[doc(alias = "mod-datetime")] pub fn connect_mod_datetime_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_mod_datetime_trampoline( this: *mut ffi::PopplerDocument, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, c"notify::mod-datetime".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_mod_datetime_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "page-layout")] pub fn connect_page_layout_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_page_layout_trampoline( this: *mut ffi::PopplerDocument, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, c"notify::page-layout".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_page_layout_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "page-mode")] pub fn connect_page_mode_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_page_mode_trampoline( this: *mut ffi::PopplerDocument, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, c"notify::page-mode".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_page_mode_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "permissions")] pub fn connect_permissions_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_permissions_trampoline( this: *mut ffi::PopplerDocument, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, c"notify::permissions".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_permissions_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v0_80")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_80")))] #[doc(alias = "print-duplex")] pub fn connect_print_duplex_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_print_duplex_trampoline( this: *mut ffi::PopplerDocument, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, c"notify::print-duplex".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_print_duplex_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v0_80")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_80")))] #[doc(alias = "print-n-copies")] pub fn connect_print_n_copies_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_print_n_copies_trampoline( this: *mut ffi::PopplerDocument, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, c"notify::print-n-copies".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_print_n_copies_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v0_73")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_73")))] #[doc(alias = "print-scaling")] pub fn connect_print_scaling_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_print_scaling_trampoline( this: *mut ffi::PopplerDocument, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, c"notify::print-scaling".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_print_scaling_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "producer")] pub fn connect_producer_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_producer_trampoline( this: *mut ffi::PopplerDocument, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, c"notify::producer".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_producer_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "subject")] pub fn connect_subject_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_subject_trampoline( this: *mut ffi::PopplerDocument, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, c"notify::subject".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_subject_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "subtype")] pub fn connect_subtype_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_subtype_trampoline( this: *mut ffi::PopplerDocument, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, c"notify::subtype".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_subtype_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "subtype-conformance")] pub fn connect_subtype_conformance_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_subtype_conformance_trampoline( this: *mut ffi::PopplerDocument, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, c"notify::subtype-conformance".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_subtype_conformance_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "subtype-part")] pub fn connect_subtype_part_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_subtype_part_trampoline( this: *mut ffi::PopplerDocument, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, c"notify::subtype-part".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_subtype_part_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "subtype-string")] pub fn connect_subtype_string_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_subtype_string_trampoline( this: *mut ffi::PopplerDocument, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, c"notify::subtype-string".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_subtype_string_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "title")] pub fn connect_title_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_title_trampoline( this: *mut ffi::PopplerDocument, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, c"notify::title".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_title_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "viewer-preferences")] pub fn connect_viewer_preferences_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_viewer_preferences_trampoline( this: *mut ffi::PopplerDocument, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, c"notify::viewer-preferences".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_viewer_preferences_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`Document`] objects. /// /// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html #[must_use = "The builder must be built to be used"] pub struct DocumentBuilder { builder: glib::object::ObjectBuilder<'static, Document>, } impl DocumentBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } pub fn author(self, author: impl Into) -> Self { Self { builder: self.builder.property("author", author.into()), } } #[cfg_attr(feature = "v20_9", deprecated = "Since 20.9")] pub fn creation_date(self, creation_date: i32) -> Self { Self { builder: self.builder.property("creation-date", creation_date), } } #[cfg(feature = "v20_9")] #[cfg_attr(docsrs, doc(cfg(feature = "v20_9")))] pub fn creation_datetime(self, creation_datetime: &glib::DateTime) -> Self { Self { builder: self .builder .property("creation-datetime", creation_datetime.clone()), } } pub fn creator(self, creator: impl Into) -> Self { Self { builder: self.builder.property("creator", creator.into()), } } pub fn keywords(self, keywords: impl Into) -> Self { Self { builder: self.builder.property("keywords", keywords.into()), } } #[cfg_attr(feature = "v20_9", deprecated = "Since 20.9")] pub fn mod_date(self, mod_date: i32) -> Self { Self { builder: self.builder.property("mod-date", mod_date), } } #[cfg(feature = "v20_9")] #[cfg_attr(docsrs, doc(cfg(feature = "v20_9")))] pub fn mod_datetime(self, mod_datetime: &glib::DateTime) -> Self { Self { builder: self.builder.property("mod-datetime", mod_datetime.clone()), } } pub fn producer(self, producer: impl Into) -> Self { Self { builder: self.builder.property("producer", producer.into()), } } pub fn subject(self, subject: impl Into) -> Self { Self { builder: self.builder.property("subject", subject.into()), } } pub fn title(self, title: impl Into) -> Self { Self { builder: self.builder.property("title", title.into()), } } // rustdoc-stripper-ignore-next /// Build the [`Document`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> Document { self.builder.build() } } poppler-rs-0.25.0/src/auto/enums.rs000064400000000000000000004753041046102023000152640ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::ffi; use glib::{prelude::*, translate::*}; #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerActionLayerAction")] pub enum ActionLayerAction { #[doc(alias = "POPPLER_ACTION_LAYER_ON")] On, #[doc(alias = "POPPLER_ACTION_LAYER_OFF")] Off, #[doc(alias = "POPPLER_ACTION_LAYER_TOGGLE")] Toggle, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for ActionLayerAction { type GlibType = ffi::PopplerActionLayerAction; #[inline] fn into_glib(self) -> ffi::PopplerActionLayerAction { match self { Self::On => ffi::POPPLER_ACTION_LAYER_ON, Self::Off => ffi::POPPLER_ACTION_LAYER_OFF, Self::Toggle => ffi::POPPLER_ACTION_LAYER_TOGGLE, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for ActionLayerAction { #[inline] unsafe fn from_glib(value: ffi::PopplerActionLayerAction) -> Self { match value { ffi::POPPLER_ACTION_LAYER_ON => Self::On, ffi::POPPLER_ACTION_LAYER_OFF => Self::Off, ffi::POPPLER_ACTION_LAYER_TOGGLE => Self::Toggle, value => Self::__Unknown(value), } } } impl StaticType for ActionLayerAction { #[inline] #[doc(alias = "poppler_action_layer_action_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_action_layer_action_get_type()) } } } impl glib::HasParamSpec for ActionLayerAction { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for ActionLayerAction { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for ActionLayerAction { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for ActionLayerAction { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: ActionLayerAction) -> Self { ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerActionMovieOperation")] pub enum ActionMovieOperation { #[doc(alias = "POPPLER_ACTION_MOVIE_PLAY")] Play, #[doc(alias = "POPPLER_ACTION_MOVIE_PAUSE")] Pause, #[doc(alias = "POPPLER_ACTION_MOVIE_RESUME")] Resume, #[doc(alias = "POPPLER_ACTION_MOVIE_STOP")] Stop, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for ActionMovieOperation { type GlibType = ffi::PopplerActionMovieOperation; #[inline] fn into_glib(self) -> ffi::PopplerActionMovieOperation { match self { Self::Play => ffi::POPPLER_ACTION_MOVIE_PLAY, Self::Pause => ffi::POPPLER_ACTION_MOVIE_PAUSE, Self::Resume => ffi::POPPLER_ACTION_MOVIE_RESUME, Self::Stop => ffi::POPPLER_ACTION_MOVIE_STOP, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for ActionMovieOperation { #[inline] unsafe fn from_glib(value: ffi::PopplerActionMovieOperation) -> Self { match value { ffi::POPPLER_ACTION_MOVIE_PLAY => Self::Play, ffi::POPPLER_ACTION_MOVIE_PAUSE => Self::Pause, ffi::POPPLER_ACTION_MOVIE_RESUME => Self::Resume, ffi::POPPLER_ACTION_MOVIE_STOP => Self::Stop, value => Self::__Unknown(value), } } } impl StaticType for ActionMovieOperation { #[inline] #[doc(alias = "poppler_action_movie_operation_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_action_movie_operation_get_type()) } } } impl glib::HasParamSpec for ActionMovieOperation { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for ActionMovieOperation { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for ActionMovieOperation { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for ActionMovieOperation { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: ActionMovieOperation) -> Self { ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerActionType")] pub enum ActionType { #[doc(alias = "POPPLER_ACTION_UNKNOWN")] Unknown, #[doc(alias = "POPPLER_ACTION_NONE")] None, #[doc(alias = "POPPLER_ACTION_GOTO_DEST")] GotoDest, #[doc(alias = "POPPLER_ACTION_GOTO_REMOTE")] GotoRemote, #[doc(alias = "POPPLER_ACTION_LAUNCH")] Launch, #[doc(alias = "POPPLER_ACTION_URI")] Uri, #[doc(alias = "POPPLER_ACTION_NAMED")] Named, #[doc(alias = "POPPLER_ACTION_MOVIE")] Movie, #[doc(alias = "POPPLER_ACTION_RENDITION")] Rendition, #[doc(alias = "POPPLER_ACTION_OCG_STATE")] OcgState, #[doc(alias = "POPPLER_ACTION_JAVASCRIPT")] Javascript, #[doc(alias = "POPPLER_ACTION_RESET_FORM")] ResetForm, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for ActionType { type GlibType = ffi::PopplerActionType; #[inline] fn into_glib(self) -> ffi::PopplerActionType { match self { Self::Unknown => ffi::POPPLER_ACTION_UNKNOWN, Self::None => ffi::POPPLER_ACTION_NONE, Self::GotoDest => ffi::POPPLER_ACTION_GOTO_DEST, Self::GotoRemote => ffi::POPPLER_ACTION_GOTO_REMOTE, Self::Launch => ffi::POPPLER_ACTION_LAUNCH, Self::Uri => ffi::POPPLER_ACTION_URI, Self::Named => ffi::POPPLER_ACTION_NAMED, Self::Movie => ffi::POPPLER_ACTION_MOVIE, Self::Rendition => ffi::POPPLER_ACTION_RENDITION, Self::OcgState => ffi::POPPLER_ACTION_OCG_STATE, Self::Javascript => ffi::POPPLER_ACTION_JAVASCRIPT, Self::ResetForm => ffi::POPPLER_ACTION_RESET_FORM, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for ActionType { #[inline] unsafe fn from_glib(value: ffi::PopplerActionType) -> Self { match value { ffi::POPPLER_ACTION_UNKNOWN => Self::Unknown, ffi::POPPLER_ACTION_NONE => Self::None, ffi::POPPLER_ACTION_GOTO_DEST => Self::GotoDest, ffi::POPPLER_ACTION_GOTO_REMOTE => Self::GotoRemote, ffi::POPPLER_ACTION_LAUNCH => Self::Launch, ffi::POPPLER_ACTION_URI => Self::Uri, ffi::POPPLER_ACTION_NAMED => Self::Named, ffi::POPPLER_ACTION_MOVIE => Self::Movie, ffi::POPPLER_ACTION_RENDITION => Self::Rendition, ffi::POPPLER_ACTION_OCG_STATE => Self::OcgState, ffi::POPPLER_ACTION_JAVASCRIPT => Self::Javascript, ffi::POPPLER_ACTION_RESET_FORM => Self::ResetForm, value => Self::__Unknown(value), } } } impl StaticType for ActionType { #[inline] #[doc(alias = "poppler_action_type_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_action_type_get_type()) } } } impl glib::HasParamSpec for ActionType { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for ActionType { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for ActionType { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for ActionType { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: ActionType) -> Self { ToValue::to_value(&v) } } #[cfg(feature = "v0_72")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_72")))] #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerAdditionalActionType")] pub enum AdditionalActionType { #[doc(alias = "POPPLER_ADDITIONAL_ACTION_FIELD_MODIFIED")] FieldModified, #[doc(alias = "POPPLER_ADDITIONAL_ACTION_FORMAT_FIELD")] FormatField, #[doc(alias = "POPPLER_ADDITIONAL_ACTION_VALIDATE_FIELD")] ValidateField, #[doc(alias = "POPPLER_ADDITIONAL_ACTION_CALCULATE_FIELD")] CalculateField, #[doc(hidden)] __Unknown(i32), } #[cfg(feature = "v0_72")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_72")))] #[doc(hidden)] impl IntoGlib for AdditionalActionType { type GlibType = ffi::PopplerAdditionalActionType; #[inline] fn into_glib(self) -> ffi::PopplerAdditionalActionType { match self { Self::FieldModified => ffi::POPPLER_ADDITIONAL_ACTION_FIELD_MODIFIED, Self::FormatField => ffi::POPPLER_ADDITIONAL_ACTION_FORMAT_FIELD, Self::ValidateField => ffi::POPPLER_ADDITIONAL_ACTION_VALIDATE_FIELD, Self::CalculateField => ffi::POPPLER_ADDITIONAL_ACTION_CALCULATE_FIELD, Self::__Unknown(value) => value, } } } #[cfg(feature = "v0_72")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_72")))] #[doc(hidden)] impl FromGlib for AdditionalActionType { #[inline] unsafe fn from_glib(value: ffi::PopplerAdditionalActionType) -> Self { match value { ffi::POPPLER_ADDITIONAL_ACTION_FIELD_MODIFIED => Self::FieldModified, ffi::POPPLER_ADDITIONAL_ACTION_FORMAT_FIELD => Self::FormatField, ffi::POPPLER_ADDITIONAL_ACTION_VALIDATE_FIELD => Self::ValidateField, ffi::POPPLER_ADDITIONAL_ACTION_CALCULATE_FIELD => Self::CalculateField, value => Self::__Unknown(value), } } } #[cfg(feature = "v0_72")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_72")))] impl StaticType for AdditionalActionType { #[inline] #[doc(alias = "poppler_additional_action_type_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_additional_action_type_get_type()) } } } #[cfg(feature = "v0_72")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_72")))] impl glib::HasParamSpec for AdditionalActionType { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } #[cfg(feature = "v0_72")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_72")))] impl glib::value::ValueType for AdditionalActionType { type Type = Self; } #[cfg(feature = "v0_72")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_72")))] unsafe impl<'a> glib::value::FromValue<'a> for AdditionalActionType { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } #[cfg(feature = "v0_72")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_72")))] impl ToValue for AdditionalActionType { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } #[cfg(feature = "v0_72")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_72")))] impl From for glib::Value { #[inline] fn from(v: AdditionalActionType) -> Self { ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerAnnotExternalDataType")] pub enum AnnotExternalDataType { #[doc(alias = "POPPLER_ANNOT_EXTERNAL_DATA_MARKUP_3D")] _3d, #[doc(alias = "POPPLER_ANNOT_EXTERNAL_DATA_MARKUP_UNKNOWN")] Unknown, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for AnnotExternalDataType { type GlibType = ffi::PopplerAnnotExternalDataType; #[inline] fn into_glib(self) -> ffi::PopplerAnnotExternalDataType { match self { Self::_3d => ffi::POPPLER_ANNOT_EXTERNAL_DATA_MARKUP_3D, Self::Unknown => ffi::POPPLER_ANNOT_EXTERNAL_DATA_MARKUP_UNKNOWN, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for AnnotExternalDataType { #[inline] unsafe fn from_glib(value: ffi::PopplerAnnotExternalDataType) -> Self { match value { ffi::POPPLER_ANNOT_EXTERNAL_DATA_MARKUP_3D => Self::_3d, ffi::POPPLER_ANNOT_EXTERNAL_DATA_MARKUP_UNKNOWN => Self::Unknown, value => Self::__Unknown(value), } } } impl StaticType for AnnotExternalDataType { #[inline] #[doc(alias = "poppler_annot_external_data_type_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_annot_external_data_type_get_type()) } } } impl glib::HasParamSpec for AnnotExternalDataType { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for AnnotExternalDataType { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for AnnotExternalDataType { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for AnnotExternalDataType { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: AnnotExternalDataType) -> Self { ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerAnnotFreeTextQuadding")] pub enum AnnotFreeTextQuadding { #[doc(alias = "POPPLER_ANNOT_FREE_TEXT_QUADDING_LEFT_JUSTIFIED")] LeftJustified, #[doc(alias = "POPPLER_ANNOT_FREE_TEXT_QUADDING_CENTERED")] Centered, #[doc(alias = "POPPLER_ANNOT_FREE_TEXT_QUADDING_RIGHT_JUSTIFIED")] RightJustified, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for AnnotFreeTextQuadding { type GlibType = ffi::PopplerAnnotFreeTextQuadding; #[inline] fn into_glib(self) -> ffi::PopplerAnnotFreeTextQuadding { match self { Self::LeftJustified => ffi::POPPLER_ANNOT_FREE_TEXT_QUADDING_LEFT_JUSTIFIED, Self::Centered => ffi::POPPLER_ANNOT_FREE_TEXT_QUADDING_CENTERED, Self::RightJustified => ffi::POPPLER_ANNOT_FREE_TEXT_QUADDING_RIGHT_JUSTIFIED, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for AnnotFreeTextQuadding { #[inline] unsafe fn from_glib(value: ffi::PopplerAnnotFreeTextQuadding) -> Self { match value { ffi::POPPLER_ANNOT_FREE_TEXT_QUADDING_LEFT_JUSTIFIED => Self::LeftJustified, ffi::POPPLER_ANNOT_FREE_TEXT_QUADDING_CENTERED => Self::Centered, ffi::POPPLER_ANNOT_FREE_TEXT_QUADDING_RIGHT_JUSTIFIED => Self::RightJustified, value => Self::__Unknown(value), } } } impl StaticType for AnnotFreeTextQuadding { #[inline] #[doc(alias = "poppler_annot_free_text_quadding_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_annot_free_text_quadding_get_type()) } } } impl glib::HasParamSpec for AnnotFreeTextQuadding { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for AnnotFreeTextQuadding { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for AnnotFreeTextQuadding { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for AnnotFreeTextQuadding { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: AnnotFreeTextQuadding) -> Self { ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerAnnotMarkupReplyType")] pub enum AnnotMarkupReplyType { #[doc(alias = "POPPLER_ANNOT_MARKUP_REPLY_TYPE_R")] R, #[doc(alias = "POPPLER_ANNOT_MARKUP_REPLY_TYPE_GROUP")] Group, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for AnnotMarkupReplyType { type GlibType = ffi::PopplerAnnotMarkupReplyType; #[inline] fn into_glib(self) -> ffi::PopplerAnnotMarkupReplyType { match self { Self::R => ffi::POPPLER_ANNOT_MARKUP_REPLY_TYPE_R, Self::Group => ffi::POPPLER_ANNOT_MARKUP_REPLY_TYPE_GROUP, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for AnnotMarkupReplyType { #[inline] unsafe fn from_glib(value: ffi::PopplerAnnotMarkupReplyType) -> Self { match value { ffi::POPPLER_ANNOT_MARKUP_REPLY_TYPE_R => Self::R, ffi::POPPLER_ANNOT_MARKUP_REPLY_TYPE_GROUP => Self::Group, value => Self::__Unknown(value), } } } impl StaticType for AnnotMarkupReplyType { #[inline] #[doc(alias = "poppler_annot_markup_reply_type_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_annot_markup_reply_type_get_type()) } } } impl glib::HasParamSpec for AnnotMarkupReplyType { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for AnnotMarkupReplyType { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for AnnotMarkupReplyType { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for AnnotMarkupReplyType { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: AnnotMarkupReplyType) -> Self { ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerAnnotTextState")] pub enum AnnotTextState { #[doc(alias = "POPPLER_ANNOT_TEXT_STATE_MARKED")] Marked, #[doc(alias = "POPPLER_ANNOT_TEXT_STATE_UNMARKED")] Unmarked, #[doc(alias = "POPPLER_ANNOT_TEXT_STATE_ACCEPTED")] Accepted, #[doc(alias = "POPPLER_ANNOT_TEXT_STATE_REJECTED")] Rejected, #[doc(alias = "POPPLER_ANNOT_TEXT_STATE_CANCELLED")] Cancelled, #[doc(alias = "POPPLER_ANNOT_TEXT_STATE_COMPLETED")] Completed, #[doc(alias = "POPPLER_ANNOT_TEXT_STATE_NONE")] None, #[doc(alias = "POPPLER_ANNOT_TEXT_STATE_UNKNOWN")] Unknown, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for AnnotTextState { type GlibType = ffi::PopplerAnnotTextState; #[inline] fn into_glib(self) -> ffi::PopplerAnnotTextState { match self { Self::Marked => ffi::POPPLER_ANNOT_TEXT_STATE_MARKED, Self::Unmarked => ffi::POPPLER_ANNOT_TEXT_STATE_UNMARKED, Self::Accepted => ffi::POPPLER_ANNOT_TEXT_STATE_ACCEPTED, Self::Rejected => ffi::POPPLER_ANNOT_TEXT_STATE_REJECTED, Self::Cancelled => ffi::POPPLER_ANNOT_TEXT_STATE_CANCELLED, Self::Completed => ffi::POPPLER_ANNOT_TEXT_STATE_COMPLETED, Self::None => ffi::POPPLER_ANNOT_TEXT_STATE_NONE, Self::Unknown => ffi::POPPLER_ANNOT_TEXT_STATE_UNKNOWN, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for AnnotTextState { #[inline] unsafe fn from_glib(value: ffi::PopplerAnnotTextState) -> Self { match value { ffi::POPPLER_ANNOT_TEXT_STATE_MARKED => Self::Marked, ffi::POPPLER_ANNOT_TEXT_STATE_UNMARKED => Self::Unmarked, ffi::POPPLER_ANNOT_TEXT_STATE_ACCEPTED => Self::Accepted, ffi::POPPLER_ANNOT_TEXT_STATE_REJECTED => Self::Rejected, ffi::POPPLER_ANNOT_TEXT_STATE_CANCELLED => Self::Cancelled, ffi::POPPLER_ANNOT_TEXT_STATE_COMPLETED => Self::Completed, ffi::POPPLER_ANNOT_TEXT_STATE_NONE => Self::None, ffi::POPPLER_ANNOT_TEXT_STATE_UNKNOWN => Self::Unknown, value => Self::__Unknown(value), } } } impl StaticType for AnnotTextState { #[inline] #[doc(alias = "poppler_annot_text_state_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_annot_text_state_get_type()) } } } impl glib::HasParamSpec for AnnotTextState { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for AnnotTextState { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for AnnotTextState { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for AnnotTextState { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: AnnotTextState) -> Self { ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerAnnotType")] pub enum AnnotType { #[doc(alias = "POPPLER_ANNOT_UNKNOWN")] Unknown, #[doc(alias = "POPPLER_ANNOT_TEXT")] Text, #[doc(alias = "POPPLER_ANNOT_LINK")] Link, #[doc(alias = "POPPLER_ANNOT_FREE_TEXT")] FreeText, #[doc(alias = "POPPLER_ANNOT_LINE")] Line, #[doc(alias = "POPPLER_ANNOT_SQUARE")] Square, #[doc(alias = "POPPLER_ANNOT_CIRCLE")] Circle, #[doc(alias = "POPPLER_ANNOT_POLYGON")] Polygon, #[doc(alias = "POPPLER_ANNOT_POLY_LINE")] PolyLine, #[doc(alias = "POPPLER_ANNOT_HIGHLIGHT")] Highlight, #[doc(alias = "POPPLER_ANNOT_UNDERLINE")] Underline, #[doc(alias = "POPPLER_ANNOT_SQUIGGLY")] Squiggly, #[doc(alias = "POPPLER_ANNOT_STRIKE_OUT")] StrikeOut, #[doc(alias = "POPPLER_ANNOT_STAMP")] Stamp, #[doc(alias = "POPPLER_ANNOT_CARET")] Caret, #[doc(alias = "POPPLER_ANNOT_INK")] Ink, #[doc(alias = "POPPLER_ANNOT_POPUP")] Popup, #[doc(alias = "POPPLER_ANNOT_FILE_ATTACHMENT")] FileAttachment, #[doc(alias = "POPPLER_ANNOT_SOUND")] Sound, #[doc(alias = "POPPLER_ANNOT_MOVIE")] Movie, #[doc(alias = "POPPLER_ANNOT_WIDGET")] Widget, #[doc(alias = "POPPLER_ANNOT_SCREEN")] Screen, #[doc(alias = "POPPLER_ANNOT_PRINTER_MARK")] PrinterMark, #[doc(alias = "POPPLER_ANNOT_TRAP_NET")] TrapNet, #[doc(alias = "POPPLER_ANNOT_WATERMARK")] Watermark, #[doc(alias = "POPPLER_ANNOT_3D")] _3d, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for AnnotType { type GlibType = ffi::PopplerAnnotType; fn into_glib(self) -> ffi::PopplerAnnotType { match self { Self::Unknown => ffi::POPPLER_ANNOT_UNKNOWN, Self::Text => ffi::POPPLER_ANNOT_TEXT, Self::Link => ffi::POPPLER_ANNOT_LINK, Self::FreeText => ffi::POPPLER_ANNOT_FREE_TEXT, Self::Line => ffi::POPPLER_ANNOT_LINE, Self::Square => ffi::POPPLER_ANNOT_SQUARE, Self::Circle => ffi::POPPLER_ANNOT_CIRCLE, Self::Polygon => ffi::POPPLER_ANNOT_POLYGON, Self::PolyLine => ffi::POPPLER_ANNOT_POLY_LINE, Self::Highlight => ffi::POPPLER_ANNOT_HIGHLIGHT, Self::Underline => ffi::POPPLER_ANNOT_UNDERLINE, Self::Squiggly => ffi::POPPLER_ANNOT_SQUIGGLY, Self::StrikeOut => ffi::POPPLER_ANNOT_STRIKE_OUT, Self::Stamp => ffi::POPPLER_ANNOT_STAMP, Self::Caret => ffi::POPPLER_ANNOT_CARET, Self::Ink => ffi::POPPLER_ANNOT_INK, Self::Popup => ffi::POPPLER_ANNOT_POPUP, Self::FileAttachment => ffi::POPPLER_ANNOT_FILE_ATTACHMENT, Self::Sound => ffi::POPPLER_ANNOT_SOUND, Self::Movie => ffi::POPPLER_ANNOT_MOVIE, Self::Widget => ffi::POPPLER_ANNOT_WIDGET, Self::Screen => ffi::POPPLER_ANNOT_SCREEN, Self::PrinterMark => ffi::POPPLER_ANNOT_PRINTER_MARK, Self::TrapNet => ffi::POPPLER_ANNOT_TRAP_NET, Self::Watermark => ffi::POPPLER_ANNOT_WATERMARK, Self::_3d => ffi::POPPLER_ANNOT_3D, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for AnnotType { unsafe fn from_glib(value: ffi::PopplerAnnotType) -> Self { match value { ffi::POPPLER_ANNOT_UNKNOWN => Self::Unknown, ffi::POPPLER_ANNOT_TEXT => Self::Text, ffi::POPPLER_ANNOT_LINK => Self::Link, ffi::POPPLER_ANNOT_FREE_TEXT => Self::FreeText, ffi::POPPLER_ANNOT_LINE => Self::Line, ffi::POPPLER_ANNOT_SQUARE => Self::Square, ffi::POPPLER_ANNOT_CIRCLE => Self::Circle, ffi::POPPLER_ANNOT_POLYGON => Self::Polygon, ffi::POPPLER_ANNOT_POLY_LINE => Self::PolyLine, ffi::POPPLER_ANNOT_HIGHLIGHT => Self::Highlight, ffi::POPPLER_ANNOT_UNDERLINE => Self::Underline, ffi::POPPLER_ANNOT_SQUIGGLY => Self::Squiggly, ffi::POPPLER_ANNOT_STRIKE_OUT => Self::StrikeOut, ffi::POPPLER_ANNOT_STAMP => Self::Stamp, ffi::POPPLER_ANNOT_CARET => Self::Caret, ffi::POPPLER_ANNOT_INK => Self::Ink, ffi::POPPLER_ANNOT_POPUP => Self::Popup, ffi::POPPLER_ANNOT_FILE_ATTACHMENT => Self::FileAttachment, ffi::POPPLER_ANNOT_SOUND => Self::Sound, ffi::POPPLER_ANNOT_MOVIE => Self::Movie, ffi::POPPLER_ANNOT_WIDGET => Self::Widget, ffi::POPPLER_ANNOT_SCREEN => Self::Screen, ffi::POPPLER_ANNOT_PRINTER_MARK => Self::PrinterMark, ffi::POPPLER_ANNOT_TRAP_NET => Self::TrapNet, ffi::POPPLER_ANNOT_WATERMARK => Self::Watermark, ffi::POPPLER_ANNOT_3D => Self::_3d, value => Self::__Unknown(value), } } } impl StaticType for AnnotType { #[inline] #[doc(alias = "poppler_annot_type_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_annot_type_get_type()) } } } impl glib::HasParamSpec for AnnotType { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for AnnotType { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for AnnotType { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for AnnotType { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: AnnotType) -> Self { ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerBackend")] pub enum Backend { #[doc(alias = "POPPLER_BACKEND_UNKNOWN")] Unknown, #[doc(alias = "POPPLER_BACKEND_SPLASH")] Splash, #[doc(alias = "POPPLER_BACKEND_CAIRO")] Cairo, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for Backend { type GlibType = ffi::PopplerBackend; #[inline] fn into_glib(self) -> ffi::PopplerBackend { match self { Self::Unknown => ffi::POPPLER_BACKEND_UNKNOWN, Self::Splash => ffi::POPPLER_BACKEND_SPLASH, Self::Cairo => ffi::POPPLER_BACKEND_CAIRO, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for Backend { #[inline] unsafe fn from_glib(value: ffi::PopplerBackend) -> Self { match value { ffi::POPPLER_BACKEND_UNKNOWN => Self::Unknown, ffi::POPPLER_BACKEND_SPLASH => Self::Splash, ffi::POPPLER_BACKEND_CAIRO => Self::Cairo, value => Self::__Unknown(value), } } } impl StaticType for Backend { #[inline] #[doc(alias = "poppler_backend_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_backend_get_type()) } } } impl glib::HasParamSpec for Backend { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for Backend { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for Backend { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for Backend { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: Backend) -> Self { ToValue::to_value(&v) } } #[cfg(feature = "v21_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v21_12")))] #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerCertificateStatus")] pub enum CertificateStatus { #[doc(alias = "POPPLER_CERTIFICATE_TRUSTED")] Trusted, #[doc(alias = "POPPLER_CERTIFICATE_UNTRUSTED_ISSUER")] UntrustedIssuer, #[doc(alias = "POPPLER_CERTIFICATE_UNKNOWN_ISSUER")] UnknownIssuer, #[doc(alias = "POPPLER_CERTIFICATE_REVOKED")] Revoked, #[doc(alias = "POPPLER_CERTIFICATE_EXPIRED")] Expired, #[doc(alias = "POPPLER_CERTIFICATE_GENERIC_ERROR")] GenericError, #[doc(alias = "POPPLER_CERTIFICATE_NOT_VERIFIED")] NotVerified, #[doc(hidden)] __Unknown(i32), } #[cfg(feature = "v21_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v21_12")))] #[doc(hidden)] impl IntoGlib for CertificateStatus { type GlibType = ffi::PopplerCertificateStatus; #[inline] fn into_glib(self) -> ffi::PopplerCertificateStatus { match self { Self::Trusted => ffi::POPPLER_CERTIFICATE_TRUSTED, Self::UntrustedIssuer => ffi::POPPLER_CERTIFICATE_UNTRUSTED_ISSUER, Self::UnknownIssuer => ffi::POPPLER_CERTIFICATE_UNKNOWN_ISSUER, Self::Revoked => ffi::POPPLER_CERTIFICATE_REVOKED, Self::Expired => ffi::POPPLER_CERTIFICATE_EXPIRED, Self::GenericError => ffi::POPPLER_CERTIFICATE_GENERIC_ERROR, Self::NotVerified => ffi::POPPLER_CERTIFICATE_NOT_VERIFIED, Self::__Unknown(value) => value, } } } #[cfg(feature = "v21_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v21_12")))] #[doc(hidden)] impl FromGlib for CertificateStatus { #[inline] unsafe fn from_glib(value: ffi::PopplerCertificateStatus) -> Self { match value { ffi::POPPLER_CERTIFICATE_TRUSTED => Self::Trusted, ffi::POPPLER_CERTIFICATE_UNTRUSTED_ISSUER => Self::UntrustedIssuer, ffi::POPPLER_CERTIFICATE_UNKNOWN_ISSUER => Self::UnknownIssuer, ffi::POPPLER_CERTIFICATE_REVOKED => Self::Revoked, ffi::POPPLER_CERTIFICATE_EXPIRED => Self::Expired, ffi::POPPLER_CERTIFICATE_GENERIC_ERROR => Self::GenericError, ffi::POPPLER_CERTIFICATE_NOT_VERIFIED => Self::NotVerified, value => Self::__Unknown(value), } } } #[cfg(feature = "v21_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v21_12")))] impl StaticType for CertificateStatus { #[inline] #[doc(alias = "poppler_certificate_status_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_certificate_status_get_type()) } } } #[cfg(feature = "v21_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v21_12")))] impl glib::HasParamSpec for CertificateStatus { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } #[cfg(feature = "v21_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v21_12")))] impl glib::value::ValueType for CertificateStatus { type Type = Self; } #[cfg(feature = "v21_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v21_12")))] unsafe impl<'a> glib::value::FromValue<'a> for CertificateStatus { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } #[cfg(feature = "v21_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v21_12")))] impl ToValue for CertificateStatus { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } #[cfg(feature = "v21_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v21_12")))] impl From for glib::Value { #[inline] fn from(v: CertificateStatus) -> Self { ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerDestType")] pub enum DestType { #[doc(alias = "POPPLER_DEST_UNKNOWN")] Unknown, #[doc(alias = "POPPLER_DEST_XYZ")] Xyz, #[doc(alias = "POPPLER_DEST_FIT")] Fit, #[doc(alias = "POPPLER_DEST_FITH")] Fith, #[doc(alias = "POPPLER_DEST_FITV")] Fitv, #[doc(alias = "POPPLER_DEST_FITR")] Fitr, #[doc(alias = "POPPLER_DEST_FITB")] Fitb, #[doc(alias = "POPPLER_DEST_FITBH")] Fitbh, #[doc(alias = "POPPLER_DEST_FITBV")] Fitbv, #[doc(alias = "POPPLER_DEST_NAMED")] Named, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for DestType { type GlibType = ffi::PopplerDestType; #[inline] fn into_glib(self) -> ffi::PopplerDestType { match self { Self::Unknown => ffi::POPPLER_DEST_UNKNOWN, Self::Xyz => ffi::POPPLER_DEST_XYZ, Self::Fit => ffi::POPPLER_DEST_FIT, Self::Fith => ffi::POPPLER_DEST_FITH, Self::Fitv => ffi::POPPLER_DEST_FITV, Self::Fitr => ffi::POPPLER_DEST_FITR, Self::Fitb => ffi::POPPLER_DEST_FITB, Self::Fitbh => ffi::POPPLER_DEST_FITBH, Self::Fitbv => ffi::POPPLER_DEST_FITBV, Self::Named => ffi::POPPLER_DEST_NAMED, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for DestType { #[inline] unsafe fn from_glib(value: ffi::PopplerDestType) -> Self { match value { ffi::POPPLER_DEST_UNKNOWN => Self::Unknown, ffi::POPPLER_DEST_XYZ => Self::Xyz, ffi::POPPLER_DEST_FIT => Self::Fit, ffi::POPPLER_DEST_FITH => Self::Fith, ffi::POPPLER_DEST_FITV => Self::Fitv, ffi::POPPLER_DEST_FITR => Self::Fitr, ffi::POPPLER_DEST_FITB => Self::Fitb, ffi::POPPLER_DEST_FITBH => Self::Fitbh, ffi::POPPLER_DEST_FITBV => Self::Fitbv, ffi::POPPLER_DEST_NAMED => Self::Named, value => Self::__Unknown(value), } } } impl StaticType for DestType { #[inline] #[doc(alias = "poppler_dest_type_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_dest_type_get_type()) } } } impl glib::HasParamSpec for DestType { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for DestType { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for DestType { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for DestType { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: DestType) -> Self { ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerError")] pub enum Error { #[doc(alias = "POPPLER_ERROR_INVALID")] Invalid, #[doc(alias = "POPPLER_ERROR_ENCRYPTED")] Encrypted, #[doc(alias = "POPPLER_ERROR_OPEN_FILE")] OpenFile, #[doc(alias = "POPPLER_ERROR_BAD_CATALOG")] BadCatalog, #[doc(alias = "POPPLER_ERROR_DAMAGED")] Damaged, #[cfg(feature = "v23_7")] #[cfg_attr(docsrs, doc(cfg(feature = "v23_7")))] #[doc(alias = "POPPLER_ERROR_SIGNING")] Signing, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for Error { type GlibType = ffi::PopplerError; #[inline] fn into_glib(self) -> ffi::PopplerError { match self { Self::Invalid => ffi::POPPLER_ERROR_INVALID, Self::Encrypted => ffi::POPPLER_ERROR_ENCRYPTED, Self::OpenFile => ffi::POPPLER_ERROR_OPEN_FILE, Self::BadCatalog => ffi::POPPLER_ERROR_BAD_CATALOG, Self::Damaged => ffi::POPPLER_ERROR_DAMAGED, #[cfg(feature = "v23_7")] Self::Signing => ffi::POPPLER_ERROR_SIGNING, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for Error { #[inline] unsafe fn from_glib(value: ffi::PopplerError) -> Self { match value { ffi::POPPLER_ERROR_INVALID => Self::Invalid, ffi::POPPLER_ERROR_ENCRYPTED => Self::Encrypted, ffi::POPPLER_ERROR_OPEN_FILE => Self::OpenFile, ffi::POPPLER_ERROR_BAD_CATALOG => Self::BadCatalog, ffi::POPPLER_ERROR_DAMAGED => Self::Damaged, #[cfg(feature = "v23_7")] ffi::POPPLER_ERROR_SIGNING => Self::Signing, value => Self::__Unknown(value), } } } impl glib::error::ErrorDomain for Error { #[inline] fn domain() -> glib::Quark { unsafe { from_glib(ffi::poppler_error_quark()) } } #[inline] fn code(self) -> i32 { self.into_glib() } #[inline] #[allow(clippy::match_single_binding)] fn from(code: i32) -> Option { match unsafe { from_glib(code) } { value => Some(value), } } } impl StaticType for Error { #[inline] #[doc(alias = "poppler_error_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_error_get_type()) } } } impl glib::HasParamSpec for Error { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for Error { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for Error { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for Error { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: Error) -> Self { ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerFontType")] pub enum FontType { #[doc(alias = "POPPLER_FONT_TYPE_UNKNOWN")] Unknown, #[doc(alias = "POPPLER_FONT_TYPE_TYPE1")] Type1, #[doc(alias = "POPPLER_FONT_TYPE_TYPE1C")] Type1c, #[doc(alias = "POPPLER_FONT_TYPE_TYPE1COT")] Type1cot, #[doc(alias = "POPPLER_FONT_TYPE_TYPE3")] Type3, #[doc(alias = "POPPLER_FONT_TYPE_TRUETYPE")] Truetype, #[doc(alias = "POPPLER_FONT_TYPE_TRUETYPEOT")] Truetypeot, #[doc(alias = "POPPLER_FONT_TYPE_CID_TYPE0")] CidType0, #[doc(alias = "POPPLER_FONT_TYPE_CID_TYPE0C")] CidType0c, #[doc(alias = "POPPLER_FONT_TYPE_CID_TYPE0COT")] CidType0cot, #[doc(alias = "POPPLER_FONT_TYPE_CID_TYPE2")] CidType2, #[doc(alias = "POPPLER_FONT_TYPE_CID_TYPE2OT")] CidType2ot, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for FontType { type GlibType = ffi::PopplerFontType; #[inline] fn into_glib(self) -> ffi::PopplerFontType { match self { Self::Unknown => ffi::POPPLER_FONT_TYPE_UNKNOWN, Self::Type1 => ffi::POPPLER_FONT_TYPE_TYPE1, Self::Type1c => ffi::POPPLER_FONT_TYPE_TYPE1C, Self::Type1cot => ffi::POPPLER_FONT_TYPE_TYPE1COT, Self::Type3 => ffi::POPPLER_FONT_TYPE_TYPE3, Self::Truetype => ffi::POPPLER_FONT_TYPE_TRUETYPE, Self::Truetypeot => ffi::POPPLER_FONT_TYPE_TRUETYPEOT, Self::CidType0 => ffi::POPPLER_FONT_TYPE_CID_TYPE0, Self::CidType0c => ffi::POPPLER_FONT_TYPE_CID_TYPE0C, Self::CidType0cot => ffi::POPPLER_FONT_TYPE_CID_TYPE0COT, Self::CidType2 => ffi::POPPLER_FONT_TYPE_CID_TYPE2, Self::CidType2ot => ffi::POPPLER_FONT_TYPE_CID_TYPE2OT, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for FontType { #[inline] unsafe fn from_glib(value: ffi::PopplerFontType) -> Self { match value { ffi::POPPLER_FONT_TYPE_UNKNOWN => Self::Unknown, ffi::POPPLER_FONT_TYPE_TYPE1 => Self::Type1, ffi::POPPLER_FONT_TYPE_TYPE1C => Self::Type1c, ffi::POPPLER_FONT_TYPE_TYPE1COT => Self::Type1cot, ffi::POPPLER_FONT_TYPE_TYPE3 => Self::Type3, ffi::POPPLER_FONT_TYPE_TRUETYPE => Self::Truetype, ffi::POPPLER_FONT_TYPE_TRUETYPEOT => Self::Truetypeot, ffi::POPPLER_FONT_TYPE_CID_TYPE0 => Self::CidType0, ffi::POPPLER_FONT_TYPE_CID_TYPE0C => Self::CidType0c, ffi::POPPLER_FONT_TYPE_CID_TYPE0COT => Self::CidType0cot, ffi::POPPLER_FONT_TYPE_CID_TYPE2 => Self::CidType2, ffi::POPPLER_FONT_TYPE_CID_TYPE2OT => Self::CidType2ot, value => Self::__Unknown(value), } } } impl StaticType for FontType { #[inline] #[doc(alias = "poppler_font_type_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_font_type_get_type()) } } } impl glib::HasParamSpec for FontType { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for FontType { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for FontType { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for FontType { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: FontType) -> Self { ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerFormButtonType")] pub enum FormButtonType { #[doc(alias = "POPPLER_FORM_BUTTON_PUSH")] Push, #[doc(alias = "POPPLER_FORM_BUTTON_CHECK")] Check, #[doc(alias = "POPPLER_FORM_BUTTON_RADIO")] Radio, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for FormButtonType { type GlibType = ffi::PopplerFormButtonType; #[inline] fn into_glib(self) -> ffi::PopplerFormButtonType { match self { Self::Push => ffi::POPPLER_FORM_BUTTON_PUSH, Self::Check => ffi::POPPLER_FORM_BUTTON_CHECK, Self::Radio => ffi::POPPLER_FORM_BUTTON_RADIO, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for FormButtonType { #[inline] unsafe fn from_glib(value: ffi::PopplerFormButtonType) -> Self { match value { ffi::POPPLER_FORM_BUTTON_PUSH => Self::Push, ffi::POPPLER_FORM_BUTTON_CHECK => Self::Check, ffi::POPPLER_FORM_BUTTON_RADIO => Self::Radio, value => Self::__Unknown(value), } } } impl StaticType for FormButtonType { #[inline] #[doc(alias = "poppler_form_button_type_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_form_button_type_get_type()) } } } impl glib::HasParamSpec for FormButtonType { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for FormButtonType { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for FormButtonType { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for FormButtonType { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: FormButtonType) -> Self { ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerFormChoiceType")] pub enum FormChoiceType { #[doc(alias = "POPPLER_FORM_CHOICE_COMBO")] Combo, #[doc(alias = "POPPLER_FORM_CHOICE_LIST")] List, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for FormChoiceType { type GlibType = ffi::PopplerFormChoiceType; #[inline] fn into_glib(self) -> ffi::PopplerFormChoiceType { match self { Self::Combo => ffi::POPPLER_FORM_CHOICE_COMBO, Self::List => ffi::POPPLER_FORM_CHOICE_LIST, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for FormChoiceType { #[inline] unsafe fn from_glib(value: ffi::PopplerFormChoiceType) -> Self { match value { ffi::POPPLER_FORM_CHOICE_COMBO => Self::Combo, ffi::POPPLER_FORM_CHOICE_LIST => Self::List, value => Self::__Unknown(value), } } } impl StaticType for FormChoiceType { #[inline] #[doc(alias = "poppler_form_choice_type_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_form_choice_type_get_type()) } } } impl glib::HasParamSpec for FormChoiceType { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for FormChoiceType { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for FormChoiceType { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for FormChoiceType { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: FormChoiceType) -> Self { ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerFormFieldType")] pub enum FormFieldType { #[doc(alias = "POPPLER_FORM_FIELD_UNKNOWN")] Unknown, #[doc(alias = "POPPLER_FORM_FIELD_BUTTON")] Button, #[doc(alias = "POPPLER_FORM_FIELD_TEXT")] Text, #[doc(alias = "POPPLER_FORM_FIELD_CHOICE")] Choice, #[doc(alias = "POPPLER_FORM_FIELD_SIGNATURE")] Signature, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for FormFieldType { type GlibType = ffi::PopplerFormFieldType; #[inline] fn into_glib(self) -> ffi::PopplerFormFieldType { match self { Self::Unknown => ffi::POPPLER_FORM_FIELD_UNKNOWN, Self::Button => ffi::POPPLER_FORM_FIELD_BUTTON, Self::Text => ffi::POPPLER_FORM_FIELD_TEXT, Self::Choice => ffi::POPPLER_FORM_FIELD_CHOICE, Self::Signature => ffi::POPPLER_FORM_FIELD_SIGNATURE, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for FormFieldType { #[inline] unsafe fn from_glib(value: ffi::PopplerFormFieldType) -> Self { match value { ffi::POPPLER_FORM_FIELD_UNKNOWN => Self::Unknown, ffi::POPPLER_FORM_FIELD_BUTTON => Self::Button, ffi::POPPLER_FORM_FIELD_TEXT => Self::Text, ffi::POPPLER_FORM_FIELD_CHOICE => Self::Choice, ffi::POPPLER_FORM_FIELD_SIGNATURE => Self::Signature, value => Self::__Unknown(value), } } } impl StaticType for FormFieldType { #[inline] #[doc(alias = "poppler_form_field_type_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_form_field_type_get_type()) } } } impl glib::HasParamSpec for FormFieldType { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for FormFieldType { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for FormFieldType { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for FormFieldType { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: FormFieldType) -> Self { ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerFormTextType")] pub enum FormTextType { #[doc(alias = "POPPLER_FORM_TEXT_NORMAL")] Normal, #[doc(alias = "POPPLER_FORM_TEXT_MULTILINE")] Multiline, #[doc(alias = "POPPLER_FORM_TEXT_FILE_SELECT")] FileSelect, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for FormTextType { type GlibType = ffi::PopplerFormTextType; #[inline] fn into_glib(self) -> ffi::PopplerFormTextType { match self { Self::Normal => ffi::POPPLER_FORM_TEXT_NORMAL, Self::Multiline => ffi::POPPLER_FORM_TEXT_MULTILINE, Self::FileSelect => ffi::POPPLER_FORM_TEXT_FILE_SELECT, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for FormTextType { #[inline] unsafe fn from_glib(value: ffi::PopplerFormTextType) -> Self { match value { ffi::POPPLER_FORM_TEXT_NORMAL => Self::Normal, ffi::POPPLER_FORM_TEXT_MULTILINE => Self::Multiline, ffi::POPPLER_FORM_TEXT_FILE_SELECT => Self::FileSelect, value => Self::__Unknown(value), } } } impl StaticType for FormTextType { #[inline] #[doc(alias = "poppler_form_text_type_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_form_text_type_get_type()) } } } impl glib::HasParamSpec for FormTextType { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for FormTextType { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for FormTextType { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for FormTextType { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: FormTextType) -> Self { ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerMoviePlayMode")] pub enum MoviePlayMode { #[doc(alias = "POPPLER_MOVIE_PLAY_MODE_ONCE")] Once, #[doc(alias = "POPPLER_MOVIE_PLAY_MODE_OPEN")] Open, #[doc(alias = "POPPLER_MOVIE_PLAY_MODE_REPEAT")] Repeat, #[doc(alias = "POPPLER_MOVIE_PLAY_MODE_PALINDROME")] Palindrome, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for MoviePlayMode { type GlibType = ffi::PopplerMoviePlayMode; #[inline] fn into_glib(self) -> ffi::PopplerMoviePlayMode { match self { Self::Once => ffi::POPPLER_MOVIE_PLAY_MODE_ONCE, Self::Open => ffi::POPPLER_MOVIE_PLAY_MODE_OPEN, Self::Repeat => ffi::POPPLER_MOVIE_PLAY_MODE_REPEAT, Self::Palindrome => ffi::POPPLER_MOVIE_PLAY_MODE_PALINDROME, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for MoviePlayMode { #[inline] unsafe fn from_glib(value: ffi::PopplerMoviePlayMode) -> Self { match value { ffi::POPPLER_MOVIE_PLAY_MODE_ONCE => Self::Once, ffi::POPPLER_MOVIE_PLAY_MODE_OPEN => Self::Open, ffi::POPPLER_MOVIE_PLAY_MODE_REPEAT => Self::Repeat, ffi::POPPLER_MOVIE_PLAY_MODE_PALINDROME => Self::Palindrome, value => Self::__Unknown(value), } } } impl StaticType for MoviePlayMode { #[inline] #[doc(alias = "poppler_movie_play_mode_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_movie_play_mode_get_type()) } } } impl glib::HasParamSpec for MoviePlayMode { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for MoviePlayMode { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for MoviePlayMode { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for MoviePlayMode { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: MoviePlayMode) -> Self { ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerPDFConformance")] pub enum PDFConformance { #[doc(alias = "POPPLER_PDF_SUBTYPE_CONF_UNSET")] Unset, #[doc(alias = "POPPLER_PDF_SUBTYPE_CONF_A")] A, #[doc(alias = "POPPLER_PDF_SUBTYPE_CONF_B")] B, #[doc(alias = "POPPLER_PDF_SUBTYPE_CONF_G")] G, #[doc(alias = "POPPLER_PDF_SUBTYPE_CONF_N")] N, #[doc(alias = "POPPLER_PDF_SUBTYPE_CONF_P")] P, #[doc(alias = "POPPLER_PDF_SUBTYPE_CONF_PG")] Pg, #[doc(alias = "POPPLER_PDF_SUBTYPE_CONF_U")] U, #[doc(alias = "POPPLER_PDF_SUBTYPE_CONF_NONE")] None, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for PDFConformance { type GlibType = ffi::PopplerPDFConformance; #[inline] fn into_glib(self) -> ffi::PopplerPDFConformance { match self { Self::Unset => ffi::POPPLER_PDF_SUBTYPE_CONF_UNSET, Self::A => ffi::POPPLER_PDF_SUBTYPE_CONF_A, Self::B => ffi::POPPLER_PDF_SUBTYPE_CONF_B, Self::G => ffi::POPPLER_PDF_SUBTYPE_CONF_G, Self::N => ffi::POPPLER_PDF_SUBTYPE_CONF_N, Self::P => ffi::POPPLER_PDF_SUBTYPE_CONF_P, Self::Pg => ffi::POPPLER_PDF_SUBTYPE_CONF_PG, Self::U => ffi::POPPLER_PDF_SUBTYPE_CONF_U, Self::None => ffi::POPPLER_PDF_SUBTYPE_CONF_NONE, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for PDFConformance { #[inline] unsafe fn from_glib(value: ffi::PopplerPDFConformance) -> Self { match value { ffi::POPPLER_PDF_SUBTYPE_CONF_UNSET => Self::Unset, ffi::POPPLER_PDF_SUBTYPE_CONF_A => Self::A, ffi::POPPLER_PDF_SUBTYPE_CONF_B => Self::B, ffi::POPPLER_PDF_SUBTYPE_CONF_G => Self::G, ffi::POPPLER_PDF_SUBTYPE_CONF_N => Self::N, ffi::POPPLER_PDF_SUBTYPE_CONF_P => Self::P, ffi::POPPLER_PDF_SUBTYPE_CONF_PG => Self::Pg, ffi::POPPLER_PDF_SUBTYPE_CONF_U => Self::U, ffi::POPPLER_PDF_SUBTYPE_CONF_NONE => Self::None, value => Self::__Unknown(value), } } } impl StaticType for PDFConformance { #[inline] #[doc(alias = "poppler_pdf_conformance_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_pdf_conformance_get_type()) } } } impl glib::HasParamSpec for PDFConformance { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for PDFConformance { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for PDFConformance { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for PDFConformance { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: PDFConformance) -> Self { ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerPDFPart")] pub enum PDFPart { #[doc(alias = "POPPLER_PDF_SUBTYPE_PART_UNSET")] Unset, #[doc(alias = "POPPLER_PDF_SUBTYPE_PART_1")] _1, #[doc(alias = "POPPLER_PDF_SUBTYPE_PART_2")] _2, #[doc(alias = "POPPLER_PDF_SUBTYPE_PART_3")] _3, #[doc(alias = "POPPLER_PDF_SUBTYPE_PART_4")] _4, #[doc(alias = "POPPLER_PDF_SUBTYPE_PART_5")] _5, #[doc(alias = "POPPLER_PDF_SUBTYPE_PART_6")] _6, #[doc(alias = "POPPLER_PDF_SUBTYPE_PART_7")] _7, #[doc(alias = "POPPLER_PDF_SUBTYPE_PART_8")] _8, #[doc(alias = "POPPLER_PDF_SUBTYPE_PART_NONE")] None, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for PDFPart { type GlibType = ffi::PopplerPDFPart; #[inline] fn into_glib(self) -> ffi::PopplerPDFPart { match self { Self::Unset => ffi::POPPLER_PDF_SUBTYPE_PART_UNSET, Self::_1 => ffi::POPPLER_PDF_SUBTYPE_PART_1, Self::_2 => ffi::POPPLER_PDF_SUBTYPE_PART_2, Self::_3 => ffi::POPPLER_PDF_SUBTYPE_PART_3, Self::_4 => ffi::POPPLER_PDF_SUBTYPE_PART_4, Self::_5 => ffi::POPPLER_PDF_SUBTYPE_PART_5, Self::_6 => ffi::POPPLER_PDF_SUBTYPE_PART_6, Self::_7 => ffi::POPPLER_PDF_SUBTYPE_PART_7, Self::_8 => ffi::POPPLER_PDF_SUBTYPE_PART_8, Self::None => ffi::POPPLER_PDF_SUBTYPE_PART_NONE, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for PDFPart { #[inline] unsafe fn from_glib(value: ffi::PopplerPDFPart) -> Self { match value { ffi::POPPLER_PDF_SUBTYPE_PART_UNSET => Self::Unset, ffi::POPPLER_PDF_SUBTYPE_PART_1 => Self::_1, ffi::POPPLER_PDF_SUBTYPE_PART_2 => Self::_2, ffi::POPPLER_PDF_SUBTYPE_PART_3 => Self::_3, ffi::POPPLER_PDF_SUBTYPE_PART_4 => Self::_4, ffi::POPPLER_PDF_SUBTYPE_PART_5 => Self::_5, ffi::POPPLER_PDF_SUBTYPE_PART_6 => Self::_6, ffi::POPPLER_PDF_SUBTYPE_PART_7 => Self::_7, ffi::POPPLER_PDF_SUBTYPE_PART_8 => Self::_8, ffi::POPPLER_PDF_SUBTYPE_PART_NONE => Self::None, value => Self::__Unknown(value), } } } impl StaticType for PDFPart { #[inline] #[doc(alias = "poppler_pdf_part_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_pdf_part_get_type()) } } } impl glib::HasParamSpec for PDFPart { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for PDFPart { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for PDFPart { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for PDFPart { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: PDFPart) -> Self { ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerPDFSubtype")] pub enum PDFSubtype { #[doc(alias = "POPPLER_PDF_SUBTYPE_UNSET")] Unset, #[doc(alias = "POPPLER_PDF_SUBTYPE_PDF_A")] PdfA, #[doc(alias = "POPPLER_PDF_SUBTYPE_PDF_E")] PdfE, #[doc(alias = "POPPLER_PDF_SUBTYPE_PDF_UA")] PdfUa, #[doc(alias = "POPPLER_PDF_SUBTYPE_PDF_VT")] PdfVt, #[doc(alias = "POPPLER_PDF_SUBTYPE_PDF_X")] PdfX, #[doc(alias = "POPPLER_PDF_SUBTYPE_NONE")] None, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for PDFSubtype { type GlibType = ffi::PopplerPDFSubtype; #[inline] fn into_glib(self) -> ffi::PopplerPDFSubtype { match self { Self::Unset => ffi::POPPLER_PDF_SUBTYPE_UNSET, Self::PdfA => ffi::POPPLER_PDF_SUBTYPE_PDF_A, Self::PdfE => ffi::POPPLER_PDF_SUBTYPE_PDF_E, Self::PdfUa => ffi::POPPLER_PDF_SUBTYPE_PDF_UA, Self::PdfVt => ffi::POPPLER_PDF_SUBTYPE_PDF_VT, Self::PdfX => ffi::POPPLER_PDF_SUBTYPE_PDF_X, Self::None => ffi::POPPLER_PDF_SUBTYPE_NONE, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for PDFSubtype { #[inline] unsafe fn from_glib(value: ffi::PopplerPDFSubtype) -> Self { match value { ffi::POPPLER_PDF_SUBTYPE_UNSET => Self::Unset, ffi::POPPLER_PDF_SUBTYPE_PDF_A => Self::PdfA, ffi::POPPLER_PDF_SUBTYPE_PDF_E => Self::PdfE, ffi::POPPLER_PDF_SUBTYPE_PDF_UA => Self::PdfUa, ffi::POPPLER_PDF_SUBTYPE_PDF_VT => Self::PdfVt, ffi::POPPLER_PDF_SUBTYPE_PDF_X => Self::PdfX, ffi::POPPLER_PDF_SUBTYPE_NONE => Self::None, value => Self::__Unknown(value), } } } impl StaticType for PDFSubtype { #[inline] #[doc(alias = "poppler_pdf_subtype_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_pdf_subtype_get_type()) } } } impl glib::HasParamSpec for PDFSubtype { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for PDFSubtype { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for PDFSubtype { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for PDFSubtype { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: PDFSubtype) -> Self { ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerPageLayout")] pub enum PageLayout { #[doc(alias = "POPPLER_PAGE_LAYOUT_UNSET")] Unset, #[doc(alias = "POPPLER_PAGE_LAYOUT_SINGLE_PAGE")] SinglePage, #[doc(alias = "POPPLER_PAGE_LAYOUT_ONE_COLUMN")] OneColumn, #[doc(alias = "POPPLER_PAGE_LAYOUT_TWO_COLUMN_LEFT")] TwoColumnLeft, #[doc(alias = "POPPLER_PAGE_LAYOUT_TWO_COLUMN_RIGHT")] TwoColumnRight, #[doc(alias = "POPPLER_PAGE_LAYOUT_TWO_PAGE_LEFT")] TwoPageLeft, #[doc(alias = "POPPLER_PAGE_LAYOUT_TWO_PAGE_RIGHT")] TwoPageRight, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for PageLayout { type GlibType = ffi::PopplerPageLayout; #[inline] fn into_glib(self) -> ffi::PopplerPageLayout { match self { Self::Unset => ffi::POPPLER_PAGE_LAYOUT_UNSET, Self::SinglePage => ffi::POPPLER_PAGE_LAYOUT_SINGLE_PAGE, Self::OneColumn => ffi::POPPLER_PAGE_LAYOUT_ONE_COLUMN, Self::TwoColumnLeft => ffi::POPPLER_PAGE_LAYOUT_TWO_COLUMN_LEFT, Self::TwoColumnRight => ffi::POPPLER_PAGE_LAYOUT_TWO_COLUMN_RIGHT, Self::TwoPageLeft => ffi::POPPLER_PAGE_LAYOUT_TWO_PAGE_LEFT, Self::TwoPageRight => ffi::POPPLER_PAGE_LAYOUT_TWO_PAGE_RIGHT, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for PageLayout { #[inline] unsafe fn from_glib(value: ffi::PopplerPageLayout) -> Self { match value { ffi::POPPLER_PAGE_LAYOUT_UNSET => Self::Unset, ffi::POPPLER_PAGE_LAYOUT_SINGLE_PAGE => Self::SinglePage, ffi::POPPLER_PAGE_LAYOUT_ONE_COLUMN => Self::OneColumn, ffi::POPPLER_PAGE_LAYOUT_TWO_COLUMN_LEFT => Self::TwoColumnLeft, ffi::POPPLER_PAGE_LAYOUT_TWO_COLUMN_RIGHT => Self::TwoColumnRight, ffi::POPPLER_PAGE_LAYOUT_TWO_PAGE_LEFT => Self::TwoPageLeft, ffi::POPPLER_PAGE_LAYOUT_TWO_PAGE_RIGHT => Self::TwoPageRight, value => Self::__Unknown(value), } } } impl StaticType for PageLayout { #[inline] #[doc(alias = "poppler_page_layout_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_page_layout_get_type()) } } } impl glib::HasParamSpec for PageLayout { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for PageLayout { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for PageLayout { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for PageLayout { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: PageLayout) -> Self { ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerPageMode")] pub enum PageMode { #[doc(alias = "POPPLER_PAGE_MODE_UNSET")] Unset, #[doc(alias = "POPPLER_PAGE_MODE_NONE")] None, #[doc(alias = "POPPLER_PAGE_MODE_USE_OUTLINES")] UseOutlines, #[doc(alias = "POPPLER_PAGE_MODE_USE_THUMBS")] UseThumbs, #[doc(alias = "POPPLER_PAGE_MODE_FULL_SCREEN")] FullScreen, #[doc(alias = "POPPLER_PAGE_MODE_USE_OC")] UseOc, #[doc(alias = "POPPLER_PAGE_MODE_USE_ATTACHMENTS")] UseAttachments, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for PageMode { type GlibType = ffi::PopplerPageMode; #[inline] fn into_glib(self) -> ffi::PopplerPageMode { match self { Self::Unset => ffi::POPPLER_PAGE_MODE_UNSET, Self::None => ffi::POPPLER_PAGE_MODE_NONE, Self::UseOutlines => ffi::POPPLER_PAGE_MODE_USE_OUTLINES, Self::UseThumbs => ffi::POPPLER_PAGE_MODE_USE_THUMBS, Self::FullScreen => ffi::POPPLER_PAGE_MODE_FULL_SCREEN, Self::UseOc => ffi::POPPLER_PAGE_MODE_USE_OC, Self::UseAttachments => ffi::POPPLER_PAGE_MODE_USE_ATTACHMENTS, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for PageMode { #[inline] unsafe fn from_glib(value: ffi::PopplerPageMode) -> Self { match value { ffi::POPPLER_PAGE_MODE_UNSET => Self::Unset, ffi::POPPLER_PAGE_MODE_NONE => Self::None, ffi::POPPLER_PAGE_MODE_USE_OUTLINES => Self::UseOutlines, ffi::POPPLER_PAGE_MODE_USE_THUMBS => Self::UseThumbs, ffi::POPPLER_PAGE_MODE_FULL_SCREEN => Self::FullScreen, ffi::POPPLER_PAGE_MODE_USE_OC => Self::UseOc, ffi::POPPLER_PAGE_MODE_USE_ATTACHMENTS => Self::UseAttachments, value => Self::__Unknown(value), } } } impl StaticType for PageMode { #[inline] #[doc(alias = "poppler_page_mode_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_page_mode_get_type()) } } } impl glib::HasParamSpec for PageMode { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for PageMode { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for PageMode { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for PageMode { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: PageMode) -> Self { ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerPageTransitionAlignment")] pub enum PageTransitionAlignment { #[doc(alias = "POPPLER_PAGE_TRANSITION_HORIZONTAL")] Horizontal, #[doc(alias = "POPPLER_PAGE_TRANSITION_VERTICAL")] Vertical, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for PageTransitionAlignment { type GlibType = ffi::PopplerPageTransitionAlignment; #[inline] fn into_glib(self) -> ffi::PopplerPageTransitionAlignment { match self { Self::Horizontal => ffi::POPPLER_PAGE_TRANSITION_HORIZONTAL, Self::Vertical => ffi::POPPLER_PAGE_TRANSITION_VERTICAL, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for PageTransitionAlignment { #[inline] unsafe fn from_glib(value: ffi::PopplerPageTransitionAlignment) -> Self { match value { ffi::POPPLER_PAGE_TRANSITION_HORIZONTAL => Self::Horizontal, ffi::POPPLER_PAGE_TRANSITION_VERTICAL => Self::Vertical, value => Self::__Unknown(value), } } } impl StaticType for PageTransitionAlignment { #[inline] #[doc(alias = "poppler_page_transition_alignment_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_page_transition_alignment_get_type()) } } } impl glib::HasParamSpec for PageTransitionAlignment { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for PageTransitionAlignment { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for PageTransitionAlignment { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for PageTransitionAlignment { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: PageTransitionAlignment) -> Self { ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerPageTransitionDirection")] pub enum PageTransitionDirection { #[doc(alias = "POPPLER_PAGE_TRANSITION_INWARD")] Inward, #[doc(alias = "POPPLER_PAGE_TRANSITION_OUTWARD")] Outward, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for PageTransitionDirection { type GlibType = ffi::PopplerPageTransitionDirection; #[inline] fn into_glib(self) -> ffi::PopplerPageTransitionDirection { match self { Self::Inward => ffi::POPPLER_PAGE_TRANSITION_INWARD, Self::Outward => ffi::POPPLER_PAGE_TRANSITION_OUTWARD, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for PageTransitionDirection { #[inline] unsafe fn from_glib(value: ffi::PopplerPageTransitionDirection) -> Self { match value { ffi::POPPLER_PAGE_TRANSITION_INWARD => Self::Inward, ffi::POPPLER_PAGE_TRANSITION_OUTWARD => Self::Outward, value => Self::__Unknown(value), } } } impl StaticType for PageTransitionDirection { #[inline] #[doc(alias = "poppler_page_transition_direction_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_page_transition_direction_get_type()) } } } impl glib::HasParamSpec for PageTransitionDirection { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for PageTransitionDirection { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for PageTransitionDirection { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for PageTransitionDirection { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: PageTransitionDirection) -> Self { ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerPageTransitionType")] pub enum PageTransitionType { #[doc(alias = "POPPLER_PAGE_TRANSITION_REPLACE")] Replace, #[doc(alias = "POPPLER_PAGE_TRANSITION_SPLIT")] Split, #[doc(alias = "POPPLER_PAGE_TRANSITION_BLINDS")] Blinds, #[doc(alias = "POPPLER_PAGE_TRANSITION_BOX")] Box, #[doc(alias = "POPPLER_PAGE_TRANSITION_WIPE")] Wipe, #[doc(alias = "POPPLER_PAGE_TRANSITION_DISSOLVE")] Dissolve, #[doc(alias = "POPPLER_PAGE_TRANSITION_GLITTER")] Glitter, #[doc(alias = "POPPLER_PAGE_TRANSITION_FLY")] Fly, #[doc(alias = "POPPLER_PAGE_TRANSITION_PUSH")] Push, #[doc(alias = "POPPLER_PAGE_TRANSITION_COVER")] Cover, #[doc(alias = "POPPLER_PAGE_TRANSITION_UNCOVER")] Uncover, #[doc(alias = "POPPLER_PAGE_TRANSITION_FADE")] Fade, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for PageTransitionType { type GlibType = ffi::PopplerPageTransitionType; #[inline] fn into_glib(self) -> ffi::PopplerPageTransitionType { match self { Self::Replace => ffi::POPPLER_PAGE_TRANSITION_REPLACE, Self::Split => ffi::POPPLER_PAGE_TRANSITION_SPLIT, Self::Blinds => ffi::POPPLER_PAGE_TRANSITION_BLINDS, Self::Box => ffi::POPPLER_PAGE_TRANSITION_BOX, Self::Wipe => ffi::POPPLER_PAGE_TRANSITION_WIPE, Self::Dissolve => ffi::POPPLER_PAGE_TRANSITION_DISSOLVE, Self::Glitter => ffi::POPPLER_PAGE_TRANSITION_GLITTER, Self::Fly => ffi::POPPLER_PAGE_TRANSITION_FLY, Self::Push => ffi::POPPLER_PAGE_TRANSITION_PUSH, Self::Cover => ffi::POPPLER_PAGE_TRANSITION_COVER, Self::Uncover => ffi::POPPLER_PAGE_TRANSITION_UNCOVER, Self::Fade => ffi::POPPLER_PAGE_TRANSITION_FADE, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for PageTransitionType { #[inline] unsafe fn from_glib(value: ffi::PopplerPageTransitionType) -> Self { match value { ffi::POPPLER_PAGE_TRANSITION_REPLACE => Self::Replace, ffi::POPPLER_PAGE_TRANSITION_SPLIT => Self::Split, ffi::POPPLER_PAGE_TRANSITION_BLINDS => Self::Blinds, ffi::POPPLER_PAGE_TRANSITION_BOX => Self::Box, ffi::POPPLER_PAGE_TRANSITION_WIPE => Self::Wipe, ffi::POPPLER_PAGE_TRANSITION_DISSOLVE => Self::Dissolve, ffi::POPPLER_PAGE_TRANSITION_GLITTER => Self::Glitter, ffi::POPPLER_PAGE_TRANSITION_FLY => Self::Fly, ffi::POPPLER_PAGE_TRANSITION_PUSH => Self::Push, ffi::POPPLER_PAGE_TRANSITION_COVER => Self::Cover, ffi::POPPLER_PAGE_TRANSITION_UNCOVER => Self::Uncover, ffi::POPPLER_PAGE_TRANSITION_FADE => Self::Fade, value => Self::__Unknown(value), } } } impl StaticType for PageTransitionType { #[inline] #[doc(alias = "poppler_page_transition_type_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_page_transition_type_get_type()) } } } impl glib::HasParamSpec for PageTransitionType { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for PageTransitionType { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for PageTransitionType { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for PageTransitionType { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: PageTransitionType) -> Self { ToValue::to_value(&v) } } #[cfg(feature = "v0_80")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_80")))] #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerPrintDuplex")] pub enum PrintDuplex { #[doc(alias = "POPPLER_PRINT_DUPLEX_NONE")] None, #[doc(alias = "POPPLER_PRINT_DUPLEX_SIMPLEX")] Simplex, #[doc(alias = "POPPLER_PRINT_DUPLEX_DUPLEX_FLIP_SHORT_EDGE")] DuplexFlipShortEdge, #[doc(alias = "POPPLER_PRINT_DUPLEX_DUPLEX_FLIP_LONG_EDGE")] DuplexFlipLongEdge, #[doc(hidden)] __Unknown(i32), } #[cfg(feature = "v0_80")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_80")))] #[doc(hidden)] impl IntoGlib for PrintDuplex { type GlibType = ffi::PopplerPrintDuplex; #[inline] fn into_glib(self) -> ffi::PopplerPrintDuplex { match self { Self::None => ffi::POPPLER_PRINT_DUPLEX_NONE, Self::Simplex => ffi::POPPLER_PRINT_DUPLEX_SIMPLEX, Self::DuplexFlipShortEdge => ffi::POPPLER_PRINT_DUPLEX_DUPLEX_FLIP_SHORT_EDGE, Self::DuplexFlipLongEdge => ffi::POPPLER_PRINT_DUPLEX_DUPLEX_FLIP_LONG_EDGE, Self::__Unknown(value) => value, } } } #[cfg(feature = "v0_80")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_80")))] #[doc(hidden)] impl FromGlib for PrintDuplex { #[inline] unsafe fn from_glib(value: ffi::PopplerPrintDuplex) -> Self { match value { ffi::POPPLER_PRINT_DUPLEX_NONE => Self::None, ffi::POPPLER_PRINT_DUPLEX_SIMPLEX => Self::Simplex, ffi::POPPLER_PRINT_DUPLEX_DUPLEX_FLIP_SHORT_EDGE => Self::DuplexFlipShortEdge, ffi::POPPLER_PRINT_DUPLEX_DUPLEX_FLIP_LONG_EDGE => Self::DuplexFlipLongEdge, value => Self::__Unknown(value), } } } #[cfg(feature = "v0_80")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_80")))] impl StaticType for PrintDuplex { #[inline] #[doc(alias = "poppler_print_duplex_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_print_duplex_get_type()) } } } #[cfg(feature = "v0_80")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_80")))] impl glib::HasParamSpec for PrintDuplex { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } #[cfg(feature = "v0_80")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_80")))] impl glib::value::ValueType for PrintDuplex { type Type = Self; } #[cfg(feature = "v0_80")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_80")))] unsafe impl<'a> glib::value::FromValue<'a> for PrintDuplex { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } #[cfg(feature = "v0_80")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_80")))] impl ToValue for PrintDuplex { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } #[cfg(feature = "v0_80")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_80")))] impl From for glib::Value { #[inline] fn from(v: PrintDuplex) -> Self { ToValue::to_value(&v) } } #[cfg(feature = "v0_73")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_73")))] #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerPrintScaling")] pub enum PrintScaling { #[doc(alias = "POPPLER_PRINT_SCALING_APP_DEFAULT")] AppDefault, #[doc(alias = "POPPLER_PRINT_SCALING_NONE")] None, #[doc(hidden)] __Unknown(i32), } #[cfg(feature = "v0_73")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_73")))] #[doc(hidden)] impl IntoGlib for PrintScaling { type GlibType = ffi::PopplerPrintScaling; #[inline] fn into_glib(self) -> ffi::PopplerPrintScaling { match self { Self::AppDefault => ffi::POPPLER_PRINT_SCALING_APP_DEFAULT, Self::None => ffi::POPPLER_PRINT_SCALING_NONE, Self::__Unknown(value) => value, } } } #[cfg(feature = "v0_73")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_73")))] #[doc(hidden)] impl FromGlib for PrintScaling { #[inline] unsafe fn from_glib(value: ffi::PopplerPrintScaling) -> Self { match value { ffi::POPPLER_PRINT_SCALING_APP_DEFAULT => Self::AppDefault, ffi::POPPLER_PRINT_SCALING_NONE => Self::None, value => Self::__Unknown(value), } } } #[cfg(feature = "v0_73")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_73")))] impl StaticType for PrintScaling { #[inline] #[doc(alias = "poppler_print_scaling_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_print_scaling_get_type()) } } } #[cfg(feature = "v0_73")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_73")))] impl glib::HasParamSpec for PrintScaling { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } #[cfg(feature = "v0_73")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_73")))] impl glib::value::ValueType for PrintScaling { type Type = Self; } #[cfg(feature = "v0_73")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_73")))] unsafe impl<'a> glib::value::FromValue<'a> for PrintScaling { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } #[cfg(feature = "v0_73")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_73")))] impl ToValue for PrintScaling { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } #[cfg(feature = "v0_73")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_73")))] impl From for glib::Value { #[inline] fn from(v: PrintScaling) -> Self { ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerSelectionStyle")] pub enum SelectionStyle { #[doc(alias = "POPPLER_SELECTION_GLYPH")] Glyph, #[doc(alias = "POPPLER_SELECTION_WORD")] Word, #[doc(alias = "POPPLER_SELECTION_LINE")] Line, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for SelectionStyle { type GlibType = ffi::PopplerSelectionStyle; #[inline] fn into_glib(self) -> ffi::PopplerSelectionStyle { match self { Self::Glyph => ffi::POPPLER_SELECTION_GLYPH, Self::Word => ffi::POPPLER_SELECTION_WORD, Self::Line => ffi::POPPLER_SELECTION_LINE, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for SelectionStyle { #[inline] unsafe fn from_glib(value: ffi::PopplerSelectionStyle) -> Self { match value { ffi::POPPLER_SELECTION_GLYPH => Self::Glyph, ffi::POPPLER_SELECTION_WORD => Self::Word, ffi::POPPLER_SELECTION_LINE => Self::Line, value => Self::__Unknown(value), } } } impl StaticType for SelectionStyle { #[inline] #[doc(alias = "poppler_selection_style_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_selection_style_get_type()) } } } impl glib::HasParamSpec for SelectionStyle { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for SelectionStyle { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for SelectionStyle { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for SelectionStyle { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: SelectionStyle) -> Self { ToValue::to_value(&v) } } #[cfg(feature = "v21_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v21_12")))] #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerSignatureStatus")] pub enum SignatureStatus { #[doc(alias = "POPPLER_SIGNATURE_VALID")] Valid, #[doc(alias = "POPPLER_SIGNATURE_INVALID")] Invalid, #[doc(alias = "POPPLER_SIGNATURE_DIGEST_MISMATCH")] DigestMismatch, #[doc(alias = "POPPLER_SIGNATURE_DECODING_ERROR")] DecodingError, #[doc(alias = "POPPLER_SIGNATURE_GENERIC_ERROR")] GenericError, #[doc(alias = "POPPLER_SIGNATURE_NOT_FOUND")] NotFound, #[doc(alias = "POPPLER_SIGNATURE_NOT_VERIFIED")] NotVerified, #[doc(hidden)] __Unknown(i32), } #[cfg(feature = "v21_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v21_12")))] #[doc(hidden)] impl IntoGlib for SignatureStatus { type GlibType = ffi::PopplerSignatureStatus; #[inline] fn into_glib(self) -> ffi::PopplerSignatureStatus { match self { Self::Valid => ffi::POPPLER_SIGNATURE_VALID, Self::Invalid => ffi::POPPLER_SIGNATURE_INVALID, Self::DigestMismatch => ffi::POPPLER_SIGNATURE_DIGEST_MISMATCH, Self::DecodingError => ffi::POPPLER_SIGNATURE_DECODING_ERROR, Self::GenericError => ffi::POPPLER_SIGNATURE_GENERIC_ERROR, Self::NotFound => ffi::POPPLER_SIGNATURE_NOT_FOUND, Self::NotVerified => ffi::POPPLER_SIGNATURE_NOT_VERIFIED, Self::__Unknown(value) => value, } } } #[cfg(feature = "v21_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v21_12")))] #[doc(hidden)] impl FromGlib for SignatureStatus { #[inline] unsafe fn from_glib(value: ffi::PopplerSignatureStatus) -> Self { match value { ffi::POPPLER_SIGNATURE_VALID => Self::Valid, ffi::POPPLER_SIGNATURE_INVALID => Self::Invalid, ffi::POPPLER_SIGNATURE_DIGEST_MISMATCH => Self::DigestMismatch, ffi::POPPLER_SIGNATURE_DECODING_ERROR => Self::DecodingError, ffi::POPPLER_SIGNATURE_GENERIC_ERROR => Self::GenericError, ffi::POPPLER_SIGNATURE_NOT_FOUND => Self::NotFound, ffi::POPPLER_SIGNATURE_NOT_VERIFIED => Self::NotVerified, value => Self::__Unknown(value), } } } #[cfg(feature = "v21_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v21_12")))] impl StaticType for SignatureStatus { #[inline] #[doc(alias = "poppler_signature_status_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_signature_status_get_type()) } } } #[cfg(feature = "v21_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v21_12")))] impl glib::HasParamSpec for SignatureStatus { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } #[cfg(feature = "v21_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v21_12")))] impl glib::value::ValueType for SignatureStatus { type Type = Self; } #[cfg(feature = "v21_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v21_12")))] unsafe impl<'a> glib::value::FromValue<'a> for SignatureStatus { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } #[cfg(feature = "v21_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v21_12")))] impl ToValue for SignatureStatus { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } #[cfg(feature = "v21_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v21_12")))] impl From for glib::Value { #[inline] fn from(v: SignatureStatus) -> Self { ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerStructureBlockAlign")] pub enum StructureBlockAlign { #[doc(alias = "POPPLER_STRUCTURE_BLOCK_ALIGN_BEFORE")] Before, #[doc(alias = "POPPLER_STRUCTURE_BLOCK_ALIGN_MIDDLE")] Middle, #[doc(alias = "POPPLER_STRUCTURE_BLOCK_ALIGN_AFTER")] After, #[doc(alias = "POPPLER_STRUCTURE_BLOCK_ALIGN_JUSTIFY")] Justify, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for StructureBlockAlign { type GlibType = ffi::PopplerStructureBlockAlign; #[inline] fn into_glib(self) -> ffi::PopplerStructureBlockAlign { match self { Self::Before => ffi::POPPLER_STRUCTURE_BLOCK_ALIGN_BEFORE, Self::Middle => ffi::POPPLER_STRUCTURE_BLOCK_ALIGN_MIDDLE, Self::After => ffi::POPPLER_STRUCTURE_BLOCK_ALIGN_AFTER, Self::Justify => ffi::POPPLER_STRUCTURE_BLOCK_ALIGN_JUSTIFY, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for StructureBlockAlign { #[inline] unsafe fn from_glib(value: ffi::PopplerStructureBlockAlign) -> Self { match value { ffi::POPPLER_STRUCTURE_BLOCK_ALIGN_BEFORE => Self::Before, ffi::POPPLER_STRUCTURE_BLOCK_ALIGN_MIDDLE => Self::Middle, ffi::POPPLER_STRUCTURE_BLOCK_ALIGN_AFTER => Self::After, ffi::POPPLER_STRUCTURE_BLOCK_ALIGN_JUSTIFY => Self::Justify, value => Self::__Unknown(value), } } } impl StaticType for StructureBlockAlign { #[inline] #[doc(alias = "poppler_structure_block_align_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_structure_block_align_get_type()) } } } impl glib::HasParamSpec for StructureBlockAlign { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for StructureBlockAlign { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for StructureBlockAlign { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for StructureBlockAlign { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: StructureBlockAlign) -> Self { ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerStructureBorderStyle")] pub enum StructureBorderStyle { #[doc(alias = "POPPLER_STRUCTURE_BORDER_STYLE_NONE")] None, #[doc(alias = "POPPLER_STRUCTURE_BORDER_STYLE_HIDDEN")] Hidden, #[doc(alias = "POPPLER_STRUCTURE_BORDER_STYLE_DOTTED")] Dotted, #[doc(alias = "POPPLER_STRUCTURE_BORDER_STYLE_DASHED")] Dashed, #[doc(alias = "POPPLER_STRUCTURE_BORDER_STYLE_SOLID")] Solid, #[doc(alias = "POPPLER_STRUCTURE_BORDER_STYLE_DOUBLE")] Double, #[doc(alias = "POPPLER_STRUCTURE_BORDER_STYLE_GROOVE")] Groove, #[doc(alias = "POPPLER_STRUCTURE_BORDER_STYLE_INSET")] Inset, #[doc(alias = "POPPLER_STRUCTURE_BORDER_STYLE_OUTSET")] Outset, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for StructureBorderStyle { type GlibType = ffi::PopplerStructureBorderStyle; #[inline] fn into_glib(self) -> ffi::PopplerStructureBorderStyle { match self { Self::None => ffi::POPPLER_STRUCTURE_BORDER_STYLE_NONE, Self::Hidden => ffi::POPPLER_STRUCTURE_BORDER_STYLE_HIDDEN, Self::Dotted => ffi::POPPLER_STRUCTURE_BORDER_STYLE_DOTTED, Self::Dashed => ffi::POPPLER_STRUCTURE_BORDER_STYLE_DASHED, Self::Solid => ffi::POPPLER_STRUCTURE_BORDER_STYLE_SOLID, Self::Double => ffi::POPPLER_STRUCTURE_BORDER_STYLE_DOUBLE, Self::Groove => ffi::POPPLER_STRUCTURE_BORDER_STYLE_GROOVE, Self::Inset => ffi::POPPLER_STRUCTURE_BORDER_STYLE_INSET, Self::Outset => ffi::POPPLER_STRUCTURE_BORDER_STYLE_OUTSET, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for StructureBorderStyle { #[inline] unsafe fn from_glib(value: ffi::PopplerStructureBorderStyle) -> Self { match value { ffi::POPPLER_STRUCTURE_BORDER_STYLE_NONE => Self::None, ffi::POPPLER_STRUCTURE_BORDER_STYLE_HIDDEN => Self::Hidden, ffi::POPPLER_STRUCTURE_BORDER_STYLE_DOTTED => Self::Dotted, ffi::POPPLER_STRUCTURE_BORDER_STYLE_DASHED => Self::Dashed, ffi::POPPLER_STRUCTURE_BORDER_STYLE_SOLID => Self::Solid, ffi::POPPLER_STRUCTURE_BORDER_STYLE_DOUBLE => Self::Double, ffi::POPPLER_STRUCTURE_BORDER_STYLE_GROOVE => Self::Groove, ffi::POPPLER_STRUCTURE_BORDER_STYLE_INSET => Self::Inset, ffi::POPPLER_STRUCTURE_BORDER_STYLE_OUTSET => Self::Outset, value => Self::__Unknown(value), } } } impl StaticType for StructureBorderStyle { #[inline] #[doc(alias = "poppler_structure_border_style_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_structure_border_style_get_type()) } } } impl glib::HasParamSpec for StructureBorderStyle { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for StructureBorderStyle { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for StructureBorderStyle { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for StructureBorderStyle { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: StructureBorderStyle) -> Self { ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerStructureElementKind")] pub enum StructureElementKind { #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_CONTENT")] Content, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_OBJECT_REFERENCE")] ObjectReference, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_DOCUMENT")] Document, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_PART")] Part, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_ARTICLE")] Article, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_SECTION")] Section, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_DIV")] Div, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_SPAN")] Span, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_QUOTE")] Quote, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_NOTE")] Note, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_REFERENCE")] Reference, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_BIBENTRY")] Bibentry, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_CODE")] Code, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_LINK")] Link, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_ANNOT")] Annot, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_BLOCKQUOTE")] Blockquote, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_CAPTION")] Caption, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_NONSTRUCT")] Nonstruct, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_TOC")] Toc, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_TOC_ITEM")] TocItem, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_INDEX")] Index, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_PRIVATE")] Private, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_PARAGRAPH")] Paragraph, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_HEADING")] Heading, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_HEADING_1")] Heading1, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_HEADING_2")] Heading2, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_HEADING_3")] Heading3, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_HEADING_4")] Heading4, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_HEADING_5")] Heading5, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_HEADING_6")] Heading6, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_LIST")] List, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_LIST_ITEM")] ListItem, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_LIST_LABEL")] ListLabel, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_LIST_BODY")] ListBody, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_TABLE")] Table, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_TABLE_ROW")] TableRow, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_TABLE_HEADING")] TableHeading, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_TABLE_DATA")] TableData, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_TABLE_HEADER")] TableHeader, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_TABLE_FOOTER")] TableFooter, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_TABLE_BODY")] TableBody, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_RUBY")] Ruby, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_RUBY_BASE_TEXT")] RubyBaseText, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_RUBY_ANNOT_TEXT")] RubyAnnotText, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_RUBY_PUNCTUATION")] RubyPunctuation, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_WARICHU")] Warichu, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_WARICHU_TEXT")] WarichuText, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_WARICHU_PUNCTUATION")] WarichuPunctuation, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_FIGURE")] Figure, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_FORMULA")] Formula, #[doc(alias = "POPPLER_STRUCTURE_ELEMENT_FORM")] Form, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for StructureElementKind { type GlibType = ffi::PopplerStructureElementKind; fn into_glib(self) -> ffi::PopplerStructureElementKind { match self { Self::Content => ffi::POPPLER_STRUCTURE_ELEMENT_CONTENT, Self::ObjectReference => ffi::POPPLER_STRUCTURE_ELEMENT_OBJECT_REFERENCE, Self::Document => ffi::POPPLER_STRUCTURE_ELEMENT_DOCUMENT, Self::Part => ffi::POPPLER_STRUCTURE_ELEMENT_PART, Self::Article => ffi::POPPLER_STRUCTURE_ELEMENT_ARTICLE, Self::Section => ffi::POPPLER_STRUCTURE_ELEMENT_SECTION, Self::Div => ffi::POPPLER_STRUCTURE_ELEMENT_DIV, Self::Span => ffi::POPPLER_STRUCTURE_ELEMENT_SPAN, Self::Quote => ffi::POPPLER_STRUCTURE_ELEMENT_QUOTE, Self::Note => ffi::POPPLER_STRUCTURE_ELEMENT_NOTE, Self::Reference => ffi::POPPLER_STRUCTURE_ELEMENT_REFERENCE, Self::Bibentry => ffi::POPPLER_STRUCTURE_ELEMENT_BIBENTRY, Self::Code => ffi::POPPLER_STRUCTURE_ELEMENT_CODE, Self::Link => ffi::POPPLER_STRUCTURE_ELEMENT_LINK, Self::Annot => ffi::POPPLER_STRUCTURE_ELEMENT_ANNOT, Self::Blockquote => ffi::POPPLER_STRUCTURE_ELEMENT_BLOCKQUOTE, Self::Caption => ffi::POPPLER_STRUCTURE_ELEMENT_CAPTION, Self::Nonstruct => ffi::POPPLER_STRUCTURE_ELEMENT_NONSTRUCT, Self::Toc => ffi::POPPLER_STRUCTURE_ELEMENT_TOC, Self::TocItem => ffi::POPPLER_STRUCTURE_ELEMENT_TOC_ITEM, Self::Index => ffi::POPPLER_STRUCTURE_ELEMENT_INDEX, Self::Private => ffi::POPPLER_STRUCTURE_ELEMENT_PRIVATE, Self::Paragraph => ffi::POPPLER_STRUCTURE_ELEMENT_PARAGRAPH, Self::Heading => ffi::POPPLER_STRUCTURE_ELEMENT_HEADING, Self::Heading1 => ffi::POPPLER_STRUCTURE_ELEMENT_HEADING_1, Self::Heading2 => ffi::POPPLER_STRUCTURE_ELEMENT_HEADING_2, Self::Heading3 => ffi::POPPLER_STRUCTURE_ELEMENT_HEADING_3, Self::Heading4 => ffi::POPPLER_STRUCTURE_ELEMENT_HEADING_4, Self::Heading5 => ffi::POPPLER_STRUCTURE_ELEMENT_HEADING_5, Self::Heading6 => ffi::POPPLER_STRUCTURE_ELEMENT_HEADING_6, Self::List => ffi::POPPLER_STRUCTURE_ELEMENT_LIST, Self::ListItem => ffi::POPPLER_STRUCTURE_ELEMENT_LIST_ITEM, Self::ListLabel => ffi::POPPLER_STRUCTURE_ELEMENT_LIST_LABEL, Self::ListBody => ffi::POPPLER_STRUCTURE_ELEMENT_LIST_BODY, Self::Table => ffi::POPPLER_STRUCTURE_ELEMENT_TABLE, Self::TableRow => ffi::POPPLER_STRUCTURE_ELEMENT_TABLE_ROW, Self::TableHeading => ffi::POPPLER_STRUCTURE_ELEMENT_TABLE_HEADING, Self::TableData => ffi::POPPLER_STRUCTURE_ELEMENT_TABLE_DATA, Self::TableHeader => ffi::POPPLER_STRUCTURE_ELEMENT_TABLE_HEADER, Self::TableFooter => ffi::POPPLER_STRUCTURE_ELEMENT_TABLE_FOOTER, Self::TableBody => ffi::POPPLER_STRUCTURE_ELEMENT_TABLE_BODY, Self::Ruby => ffi::POPPLER_STRUCTURE_ELEMENT_RUBY, Self::RubyBaseText => ffi::POPPLER_STRUCTURE_ELEMENT_RUBY_BASE_TEXT, Self::RubyAnnotText => ffi::POPPLER_STRUCTURE_ELEMENT_RUBY_ANNOT_TEXT, Self::RubyPunctuation => ffi::POPPLER_STRUCTURE_ELEMENT_RUBY_PUNCTUATION, Self::Warichu => ffi::POPPLER_STRUCTURE_ELEMENT_WARICHU, Self::WarichuText => ffi::POPPLER_STRUCTURE_ELEMENT_WARICHU_TEXT, Self::WarichuPunctuation => ffi::POPPLER_STRUCTURE_ELEMENT_WARICHU_PUNCTUATION, Self::Figure => ffi::POPPLER_STRUCTURE_ELEMENT_FIGURE, Self::Formula => ffi::POPPLER_STRUCTURE_ELEMENT_FORMULA, Self::Form => ffi::POPPLER_STRUCTURE_ELEMENT_FORM, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for StructureElementKind { unsafe fn from_glib(value: ffi::PopplerStructureElementKind) -> Self { match value { ffi::POPPLER_STRUCTURE_ELEMENT_CONTENT => Self::Content, ffi::POPPLER_STRUCTURE_ELEMENT_OBJECT_REFERENCE => Self::ObjectReference, ffi::POPPLER_STRUCTURE_ELEMENT_DOCUMENT => Self::Document, ffi::POPPLER_STRUCTURE_ELEMENT_PART => Self::Part, ffi::POPPLER_STRUCTURE_ELEMENT_ARTICLE => Self::Article, ffi::POPPLER_STRUCTURE_ELEMENT_SECTION => Self::Section, ffi::POPPLER_STRUCTURE_ELEMENT_DIV => Self::Div, ffi::POPPLER_STRUCTURE_ELEMENT_SPAN => Self::Span, ffi::POPPLER_STRUCTURE_ELEMENT_QUOTE => Self::Quote, ffi::POPPLER_STRUCTURE_ELEMENT_NOTE => Self::Note, ffi::POPPLER_STRUCTURE_ELEMENT_REFERENCE => Self::Reference, ffi::POPPLER_STRUCTURE_ELEMENT_BIBENTRY => Self::Bibentry, ffi::POPPLER_STRUCTURE_ELEMENT_CODE => Self::Code, ffi::POPPLER_STRUCTURE_ELEMENT_LINK => Self::Link, ffi::POPPLER_STRUCTURE_ELEMENT_ANNOT => Self::Annot, ffi::POPPLER_STRUCTURE_ELEMENT_BLOCKQUOTE => Self::Blockquote, ffi::POPPLER_STRUCTURE_ELEMENT_CAPTION => Self::Caption, ffi::POPPLER_STRUCTURE_ELEMENT_NONSTRUCT => Self::Nonstruct, ffi::POPPLER_STRUCTURE_ELEMENT_TOC => Self::Toc, ffi::POPPLER_STRUCTURE_ELEMENT_TOC_ITEM => Self::TocItem, ffi::POPPLER_STRUCTURE_ELEMENT_INDEX => Self::Index, ffi::POPPLER_STRUCTURE_ELEMENT_PRIVATE => Self::Private, ffi::POPPLER_STRUCTURE_ELEMENT_PARAGRAPH => Self::Paragraph, ffi::POPPLER_STRUCTURE_ELEMENT_HEADING => Self::Heading, ffi::POPPLER_STRUCTURE_ELEMENT_HEADING_1 => Self::Heading1, ffi::POPPLER_STRUCTURE_ELEMENT_HEADING_2 => Self::Heading2, ffi::POPPLER_STRUCTURE_ELEMENT_HEADING_3 => Self::Heading3, ffi::POPPLER_STRUCTURE_ELEMENT_HEADING_4 => Self::Heading4, ffi::POPPLER_STRUCTURE_ELEMENT_HEADING_5 => Self::Heading5, ffi::POPPLER_STRUCTURE_ELEMENT_HEADING_6 => Self::Heading6, ffi::POPPLER_STRUCTURE_ELEMENT_LIST => Self::List, ffi::POPPLER_STRUCTURE_ELEMENT_LIST_ITEM => Self::ListItem, ffi::POPPLER_STRUCTURE_ELEMENT_LIST_LABEL => Self::ListLabel, ffi::POPPLER_STRUCTURE_ELEMENT_LIST_BODY => Self::ListBody, ffi::POPPLER_STRUCTURE_ELEMENT_TABLE => Self::Table, ffi::POPPLER_STRUCTURE_ELEMENT_TABLE_ROW => Self::TableRow, ffi::POPPLER_STRUCTURE_ELEMENT_TABLE_HEADING => Self::TableHeading, ffi::POPPLER_STRUCTURE_ELEMENT_TABLE_DATA => Self::TableData, ffi::POPPLER_STRUCTURE_ELEMENT_TABLE_HEADER => Self::TableHeader, ffi::POPPLER_STRUCTURE_ELEMENT_TABLE_FOOTER => Self::TableFooter, ffi::POPPLER_STRUCTURE_ELEMENT_TABLE_BODY => Self::TableBody, ffi::POPPLER_STRUCTURE_ELEMENT_RUBY => Self::Ruby, ffi::POPPLER_STRUCTURE_ELEMENT_RUBY_BASE_TEXT => Self::RubyBaseText, ffi::POPPLER_STRUCTURE_ELEMENT_RUBY_ANNOT_TEXT => Self::RubyAnnotText, ffi::POPPLER_STRUCTURE_ELEMENT_RUBY_PUNCTUATION => Self::RubyPunctuation, ffi::POPPLER_STRUCTURE_ELEMENT_WARICHU => Self::Warichu, ffi::POPPLER_STRUCTURE_ELEMENT_WARICHU_TEXT => Self::WarichuText, ffi::POPPLER_STRUCTURE_ELEMENT_WARICHU_PUNCTUATION => Self::WarichuPunctuation, ffi::POPPLER_STRUCTURE_ELEMENT_FIGURE => Self::Figure, ffi::POPPLER_STRUCTURE_ELEMENT_FORMULA => Self::Formula, ffi::POPPLER_STRUCTURE_ELEMENT_FORM => Self::Form, value => Self::__Unknown(value), } } } impl StaticType for StructureElementKind { #[inline] #[doc(alias = "poppler_structure_element_kind_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_structure_element_kind_get_type()) } } } impl glib::HasParamSpec for StructureElementKind { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for StructureElementKind { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for StructureElementKind { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for StructureElementKind { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: StructureElementKind) -> Self { ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerStructureFormRole")] pub enum StructureFormRole { #[doc(alias = "POPPLER_STRUCTURE_FORM_ROLE_UNDEFINED")] Undefined, #[doc(alias = "POPPLER_STRUCTURE_FORM_ROLE_RADIO_BUTTON")] RadioButton, #[doc(alias = "POPPLER_STRUCTURE_FORM_ROLE_PUSH_BUTTON")] PushButton, #[doc(alias = "POPPLER_STRUCTURE_FORM_ROLE_TEXT_VALUE")] TextValue, #[doc(alias = "POPPLER_STRUCTURE_FORM_ROLE_CHECKBOX")] Checkbox, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for StructureFormRole { type GlibType = ffi::PopplerStructureFormRole; #[inline] fn into_glib(self) -> ffi::PopplerStructureFormRole { match self { Self::Undefined => ffi::POPPLER_STRUCTURE_FORM_ROLE_UNDEFINED, Self::RadioButton => ffi::POPPLER_STRUCTURE_FORM_ROLE_RADIO_BUTTON, Self::PushButton => ffi::POPPLER_STRUCTURE_FORM_ROLE_PUSH_BUTTON, Self::TextValue => ffi::POPPLER_STRUCTURE_FORM_ROLE_TEXT_VALUE, Self::Checkbox => ffi::POPPLER_STRUCTURE_FORM_ROLE_CHECKBOX, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for StructureFormRole { #[inline] unsafe fn from_glib(value: ffi::PopplerStructureFormRole) -> Self { match value { ffi::POPPLER_STRUCTURE_FORM_ROLE_UNDEFINED => Self::Undefined, ffi::POPPLER_STRUCTURE_FORM_ROLE_RADIO_BUTTON => Self::RadioButton, ffi::POPPLER_STRUCTURE_FORM_ROLE_PUSH_BUTTON => Self::PushButton, ffi::POPPLER_STRUCTURE_FORM_ROLE_TEXT_VALUE => Self::TextValue, ffi::POPPLER_STRUCTURE_FORM_ROLE_CHECKBOX => Self::Checkbox, value => Self::__Unknown(value), } } } impl StaticType for StructureFormRole { #[inline] #[doc(alias = "poppler_structure_form_role_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_structure_form_role_get_type()) } } } impl glib::HasParamSpec for StructureFormRole { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for StructureFormRole { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for StructureFormRole { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for StructureFormRole { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: StructureFormRole) -> Self { ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerStructureFormState")] pub enum StructureFormState { #[doc(alias = "POPPLER_STRUCTURE_FORM_STATE_ON")] On, #[doc(alias = "POPPLER_STRUCTURE_FORM_STATE_OFF")] Off, #[doc(alias = "POPPLER_STRUCTURE_FORM_STATE_NEUTRAL")] Neutral, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for StructureFormState { type GlibType = ffi::PopplerStructureFormState; #[inline] fn into_glib(self) -> ffi::PopplerStructureFormState { match self { Self::On => ffi::POPPLER_STRUCTURE_FORM_STATE_ON, Self::Off => ffi::POPPLER_STRUCTURE_FORM_STATE_OFF, Self::Neutral => ffi::POPPLER_STRUCTURE_FORM_STATE_NEUTRAL, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for StructureFormState { #[inline] unsafe fn from_glib(value: ffi::PopplerStructureFormState) -> Self { match value { ffi::POPPLER_STRUCTURE_FORM_STATE_ON => Self::On, ffi::POPPLER_STRUCTURE_FORM_STATE_OFF => Self::Off, ffi::POPPLER_STRUCTURE_FORM_STATE_NEUTRAL => Self::Neutral, value => Self::__Unknown(value), } } } impl StaticType for StructureFormState { #[inline] #[doc(alias = "poppler_structure_form_state_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_structure_form_state_get_type()) } } } impl glib::HasParamSpec for StructureFormState { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for StructureFormState { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for StructureFormState { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for StructureFormState { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: StructureFormState) -> Self { ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerStructureGlyphOrientation")] pub enum StructureGlyphOrientation { #[doc(alias = "POPPLER_STRUCTURE_GLYPH_ORIENTATION_AUTO")] Auto, #[doc(alias = "POPPLER_STRUCTURE_GLYPH_ORIENTATION_90")] _90, #[doc(alias = "POPPLER_STRUCTURE_GLYPH_ORIENTATION_180")] _180, #[doc(alias = "POPPLER_STRUCTURE_GLYPH_ORIENTATION_270")] _270, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for StructureGlyphOrientation { type GlibType = ffi::PopplerStructureGlyphOrientation; #[inline] fn into_glib(self) -> ffi::PopplerStructureGlyphOrientation { match self { Self::Auto => ffi::POPPLER_STRUCTURE_GLYPH_ORIENTATION_AUTO, Self::_90 => ffi::POPPLER_STRUCTURE_GLYPH_ORIENTATION_90, Self::_180 => ffi::POPPLER_STRUCTURE_GLYPH_ORIENTATION_180, Self::_270 => ffi::POPPLER_STRUCTURE_GLYPH_ORIENTATION_270, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for StructureGlyphOrientation { #[inline] unsafe fn from_glib(value: ffi::PopplerStructureGlyphOrientation) -> Self { match value { ffi::POPPLER_STRUCTURE_GLYPH_ORIENTATION_AUTO => Self::Auto, ffi::POPPLER_STRUCTURE_GLYPH_ORIENTATION_90 => Self::_90, ffi::POPPLER_STRUCTURE_GLYPH_ORIENTATION_180 => Self::_180, ffi::POPPLER_STRUCTURE_GLYPH_ORIENTATION_270 => Self::_270, value => Self::__Unknown(value), } } } impl StaticType for StructureGlyphOrientation { #[inline] #[doc(alias = "poppler_structure_glyph_orientation_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_structure_glyph_orientation_get_type()) } } } impl glib::HasParamSpec for StructureGlyphOrientation { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for StructureGlyphOrientation { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for StructureGlyphOrientation { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for StructureGlyphOrientation { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: StructureGlyphOrientation) -> Self { ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerStructureInlineAlign")] pub enum StructureInlineAlign { #[doc(alias = "POPPLER_STRUCTURE_INLINE_ALIGN_START")] Start, #[doc(alias = "POPPLER_STRUCTURE_INLINE_ALIGN_CENTER")] Center, #[doc(alias = "POPPLER_STRUCTURE_INLINE_ALIGN_END")] End, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for StructureInlineAlign { type GlibType = ffi::PopplerStructureInlineAlign; #[inline] fn into_glib(self) -> ffi::PopplerStructureInlineAlign { match self { Self::Start => ffi::POPPLER_STRUCTURE_INLINE_ALIGN_START, Self::Center => ffi::POPPLER_STRUCTURE_INLINE_ALIGN_CENTER, Self::End => ffi::POPPLER_STRUCTURE_INLINE_ALIGN_END, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for StructureInlineAlign { #[inline] unsafe fn from_glib(value: ffi::PopplerStructureInlineAlign) -> Self { match value { ffi::POPPLER_STRUCTURE_INLINE_ALIGN_START => Self::Start, ffi::POPPLER_STRUCTURE_INLINE_ALIGN_CENTER => Self::Center, ffi::POPPLER_STRUCTURE_INLINE_ALIGN_END => Self::End, value => Self::__Unknown(value), } } } impl StaticType for StructureInlineAlign { #[inline] #[doc(alias = "poppler_structure_inline_align_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_structure_inline_align_get_type()) } } } impl glib::HasParamSpec for StructureInlineAlign { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for StructureInlineAlign { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for StructureInlineAlign { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for StructureInlineAlign { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: StructureInlineAlign) -> Self { ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerStructureListNumbering")] pub enum StructureListNumbering { #[doc(alias = "POPPLER_STRUCTURE_LIST_NUMBERING_NONE")] None, #[doc(alias = "POPPLER_STRUCTURE_LIST_NUMBERING_DISC")] Disc, #[doc(alias = "POPPLER_STRUCTURE_LIST_NUMBERING_CIRCLE")] Circle, #[doc(alias = "POPPLER_STRUCTURE_LIST_NUMBERING_SQUARE")] Square, #[doc(alias = "POPPLER_STRUCTURE_LIST_NUMBERING_DECIMAL")] Decimal, #[doc(alias = "POPPLER_STRUCTURE_LIST_NUMBERING_UPPER_ROMAN")] UpperRoman, #[doc(alias = "POPPLER_STRUCTURE_LIST_NUMBERING_LOWER_ROMAN")] LowerRoman, #[doc(alias = "POPPLER_STRUCTURE_LIST_NUMBERING_UPPER_ALPHA")] UpperAlpha, #[doc(alias = "POPPLER_STRUCTURE_LIST_NUMBERING_LOWER_ALPHA")] LowerAlpha, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for StructureListNumbering { type GlibType = ffi::PopplerStructureListNumbering; #[inline] fn into_glib(self) -> ffi::PopplerStructureListNumbering { match self { Self::None => ffi::POPPLER_STRUCTURE_LIST_NUMBERING_NONE, Self::Disc => ffi::POPPLER_STRUCTURE_LIST_NUMBERING_DISC, Self::Circle => ffi::POPPLER_STRUCTURE_LIST_NUMBERING_CIRCLE, Self::Square => ffi::POPPLER_STRUCTURE_LIST_NUMBERING_SQUARE, Self::Decimal => ffi::POPPLER_STRUCTURE_LIST_NUMBERING_DECIMAL, Self::UpperRoman => ffi::POPPLER_STRUCTURE_LIST_NUMBERING_UPPER_ROMAN, Self::LowerRoman => ffi::POPPLER_STRUCTURE_LIST_NUMBERING_LOWER_ROMAN, Self::UpperAlpha => ffi::POPPLER_STRUCTURE_LIST_NUMBERING_UPPER_ALPHA, Self::LowerAlpha => ffi::POPPLER_STRUCTURE_LIST_NUMBERING_LOWER_ALPHA, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for StructureListNumbering { #[inline] unsafe fn from_glib(value: ffi::PopplerStructureListNumbering) -> Self { match value { ffi::POPPLER_STRUCTURE_LIST_NUMBERING_NONE => Self::None, ffi::POPPLER_STRUCTURE_LIST_NUMBERING_DISC => Self::Disc, ffi::POPPLER_STRUCTURE_LIST_NUMBERING_CIRCLE => Self::Circle, ffi::POPPLER_STRUCTURE_LIST_NUMBERING_SQUARE => Self::Square, ffi::POPPLER_STRUCTURE_LIST_NUMBERING_DECIMAL => Self::Decimal, ffi::POPPLER_STRUCTURE_LIST_NUMBERING_UPPER_ROMAN => Self::UpperRoman, ffi::POPPLER_STRUCTURE_LIST_NUMBERING_LOWER_ROMAN => Self::LowerRoman, ffi::POPPLER_STRUCTURE_LIST_NUMBERING_UPPER_ALPHA => Self::UpperAlpha, ffi::POPPLER_STRUCTURE_LIST_NUMBERING_LOWER_ALPHA => Self::LowerAlpha, value => Self::__Unknown(value), } } } impl StaticType for StructureListNumbering { #[inline] #[doc(alias = "poppler_structure_list_numbering_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_structure_list_numbering_get_type()) } } } impl glib::HasParamSpec for StructureListNumbering { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for StructureListNumbering { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for StructureListNumbering { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for StructureListNumbering { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: StructureListNumbering) -> Self { ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerStructurePlacement")] pub enum StructurePlacement { #[doc(alias = "POPPLER_STRUCTURE_PLACEMENT_BLOCK")] Block, #[doc(alias = "POPPLER_STRUCTURE_PLACEMENT_INLINE")] Inline, #[doc(alias = "POPPLER_STRUCTURE_PLACEMENT_BEFORE")] Before, #[doc(alias = "POPPLER_STRUCTURE_PLACEMENT_START")] Start, #[doc(alias = "POPPLER_STRUCTURE_PLACEMENT_END")] End, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for StructurePlacement { type GlibType = ffi::PopplerStructurePlacement; #[inline] fn into_glib(self) -> ffi::PopplerStructurePlacement { match self { Self::Block => ffi::POPPLER_STRUCTURE_PLACEMENT_BLOCK, Self::Inline => ffi::POPPLER_STRUCTURE_PLACEMENT_INLINE, Self::Before => ffi::POPPLER_STRUCTURE_PLACEMENT_BEFORE, Self::Start => ffi::POPPLER_STRUCTURE_PLACEMENT_START, Self::End => ffi::POPPLER_STRUCTURE_PLACEMENT_END, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for StructurePlacement { #[inline] unsafe fn from_glib(value: ffi::PopplerStructurePlacement) -> Self { match value { ffi::POPPLER_STRUCTURE_PLACEMENT_BLOCK => Self::Block, ffi::POPPLER_STRUCTURE_PLACEMENT_INLINE => Self::Inline, ffi::POPPLER_STRUCTURE_PLACEMENT_BEFORE => Self::Before, ffi::POPPLER_STRUCTURE_PLACEMENT_START => Self::Start, ffi::POPPLER_STRUCTURE_PLACEMENT_END => Self::End, value => Self::__Unknown(value), } } } impl StaticType for StructurePlacement { #[inline] #[doc(alias = "poppler_structure_placement_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_structure_placement_get_type()) } } } impl glib::HasParamSpec for StructurePlacement { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for StructurePlacement { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for StructurePlacement { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for StructurePlacement { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: StructurePlacement) -> Self { ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerStructureRubyAlign")] pub enum StructureRubyAlign { #[doc(alias = "POPPLER_STRUCTURE_RUBY_ALIGN_START")] Start, #[doc(alias = "POPPLER_STRUCTURE_RUBY_ALIGN_CENTER")] Center, #[doc(alias = "POPPLER_STRUCTURE_RUBY_ALIGN_END")] End, #[doc(alias = "POPPLER_STRUCTURE_RUBY_ALIGN_JUSTIFY")] Justify, #[doc(alias = "POPPLER_STRUCTURE_RUBY_ALIGN_DISTRIBUTE")] Distribute, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for StructureRubyAlign { type GlibType = ffi::PopplerStructureRubyAlign; #[inline] fn into_glib(self) -> ffi::PopplerStructureRubyAlign { match self { Self::Start => ffi::POPPLER_STRUCTURE_RUBY_ALIGN_START, Self::Center => ffi::POPPLER_STRUCTURE_RUBY_ALIGN_CENTER, Self::End => ffi::POPPLER_STRUCTURE_RUBY_ALIGN_END, Self::Justify => ffi::POPPLER_STRUCTURE_RUBY_ALIGN_JUSTIFY, Self::Distribute => ffi::POPPLER_STRUCTURE_RUBY_ALIGN_DISTRIBUTE, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for StructureRubyAlign { #[inline] unsafe fn from_glib(value: ffi::PopplerStructureRubyAlign) -> Self { match value { ffi::POPPLER_STRUCTURE_RUBY_ALIGN_START => Self::Start, ffi::POPPLER_STRUCTURE_RUBY_ALIGN_CENTER => Self::Center, ffi::POPPLER_STRUCTURE_RUBY_ALIGN_END => Self::End, ffi::POPPLER_STRUCTURE_RUBY_ALIGN_JUSTIFY => Self::Justify, ffi::POPPLER_STRUCTURE_RUBY_ALIGN_DISTRIBUTE => Self::Distribute, value => Self::__Unknown(value), } } } impl StaticType for StructureRubyAlign { #[inline] #[doc(alias = "poppler_structure_ruby_align_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_structure_ruby_align_get_type()) } } } impl glib::HasParamSpec for StructureRubyAlign { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for StructureRubyAlign { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for StructureRubyAlign { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for StructureRubyAlign { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: StructureRubyAlign) -> Self { ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerStructureRubyPosition")] pub enum StructureRubyPosition { #[doc(alias = "POPPLER_STRUCTURE_RUBY_POSITION_BEFORE")] Before, #[doc(alias = "POPPLER_STRUCTURE_RUBY_POSITION_AFTER")] After, #[doc(alias = "POPPLER_STRUCTURE_RUBY_POSITION_WARICHU")] Warichu, #[doc(alias = "POPPLER_STRUCTURE_RUBY_POSITION_INLINE")] Inline, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for StructureRubyPosition { type GlibType = ffi::PopplerStructureRubyPosition; #[inline] fn into_glib(self) -> ffi::PopplerStructureRubyPosition { match self { Self::Before => ffi::POPPLER_STRUCTURE_RUBY_POSITION_BEFORE, Self::After => ffi::POPPLER_STRUCTURE_RUBY_POSITION_AFTER, Self::Warichu => ffi::POPPLER_STRUCTURE_RUBY_POSITION_WARICHU, Self::Inline => ffi::POPPLER_STRUCTURE_RUBY_POSITION_INLINE, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for StructureRubyPosition { #[inline] unsafe fn from_glib(value: ffi::PopplerStructureRubyPosition) -> Self { match value { ffi::POPPLER_STRUCTURE_RUBY_POSITION_BEFORE => Self::Before, ffi::POPPLER_STRUCTURE_RUBY_POSITION_AFTER => Self::After, ffi::POPPLER_STRUCTURE_RUBY_POSITION_WARICHU => Self::Warichu, ffi::POPPLER_STRUCTURE_RUBY_POSITION_INLINE => Self::Inline, value => Self::__Unknown(value), } } } impl StaticType for StructureRubyPosition { #[inline] #[doc(alias = "poppler_structure_ruby_position_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_structure_ruby_position_get_type()) } } } impl glib::HasParamSpec for StructureRubyPosition { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for StructureRubyPosition { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for StructureRubyPosition { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for StructureRubyPosition { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: StructureRubyPosition) -> Self { ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerStructureTableScope")] pub enum StructureTableScope { #[doc(alias = "POPPLER_STRUCTURE_TABLE_SCOPE_ROW")] Row, #[doc(alias = "POPPLER_STRUCTURE_TABLE_SCOPE_COLUMN")] Column, #[doc(alias = "POPPLER_STRUCTURE_TABLE_SCOPE_BOTH")] Both, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for StructureTableScope { type GlibType = ffi::PopplerStructureTableScope; #[inline] fn into_glib(self) -> ffi::PopplerStructureTableScope { match self { Self::Row => ffi::POPPLER_STRUCTURE_TABLE_SCOPE_ROW, Self::Column => ffi::POPPLER_STRUCTURE_TABLE_SCOPE_COLUMN, Self::Both => ffi::POPPLER_STRUCTURE_TABLE_SCOPE_BOTH, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for StructureTableScope { #[inline] unsafe fn from_glib(value: ffi::PopplerStructureTableScope) -> Self { match value { ffi::POPPLER_STRUCTURE_TABLE_SCOPE_ROW => Self::Row, ffi::POPPLER_STRUCTURE_TABLE_SCOPE_COLUMN => Self::Column, ffi::POPPLER_STRUCTURE_TABLE_SCOPE_BOTH => Self::Both, value => Self::__Unknown(value), } } } impl StaticType for StructureTableScope { #[inline] #[doc(alias = "poppler_structure_table_scope_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_structure_table_scope_get_type()) } } } impl glib::HasParamSpec for StructureTableScope { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for StructureTableScope { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for StructureTableScope { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for StructureTableScope { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: StructureTableScope) -> Self { ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerStructureTextAlign")] pub enum StructureTextAlign { #[doc(alias = "POPPLER_STRUCTURE_TEXT_ALIGN_START")] Start, #[doc(alias = "POPPLER_STRUCTURE_TEXT_ALIGN_CENTER")] Center, #[doc(alias = "POPPLER_STRUCTURE_TEXT_ALIGN_END")] End, #[doc(alias = "POPPLER_STRUCTURE_TEXT_ALIGN_JUSTIFY")] Justify, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for StructureTextAlign { type GlibType = ffi::PopplerStructureTextAlign; #[inline] fn into_glib(self) -> ffi::PopplerStructureTextAlign { match self { Self::Start => ffi::POPPLER_STRUCTURE_TEXT_ALIGN_START, Self::Center => ffi::POPPLER_STRUCTURE_TEXT_ALIGN_CENTER, Self::End => ffi::POPPLER_STRUCTURE_TEXT_ALIGN_END, Self::Justify => ffi::POPPLER_STRUCTURE_TEXT_ALIGN_JUSTIFY, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for StructureTextAlign { #[inline] unsafe fn from_glib(value: ffi::PopplerStructureTextAlign) -> Self { match value { ffi::POPPLER_STRUCTURE_TEXT_ALIGN_START => Self::Start, ffi::POPPLER_STRUCTURE_TEXT_ALIGN_CENTER => Self::Center, ffi::POPPLER_STRUCTURE_TEXT_ALIGN_END => Self::End, ffi::POPPLER_STRUCTURE_TEXT_ALIGN_JUSTIFY => Self::Justify, value => Self::__Unknown(value), } } } impl StaticType for StructureTextAlign { #[inline] #[doc(alias = "poppler_structure_text_align_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_structure_text_align_get_type()) } } } impl glib::HasParamSpec for StructureTextAlign { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for StructureTextAlign { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for StructureTextAlign { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for StructureTextAlign { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: StructureTextAlign) -> Self { ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerStructureTextDecoration")] pub enum StructureTextDecoration { #[doc(alias = "POPPLER_STRUCTURE_TEXT_DECORATION_NONE")] None, #[doc(alias = "POPPLER_STRUCTURE_TEXT_DECORATION_UNDERLINE")] Underline, #[doc(alias = "POPPLER_STRUCTURE_TEXT_DECORATION_OVERLINE")] Overline, #[doc(alias = "POPPLER_STRUCTURE_TEXT_DECORATION_LINETHROUGH")] Linethrough, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for StructureTextDecoration { type GlibType = ffi::PopplerStructureTextDecoration; #[inline] fn into_glib(self) -> ffi::PopplerStructureTextDecoration { match self { Self::None => ffi::POPPLER_STRUCTURE_TEXT_DECORATION_NONE, Self::Underline => ffi::POPPLER_STRUCTURE_TEXT_DECORATION_UNDERLINE, Self::Overline => ffi::POPPLER_STRUCTURE_TEXT_DECORATION_OVERLINE, Self::Linethrough => ffi::POPPLER_STRUCTURE_TEXT_DECORATION_LINETHROUGH, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for StructureTextDecoration { #[inline] unsafe fn from_glib(value: ffi::PopplerStructureTextDecoration) -> Self { match value { ffi::POPPLER_STRUCTURE_TEXT_DECORATION_NONE => Self::None, ffi::POPPLER_STRUCTURE_TEXT_DECORATION_UNDERLINE => Self::Underline, ffi::POPPLER_STRUCTURE_TEXT_DECORATION_OVERLINE => Self::Overline, ffi::POPPLER_STRUCTURE_TEXT_DECORATION_LINETHROUGH => Self::Linethrough, value => Self::__Unknown(value), } } } impl StaticType for StructureTextDecoration { #[inline] #[doc(alias = "poppler_structure_text_decoration_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_structure_text_decoration_get_type()) } } } impl glib::HasParamSpec for StructureTextDecoration { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for StructureTextDecoration { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for StructureTextDecoration { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for StructureTextDecoration { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: StructureTextDecoration) -> Self { ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "PopplerStructureWritingMode")] pub enum StructureWritingMode { #[doc(alias = "POPPLER_STRUCTURE_WRITING_MODE_LR_TB")] LrTb, #[doc(alias = "POPPLER_STRUCTURE_WRITING_MODE_RL_TB")] RlTb, #[doc(alias = "POPPLER_STRUCTURE_WRITING_MODE_TB_RL")] TbRl, #[doc(hidden)] __Unknown(i32), } #[doc(hidden)] impl IntoGlib for StructureWritingMode { type GlibType = ffi::PopplerStructureWritingMode; #[inline] fn into_glib(self) -> ffi::PopplerStructureWritingMode { match self { Self::LrTb => ffi::POPPLER_STRUCTURE_WRITING_MODE_LR_TB, Self::RlTb => ffi::POPPLER_STRUCTURE_WRITING_MODE_RL_TB, Self::TbRl => ffi::POPPLER_STRUCTURE_WRITING_MODE_TB_RL, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for StructureWritingMode { #[inline] unsafe fn from_glib(value: ffi::PopplerStructureWritingMode) -> Self { match value { ffi::POPPLER_STRUCTURE_WRITING_MODE_LR_TB => Self::LrTb, ffi::POPPLER_STRUCTURE_WRITING_MODE_RL_TB => Self::RlTb, ffi::POPPLER_STRUCTURE_WRITING_MODE_TB_RL => Self::TbRl, value => Self::__Unknown(value), } } } impl StaticType for StructureWritingMode { #[inline] #[doc(alias = "poppler_structure_writing_mode_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_structure_writing_mode_get_type()) } } } impl glib::HasParamSpec for StructureWritingMode { type ParamSpec = glib::ParamSpecEnum; type SetValue = Self; type BuilderFn = fn(&str, Self) -> glib::ParamSpecEnumBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder_with_default } } impl glib::value::ValueType for StructureWritingMode { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for StructureWritingMode { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for StructureWritingMode { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_enum(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: StructureWritingMode) -> Self { ToValue::to_value(&v) } } poppler-rs-0.25.0/src/auto/flags.rs000064400000000000000000000501701046102023000152170ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::ffi; use glib::{bitflags::bitflags, prelude::*, translate::*}; bitflags! { #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] #[doc(alias = "PopplerAnnotFlag")] pub struct AnnotFlag: u32 { #[doc(alias = "POPPLER_ANNOT_FLAG_UNKNOWN")] const UNKNOWN = ffi::POPPLER_ANNOT_FLAG_UNKNOWN as _; #[doc(alias = "POPPLER_ANNOT_FLAG_INVISIBLE")] const INVISIBLE = ffi::POPPLER_ANNOT_FLAG_INVISIBLE as _; #[doc(alias = "POPPLER_ANNOT_FLAG_HIDDEN")] const HIDDEN = ffi::POPPLER_ANNOT_FLAG_HIDDEN as _; #[doc(alias = "POPPLER_ANNOT_FLAG_PRINT")] const PRINT = ffi::POPPLER_ANNOT_FLAG_PRINT as _; #[doc(alias = "POPPLER_ANNOT_FLAG_NO_ZOOM")] const NO_ZOOM = ffi::POPPLER_ANNOT_FLAG_NO_ZOOM as _; #[doc(alias = "POPPLER_ANNOT_FLAG_NO_ROTATE")] const NO_ROTATE = ffi::POPPLER_ANNOT_FLAG_NO_ROTATE as _; #[doc(alias = "POPPLER_ANNOT_FLAG_NO_VIEW")] const NO_VIEW = ffi::POPPLER_ANNOT_FLAG_NO_VIEW as _; #[doc(alias = "POPPLER_ANNOT_FLAG_READ_ONLY")] const READ_ONLY = ffi::POPPLER_ANNOT_FLAG_READ_ONLY as _; #[doc(alias = "POPPLER_ANNOT_FLAG_LOCKED")] const LOCKED = ffi::POPPLER_ANNOT_FLAG_LOCKED as _; #[doc(alias = "POPPLER_ANNOT_FLAG_TOGGLE_NO_VIEW")] const TOGGLE_NO_VIEW = ffi::POPPLER_ANNOT_FLAG_TOGGLE_NO_VIEW as _; #[doc(alias = "POPPLER_ANNOT_FLAG_LOCKED_CONTENTS")] const LOCKED_CONTENTS = ffi::POPPLER_ANNOT_FLAG_LOCKED_CONTENTS as _; } } #[doc(hidden)] impl IntoGlib for AnnotFlag { type GlibType = ffi::PopplerAnnotFlag; #[inline] fn into_glib(self) -> ffi::PopplerAnnotFlag { self.bits() } } #[doc(hidden)] impl FromGlib for AnnotFlag { #[inline] unsafe fn from_glib(value: ffi::PopplerAnnotFlag) -> Self { Self::from_bits_truncate(value) } } impl StaticType for AnnotFlag { #[inline] #[doc(alias = "poppler_annot_flag_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_annot_flag_get_type()) } } } impl glib::HasParamSpec for AnnotFlag { type ParamSpec = glib::ParamSpecFlags; type SetValue = Self; type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder } } impl glib::value::ValueType for AnnotFlag { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for AnnotFlag { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) } } impl ToValue for AnnotFlag { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: AnnotFlag) -> Self { ToValue::to_value(&v) } } bitflags! { #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] #[doc(alias = "PopplerFindFlags")] pub struct FindFlags: u32 { #[doc(alias = "POPPLER_FIND_DEFAULT")] const DEFAULT = ffi::POPPLER_FIND_DEFAULT as _; #[doc(alias = "POPPLER_FIND_CASE_SENSITIVE")] const CASE_SENSITIVE = ffi::POPPLER_FIND_CASE_SENSITIVE as _; #[doc(alias = "POPPLER_FIND_BACKWARDS")] const BACKWARDS = ffi::POPPLER_FIND_BACKWARDS as _; #[doc(alias = "POPPLER_FIND_WHOLE_WORDS_ONLY")] const WHOLE_WORDS_ONLY = ffi::POPPLER_FIND_WHOLE_WORDS_ONLY as _; #[doc(alias = "POPPLER_FIND_IGNORE_DIACRITICS")] const IGNORE_DIACRITICS = ffi::POPPLER_FIND_IGNORE_DIACRITICS as _; #[doc(alias = "POPPLER_FIND_MULTILINE")] const MULTILINE = ffi::POPPLER_FIND_MULTILINE as _; } } #[doc(hidden)] impl IntoGlib for FindFlags { type GlibType = ffi::PopplerFindFlags; #[inline] fn into_glib(self) -> ffi::PopplerFindFlags { self.bits() } } #[doc(hidden)] impl FromGlib for FindFlags { #[inline] unsafe fn from_glib(value: ffi::PopplerFindFlags) -> Self { Self::from_bits_truncate(value) } } impl StaticType for FindFlags { #[inline] #[doc(alias = "poppler_find_flags_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_find_flags_get_type()) } } } impl glib::HasParamSpec for FindFlags { type ParamSpec = glib::ParamSpecFlags; type SetValue = Self; type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder } } impl glib::value::ValueType for FindFlags { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for FindFlags { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) } } impl ToValue for FindFlags { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: FindFlags) -> Self { ToValue::to_value(&v) } } bitflags! { #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] #[doc(alias = "PopplerPermissions")] pub struct Permissions: u32 { #[doc(alias = "POPPLER_PERMISSIONS_OK_TO_PRINT")] const OK_TO_PRINT = ffi::POPPLER_PERMISSIONS_OK_TO_PRINT as _; #[doc(alias = "POPPLER_PERMISSIONS_OK_TO_MODIFY")] const OK_TO_MODIFY = ffi::POPPLER_PERMISSIONS_OK_TO_MODIFY as _; #[doc(alias = "POPPLER_PERMISSIONS_OK_TO_COPY")] const OK_TO_COPY = ffi::POPPLER_PERMISSIONS_OK_TO_COPY as _; #[doc(alias = "POPPLER_PERMISSIONS_OK_TO_ADD_NOTES")] const OK_TO_ADD_NOTES = ffi::POPPLER_PERMISSIONS_OK_TO_ADD_NOTES as _; #[doc(alias = "POPPLER_PERMISSIONS_OK_TO_FILL_FORM")] const OK_TO_FILL_FORM = ffi::POPPLER_PERMISSIONS_OK_TO_FILL_FORM as _; #[doc(alias = "POPPLER_PERMISSIONS_OK_TO_EXTRACT_CONTENTS")] const OK_TO_EXTRACT_CONTENTS = ffi::POPPLER_PERMISSIONS_OK_TO_EXTRACT_CONTENTS as _; #[doc(alias = "POPPLER_PERMISSIONS_OK_TO_ASSEMBLE")] const OK_TO_ASSEMBLE = ffi::POPPLER_PERMISSIONS_OK_TO_ASSEMBLE as _; #[doc(alias = "POPPLER_PERMISSIONS_OK_TO_PRINT_HIGH_RESOLUTION")] const OK_TO_PRINT_HIGH_RESOLUTION = ffi::POPPLER_PERMISSIONS_OK_TO_PRINT_HIGH_RESOLUTION as _; #[doc(alias = "POPPLER_PERMISSIONS_FULL")] const FULL = ffi::POPPLER_PERMISSIONS_FULL as _; } } #[doc(hidden)] impl IntoGlib for Permissions { type GlibType = ffi::PopplerPermissions; #[inline] fn into_glib(self) -> ffi::PopplerPermissions { self.bits() } } #[doc(hidden)] impl FromGlib for Permissions { #[inline] unsafe fn from_glib(value: ffi::PopplerPermissions) -> Self { Self::from_bits_truncate(value) } } impl StaticType for Permissions { #[inline] #[doc(alias = "poppler_permissions_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_permissions_get_type()) } } } impl glib::HasParamSpec for Permissions { type ParamSpec = glib::ParamSpecFlags; type SetValue = Self; type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder } } impl glib::value::ValueType for Permissions { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for Permissions { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) } } impl ToValue for Permissions { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: Permissions) -> Self { ToValue::to_value(&v) } } bitflags! { #[cfg_attr(feature = "v25_2", deprecated = "Since 25.2")] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] #[doc(alias = "PopplerPrintFlags")] pub struct PrintFlags: u32 { #[doc(alias = "POPPLER_PRINT_DOCUMENT")] const DOCUMENT = ffi::POPPLER_PRINT_DOCUMENT as _; #[doc(alias = "POPPLER_PRINT_MARKUP_ANNOTS")] const MARKUP_ANNOTS = ffi::POPPLER_PRINT_MARKUP_ANNOTS as _; #[doc(alias = "POPPLER_PRINT_STAMP_ANNOTS_ONLY")] const STAMP_ANNOTS_ONLY = ffi::POPPLER_PRINT_STAMP_ANNOTS_ONLY as _; #[doc(alias = "POPPLER_PRINT_ALL")] const ALL = ffi::POPPLER_PRINT_ALL as _; } } #[allow(deprecated)] #[doc(hidden)] impl IntoGlib for PrintFlags { type GlibType = ffi::PopplerPrintFlags; #[inline] fn into_glib(self) -> ffi::PopplerPrintFlags { self.bits() } } #[allow(deprecated)] #[doc(hidden)] impl FromGlib for PrintFlags { #[inline] unsafe fn from_glib(value: ffi::PopplerPrintFlags) -> Self { Self::from_bits_truncate(value) } } #[allow(deprecated)] impl StaticType for PrintFlags { #[inline] #[doc(alias = "poppler_print_flags_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_print_flags_get_type()) } } } #[allow(deprecated)] impl glib::HasParamSpec for PrintFlags { type ParamSpec = glib::ParamSpecFlags; type SetValue = Self; type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder } } #[allow(deprecated)] impl glib::value::ValueType for PrintFlags { type Type = Self; } #[allow(deprecated)] unsafe impl<'a> glib::value::FromValue<'a> for PrintFlags { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) } } #[allow(deprecated)] impl ToValue for PrintFlags { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } #[allow(deprecated)] impl From for glib::Value { #[inline] fn from(v: PrintFlags) -> Self { ToValue::to_value(&v) } } #[cfg(feature = "v21_12")] bitflags! { #[cfg_attr(docsrs, doc(cfg(feature = "v21_12")))] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] #[doc(alias = "PopplerSignatureValidationFlags")] pub struct SignatureValidationFlags: u32 { #[doc(alias = "POPPLER_SIGNATURE_VALIDATION_FLAG_VALIDATE_CERTIFICATE")] const VALIDATE_CERTIFICATE = ffi::POPPLER_SIGNATURE_VALIDATION_FLAG_VALIDATE_CERTIFICATE as _; #[doc(alias = "POPPLER_SIGNATURE_VALIDATION_FLAG_WITHOUT_OCSP_REVOCATION_CHECK")] const WITHOUT_OCSP_REVOCATION_CHECK = ffi::POPPLER_SIGNATURE_VALIDATION_FLAG_WITHOUT_OCSP_REVOCATION_CHECK as _; #[doc(alias = "POPPLER_SIGNATURE_VALIDATION_FLAG_USE_AIA_CERTIFICATE_FETCH")] const USE_AIA_CERTIFICATE_FETCH = ffi::POPPLER_SIGNATURE_VALIDATION_FLAG_USE_AIA_CERTIFICATE_FETCH as _; } } #[cfg(feature = "v21_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v21_12")))] #[doc(hidden)] impl IntoGlib for SignatureValidationFlags { type GlibType = ffi::PopplerSignatureValidationFlags; #[inline] fn into_glib(self) -> ffi::PopplerSignatureValidationFlags { self.bits() } } #[cfg(feature = "v21_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v21_12")))] #[doc(hidden)] impl FromGlib for SignatureValidationFlags { #[inline] unsafe fn from_glib(value: ffi::PopplerSignatureValidationFlags) -> Self { Self::from_bits_truncate(value) } } #[cfg(feature = "v21_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v21_12")))] impl StaticType for SignatureValidationFlags { #[inline] #[doc(alias = "poppler_signature_validation_flags_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_signature_validation_flags_get_type()) } } } #[cfg(feature = "v21_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v21_12")))] impl glib::HasParamSpec for SignatureValidationFlags { type ParamSpec = glib::ParamSpecFlags; type SetValue = Self; type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder } } #[cfg(feature = "v21_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v21_12")))] impl glib::value::ValueType for SignatureValidationFlags { type Type = Self; } #[cfg(feature = "v21_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v21_12")))] unsafe impl<'a> glib::value::FromValue<'a> for SignatureValidationFlags { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) } } #[cfg(feature = "v21_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v21_12")))] impl ToValue for SignatureValidationFlags { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } #[cfg(feature = "v21_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v21_12")))] impl From for glib::Value { #[inline] fn from(v: SignatureValidationFlags) -> Self { ToValue::to_value(&v) } } bitflags! { #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] #[doc(alias = "PopplerStructureGetTextFlags")] pub struct StructureGetTextFlags: u32 { #[doc(alias = "POPPLER_STRUCTURE_GET_TEXT_NONE")] const NONE = ffi::POPPLER_STRUCTURE_GET_TEXT_NONE as _; #[doc(alias = "POPPLER_STRUCTURE_GET_TEXT_RECURSIVE")] const RECURSIVE = ffi::POPPLER_STRUCTURE_GET_TEXT_RECURSIVE as _; } } #[doc(hidden)] impl IntoGlib for StructureGetTextFlags { type GlibType = ffi::PopplerStructureGetTextFlags; #[inline] fn into_glib(self) -> ffi::PopplerStructureGetTextFlags { self.bits() } } #[doc(hidden)] impl FromGlib for StructureGetTextFlags { #[inline] unsafe fn from_glib(value: ffi::PopplerStructureGetTextFlags) -> Self { Self::from_bits_truncate(value) } } impl StaticType for StructureGetTextFlags { #[inline] #[doc(alias = "poppler_structure_get_text_flags_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_structure_get_text_flags_get_type()) } } } impl glib::HasParamSpec for StructureGetTextFlags { type ParamSpec = glib::ParamSpecFlags; type SetValue = Self; type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder } } impl glib::value::ValueType for StructureGetTextFlags { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for StructureGetTextFlags { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) } } impl ToValue for StructureGetTextFlags { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: StructureGetTextFlags) -> Self { ToValue::to_value(&v) } } bitflags! { #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] #[doc(alias = "PopplerViewerPreferences")] pub struct ViewerPreferences: u32 { #[doc(alias = "POPPLER_VIEWER_PREFERENCES_UNSET")] const UNSET = ffi::POPPLER_VIEWER_PREFERENCES_UNSET as _; #[doc(alias = "POPPLER_VIEWER_PREFERENCES_HIDE_TOOLBAR")] const HIDE_TOOLBAR = ffi::POPPLER_VIEWER_PREFERENCES_HIDE_TOOLBAR as _; #[doc(alias = "POPPLER_VIEWER_PREFERENCES_HIDE_MENUBAR")] const HIDE_MENUBAR = ffi::POPPLER_VIEWER_PREFERENCES_HIDE_MENUBAR as _; #[doc(alias = "POPPLER_VIEWER_PREFERENCES_HIDE_WINDOWUI")] const HIDE_WINDOWUI = ffi::POPPLER_VIEWER_PREFERENCES_HIDE_WINDOWUI as _; #[doc(alias = "POPPLER_VIEWER_PREFERENCES_FIT_WINDOW")] const FIT_WINDOW = ffi::POPPLER_VIEWER_PREFERENCES_FIT_WINDOW as _; #[doc(alias = "POPPLER_VIEWER_PREFERENCES_CENTER_WINDOW")] const CENTER_WINDOW = ffi::POPPLER_VIEWER_PREFERENCES_CENTER_WINDOW as _; #[doc(alias = "POPPLER_VIEWER_PREFERENCES_DISPLAY_DOC_TITLE")] const DISPLAY_DOC_TITLE = ffi::POPPLER_VIEWER_PREFERENCES_DISPLAY_DOC_TITLE as _; #[doc(alias = "POPPLER_VIEWER_PREFERENCES_DIRECTION_RTL")] const DIRECTION_RTL = ffi::POPPLER_VIEWER_PREFERENCES_DIRECTION_RTL as _; } } #[doc(hidden)] impl IntoGlib for ViewerPreferences { type GlibType = ffi::PopplerViewerPreferences; #[inline] fn into_glib(self) -> ffi::PopplerViewerPreferences { self.bits() } } #[doc(hidden)] impl FromGlib for ViewerPreferences { #[inline] unsafe fn from_glib(value: ffi::PopplerViewerPreferences) -> Self { Self::from_bits_truncate(value) } } impl StaticType for ViewerPreferences { #[inline] #[doc(alias = "poppler_viewer_preferences_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::poppler_viewer_preferences_get_type()) } } } impl glib::HasParamSpec for ViewerPreferences { type ParamSpec = glib::ParamSpecFlags; type SetValue = Self; type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder; fn param_spec_builder() -> Self::BuilderFn { Self::ParamSpec::builder } } impl glib::value::ValueType for ViewerPreferences { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for ViewerPreferences { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) } } impl ToValue for ViewerPreferences { #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib()); } value } #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } } impl From for glib::Value { #[inline] fn from(v: ViewerPreferences) -> Self { ToValue::to_value(&v) } } poppler-rs-0.25.0/src/auto/font_info.rs000064400000000000000000000020731046102023000161030ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, Document, FontsIter}; use glib::translate::*; glib::wrapper! { #[doc(alias = "PopplerFontInfo")] pub struct FontInfo(Object); match fn { type_ => || ffi::poppler_font_info_get_type(), } } impl FontInfo { #[doc(alias = "poppler_font_info_new")] pub fn new(document: &Document) -> FontInfo { unsafe { from_glib_full(ffi::poppler_font_info_new(document.to_glib_none().0)) } } #[doc(alias = "poppler_font_info_scan")] pub fn scan(&self, n_pages: i32) -> Option { unsafe { let mut iter = std::ptr::null_mut(); let ret = from_glib(ffi::poppler_font_info_scan( self.to_glib_none().0, n_pages, &mut iter, )); if ret { Some(from_glib_full(iter)) } else { None } } } } poppler-rs-0.25.0/src/auto/fonts_iter.rs000064400000000000000000000056101046102023000162760ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, FontType}; use glib::translate::*; glib::wrapper! { #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct FontsIter(Boxed); match fn { copy => |ptr| ffi::poppler_fonts_iter_copy(mut_override(ptr)), free => |ptr| ffi::poppler_fonts_iter_free(ptr), type_ => || ffi::poppler_fonts_iter_get_type(), } } impl FontsIter { #[doc(alias = "poppler_fonts_iter_get_encoding")] #[doc(alias = "get_encoding")] pub fn encoding(&mut self) -> Option { unsafe { from_glib_none(ffi::poppler_fonts_iter_get_encoding( self.to_glib_none_mut().0, )) } } #[doc(alias = "poppler_fonts_iter_get_file_name")] #[doc(alias = "get_file_name")] pub fn file_name(&mut self) -> Option { unsafe { from_glib_none(ffi::poppler_fonts_iter_get_file_name( self.to_glib_none_mut().0, )) } } #[doc(alias = "poppler_fonts_iter_get_font_type")] #[doc(alias = "get_font_type")] pub fn font_type(&mut self) -> FontType { unsafe { from_glib(ffi::poppler_fonts_iter_get_font_type( self.to_glib_none_mut().0, )) } } #[doc(alias = "poppler_fonts_iter_get_full_name")] #[doc(alias = "get_full_name")] pub fn full_name(&mut self) -> Option { unsafe { from_glib_none(ffi::poppler_fonts_iter_get_full_name( self.to_glib_none_mut().0, )) } } #[doc(alias = "poppler_fonts_iter_get_name")] #[doc(alias = "get_name")] pub fn name(&mut self) -> Option { unsafe { from_glib_none(ffi::poppler_fonts_iter_get_name(self.to_glib_none_mut().0)) } } #[doc(alias = "poppler_fonts_iter_get_substitute_name")] #[doc(alias = "get_substitute_name")] pub fn substitute_name(&mut self) -> Option { unsafe { from_glib_none(ffi::poppler_fonts_iter_get_substitute_name( self.to_glib_none_mut().0, )) } } #[doc(alias = "poppler_fonts_iter_is_embedded")] pub fn is_embedded(&mut self) -> bool { unsafe { from_glib(ffi::poppler_fonts_iter_is_embedded( self.to_glib_none_mut().0, )) } } #[doc(alias = "poppler_fonts_iter_is_subset")] pub fn is_subset(&mut self) -> bool { unsafe { from_glib(ffi::poppler_fonts_iter_is_subset(self.to_glib_none_mut().0)) } } #[doc(alias = "poppler_fonts_iter_next")] pub fn next(&mut self) -> bool { unsafe { from_glib(ffi::poppler_fonts_iter_next(self.to_glib_none_mut().0)) } } } poppler-rs-0.25.0/src/auto/form_field.rs000064400000000000000000000317751046102023000162430ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, FormButtonType, FormChoiceType, FormFieldType, FormTextType}; #[cfg(feature = "v21_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v21_12")))] use crate::{SignatureInfo, SignatureValidationFlags}; #[cfg(feature = "v21_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v21_12")))] use glib::prelude::*; use glib::translate::*; #[cfg(feature = "v21_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v21_12")))] use std::{boxed::Box as Box_, pin::Pin}; glib::wrapper! { #[doc(alias = "PopplerFormField")] pub struct FormField(Object); match fn { type_ => || ffi::poppler_form_field_get_type(), } } impl FormField { #[doc(alias = "poppler_form_field_button_get_button_type")] pub fn button_get_button_type(&self) -> FormButtonType { unsafe { from_glib(ffi::poppler_form_field_button_get_button_type( self.to_glib_none().0, )) } } #[doc(alias = "poppler_form_field_button_get_state")] pub fn button_get_state(&self) -> bool { unsafe { from_glib(ffi::poppler_form_field_button_get_state( self.to_glib_none().0, )) } } #[doc(alias = "poppler_form_field_button_set_state")] pub fn button_set_state(&self, state: bool) { unsafe { ffi::poppler_form_field_button_set_state(self.to_glib_none().0, state.into_glib()); } } #[doc(alias = "poppler_form_field_choice_can_select_multiple")] pub fn choice_can_select_multiple(&self) -> bool { unsafe { from_glib(ffi::poppler_form_field_choice_can_select_multiple( self.to_glib_none().0, )) } } #[doc(alias = "poppler_form_field_choice_commit_on_change")] pub fn choice_commit_on_change(&self) -> bool { unsafe { from_glib(ffi::poppler_form_field_choice_commit_on_change( self.to_glib_none().0, )) } } #[doc(alias = "poppler_form_field_choice_do_spell_check")] pub fn choice_do_spell_check(&self) -> bool { unsafe { from_glib(ffi::poppler_form_field_choice_do_spell_check( self.to_glib_none().0, )) } } #[doc(alias = "poppler_form_field_choice_get_choice_type")] pub fn choice_get_choice_type(&self) -> FormChoiceType { unsafe { from_glib(ffi::poppler_form_field_choice_get_choice_type( self.to_glib_none().0, )) } } #[doc(alias = "poppler_form_field_choice_get_item")] pub fn choice_get_item(&self, index: i32) -> Option { unsafe { from_glib_full(ffi::poppler_form_field_choice_get_item( self.to_glib_none().0, index, )) } } #[doc(alias = "poppler_form_field_choice_get_n_items")] pub fn choice_get_n_items(&self) -> i32 { unsafe { ffi::poppler_form_field_choice_get_n_items(self.to_glib_none().0) } } #[doc(alias = "poppler_form_field_choice_get_text")] pub fn choice_get_text(&self) -> Option { unsafe { from_glib_full(ffi::poppler_form_field_choice_get_text( self.to_glib_none().0, )) } } #[doc(alias = "poppler_form_field_choice_is_editable")] pub fn choice_is_editable(&self) -> bool { unsafe { from_glib(ffi::poppler_form_field_choice_is_editable( self.to_glib_none().0, )) } } #[doc(alias = "poppler_form_field_choice_is_item_selected")] pub fn choice_is_item_selected(&self, index: i32) -> bool { unsafe { from_glib(ffi::poppler_form_field_choice_is_item_selected( self.to_glib_none().0, index, )) } } #[doc(alias = "poppler_form_field_choice_select_item")] pub fn choice_select_item(&self, index: i32) { unsafe { ffi::poppler_form_field_choice_select_item(self.to_glib_none().0, index); } } #[doc(alias = "poppler_form_field_choice_set_text")] pub fn choice_set_text(&self, text: &str) { unsafe { ffi::poppler_form_field_choice_set_text(self.to_glib_none().0, text.to_glib_none().0); } } #[doc(alias = "poppler_form_field_choice_toggle_item")] pub fn choice_toggle_item(&self, index: i32) { unsafe { ffi::poppler_form_field_choice_toggle_item(self.to_glib_none().0, index); } } #[doc(alias = "poppler_form_field_choice_unselect_all")] pub fn choice_unselect_all(&self) { unsafe { ffi::poppler_form_field_choice_unselect_all(self.to_glib_none().0); } } //#[doc(alias = "poppler_form_field_get_action")] //#[doc(alias = "get_action")] //pub fn action(&self) -> /*Ignored*/Option { // unsafe { TODO: call ffi:poppler_form_field_get_action() } //} //#[cfg(feature = "v0_72")] //#[cfg_attr(docsrs, doc(cfg(feature = "v0_72")))] //#[doc(alias = "poppler_form_field_get_additional_action")] //#[doc(alias = "get_additional_action")] //pub fn additional_action(&self, type_: AdditionalActionType) -> /*Ignored*/Option { // unsafe { TODO: call ffi:poppler_form_field_get_additional_action() } //} #[cfg(feature = "v0_88")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_88")))] #[doc(alias = "poppler_form_field_get_alternate_ui_name")] #[doc(alias = "get_alternate_ui_name")] pub fn alternate_ui_name(&self) -> Option { unsafe { from_glib_full(ffi::poppler_form_field_get_alternate_ui_name( self.to_glib_none().0, )) } } #[doc(alias = "poppler_form_field_get_field_type")] #[doc(alias = "get_field_type")] pub fn field_type(&self) -> FormFieldType { unsafe { from_glib(ffi::poppler_form_field_get_field_type( self.to_glib_none().0, )) } } #[doc(alias = "poppler_form_field_get_font_size")] #[doc(alias = "get_font_size")] pub fn font_size(&self) -> f64 { unsafe { ffi::poppler_form_field_get_font_size(self.to_glib_none().0) } } #[doc(alias = "poppler_form_field_get_id")] #[doc(alias = "get_id")] pub fn id(&self) -> i32 { unsafe { ffi::poppler_form_field_get_id(self.to_glib_none().0) } } #[doc(alias = "poppler_form_field_get_mapping_name")] #[doc(alias = "get_mapping_name")] pub fn mapping_name(&self) -> Option { unsafe { from_glib_full(ffi::poppler_form_field_get_mapping_name( self.to_glib_none().0, )) } } #[doc(alias = "poppler_form_field_get_name")] #[doc(alias = "get_name")] pub fn name(&self) -> Option { unsafe { from_glib_full(ffi::poppler_form_field_get_name(self.to_glib_none().0)) } } #[doc(alias = "poppler_form_field_get_partial_name")] #[doc(alias = "get_partial_name")] pub fn partial_name(&self) -> Option { unsafe { from_glib_full(ffi::poppler_form_field_get_partial_name( self.to_glib_none().0, )) } } #[doc(alias = "poppler_form_field_is_read_only")] pub fn is_read_only(&self) -> bool { unsafe { from_glib(ffi::poppler_form_field_is_read_only(self.to_glib_none().0)) } } #[cfg(feature = "v21_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v21_12")))] #[doc(alias = "poppler_form_field_signature_validate_async")] pub fn signature_validate_async) + 'static>( &self, flags: SignatureValidationFlags, cancellable: Option<&impl IsA>, callback: P, ) { let main_context = glib::MainContext::ref_thread_default(); let is_main_context_owner = main_context.is_owner(); let has_acquired_main_context = (!is_main_context_owner) .then(|| main_context.acquire().ok()) .flatten(); assert!( is_main_context_owner || has_acquired_main_context.is_some(), "Async operations only allowed if the thread is owning the MainContext" ); let user_data: Box_> = Box_::new(glib::thread_guard::ThreadGuard::new(callback)); unsafe extern "C" fn signature_validate_async_trampoline< P: FnOnce(Result) + 'static, >( _source_object: *mut glib::gobject_ffi::GObject, res: *mut gio::ffi::GAsyncResult, user_data: glib::ffi::gpointer, ) { let mut error = std::ptr::null_mut(); let ret = ffi::poppler_form_field_signature_validate_finish( _source_object as *mut _, res, &mut error, ); let result = if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }; let callback: Box_> = Box_::from_raw(user_data as *mut _); let callback: P = callback.into_inner(); callback(result); } let callback = signature_validate_async_trampoline::

; unsafe { ffi::poppler_form_field_signature_validate_async( self.to_glib_none().0, flags.into_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, Some(callback), Box_::into_raw(user_data) as *mut _, ); } } #[cfg(feature = "v21_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v21_12")))] pub fn signature_validate_future( &self, flags: SignatureValidationFlags, ) -> Pin> + 'static>> { Box_::pin(gio::GioFuture::new(self, move |obj, cancellable, send| { obj.signature_validate_async(flags, Some(cancellable), move |res| { send.resolve(res); }); })) } #[cfg(feature = "v21_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v21_12")))] #[doc(alias = "poppler_form_field_signature_validate_sync")] pub fn signature_validate_sync( &self, flags: SignatureValidationFlags, cancellable: Option<&impl IsA>, ) -> Result { unsafe { let mut error = std::ptr::null_mut(); let ret = ffi::poppler_form_field_signature_validate_sync( self.to_glib_none().0, flags.into_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error, ); if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) } } } #[doc(alias = "poppler_form_field_text_do_scroll")] pub fn text_do_scroll(&self) -> bool { unsafe { from_glib(ffi::poppler_form_field_text_do_scroll( self.to_glib_none().0, )) } } #[doc(alias = "poppler_form_field_text_do_spell_check")] pub fn text_do_spell_check(&self) -> bool { unsafe { from_glib(ffi::poppler_form_field_text_do_spell_check( self.to_glib_none().0, )) } } #[doc(alias = "poppler_form_field_text_get_max_len")] pub fn text_get_max_len(&self) -> i32 { unsafe { ffi::poppler_form_field_text_get_max_len(self.to_glib_none().0) } } #[doc(alias = "poppler_form_field_text_get_text")] pub fn text_get_text(&self) -> Option { unsafe { from_glib_full(ffi::poppler_form_field_text_get_text(self.to_glib_none().0)) } } #[doc(alias = "poppler_form_field_text_get_text_type")] pub fn text_get_text_type(&self) -> FormTextType { unsafe { from_glib(ffi::poppler_form_field_text_get_text_type( self.to_glib_none().0, )) } } #[doc(alias = "poppler_form_field_text_is_password")] pub fn text_is_password(&self) -> bool { unsafe { from_glib(ffi::poppler_form_field_text_is_password( self.to_glib_none().0, )) } } #[doc(alias = "poppler_form_field_text_is_rich_text")] pub fn text_is_rich_text(&self) -> bool { unsafe { from_glib(ffi::poppler_form_field_text_is_rich_text( self.to_glib_none().0, )) } } #[doc(alias = "poppler_form_field_text_set_text")] pub fn text_set_text(&self, text: &str) { unsafe { ffi::poppler_form_field_text_set_text(self.to_glib_none().0, text.to_glib_none().0); } } } poppler-rs-0.25.0/src/auto/form_field_mapping.rs000064400000000000000000000015271046102023000177460ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::ffi; use glib::translate::*; glib::wrapper! { #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct FormFieldMapping(Boxed); match fn { copy => |ptr| ffi::poppler_form_field_mapping_copy(mut_override(ptr)), free => |ptr| ffi::poppler_form_field_mapping_free(ptr), type_ => || ffi::poppler_form_field_mapping_get_type(), } } impl FormFieldMapping { #[doc(alias = "poppler_form_field_mapping_new")] pub fn new() -> FormFieldMapping { unsafe { from_glib_full(ffi::poppler_form_field_mapping_new()) } } } impl Default for FormFieldMapping { fn default() -> Self { Self::new() } } poppler-rs-0.25.0/src/auto/functions.rs000064400000000000000000000056051046102023000161360ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT #[cfg(feature = "v23_7")] #[cfg_attr(docsrs, doc(cfg(feature = "v23_7")))] use crate::CertificateInfo; use crate::{ffi, Backend}; use glib::translate::*; #[cfg(feature = "v23_7")] #[cfg_attr(docsrs, doc(cfg(feature = "v23_7")))] #[doc(alias = "poppler_get_available_signing_certificates")] #[doc(alias = "get_available_signing_certificates")] pub fn available_signing_certificates() -> Vec { unsafe { FromGlibPtrContainer::from_glib_full(ffi::poppler_get_available_signing_certificates()) } } #[doc(alias = "poppler_get_backend")] #[doc(alias = "get_backend")] pub fn backend() -> Backend { unsafe { from_glib(ffi::poppler_get_backend()) } } #[cfg(feature = "v23_7")] #[cfg_attr(docsrs, doc(cfg(feature = "v23_7")))] #[doc(alias = "poppler_get_certificate_info_by_id")] #[doc(alias = "get_certificate_info_by_id")] pub fn certificate_info_by_id(id: &str) -> Option { unsafe { from_glib_full(ffi::poppler_get_certificate_info_by_id(id.to_glib_none().0)) } } #[cfg(feature = "v23_7")] #[cfg_attr(docsrs, doc(cfg(feature = "v23_7")))] #[doc(alias = "poppler_get_nss_dir")] #[doc(alias = "get_nss_dir")] pub fn nss_dir() -> Option { unsafe { from_glib_full(ffi::poppler_get_nss_dir()) } } #[doc(alias = "poppler_get_version")] #[doc(alias = "get_version")] pub fn version() -> Option { unsafe { from_glib_none(ffi::poppler_get_version()) } } #[cfg(feature = "v0_73")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_73")))] #[doc(alias = "poppler_named_dest_from_bytestring")] pub fn named_dest_from_bytestring(data: &[u8]) -> Option { let length = data.len() as _; unsafe { from_glib_full(ffi::poppler_named_dest_from_bytestring( data.to_glib_none().0, length, )) } } #[cfg(feature = "v0_73")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_73")))] #[doc(alias = "poppler_named_dest_to_bytestring")] pub fn named_dest_to_bytestring(name: &str) -> Vec { unsafe { let mut length = std::mem::MaybeUninit::uninit(); let ret = FromGlibContainer::from_glib_full_num( ffi::poppler_named_dest_to_bytestring(name.to_glib_none().0, length.as_mut_ptr()), length.assume_init() as _, ); ret } } #[cfg(feature = "v23_7")] #[cfg_attr(docsrs, doc(cfg(feature = "v23_7")))] #[doc(alias = "poppler_set_nss_dir")] pub fn set_nss_dir(path: &str) { unsafe { ffi::poppler_set_nss_dir(path.to_glib_none().0); } } //#[cfg(feature = "v23_7")] //#[cfg_attr(docsrs, doc(cfg(feature = "v23_7")))] //#[doc(alias = "poppler_set_nss_password_callback")] //pub fn set_nss_password_callback String>(func: P) { // unsafe { TODO: call ffi:poppler_set_nss_password_callback() } //} poppler-rs-0.25.0/src/auto/image_mapping.rs000064400000000000000000000014521046102023000167170ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::ffi; use glib::translate::*; glib::wrapper! { #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct ImageMapping(Boxed); match fn { copy => |ptr| ffi::poppler_image_mapping_copy(mut_override(ptr)), free => |ptr| ffi::poppler_image_mapping_free(ptr), type_ => || ffi::poppler_image_mapping_get_type(), } } impl ImageMapping { #[doc(alias = "poppler_image_mapping_new")] pub fn new() -> ImageMapping { unsafe { from_glib_full(ffi::poppler_image_mapping_new()) } } } impl Default for ImageMapping { fn default() -> Self { Self::new() } } poppler-rs-0.25.0/src/auto/index_iter.rs000064400000000000000000000030711046102023000162530ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, Document}; use glib::translate::*; glib::wrapper! { #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct IndexIter(Boxed); match fn { copy => |ptr| ffi::poppler_index_iter_copy(mut_override(ptr)), free => |ptr| ffi::poppler_index_iter_free(ptr), type_ => || ffi::poppler_index_iter_get_type(), } } impl IndexIter { #[doc(alias = "poppler_index_iter_new")] pub fn new(document: &Document) -> IndexIter { unsafe { from_glib_full(ffi::poppler_index_iter_new(document.to_glib_none().0)) } } //#[doc(alias = "poppler_index_iter_get_action")] //#[doc(alias = "get_action")] //pub fn action(&mut self) -> /*Ignored*/Option { // unsafe { TODO: call ffi:poppler_index_iter_get_action() } //} #[doc(alias = "poppler_index_iter_get_child")] #[doc(alias = "get_child")] #[must_use] pub fn child(&mut self) -> Option { unsafe { from_glib_full(ffi::poppler_index_iter_get_child(self.to_glib_none_mut().0)) } } #[doc(alias = "poppler_index_iter_is_open")] pub fn is_open(&mut self) -> bool { unsafe { from_glib(ffi::poppler_index_iter_is_open(self.to_glib_none_mut().0)) } } #[doc(alias = "poppler_index_iter_next")] pub fn next(&mut self) -> bool { unsafe { from_glib(ffi::poppler_index_iter_next(self.to_glib_none_mut().0)) } } } poppler-rs-0.25.0/src/auto/layer.rs000064400000000000000000000027631046102023000152440ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::ffi; use glib::translate::*; glib::wrapper! { #[doc(alias = "PopplerLayer")] pub struct Layer(Object); match fn { type_ => || ffi::poppler_layer_get_type(), } } impl Layer { #[doc(alias = "poppler_layer_get_radio_button_group_id")] #[doc(alias = "get_radio_button_group_id")] pub fn radio_button_group_id(&self) -> i32 { unsafe { ffi::poppler_layer_get_radio_button_group_id(self.to_glib_none().0) } } #[doc(alias = "poppler_layer_get_title")] #[doc(alias = "get_title")] pub fn title(&self) -> Option { unsafe { from_glib_none(ffi::poppler_layer_get_title(self.to_glib_none().0)) } } #[doc(alias = "poppler_layer_hide")] pub fn hide(&self) { unsafe { ffi::poppler_layer_hide(self.to_glib_none().0); } } #[doc(alias = "poppler_layer_is_parent")] pub fn is_parent(&self) -> bool { unsafe { from_glib(ffi::poppler_layer_is_parent(self.to_glib_none().0)) } } #[doc(alias = "poppler_layer_is_visible")] pub fn is_visible(&self) -> bool { unsafe { from_glib(ffi::poppler_layer_is_visible(self.to_glib_none().0)) } } #[doc(alias = "poppler_layer_show")] pub fn show(&self) { unsafe { ffi::poppler_layer_show(self.to_glib_none().0); } } } poppler-rs-0.25.0/src/auto/layers_iter.rs000064400000000000000000000034501046102023000164440ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, Document, Layer}; use glib::translate::*; glib::wrapper! { #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct LayersIter(Boxed); match fn { copy => |ptr| ffi::poppler_layers_iter_copy(mut_override(ptr)), free => |ptr| ffi::poppler_layers_iter_free(ptr), type_ => || ffi::poppler_layers_iter_get_type(), } } impl LayersIter { #[doc(alias = "poppler_layers_iter_new")] pub fn new(document: &Document) -> LayersIter { unsafe { from_glib_full(ffi::poppler_layers_iter_new(document.to_glib_none().0)) } } #[doc(alias = "poppler_layers_iter_get_child")] #[doc(alias = "get_child")] #[must_use] pub fn child(&mut self) -> Option { unsafe { from_glib_full(ffi::poppler_layers_iter_get_child( self.to_glib_none_mut().0, )) } } #[doc(alias = "poppler_layers_iter_get_layer")] #[doc(alias = "get_layer")] pub fn layer(&mut self) -> Option { unsafe { from_glib_full(ffi::poppler_layers_iter_get_layer( self.to_glib_none_mut().0, )) } } #[doc(alias = "poppler_layers_iter_get_title")] #[doc(alias = "get_title")] pub fn title(&mut self) -> Option { unsafe { from_glib_full(ffi::poppler_layers_iter_get_title( self.to_glib_none_mut().0, )) } } #[doc(alias = "poppler_layers_iter_next")] pub fn next(&mut self) -> bool { unsafe { from_glib(ffi::poppler_layers_iter_next(self.to_glib_none_mut().0)) } } } poppler-rs-0.25.0/src/auto/link_mapping.rs000064400000000000000000000014401046102023000165670ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::ffi; use glib::translate::*; glib::wrapper! { #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct LinkMapping(Boxed); match fn { copy => |ptr| ffi::poppler_link_mapping_copy(mut_override(ptr)), free => |ptr| ffi::poppler_link_mapping_free(ptr), type_ => || ffi::poppler_link_mapping_get_type(), } } impl LinkMapping { #[doc(alias = "poppler_link_mapping_new")] pub fn new() -> LinkMapping { unsafe { from_glib_full(ffi::poppler_link_mapping_new()) } } } impl Default for LinkMapping { fn default() -> Self { Self::new() } } poppler-rs-0.25.0/src/auto/media.rs000064400000000000000000000066201046102023000152030ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::ffi; use glib::translate::*; glib::wrapper! { #[doc(alias = "PopplerMedia")] pub struct Media(Object); match fn { type_ => || ffi::poppler_media_get_type(), } } impl Media { #[cfg(feature = "v20_4")] #[cfg_attr(docsrs, doc(cfg(feature = "v20_4")))] #[doc(alias = "poppler_media_get_auto_play")] #[doc(alias = "get_auto_play")] pub fn is_auto_play(&self) -> bool { unsafe { from_glib(ffi::poppler_media_get_auto_play(self.to_glib_none().0)) } } #[doc(alias = "poppler_media_get_filename")] #[doc(alias = "get_filename")] pub fn filename(&self) -> Option { unsafe { from_glib_none(ffi::poppler_media_get_filename(self.to_glib_none().0)) } } #[doc(alias = "poppler_media_get_mime_type")] #[doc(alias = "get_mime_type")] pub fn mime_type(&self) -> Option { unsafe { from_glib_none(ffi::poppler_media_get_mime_type(self.to_glib_none().0)) } } #[cfg(feature = "v20_4")] #[cfg_attr(docsrs, doc(cfg(feature = "v20_4")))] #[doc(alias = "poppler_media_get_repeat_count")] #[doc(alias = "get_repeat_count")] pub fn repeat_count(&self) -> f32 { unsafe { ffi::poppler_media_get_repeat_count(self.to_glib_none().0) } } #[cfg(feature = "v20_4")] #[cfg_attr(docsrs, doc(cfg(feature = "v20_4")))] #[doc(alias = "poppler_media_get_show_controls")] #[doc(alias = "get_show_controls")] pub fn shows_controls(&self) -> bool { unsafe { from_glib(ffi::poppler_media_get_show_controls(self.to_glib_none().0)) } } #[doc(alias = "poppler_media_is_embedded")] pub fn is_embedded(&self) -> bool { unsafe { from_glib(ffi::poppler_media_is_embedded(self.to_glib_none().0)) } } #[doc(alias = "poppler_media_save")] pub fn save(&self, filename: &str) -> Result<(), glib::Error> { unsafe { let mut error = std::ptr::null_mut(); let is_ok = ffi::poppler_media_save( self.to_glib_none().0, filename.to_glib_none().0, &mut error, ); debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } //#[doc(alias = "poppler_media_save_to_callback")] //pub fn save_to_callback, usize, Option<&glib::Error>) -> bool>(&self, save_func: P) -> Result<(), glib::Error> { // unsafe { TODO: call ffi:poppler_media_save_to_callback() } //} #[cfg(target_os = "linux")] #[cfg_attr(docsrs, doc(cfg(target_os = "linux")))] #[cfg(feature = "v21_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v21_12")))] #[doc(alias = "poppler_media_save_to_fd")] pub fn save_to_fd(&self, fd: i32) -> Result<(), glib::Error> { unsafe { let mut error = std::ptr::null_mut(); let is_ok = ffi::poppler_media_save_to_fd(self.to_glib_none().0, fd, &mut error); debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } } poppler-rs-0.25.0/src/auto/mod.rs000064400000000000000000000141731046102023000147050ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT mod annot; pub use self::annot::Annot; mod annot_circle; pub use self::annot_circle::AnnotCircle; mod annot_file_attachment; pub use self::annot_file_attachment::AnnotFileAttachment; mod annot_free_text; pub use self::annot_free_text::AnnotFreeText; #[cfg(feature = "v25_6")] #[cfg_attr(docsrs, doc(cfg(feature = "v25_6")))] mod annot_ink; #[cfg(feature = "v25_6")] #[cfg_attr(docsrs, doc(cfg(feature = "v25_6")))] pub use self::annot_ink::AnnotInk; mod annot_markup; pub use self::annot_markup::AnnotMarkup; mod attachment; pub use self::attachment::Attachment; mod document; pub use self::document::Document; mod font_info; pub use self::font_info::FontInfo; mod form_field; pub use self::form_field::FormField; mod layer; pub use self::layer::Layer; mod media; pub use self::media::Media; mod movie; pub use self::movie::Movie; mod ps_file; pub use self::ps_file::PSFile; mod page; pub use self::page::Page; mod structure_element; pub use self::structure_element::StructureElement; mod annot_callout_line; pub use self::annot_callout_line::AnnotCalloutLine; mod annot_mapping; pub use self::annot_mapping::AnnotMapping; #[cfg(feature = "v23_7")] #[cfg_attr(docsrs, doc(cfg(feature = "v23_7")))] mod certificate_info; #[cfg(feature = "v23_7")] #[cfg_attr(docsrs, doc(cfg(feature = "v23_7")))] pub use self::certificate_info::CertificateInfo; mod color; pub use self::color::Color; mod dest; pub use self::dest::Dest; mod fonts_iter; pub use self::fonts_iter::FontsIter; mod form_field_mapping; pub use self::form_field_mapping::FormFieldMapping; mod image_mapping; pub use self::image_mapping::ImageMapping; mod index_iter; pub use self::index_iter::IndexIter; mod layers_iter; pub use self::layers_iter::LayersIter; mod link_mapping; pub use self::link_mapping::LinkMapping; mod page_transition; pub use self::page_transition::PageTransition; #[cfg(feature = "v25_6")] #[cfg_attr(docsrs, doc(cfg(feature = "v25_6")))] mod path; #[cfg(feature = "v25_6")] #[cfg_attr(docsrs, doc(cfg(feature = "v25_6")))] pub use self::path::Path; mod point; pub use self::point::Point; mod quadrilateral; pub use self::quadrilateral::Quadrilateral; mod rectangle; pub use self::rectangle::Rectangle; #[cfg(feature = "v21_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v21_12")))] mod signature_info; #[cfg(feature = "v21_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v21_12")))] pub use self::signature_info::SignatureInfo; #[cfg(feature = "v23_7")] #[cfg_attr(docsrs, doc(cfg(feature = "v23_7")))] mod signing_data; #[cfg(feature = "v23_7")] #[cfg_attr(docsrs, doc(cfg(feature = "v23_7")))] pub use self::signing_data::SigningData; mod structure_element_iter; pub use self::structure_element_iter::StructureElementIter; mod text_attributes; pub use self::text_attributes::TextAttributes; mod text_span; pub use self::text_span::TextSpan; mod enums; pub use self::enums::ActionLayerAction; pub use self::enums::ActionMovieOperation; pub use self::enums::ActionType; #[cfg(feature = "v0_72")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_72")))] pub use self::enums::AdditionalActionType; pub use self::enums::AnnotExternalDataType; pub use self::enums::AnnotFreeTextQuadding; pub use self::enums::AnnotMarkupReplyType; pub use self::enums::AnnotTextState; pub use self::enums::AnnotType; pub use self::enums::Backend; #[cfg(feature = "v21_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v21_12")))] pub use self::enums::CertificateStatus; pub use self::enums::DestType; pub use self::enums::Error; pub use self::enums::FontType; pub use self::enums::FormButtonType; pub use self::enums::FormChoiceType; pub use self::enums::FormFieldType; pub use self::enums::FormTextType; pub use self::enums::MoviePlayMode; pub use self::enums::PDFConformance; pub use self::enums::PDFPart; pub use self::enums::PDFSubtype; pub use self::enums::PageLayout; pub use self::enums::PageMode; pub use self::enums::PageTransitionAlignment; pub use self::enums::PageTransitionDirection; pub use self::enums::PageTransitionType; #[cfg(feature = "v0_80")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_80")))] pub use self::enums::PrintDuplex; #[cfg(feature = "v0_73")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_73")))] pub use self::enums::PrintScaling; pub use self::enums::SelectionStyle; #[cfg(feature = "v21_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v21_12")))] pub use self::enums::SignatureStatus; pub use self::enums::StructureBlockAlign; pub use self::enums::StructureBorderStyle; pub use self::enums::StructureElementKind; pub use self::enums::StructureFormRole; pub use self::enums::StructureFormState; pub use self::enums::StructureGlyphOrientation; pub use self::enums::StructureInlineAlign; pub use self::enums::StructureListNumbering; pub use self::enums::StructurePlacement; pub use self::enums::StructureRubyAlign; pub use self::enums::StructureRubyPosition; pub use self::enums::StructureTableScope; pub use self::enums::StructureTextAlign; pub use self::enums::StructureTextDecoration; pub use self::enums::StructureWritingMode; mod flags; pub use self::flags::AnnotFlag; pub use self::flags::FindFlags; pub use self::flags::Permissions; #[allow(deprecated)] pub use self::flags::PrintFlags; #[cfg(feature = "v21_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v21_12")))] pub use self::flags::SignatureValidationFlags; pub use self::flags::StructureGetTextFlags; pub use self::flags::ViewerPreferences; pub(crate) mod functions; mod constants; pub use self::constants::ANNOT_TEXT_ICON_CIRCLE; pub use self::constants::ANNOT_TEXT_ICON_COMMENT; pub use self::constants::ANNOT_TEXT_ICON_CROSS; pub use self::constants::ANNOT_TEXT_ICON_HELP; pub use self::constants::ANNOT_TEXT_ICON_INSERT; pub use self::constants::ANNOT_TEXT_ICON_KEY; pub use self::constants::ANNOT_TEXT_ICON_NEW_PARAGRAPH; pub use self::constants::ANNOT_TEXT_ICON_NOTE; pub use self::constants::ANNOT_TEXT_ICON_PARAGRAPH; pub(crate) mod traits { pub use super::annot::AnnotExt; pub use super::annot_markup::AnnotMarkupExt; pub use super::attachment::AttachmentExt; } pub(crate) mod builders { pub use super::document::DocumentBuilder; } poppler-rs-0.25.0/src/auto/movie.rs000064400000000000000000000055361046102023000152500ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, MoviePlayMode}; use glib::translate::*; glib::wrapper! { #[doc(alias = "PopplerMovie")] pub struct Movie(Object); match fn { type_ => || ffi::poppler_movie_get_type(), } } impl Movie { #[cfg(feature = "v0_80")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_80")))] #[doc(alias = "poppler_movie_get_duration")] #[doc(alias = "get_duration")] pub fn duration(&self) -> u64 { unsafe { ffi::poppler_movie_get_duration(self.to_glib_none().0) } } #[doc(alias = "poppler_movie_get_filename")] #[doc(alias = "get_filename")] pub fn filename(&self) -> Option { unsafe { from_glib_none(ffi::poppler_movie_get_filename(self.to_glib_none().0)) } } #[doc(alias = "poppler_movie_get_play_mode")] #[doc(alias = "get_play_mode")] pub fn play_mode(&self) -> MoviePlayMode { unsafe { from_glib(ffi::poppler_movie_get_play_mode(self.to_glib_none().0)) } } #[cfg(feature = "v0_80")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_80")))] #[doc(alias = "poppler_movie_get_rate")] #[doc(alias = "get_rate")] pub fn rate(&self) -> f64 { unsafe { ffi::poppler_movie_get_rate(self.to_glib_none().0) } } #[cfg(feature = "v0_80")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_80")))] #[doc(alias = "poppler_movie_get_rotation_angle")] #[doc(alias = "get_rotation_angle")] pub fn rotation_angle(&self) -> libc::c_ushort { unsafe { ffi::poppler_movie_get_rotation_angle(self.to_glib_none().0) } } #[cfg(feature = "v0_80")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_80")))] #[doc(alias = "poppler_movie_get_start")] #[doc(alias = "get_start")] pub fn start(&self) -> u64 { unsafe { ffi::poppler_movie_get_start(self.to_glib_none().0) } } #[cfg(feature = "v0_80")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_80")))] #[doc(alias = "poppler_movie_get_volume")] #[doc(alias = "get_volume")] pub fn volume(&self) -> f64 { unsafe { ffi::poppler_movie_get_volume(self.to_glib_none().0) } } #[cfg(feature = "v0_80")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_80")))] #[doc(alias = "poppler_movie_is_synchronous")] pub fn is_synchronous(&self) -> bool { unsafe { from_glib(ffi::poppler_movie_is_synchronous(self.to_glib_none().0)) } } #[doc(alias = "poppler_movie_need_poster")] pub fn need_poster(&self) -> bool { unsafe { from_glib(ffi::poppler_movie_need_poster(self.to_glib_none().0)) } } #[doc(alias = "poppler_movie_show_controls")] pub fn show_controls(&self) -> bool { unsafe { from_glib(ffi::poppler_movie_show_controls(self.to_glib_none().0)) } } } poppler-rs-0.25.0/src/auto/page.rs000064400000000000000000000262641046102023000150460ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT #![allow(deprecated)] use crate::{ ffi, Annot, AnnotMapping, Color, FindFlags, FormFieldMapping, ImageMapping, LinkMapping, PSFile, PageTransition, PrintFlags, Rectangle, SelectionStyle, TextAttributes, }; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::boxed::Box as Box_; glib::wrapper! { #[doc(alias = "PopplerPage")] pub struct Page(Object); match fn { type_ => || ffi::poppler_page_get_type(), } } impl Page { #[doc(alias = "poppler_page_add_annot")] pub fn add_annot(&self, annot: &impl IsA) { unsafe { ffi::poppler_page_add_annot(self.to_glib_none().0, annot.as_ref().to_glib_none().0); } } #[doc(alias = "poppler_page_find_text")] pub fn find_text(&self, text: &str) -> Vec { unsafe { FromGlibPtrContainer::from_glib_full(ffi::poppler_page_find_text( self.to_glib_none().0, text.to_glib_none().0, )) } } #[doc(alias = "poppler_page_find_text_with_options")] pub fn find_text_with_options(&self, text: &str, options: FindFlags) -> Vec { unsafe { FromGlibPtrContainer::from_glib_full(ffi::poppler_page_find_text_with_options( self.to_glib_none().0, text.to_glib_none().0, options.into_glib(), )) } } #[doc(alias = "poppler_page_get_annot_mapping")] #[doc(alias = "get_annot_mapping")] pub fn annot_mapping(&self) -> Vec { unsafe { FromGlibPtrContainer::from_glib_full(ffi::poppler_page_get_annot_mapping( self.to_glib_none().0, )) } } #[doc(alias = "poppler_page_get_bounding_box")] pub fn get_bounding_box(&self, rect: &mut Rectangle) -> bool { unsafe { from_glib(ffi::poppler_page_get_bounding_box( self.to_glib_none().0, rect.to_glib_none_mut().0, )) } } #[doc(alias = "poppler_page_get_duration")] #[doc(alias = "get_duration")] pub fn duration(&self) -> f64 { unsafe { ffi::poppler_page_get_duration(self.to_glib_none().0) } } #[doc(alias = "poppler_page_get_form_field_mapping")] #[doc(alias = "get_form_field_mapping")] pub fn form_field_mapping(&self) -> Vec { unsafe { FromGlibPtrContainer::from_glib_full(ffi::poppler_page_get_form_field_mapping( self.to_glib_none().0, )) } } #[doc(alias = "poppler_page_get_image")] #[doc(alias = "get_image")] pub fn image(&self, image_id: i32) -> Option { unsafe { from_glib_full(ffi::poppler_page_get_image(self.to_glib_none().0, image_id)) } } #[doc(alias = "poppler_page_get_image_mapping")] #[doc(alias = "get_image_mapping")] pub fn image_mapping(&self) -> Vec { unsafe { FromGlibPtrContainer::from_glib_full(ffi::poppler_page_get_image_mapping( self.to_glib_none().0, )) } } #[doc(alias = "poppler_page_get_index")] #[doc(alias = "get_index")] pub fn index(&self) -> i32 { unsafe { ffi::poppler_page_get_index(self.to_glib_none().0) } } #[doc(alias = "poppler_page_get_label")] #[doc(alias = "get_label")] pub fn label(&self) -> Option { unsafe { from_glib_full(ffi::poppler_page_get_label(self.to_glib_none().0)) } } #[doc(alias = "poppler_page_get_link_mapping")] #[doc(alias = "get_link_mapping")] pub fn link_mapping(&self) -> Vec { unsafe { FromGlibPtrContainer::from_glib_full(ffi::poppler_page_get_link_mapping( self.to_glib_none().0, )) } } #[doc(alias = "poppler_page_get_selected_region")] #[doc(alias = "get_selected_region")] pub fn selected_region( &self, scale: f64, style: SelectionStyle, selection: &mut Rectangle, ) -> Option { unsafe { from_glib_full(ffi::poppler_page_get_selected_region( self.to_glib_none().0, scale, style.into_glib(), selection.to_glib_none_mut().0, )) } } #[doc(alias = "poppler_page_get_selected_text")] #[doc(alias = "get_selected_text")] pub fn selected_text( &self, style: SelectionStyle, selection: &mut Rectangle, ) -> Option { unsafe { from_glib_full(ffi::poppler_page_get_selected_text( self.to_glib_none().0, style.into_glib(), selection.to_glib_none_mut().0, )) } } #[doc(alias = "poppler_page_get_size")] #[doc(alias = "get_size")] pub fn size(&self) -> (f64, f64) { unsafe { let mut width = std::mem::MaybeUninit::uninit(); let mut height = std::mem::MaybeUninit::uninit(); ffi::poppler_page_get_size( self.to_glib_none().0, width.as_mut_ptr(), height.as_mut_ptr(), ); (width.assume_init(), height.assume_init()) } } #[doc(alias = "poppler_page_get_text")] #[doc(alias = "get_text")] pub fn text(&self) -> Option { unsafe { from_glib_full(ffi::poppler_page_get_text(self.to_glib_none().0)) } } #[doc(alias = "poppler_page_get_text_attributes")] #[doc(alias = "get_text_attributes")] pub fn text_attributes(&self) -> Vec { unsafe { FromGlibPtrContainer::from_glib_full(ffi::poppler_page_get_text_attributes( self.to_glib_none().0, )) } } #[doc(alias = "poppler_page_get_text_attributes_for_area")] #[doc(alias = "get_text_attributes_for_area")] pub fn text_attributes_for_area(&self, area: &mut Rectangle) -> Vec { unsafe { FromGlibPtrContainer::from_glib_full(ffi::poppler_page_get_text_attributes_for_area( self.to_glib_none().0, area.to_glib_none_mut().0, )) } } #[doc(alias = "poppler_page_get_text_for_area")] #[doc(alias = "get_text_for_area")] pub fn text_for_area(&self, area: &mut Rectangle) -> Option { unsafe { from_glib_full(ffi::poppler_page_get_text_for_area( self.to_glib_none().0, area.to_glib_none_mut().0, )) } } #[doc(alias = "poppler_page_get_thumbnail")] #[doc(alias = "get_thumbnail")] pub fn thumbnail(&self) -> Option { unsafe { from_glib_full(ffi::poppler_page_get_thumbnail(self.to_glib_none().0)) } } #[doc(alias = "poppler_page_get_thumbnail_size")] #[doc(alias = "get_thumbnail_size")] pub fn thumbnail_size(&self) -> Option<(i32, i32)> { unsafe { let mut width = std::mem::MaybeUninit::uninit(); let mut height = std::mem::MaybeUninit::uninit(); let ret = from_glib(ffi::poppler_page_get_thumbnail_size( self.to_glib_none().0, width.as_mut_ptr(), height.as_mut_ptr(), )); if ret { Some((width.assume_init(), height.assume_init())) } else { None } } } #[doc(alias = "poppler_page_get_transition")] #[doc(alias = "get_transition")] pub fn transition(&self) -> Option { unsafe { from_glib_full(ffi::poppler_page_get_transition(self.to_glib_none().0)) } } #[doc(alias = "poppler_page_remove_annot")] pub fn remove_annot(&self, annot: &impl IsA) { unsafe { ffi::poppler_page_remove_annot(self.to_glib_none().0, annot.as_ref().to_glib_none().0); } } #[doc(alias = "poppler_page_render")] pub fn render(&self, cairo: &cairo::Context) { unsafe { ffi::poppler_page_render(self.to_glib_none().0, mut_override(cairo.to_glib_none().0)); } } #[doc(alias = "poppler_page_render_for_printing")] pub fn render_for_printing(&self, cairo: &cairo::Context) { unsafe { ffi::poppler_page_render_for_printing( self.to_glib_none().0, mut_override(cairo.to_glib_none().0), ); } } #[cfg_attr(feature = "v25_2", deprecated = "Since 25.2")] #[allow(deprecated)] #[doc(alias = "poppler_page_render_for_printing_with_options")] pub fn render_for_printing_with_options(&self, cairo: &cairo::Context, options: PrintFlags) { unsafe { ffi::poppler_page_render_for_printing_with_options( self.to_glib_none().0, mut_override(cairo.to_glib_none().0), options.into_glib(), ); } } //#[cfg(feature = "v25_2")] //#[cfg_attr(docsrs, doc(cfg(feature = "v25_2")))] //#[doc(alias = "poppler_page_render_full")] //pub fn render_full(&self, cairo: &mut cairo::Context, printing: bool, flags: /*Ignored*/RenderAnnotsFlags) { // unsafe { TODO: call ffi:poppler_page_render_full() } //} #[doc(alias = "poppler_page_render_selection")] pub fn render_selection( &self, cairo: &cairo::Context, selection: &mut Rectangle, old_selection: &mut Rectangle, style: SelectionStyle, glyph_color: &mut Color, background_color: &mut Color, ) { unsafe { ffi::poppler_page_render_selection( self.to_glib_none().0, mut_override(cairo.to_glib_none().0), selection.to_glib_none_mut().0, old_selection.to_glib_none_mut().0, style.into_glib(), glyph_color.to_glib_none_mut().0, background_color.to_glib_none_mut().0, ); } } #[doc(alias = "poppler_page_render_to_ps")] pub fn render_to_ps(&self, ps_file: &PSFile) { unsafe { ffi::poppler_page_render_to_ps(self.to_glib_none().0, ps_file.to_glib_none().0); } } #[doc(alias = "label")] pub fn connect_label_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_label_trampoline( this: *mut ffi::PopplerPage, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, c"notify::label".as_ptr() as *const _, Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>( notify_label_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } poppler-rs-0.25.0/src/auto/page_transition.rs000064400000000000000000000014761046102023000173160ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::ffi; use glib::translate::*; glib::wrapper! { #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct PageTransition(Boxed); match fn { copy => |ptr| ffi::poppler_page_transition_copy(mut_override(ptr)), free => |ptr| ffi::poppler_page_transition_free(ptr), type_ => || ffi::poppler_page_transition_get_type(), } } impl PageTransition { #[doc(alias = "poppler_page_transition_new")] pub fn new() -> PageTransition { unsafe { from_glib_full(ffi::poppler_page_transition_new()) } } } impl Default for PageTransition { fn default() -> Self { Self::new() } } poppler-rs-0.25.0/src/auto/path.rs000064400000000000000000000025511046102023000150570ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, Point}; use glib::translate::*; glib::wrapper! { #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct Path(Boxed); match fn { copy => |ptr| ffi::poppler_path_copy(mut_override(ptr)), free => |ptr| ffi::poppler_path_free(ptr), type_ => || ffi::poppler_path_get_type(), } } impl Path { #[doc(alias = "poppler_path_new_from_array")] #[doc(alias = "new_from_array")] pub fn from_array(points: &Point, n_points: usize) -> Path { unsafe { from_glib_full(ffi::poppler_path_new_from_array( mut_override(points.to_glib_none().0), n_points, )) } } #[doc(alias = "poppler_path_get_points")] #[doc(alias = "get_points")] pub fn points(&self) -> Vec { unsafe { let mut n_points = std::mem::MaybeUninit::uninit(); let ret = FromGlibContainer::from_glib_none_num( ffi::poppler_path_get_points( mut_override(self.to_glib_none().0), n_points.as_mut_ptr(), ), n_points.assume_init() as _, ); ret } } } poppler-rs-0.25.0/src/auto/point.rs000064400000000000000000000012521046102023000152510ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::ffi; use glib::translate::*; glib::wrapper! { pub struct Point(BoxedInline); match fn { copy => |ptr| ffi::poppler_point_copy(mut_override(ptr)), free => |ptr| ffi::poppler_point_free(ptr), type_ => || ffi::poppler_point_get_type(), } } impl Point { #[doc(alias = "poppler_point_new")] pub fn new() -> Point { unsafe { from_glib_full(ffi::poppler_point_new()) } } } impl Default for Point { fn default() -> Self { Self::new() } } poppler-rs-0.25.0/src/auto/ps_file.rs000064400000000000000000000033311046102023000155410ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, Document}; use glib::translate::*; glib::wrapper! { #[doc(alias = "PopplerPSFile")] pub struct PSFile(Object); match fn { type_ => || ffi::poppler_ps_file_get_type(), } } impl PSFile { #[doc(alias = "poppler_ps_file_new")] pub fn new(document: &Document, filename: &str, first_page: i32, n_pages: i32) -> PSFile { unsafe { from_glib_full(ffi::poppler_ps_file_new( document.to_glib_none().0, filename.to_glib_none().0, first_page, n_pages, )) } } #[cfg(target_os = "linux")] #[cfg_attr(docsrs, doc(cfg(target_os = "linux")))] #[cfg(feature = "v21_12")] #[cfg_attr(docsrs, doc(cfg(feature = "v21_12")))] #[doc(alias = "poppler_ps_file_new_fd")] pub fn new_fd(document: &Document, fd: i32, first_page: i32, n_pages: i32) -> PSFile { unsafe { from_glib_full(ffi::poppler_ps_file_new_fd( document.to_glib_none().0, fd, first_page, n_pages, )) } } #[doc(alias = "poppler_ps_file_set_duplex")] pub fn set_duplex(&self, duplex: bool) { unsafe { ffi::poppler_ps_file_set_duplex(self.to_glib_none().0, duplex.into_glib()); } } #[doc(alias = "poppler_ps_file_set_paper_size")] pub fn set_paper_size(&self, width: f64, height: f64) { unsafe { ffi::poppler_ps_file_set_paper_size(self.to_glib_none().0, width, height); } } } poppler-rs-0.25.0/src/auto/quadrilateral.rs000064400000000000000000000013721046102023000167550ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::ffi; use glib::translate::*; glib::wrapper! { pub struct Quadrilateral(BoxedInline); match fn { copy => |ptr| ffi::poppler_quadrilateral_copy(mut_override(ptr)), free => |ptr| ffi::poppler_quadrilateral_free(ptr), type_ => || ffi::poppler_quadrilateral_get_type(), } } impl Quadrilateral { #[doc(alias = "poppler_quadrilateral_new")] pub fn new() -> Quadrilateral { unsafe { from_glib_full(ffi::poppler_quadrilateral_new()) } } } impl Default for Quadrilateral { fn default() -> Self { Self::new() } } poppler-rs-0.25.0/src/auto/rectangle.rs000064400000000000000000000026371046102023000160740ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::ffi; use glib::translate::*; glib::wrapper! { pub struct Rectangle(BoxedInline); match fn { copy => |ptr| ffi::poppler_rectangle_copy(mut_override(ptr)), free => |ptr| ffi::poppler_rectangle_free(ptr), type_ => || ffi::poppler_rectangle_get_type(), } } impl Rectangle { #[doc(alias = "poppler_rectangle_new")] pub fn new() -> Rectangle { unsafe { from_glib_full(ffi::poppler_rectangle_new()) } } #[cfg(feature = "v21_5")] #[cfg_attr(docsrs, doc(cfg(feature = "v21_5")))] #[doc(alias = "poppler_rectangle_find_get_ignored_hyphen")] pub fn find_get_ignored_hyphen(&self) -> bool { unsafe { from_glib(ffi::poppler_rectangle_find_get_ignored_hyphen( self.to_glib_none().0, )) } } #[cfg(feature = "v21_5")] #[cfg_attr(docsrs, doc(cfg(feature = "v21_5")))] #[doc(alias = "poppler_rectangle_find_get_match_continued")] pub fn find_get_match_continued(&self) -> bool { unsafe { from_glib(ffi::poppler_rectangle_find_get_match_continued( self.to_glib_none().0, )) } } } impl Default for Rectangle { fn default() -> Self { Self::new() } } poppler-rs-0.25.0/src/auto/signature_info.rs000064400000000000000000000046071046102023000171430ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT #[cfg(feature = "v23_8")] #[cfg_attr(docsrs, doc(cfg(feature = "v23_8")))] use crate::CertificateInfo; use crate::{ffi, CertificateStatus, SignatureStatus}; use glib::translate::*; glib::wrapper! { #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct SignatureInfo(Boxed); match fn { copy => |ptr| ffi::poppler_signature_info_copy(ptr), free => |ptr| ffi::poppler_signature_info_free(ptr), type_ => || ffi::poppler_signature_info_get_type(), } } impl SignatureInfo { #[cfg(feature = "v23_8")] #[cfg_attr(docsrs, doc(cfg(feature = "v23_8")))] #[doc(alias = "poppler_signature_info_get_certificate_info")] #[doc(alias = "get_certificate_info")] pub fn certificate_info(&self) -> Option { unsafe { from_glib_none(ffi::poppler_signature_info_get_certificate_info( self.to_glib_none().0, )) } } #[doc(alias = "poppler_signature_info_get_certificate_status")] #[doc(alias = "get_certificate_status")] pub fn certificate_status(&self) -> CertificateStatus { unsafe { from_glib(ffi::poppler_signature_info_get_certificate_status( self.to_glib_none().0, )) } } #[doc(alias = "poppler_signature_info_get_local_signing_time")] #[doc(alias = "get_local_signing_time")] pub fn local_signing_time(&self) -> Option { unsafe { from_glib_none(ffi::poppler_signature_info_get_local_signing_time( self.to_glib_none().0, )) } } #[doc(alias = "poppler_signature_info_get_signature_status")] #[doc(alias = "get_signature_status")] pub fn signature_status(&self) -> SignatureStatus { unsafe { from_glib(ffi::poppler_signature_info_get_signature_status( self.to_glib_none().0, )) } } #[doc(alias = "poppler_signature_info_get_signer_name")] #[doc(alias = "get_signer_name")] pub fn signer_name(&self) -> Option { unsafe { from_glib_none(ffi::poppler_signature_info_get_signer_name( self.to_glib_none().0, )) } } } poppler-rs-0.25.0/src/auto/signing_data.rs000064400000000000000000000303211046102023000165460ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, CertificateInfo, Color, Rectangle}; use glib::translate::*; glib::wrapper! { #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct SigningData(Boxed); match fn { copy => |ptr| ffi::poppler_signing_data_copy(ptr), free => |ptr| ffi::poppler_signing_data_free(ptr), type_ => || ffi::poppler_signing_data_get_type(), } } impl SigningData { #[doc(alias = "poppler_signing_data_new")] pub fn new() -> SigningData { unsafe { from_glib_full(ffi::poppler_signing_data_new()) } } #[doc(alias = "poppler_signing_data_get_background_color")] #[doc(alias = "get_background_color")] pub fn background_color(&self) -> Option { unsafe { from_glib_none(ffi::poppler_signing_data_get_background_color( self.to_glib_none().0, )) } } #[doc(alias = "poppler_signing_data_get_border_color")] #[doc(alias = "get_border_color")] pub fn border_color(&self) -> Option { unsafe { from_glib_none(ffi::poppler_signing_data_get_border_color( self.to_glib_none().0, )) } } #[doc(alias = "poppler_signing_data_get_border_width")] #[doc(alias = "get_border_width")] pub fn border_width(&self) -> f64 { unsafe { ffi::poppler_signing_data_get_border_width(self.to_glib_none().0) } } #[doc(alias = "poppler_signing_data_get_certificate_info")] #[doc(alias = "get_certificate_info")] pub fn certificate_info(&self) -> Option { unsafe { from_glib_none(ffi::poppler_signing_data_get_certificate_info( self.to_glib_none().0, )) } } #[doc(alias = "poppler_signing_data_get_destination_filename")] #[doc(alias = "get_destination_filename")] pub fn destination_filename(&self) -> Option { unsafe { from_glib_none(ffi::poppler_signing_data_get_destination_filename( self.to_glib_none().0, )) } } #[doc(alias = "poppler_signing_data_get_document_owner_password")] #[doc(alias = "get_document_owner_password")] pub fn document_owner_password(&self) -> Option { unsafe { from_glib_none(ffi::poppler_signing_data_get_document_owner_password( self.to_glib_none().0, )) } } #[doc(alias = "poppler_signing_data_get_document_user_password")] #[doc(alias = "get_document_user_password")] pub fn document_user_password(&self) -> Option { unsafe { from_glib_none(ffi::poppler_signing_data_get_document_user_password( self.to_glib_none().0, )) } } #[doc(alias = "poppler_signing_data_get_field_partial_name")] #[doc(alias = "get_field_partial_name")] pub fn field_partial_name(&self) -> Option { unsafe { from_glib_none(ffi::poppler_signing_data_get_field_partial_name( self.to_glib_none().0, )) } } #[doc(alias = "poppler_signing_data_get_font_color")] #[doc(alias = "get_font_color")] pub fn font_color(&self) -> Option { unsafe { from_glib_none(ffi::poppler_signing_data_get_font_color( self.to_glib_none().0, )) } } #[doc(alias = "poppler_signing_data_get_font_size")] #[doc(alias = "get_font_size")] pub fn font_size(&self) -> f64 { unsafe { ffi::poppler_signing_data_get_font_size(self.to_glib_none().0) } } #[doc(alias = "poppler_signing_data_get_image_path")] #[doc(alias = "get_image_path")] pub fn image_path(&self) -> Option { unsafe { from_glib_none(ffi::poppler_signing_data_get_image_path( self.to_glib_none().0, )) } } #[doc(alias = "poppler_signing_data_get_left_font_size")] #[doc(alias = "get_left_font_size")] pub fn left_font_size(&self) -> f64 { unsafe { ffi::poppler_signing_data_get_left_font_size(self.to_glib_none().0) } } #[doc(alias = "poppler_signing_data_get_location")] #[doc(alias = "get_location")] pub fn location(&self) -> Option { unsafe { from_glib_none(ffi::poppler_signing_data_get_location( self.to_glib_none().0, )) } } #[doc(alias = "poppler_signing_data_get_page")] #[doc(alias = "get_page")] pub fn page(&self) -> i32 { unsafe { ffi::poppler_signing_data_get_page(self.to_glib_none().0) } } #[doc(alias = "poppler_signing_data_get_password")] #[doc(alias = "get_password")] pub fn password(&self) -> Option { unsafe { from_glib_none(ffi::poppler_signing_data_get_password( self.to_glib_none().0, )) } } #[doc(alias = "poppler_signing_data_get_reason")] #[doc(alias = "get_reason")] pub fn reason(&self) -> Option { unsafe { from_glib_none(ffi::poppler_signing_data_get_reason(self.to_glib_none().0)) } } #[doc(alias = "poppler_signing_data_get_signature_rectangle")] #[doc(alias = "get_signature_rectangle")] pub fn signature_rectangle(&self) -> Option { unsafe { from_glib_none(ffi::poppler_signing_data_get_signature_rectangle( self.to_glib_none().0, )) } } #[doc(alias = "poppler_signing_data_get_signature_text")] #[doc(alias = "get_signature_text")] pub fn signature_text(&self) -> Option { unsafe { from_glib_none(ffi::poppler_signing_data_get_signature_text( self.to_glib_none().0, )) } } #[doc(alias = "poppler_signing_data_get_signature_text_left")] #[doc(alias = "get_signature_text_left")] pub fn signature_text_left(&self) -> Option { unsafe { from_glib_none(ffi::poppler_signing_data_get_signature_text_left( self.to_glib_none().0, )) } } #[doc(alias = "poppler_signing_data_set_background_color")] pub fn set_background_color(&mut self, background_color: &Color) { unsafe { ffi::poppler_signing_data_set_background_color( self.to_glib_none_mut().0, background_color.to_glib_none().0, ); } } #[doc(alias = "poppler_signing_data_set_border_color")] pub fn set_border_color(&mut self, border_color: &Color) { unsafe { ffi::poppler_signing_data_set_border_color( self.to_glib_none_mut().0, border_color.to_glib_none().0, ); } } #[doc(alias = "poppler_signing_data_set_border_width")] pub fn set_border_width(&mut self, border_width: f64) { unsafe { ffi::poppler_signing_data_set_border_width(self.to_glib_none_mut().0, border_width); } } #[doc(alias = "poppler_signing_data_set_certificate_info")] pub fn set_certificate_info(&mut self, certificate_info: &CertificateInfo) { unsafe { ffi::poppler_signing_data_set_certificate_info( self.to_glib_none_mut().0, certificate_info.to_glib_none().0, ); } } #[doc(alias = "poppler_signing_data_set_destination_filename")] pub fn set_destination_filename(&mut self, filename: &str) { unsafe { ffi::poppler_signing_data_set_destination_filename( self.to_glib_none_mut().0, filename.to_glib_none().0, ); } } #[doc(alias = "poppler_signing_data_set_document_owner_password")] pub fn set_document_owner_password(&mut self, document_owner_password: &str) { unsafe { ffi::poppler_signing_data_set_document_owner_password( self.to_glib_none_mut().0, document_owner_password.to_glib_none().0, ); } } #[doc(alias = "poppler_signing_data_set_document_user_password")] pub fn set_document_user_password(&mut self, document_user_password: &str) { unsafe { ffi::poppler_signing_data_set_document_user_password( self.to_glib_none_mut().0, document_user_password.to_glib_none().0, ); } } #[doc(alias = "poppler_signing_data_set_field_partial_name")] pub fn set_field_partial_name(&mut self, field_partial_name: &str) { unsafe { ffi::poppler_signing_data_set_field_partial_name( self.to_glib_none_mut().0, field_partial_name.to_glib_none().0, ); } } #[doc(alias = "poppler_signing_data_set_font_color")] pub fn set_font_color(&mut self, font_color: &Color) { unsafe { ffi::poppler_signing_data_set_font_color( self.to_glib_none_mut().0, font_color.to_glib_none().0, ); } } #[doc(alias = "poppler_signing_data_set_font_size")] pub fn set_font_size(&mut self, font_size: f64) { unsafe { ffi::poppler_signing_data_set_font_size(self.to_glib_none_mut().0, font_size); } } #[doc(alias = "poppler_signing_data_set_image_path")] pub fn set_image_path(&mut self, image_path: &str) { unsafe { ffi::poppler_signing_data_set_image_path( self.to_glib_none_mut().0, image_path.to_glib_none().0, ); } } #[doc(alias = "poppler_signing_data_set_left_font_size")] pub fn set_left_font_size(&mut self, font_size: f64) { unsafe { ffi::poppler_signing_data_set_left_font_size(self.to_glib_none_mut().0, font_size); } } #[doc(alias = "poppler_signing_data_set_location")] pub fn set_location(&mut self, location: &str) { unsafe { ffi::poppler_signing_data_set_location( self.to_glib_none_mut().0, location.to_glib_none().0, ); } } #[doc(alias = "poppler_signing_data_set_page")] pub fn set_page(&mut self, page: i32) { unsafe { ffi::poppler_signing_data_set_page(self.to_glib_none_mut().0, page); } } #[doc(alias = "poppler_signing_data_set_password")] pub fn set_password(&mut self, password: &str) { unsafe { ffi::poppler_signing_data_set_password( self.to_glib_none_mut().0, password.to_glib_none().0, ); } } #[doc(alias = "poppler_signing_data_set_reason")] pub fn set_reason(&mut self, reason: &str) { unsafe { ffi::poppler_signing_data_set_reason( self.to_glib_none_mut().0, reason.to_glib_none().0, ); } } #[doc(alias = "poppler_signing_data_set_signature_rectangle")] pub fn set_signature_rectangle(&mut self, signature_rect: &Rectangle) { unsafe { ffi::poppler_signing_data_set_signature_rectangle( self.to_glib_none_mut().0, signature_rect.to_glib_none().0, ); } } #[doc(alias = "poppler_signing_data_set_signature_text")] pub fn set_signature_text(&mut self, signature_text: &str) { unsafe { ffi::poppler_signing_data_set_signature_text( self.to_glib_none_mut().0, signature_text.to_glib_none().0, ); } } #[doc(alias = "poppler_signing_data_set_signature_text_left")] pub fn set_signature_text_left(&mut self, signature_text_left: &str) { unsafe { ffi::poppler_signing_data_set_signature_text_left( self.to_glib_none_mut().0, signature_text_left.to_glib_none().0, ); } } } #[cfg(feature = "v23_7")] #[cfg_attr(docsrs, doc(cfg(feature = "v23_7")))] impl Default for SigningData { fn default() -> Self { Self::new() } } poppler-rs-0.25.0/src/auto/structure_element.rs000064400000000000000000000441411046102023000176750ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ ffi, Color, Rectangle, StructureBlockAlign, StructureElementKind, StructureFormRole, StructureFormState, StructureGetTextFlags, StructureGlyphOrientation, StructureInlineAlign, StructureListNumbering, StructurePlacement, StructureRubyAlign, StructureRubyPosition, StructureTableScope, StructureTextAlign, StructureTextDecoration, StructureWritingMode, TextSpan, }; use glib::translate::*; glib::wrapper! { #[doc(alias = "PopplerStructureElement")] pub struct StructureElement(Object); match fn { type_ => || ffi::poppler_structure_element_get_type(), } } impl StructureElement { #[doc(alias = "poppler_structure_element_get_abbreviation")] #[doc(alias = "get_abbreviation")] pub fn abbreviation(&self) -> Option { unsafe { from_glib_full(ffi::poppler_structure_element_get_abbreviation( self.to_glib_none().0, )) } } #[doc(alias = "poppler_structure_element_get_actual_text")] #[doc(alias = "get_actual_text")] pub fn actual_text(&self) -> Option { unsafe { from_glib_full(ffi::poppler_structure_element_get_actual_text( self.to_glib_none().0, )) } } #[doc(alias = "poppler_structure_element_get_alt_text")] #[doc(alias = "get_alt_text")] pub fn alt_text(&self) -> Option { unsafe { from_glib_full(ffi::poppler_structure_element_get_alt_text( self.to_glib_none().0, )) } } #[doc(alias = "poppler_structure_element_get_background_color")] #[doc(alias = "get_background_color")] pub fn background_color(&self) -> Option { unsafe { let mut color = Color::uninitialized(); let ret = from_glib(ffi::poppler_structure_element_get_background_color( self.to_glib_none().0, color.to_glib_none_mut().0, )); if ret { Some(color) } else { None } } } #[doc(alias = "poppler_structure_element_get_baseline_shift")] #[doc(alias = "get_baseline_shift")] pub fn baseline_shift(&self) -> f64 { unsafe { ffi::poppler_structure_element_get_baseline_shift(self.to_glib_none().0) } } #[doc(alias = "poppler_structure_element_get_block_align")] #[doc(alias = "get_block_align")] pub fn block_align(&self) -> StructureBlockAlign { unsafe { from_glib(ffi::poppler_structure_element_get_block_align( self.to_glib_none().0, )) } } //#[doc(alias = "poppler_structure_element_get_border_color")] //#[doc(alias = "get_border_color")] //pub fn border_color(&self, colors: /*Unimplemented*/FixedArray TypeId { ns_id: 1, id: 23 }; 4) -> bool { // unsafe { TODO: call ffi:poppler_structure_element_get_border_color() } //} //#[doc(alias = "poppler_structure_element_get_border_style")] //#[doc(alias = "get_border_style")] //pub fn border_style(&self, border_styles: /*Unimplemented*/FixedArray TypeId { ns_id: 1, id: 103 }; 4) { // unsafe { TODO: call ffi:poppler_structure_element_get_border_style() } //} //#[doc(alias = "poppler_structure_element_get_border_thickness")] //#[doc(alias = "get_border_thickness")] //pub fn border_thickness(&self, border_thicknesses: /*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 21 }; 4) -> bool { // unsafe { TODO: call ffi:poppler_structure_element_get_border_thickness() } //} #[doc(alias = "poppler_structure_element_get_bounding_box")] #[doc(alias = "get_bounding_box")] pub fn bounding_box(&self) -> Option { unsafe { let mut bounding_box = Rectangle::uninitialized(); let ret = from_glib(ffi::poppler_structure_element_get_bounding_box( self.to_glib_none().0, bounding_box.to_glib_none_mut().0, )); if ret { Some(bounding_box) } else { None } } } #[doc(alias = "poppler_structure_element_get_color")] #[doc(alias = "get_color")] pub fn color(&self) -> Option { unsafe { let mut color = Color::uninitialized(); let ret = from_glib(ffi::poppler_structure_element_get_color( self.to_glib_none().0, color.to_glib_none_mut().0, )); if ret { Some(color) } else { None } } } #[doc(alias = "poppler_structure_element_get_column_count")] #[doc(alias = "get_column_count")] pub fn column_count(&self) -> u32 { unsafe { ffi::poppler_structure_element_get_column_count(self.to_glib_none().0) } } #[doc(alias = "poppler_structure_element_get_column_gaps")] #[doc(alias = "get_column_gaps")] pub fn column_gaps(&self) -> Vec { unsafe { let mut n_values = std::mem::MaybeUninit::uninit(); let ret = FromGlibContainer::from_glib_full_num( ffi::poppler_structure_element_get_column_gaps( self.to_glib_none().0, n_values.as_mut_ptr(), ), n_values.assume_init() as _, ); ret } } #[doc(alias = "poppler_structure_element_get_column_widths")] #[doc(alias = "get_column_widths")] pub fn column_widths(&self) -> Vec { unsafe { let mut n_values = std::mem::MaybeUninit::uninit(); let ret = FromGlibContainer::from_glib_full_num( ffi::poppler_structure_element_get_column_widths( self.to_glib_none().0, n_values.as_mut_ptr(), ), n_values.assume_init() as _, ); ret } } #[doc(alias = "poppler_structure_element_get_end_indent")] #[doc(alias = "get_end_indent")] pub fn end_indent(&self) -> f64 { unsafe { ffi::poppler_structure_element_get_end_indent(self.to_glib_none().0) } } #[doc(alias = "poppler_structure_element_get_form_description")] #[doc(alias = "get_form_description")] pub fn form_description(&self) -> Option { unsafe { from_glib_full(ffi::poppler_structure_element_get_form_description( self.to_glib_none().0, )) } } #[doc(alias = "poppler_structure_element_get_form_role")] #[doc(alias = "get_form_role")] pub fn form_role(&self) -> StructureFormRole { unsafe { from_glib(ffi::poppler_structure_element_get_form_role( self.to_glib_none().0, )) } } #[doc(alias = "poppler_structure_element_get_form_state")] #[doc(alias = "get_form_state")] pub fn form_state(&self) -> StructureFormState { unsafe { from_glib(ffi::poppler_structure_element_get_form_state( self.to_glib_none().0, )) } } #[doc(alias = "poppler_structure_element_get_glyph_orientation")] #[doc(alias = "get_glyph_orientation")] pub fn glyph_orientation(&self) -> StructureGlyphOrientation { unsafe { from_glib(ffi::poppler_structure_element_get_glyph_orientation( self.to_glib_none().0, )) } } #[doc(alias = "poppler_structure_element_get_height")] #[doc(alias = "get_height")] pub fn height(&self) -> f64 { unsafe { ffi::poppler_structure_element_get_height(self.to_glib_none().0) } } #[doc(alias = "poppler_structure_element_get_id")] #[doc(alias = "get_id")] pub fn id(&self) -> Option { unsafe { from_glib_full(ffi::poppler_structure_element_get_id(self.to_glib_none().0)) } } #[doc(alias = "poppler_structure_element_get_inline_align")] #[doc(alias = "get_inline_align")] pub fn inline_align(&self) -> StructureInlineAlign { unsafe { from_glib(ffi::poppler_structure_element_get_inline_align( self.to_glib_none().0, )) } } #[doc(alias = "poppler_structure_element_get_kind")] #[doc(alias = "get_kind")] pub fn kind(&self) -> StructureElementKind { unsafe { from_glib(ffi::poppler_structure_element_get_kind( self.to_glib_none().0, )) } } #[doc(alias = "poppler_structure_element_get_language")] #[doc(alias = "get_language")] pub fn language(&self) -> Option { unsafe { from_glib_full(ffi::poppler_structure_element_get_language( self.to_glib_none().0, )) } } #[doc(alias = "poppler_structure_element_get_line_height")] #[doc(alias = "get_line_height")] pub fn line_height(&self) -> f64 { unsafe { ffi::poppler_structure_element_get_line_height(self.to_glib_none().0) } } #[doc(alias = "poppler_structure_element_get_list_numbering")] #[doc(alias = "get_list_numbering")] pub fn list_numbering(&self) -> StructureListNumbering { unsafe { from_glib(ffi::poppler_structure_element_get_list_numbering( self.to_glib_none().0, )) } } //#[doc(alias = "poppler_structure_element_get_padding")] //#[doc(alias = "get_padding")] //pub fn padding(&self, paddings: /*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 21 }; 4) { // unsafe { TODO: call ffi:poppler_structure_element_get_padding() } //} #[doc(alias = "poppler_structure_element_get_page")] #[doc(alias = "get_page")] pub fn page(&self) -> i32 { unsafe { ffi::poppler_structure_element_get_page(self.to_glib_none().0) } } #[doc(alias = "poppler_structure_element_get_placement")] #[doc(alias = "get_placement")] pub fn placement(&self) -> StructurePlacement { unsafe { from_glib(ffi::poppler_structure_element_get_placement( self.to_glib_none().0, )) } } #[doc(alias = "poppler_structure_element_get_ruby_align")] #[doc(alias = "get_ruby_align")] pub fn ruby_align(&self) -> StructureRubyAlign { unsafe { from_glib(ffi::poppler_structure_element_get_ruby_align( self.to_glib_none().0, )) } } #[doc(alias = "poppler_structure_element_get_ruby_position")] #[doc(alias = "get_ruby_position")] pub fn ruby_position(&self) -> StructureRubyPosition { unsafe { from_glib(ffi::poppler_structure_element_get_ruby_position( self.to_glib_none().0, )) } } #[doc(alias = "poppler_structure_element_get_space_after")] #[doc(alias = "get_space_after")] pub fn space_after(&self) -> f64 { unsafe { ffi::poppler_structure_element_get_space_after(self.to_glib_none().0) } } #[doc(alias = "poppler_structure_element_get_space_before")] #[doc(alias = "get_space_before")] pub fn space_before(&self) -> f64 { unsafe { ffi::poppler_structure_element_get_space_before(self.to_glib_none().0) } } #[doc(alias = "poppler_structure_element_get_start_indent")] #[doc(alias = "get_start_indent")] pub fn start_indent(&self) -> f64 { unsafe { ffi::poppler_structure_element_get_start_indent(self.to_glib_none().0) } } //#[doc(alias = "poppler_structure_element_get_table_border_style")] //#[doc(alias = "get_table_border_style")] //pub fn table_border_style(&self, border_styles: /*Unimplemented*/FixedArray TypeId { ns_id: 1, id: 103 }; 4) { // unsafe { TODO: call ffi:poppler_structure_element_get_table_border_style() } //} #[doc(alias = "poppler_structure_element_get_table_column_span")] #[doc(alias = "get_table_column_span")] pub fn table_column_span(&self) -> u32 { unsafe { ffi::poppler_structure_element_get_table_column_span(self.to_glib_none().0) } } #[doc(alias = "poppler_structure_element_get_table_headers")] #[doc(alias = "get_table_headers")] pub fn table_headers(&self) -> Vec { unsafe { FromGlibPtrContainer::from_glib_full(ffi::poppler_structure_element_get_table_headers( self.to_glib_none().0, )) } } //#[doc(alias = "poppler_structure_element_get_table_padding")] //#[doc(alias = "get_table_padding")] //pub fn table_padding(&self, paddings: /*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 21 }; 4) { // unsafe { TODO: call ffi:poppler_structure_element_get_table_padding() } //} #[doc(alias = "poppler_structure_element_get_table_row_span")] #[doc(alias = "get_table_row_span")] pub fn table_row_span(&self) -> u32 { unsafe { ffi::poppler_structure_element_get_table_row_span(self.to_glib_none().0) } } #[doc(alias = "poppler_structure_element_get_table_scope")] #[doc(alias = "get_table_scope")] pub fn table_scope(&self) -> StructureTableScope { unsafe { from_glib(ffi::poppler_structure_element_get_table_scope( self.to_glib_none().0, )) } } #[doc(alias = "poppler_structure_element_get_table_summary")] #[doc(alias = "get_table_summary")] pub fn table_summary(&self) -> Option { unsafe { from_glib_full(ffi::poppler_structure_element_get_table_summary( self.to_glib_none().0, )) } } #[doc(alias = "poppler_structure_element_get_text")] #[doc(alias = "get_text")] pub fn text(&self, flags: StructureGetTextFlags) -> Option { unsafe { from_glib_full(ffi::poppler_structure_element_get_text( self.to_glib_none().0, flags.into_glib(), )) } } #[doc(alias = "poppler_structure_element_get_text_align")] #[doc(alias = "get_text_align")] pub fn text_align(&self) -> StructureTextAlign { unsafe { from_glib(ffi::poppler_structure_element_get_text_align( self.to_glib_none().0, )) } } #[doc(alias = "poppler_structure_element_get_text_decoration_color")] #[doc(alias = "get_text_decoration_color")] pub fn text_decoration_color(&self) -> Option { unsafe { let mut color = Color::uninitialized(); let ret = from_glib(ffi::poppler_structure_element_get_text_decoration_color( self.to_glib_none().0, color.to_glib_none_mut().0, )); if ret { Some(color) } else { None } } } #[doc(alias = "poppler_structure_element_get_text_decoration_thickness")] #[doc(alias = "get_text_decoration_thickness")] pub fn text_decoration_thickness(&self) -> f64 { unsafe { ffi::poppler_structure_element_get_text_decoration_thickness(self.to_glib_none().0) } } #[doc(alias = "poppler_structure_element_get_text_decoration_type")] #[doc(alias = "get_text_decoration_type")] pub fn text_decoration_type(&self) -> StructureTextDecoration { unsafe { from_glib(ffi::poppler_structure_element_get_text_decoration_type( self.to_glib_none().0, )) } } #[doc(alias = "poppler_structure_element_get_text_indent")] #[doc(alias = "get_text_indent")] pub fn text_indent(&self) -> f64 { unsafe { ffi::poppler_structure_element_get_text_indent(self.to_glib_none().0) } } #[doc(alias = "poppler_structure_element_get_text_spans")] #[doc(alias = "get_text_spans")] pub fn text_spans(&self) -> Vec { unsafe { let mut n_text_spans = std::mem::MaybeUninit::uninit(); let ret = FromGlibContainer::from_glib_full_num( ffi::poppler_structure_element_get_text_spans( self.to_glib_none().0, n_text_spans.as_mut_ptr(), ), n_text_spans.assume_init() as _, ); ret } } #[doc(alias = "poppler_structure_element_get_title")] #[doc(alias = "get_title")] pub fn title(&self) -> Option { unsafe { from_glib_full(ffi::poppler_structure_element_get_title( self.to_glib_none().0, )) } } #[doc(alias = "poppler_structure_element_get_width")] #[doc(alias = "get_width")] pub fn width(&self) -> f64 { unsafe { ffi::poppler_structure_element_get_width(self.to_glib_none().0) } } #[doc(alias = "poppler_structure_element_get_writing_mode")] #[doc(alias = "get_writing_mode")] pub fn writing_mode(&self) -> StructureWritingMode { unsafe { from_glib(ffi::poppler_structure_element_get_writing_mode( self.to_glib_none().0, )) } } #[doc(alias = "poppler_structure_element_is_block")] pub fn is_block(&self) -> bool { unsafe { from_glib(ffi::poppler_structure_element_is_block( self.to_glib_none().0, )) } } #[doc(alias = "poppler_structure_element_is_content")] pub fn is_content(&self) -> bool { unsafe { from_glib(ffi::poppler_structure_element_is_content( self.to_glib_none().0, )) } } #[doc(alias = "poppler_structure_element_is_grouping")] pub fn is_grouping(&self) -> bool { unsafe { from_glib(ffi::poppler_structure_element_is_grouping( self.to_glib_none().0, )) } } #[doc(alias = "poppler_structure_element_is_inline")] pub fn is_inline(&self) -> bool { unsafe { from_glib(ffi::poppler_structure_element_is_inline( self.to_glib_none().0, )) } } } poppler-rs-0.25.0/src/auto/structure_element_iter.rs000064400000000000000000000035011046102023000207130ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, Document, StructureElement}; use glib::translate::*; glib::wrapper! { #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct StructureElementIter(Boxed); match fn { copy => |ptr| ffi::poppler_structure_element_iter_copy(mut_override(ptr)), free => |ptr| ffi::poppler_structure_element_iter_free(ptr), type_ => || ffi::poppler_structure_element_iter_get_type(), } } impl StructureElementIter { #[doc(alias = "poppler_structure_element_iter_new")] pub fn new(poppler_document: &Document) -> StructureElementIter { unsafe { from_glib_full(ffi::poppler_structure_element_iter_new( poppler_document.to_glib_none().0, )) } } #[doc(alias = "poppler_structure_element_iter_get_child")] #[doc(alias = "get_child")] #[must_use] pub fn child(&mut self) -> Option { unsafe { from_glib_full(ffi::poppler_structure_element_iter_get_child( self.to_glib_none_mut().0, )) } } #[doc(alias = "poppler_structure_element_iter_get_element")] #[doc(alias = "get_element")] pub fn element(&mut self) -> Option { unsafe { from_glib_full(ffi::poppler_structure_element_iter_get_element( self.to_glib_none_mut().0, )) } } #[doc(alias = "poppler_structure_element_iter_next")] pub fn next(&mut self) -> bool { unsafe { from_glib(ffi::poppler_structure_element_iter_next( self.to_glib_none_mut().0, )) } } } poppler-rs-0.25.0/src/auto/text_attributes.rs000064400000000000000000000014761046102023000173620ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::ffi; use glib::translate::*; glib::wrapper! { #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct TextAttributes(Boxed); match fn { copy => |ptr| ffi::poppler_text_attributes_copy(mut_override(ptr)), free => |ptr| ffi::poppler_text_attributes_free(ptr), type_ => || ffi::poppler_text_attributes_get_type(), } } impl TextAttributes { #[doc(alias = "poppler_text_attributes_new")] pub fn new() -> TextAttributes { unsafe { from_glib_full(ffi::poppler_text_attributes_new()) } } } impl Default for TextAttributes { fn default() -> Self { Self::new() } } poppler-rs-0.25.0/src/auto/text_span.rs000064400000000000000000000042131046102023000161250ustar 00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ffi, Color}; use glib::translate::*; glib::wrapper! { #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct TextSpan(Boxed); match fn { copy => |ptr| ffi::poppler_text_span_copy(mut_override(ptr)), free => |ptr| ffi::poppler_text_span_free(ptr), type_ => || ffi::poppler_text_span_get_type(), } } impl TextSpan { #[doc(alias = "poppler_text_span_get_color")] #[doc(alias = "get_color")] pub fn color(&mut self) -> Color { unsafe { let mut color = Color::uninitialized(); ffi::poppler_text_span_get_color(self.to_glib_none_mut().0, color.to_glib_none_mut().0); color } } #[doc(alias = "poppler_text_span_get_font_name")] #[doc(alias = "get_font_name")] pub fn font_name(&mut self) -> Option { unsafe { from_glib_none(ffi::poppler_text_span_get_font_name( self.to_glib_none_mut().0, )) } } #[doc(alias = "poppler_text_span_get_text")] #[doc(alias = "get_text")] pub fn text(&mut self) -> Option { unsafe { from_glib_none(ffi::poppler_text_span_get_text(self.to_glib_none_mut().0)) } } #[doc(alias = "poppler_text_span_is_bold_font")] pub fn is_bold_font(&mut self) -> bool { unsafe { from_glib(ffi::poppler_text_span_is_bold_font( self.to_glib_none_mut().0, )) } } #[doc(alias = "poppler_text_span_is_fixed_width_font")] pub fn is_fixed_width_font(&mut self) -> bool { unsafe { from_glib(ffi::poppler_text_span_is_fixed_width_font( self.to_glib_none_mut().0, )) } } #[doc(alias = "poppler_text_span_is_serif_font")] pub fn is_serif_font(&mut self) -> bool { unsafe { from_glib(ffi::poppler_text_span_is_serif_font( self.to_glib_none_mut().0, )) } } } poppler-rs-0.25.0/src/auto/versions.txt000064400000000000000000000002121046102023000161560ustar 00000000000000Generated by gir (https://github.com/gtk-rs/gir @ b3d444a058cf) from from gir-files (https://github.com/gtk-rs/gir-files @ 5c1e490fe50a) poppler-rs-0.25.0/src/color.rs000064400000000000000000000013721046102023000142710ustar 00000000000000use crate::Color; use std::fmt; impl Color { pub fn red(&self) -> u16 { self.inner.red } pub fn set_red(&mut self, red: u16) { self.inner.red = red; } pub fn green(&self) -> u16 { self.inner.green } pub fn set_green(&mut self, green: u16) { self.inner.green = green; } pub fn blue(&self) -> u16 { self.inner.blue } pub fn set_blue(&mut self, blue: u16) { self.inner.blue = blue; } } impl fmt::Debug for Color { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("Color") .field("red", &self.red()) .field("green", &self.green()) .field("blue", &self.blue()) .finish() } } poppler-rs-0.25.0/src/document.rs000064400000000000000000000016601046102023000147710ustar 00000000000000use crate::Document; #[cfg(feature = "v0_80")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_80")))] use crate::{ffi, PageRange}; #[cfg(feature = "v0_80")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_80")))] use glib::translate::*; impl Document { #[cfg(feature = "v0_80")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_80")))] #[doc(alias = "poppler_document_get_print_page_ranges")] #[doc(alias = "get_print_page_ranges")] pub fn print_page_ranges(&self) -> &[PageRange] { unsafe { let mut n_ranges = std::mem::MaybeUninit::uninit(); let pages = std::slice::from_raw_parts( ffi::poppler_document_get_print_page_ranges( self.to_glib_none().0, n_ranges.as_mut_ptr(), ), n_ranges.assume_init() as usize, ); &*(pages as *const [ffi::PopplerPageRange] as *const [PageRange]) } } } poppler-rs-0.25.0/src/lib.rs000064400000000000000000000007001046102023000137130ustar 00000000000000#![cfg_attr(docsrs, feature(doc_cfg))] #[allow(unused_imports)] mod auto; pub use auto::*; pub use poppler_sys as ffi; mod color; mod document; mod movie; mod page_range; mod point; mod quadrilateral; mod rectangle; pub use page_range::PageRange; pub mod functions { pub use super::auto::functions::*; } pub mod builders { pub use super::auto::builders::*; } pub use functions::*; pub mod prelude { pub use super::auto::traits::*; } poppler-rs-0.25.0/src/movie.rs000064400000000000000000000013261046102023000142710ustar 00000000000000use crate::Movie; #[cfg(feature = "v0_89")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_89")))] use glib::translate::*; impl Movie { #[cfg(feature = "v0_89")] #[cfg_attr(docsrs, doc(cfg(feature = "v0_89")))] #[doc(alias = "poppler_movie_get_aspect")] #[doc(alias = "get_aspect")] pub fn aspect(&self) -> (i32, i32) { unsafe { let mut width = std::mem::MaybeUninit::uninit(); let mut height = std::mem::MaybeUninit::uninit(); crate::ffi::poppler_movie_get_aspect( self.to_glib_none().0, width.as_mut_ptr(), height.as_mut_ptr(), ); (width.assume_init(), height.assume_init()) } } } poppler-rs-0.25.0/src/page_range.rs000064400000000000000000000003461046102023000152430ustar 00000000000000#[repr(transparent)] pub struct PageRange(crate::ffi::PopplerPageRange); impl PageRange { pub fn start_page(&self) -> i32 { self.0.start_page } pub fn end_page(&self) -> i32 { self.0.end_page } } poppler-rs-0.25.0/src/point.rs000064400000000000000000000010171046102023000143000ustar 00000000000000use crate::Point; use std::fmt; impl Point { pub fn x(&self) -> f64 { self.inner.x } pub fn set_x(&mut self, x: f64) { self.inner.x = x; } pub fn y(&self) -> f64 { self.inner.y } pub fn set_y(&mut self, y: f64) { self.inner.y = y; } } impl fmt::Debug for Point { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("Point") .field("x", &self.x()) .field("y", &self.y()) .finish() } } poppler-rs-0.25.0/src/quadrilateral.rs000064400000000000000000000022771046102023000160120ustar 00000000000000use crate::{ffi, Point, Quadrilateral}; use std::fmt; impl Quadrilateral { pub fn p1(&self) -> &Point { unsafe { &*(&self.inner.p1 as *const ffi::PopplerPoint as *const Point) } } pub fn set_p1(&mut self, p1: Point) { self.inner.p1 = p1.inner; } pub fn p2(&self) -> &Point { unsafe { &*(&self.inner.p2 as *const ffi::PopplerPoint as *const Point) } } pub fn set_p2(&mut self, p2: Point) { self.inner.p2 = p2.inner; } pub fn p3(&self) -> &Point { unsafe { &*(&self.inner.p3 as *const ffi::PopplerPoint as *const Point) } } pub fn set_p3(&mut self, p3: Point) { self.inner.p3 = p3.inner; } pub fn p4(&self) -> &Point { unsafe { &*(&self.inner.p4 as *const ffi::PopplerPoint as *const Point) } } pub fn set_p4(&mut self, p4: Point) { self.inner.p4 = p4.inner; } } impl fmt::Debug for Quadrilateral { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("Quadrilateral") .field("p1", &self.p1()) .field("p2", &self.p2()) .field("p3", &self.p3()) .field("p4", &self.p4()) .finish() } } poppler-rs-0.25.0/src/rectangle.rs000064400000000000000000000016051046102023000151160ustar 00000000000000use crate::Rectangle; use std::fmt; impl Rectangle { pub fn x1(&self) -> f64 { self.inner.x1 } pub fn set_x1(&mut self, x1: f64) { self.inner.x1 = x1; } pub fn y1(&self) -> f64 { self.inner.y1 } pub fn set_y1(&mut self, y1: f64) { self.inner.y1 = y1; } pub fn x2(&self) -> f64 { self.inner.x2 } pub fn set_x2(&mut self, x2: f64) { self.inner.x2 = x2; } pub fn y2(&self) -> f64 { self.inner.y2 } pub fn set_y2(&mut self, y2: f64) { self.inner.y2 = y2; } } impl fmt::Debug for Rectangle { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("Rectangle") .field("x1", &self.x1()) .field("y1", &self.y1()) .field("x2", &self.x2()) .field("y2", &self.y2()) .finish() } }