pax_global_header00006660000000000000000000000064147025513540014520gustar00rootroot0000000000000052 comment=538281678636b7795171984db62b07d0489e38af rust-libhandy-0.11-0.11.1/000077500000000000000000000000001470255135400147425ustar00rootroot00000000000000rust-libhandy-0.11-0.11.1/.cargo_vcs_info.json000066400000000000000000000001461470255135400206750ustar00rootroot00000000000000{ "git": { "sha1": "6ec68308fde11b2d16fe15f8e25b561301d8b40c" }, "path_in_vcs": "libhandy" }rust-libhandy-0.11-0.11.1/Cargo.toml000066400000000000000000000031521470255135400166730ustar00rootroot00000000000000# 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" name = "libhandy" version = "0.11.1" authors = ["Julian Sparber "] exclude = [ "gir-files/*", "gir/", ] description = "Rust bindings for libhandy" documentation = "https://world.pages.gitlab.gnome.org/Rust/libhandy-rs/stable/latest/docs/libhandy/" keywords = [ "libhandy", "handy", "gtk-rs", "gnome", ] license = "LGPL-2.1-only" repository = "https://gitlab.gnome.org/World/Rust/libhandy-rs" resolver = "1" [package.metadata.docs.rs] all-features = true rustc-args = [ "--cfg", "docsrs", ] rustdoc-args = [ "--cfg", "docsrs", "--generate-link-to-definition", ] [dependencies.ffi] version = "0.11.1" package = "libhandy-sys" [dependencies.gdk] version = "0.18" [dependencies.gdk-pixbuf] version = "0.18" [dependencies.gio] version = "0.18" [dependencies.glib] version = "0.18" [dependencies.gtk] version = "0.18" features = ["v3_24"] [dependencies.libc] version = "0.2" [dependencies.pango] version = "0.18" [features] default = ["v1_0"] v1_0 = ["ffi/v1_0"] v1_2 = [ "v1_0", "ffi/v1_2", ] v1_4 = [ "v1_2", "ffi/v1_4", ] v1_6 = [ "v1_4", "ffi/v1_6", ] rust-libhandy-0.11-0.11.1/Cargo.toml.orig000066400000000000000000000027041470255135400176340ustar00rootroot00000000000000[package] name = 'libhandy' authors = ['Julian Sparber '] keywords = [ 'libhandy', 'handy', 'gtk-rs', 'gnome', ] version = '0.11.1' description = 'Rust bindings for libhandy' license = 'LGPL-2.1-only' repository = 'https://gitlab.gnome.org/World/Rust/libhandy-rs' documentation = "https://world.pages.gitlab.gnome.org/Rust/libhandy-rs/stable/latest/docs/libhandy/" exclude = [ 'gir-files/*', 'gir/', ] edition = "2021" [dependencies] libc = '0.2' gdk = { version = "0.18", branch = "0.18", git = "https://github.com/gtk-rs/gtk3-rs.git" } gdk-pixbuf = { version = "0.18", branch = "0.18", git = "https://github.com/gtk-rs/gtk-rs-core.git" } gio = { version = "0.18", branch = "0.18", git = "https://github.com/gtk-rs/gtk-rs-core.git" } glib = { version = "0.18", branch = "0.18", git = "https://github.com/gtk-rs/gtk-rs-core.git" } pango = { version = "0.18", branch = "0.18", git = "https://github.com/gtk-rs/gtk-rs-core.git" } [dependencies.gtk] version = '0.18' branch = "0.18" git = "https://github.com/gtk-rs/gtk3-rs.git" features = ['v3_24'] [dependencies.ffi] package = "libhandy-sys" version = '0.11.1' path = '../libhandy-sys' [features] default = [ "v1_0" ] v1_0 = [ "ffi/v1_0" ] v1_2 = [ "v1_0", "ffi/v1_2" ] v1_4 = [ "v1_2", "ffi/v1_4" ] v1_6 = [ "v1_4", "ffi/v1_6" ] [package.metadata.docs.rs] all-features = true rustc-args = ["--cfg", "docsrs"] rustdoc-args = ["--cfg", "docsrs", "--generate-link-to-definition"]rust-libhandy-0.11-0.11.1/Gir.toml000066400000000000000000000110671470255135400163650ustar00rootroot00000000000000[external_libraries] Gio = {min_version = "2.44"} Gtk = {min_version = "3.24"} # we already enable v3_24 feature by default [options] girs_directories = ["../", "../gir-files"] library = "Handy" version = "1" min_cfg_version = "1.0" target_path = "." work_mode = "normal" generate_safety_asserts = true deprecate_by_min_version = true # with this option enabled, versions for gir and gir-files saved only to one file to minimize noise single_version_file = true generate_builder = true use_gi_docgen = true generate = [ "Handy.CenteringPolicy", "Handy.ColorScheme", "Handy.DeckTransitionType", "Handy.EnumValueObject", "Handy.FlapFoldPolicy", "Handy.FlapTransitionType", "Handy.HeaderGroupChild", "Handy.HeaderGroupChildType", "Handy.LeafletTransitionType", "Handy.NavigationDirection", "Handy.SqueezerTransitionType", "Handy.SwipeGroup", "Handy.Swipeable", "Handy.ViewSwitcherPolicy", "Handy.Window", "Handy.WindowHandle", "Handy.ActionRow", "Handy.ApplicationWindow", "Handy.Carousel", "Handy.CarouselIndicatorDots", "Handy.CarouselIndicatorLines", "Handy.Clamp", "Handy.ComboRow", "Handy.ExpanderRow", "Handy.Flap", "Handy.HeaderGroup", "Handy.Keypad", "Handy.PreferencesGroup", "Handy.PreferencesPage", "Handy.PreferencesRow", "Handy.PreferencesWindow", "Handy.Squeezer", "Handy.StatusPage", "Handy.SwipeTracker", "Handy.TabBar", "Handy.TabPage", "Handy.TabView", "Handy.TitleBar", "Handy.ViewSwitcher", "Handy.ViewSwitcherBar", "Handy.ViewSwitcherTitle", ] manual = [ "GLib.DestroyNotify", "GLib.String", "GLib.Variant", "GObject.Object", "GObject.Value", "Gdk.Display", "Gdk.DragContext", "Gdk.Event", "Gdk.EventMask", "Gdk.Rectangle", "GdkPixbuf.Pixbuf", "Gio.ActionGroup", "Gio.ActionMap", "Gio.AsyncReadyCallback", "Gio.AsyncResult", "Gio.Cancellable", "Gio.Icon", "Gio.ListModel", "Gio.LoadableIcon", "Gio.MenuModel", "Gtk.Actionable", "Gtk.Adjustment", "Gtk.Align", "Gtk.ApplicationWindow", "Gtk.BaselinePosition", "Gtk.Bin", "Gtk.Box", "Gtk.Buildable", "Gtk.Button", "Gtk.Container", "Gtk.CornerType", "Gtk.Dialog", "Gtk.DrawingArea", "Gtk.Entry", "Gtk.EventBox", "Gtk.Grid", "Gtk.HeaderBar", "Gtk.IconSize", "Gtk.ListBoxRow", "Gtk.Orientable", "Gtk.Orientation", "Gtk.PackType", "Gtk.PolicyType", "Gtk.PositionType", "Gtk.ReliefStyle", "Gtk.ResizeMode", "Gtk.ScrolledWindow", "Gtk.SelectionData", "Gtk.ShadowType", "Gtk.Stack", "Gtk.TargetList", "Gtk.Widget", "Pango.EllipsizeMode", ] [[object]] name = "Handy.*" status = "generate" [[object.function]] name = "string_utf8_truncate" ignore = true [[object.function]] name = "string_utf8_len" ignore = true [[object]] name = "Handy.Avatar" status = "generate" [[object.function]] name = "draw_to_pixbuf_async" # gir panics if this is generated ignore = true [[object]] name = "Handy.Deck" status = "generate" [[object.child_prop]] name = "name" type = "utf8" [[object]] name = "Handy.HeaderBar" status = "generate" trait_name = "HdyHeaderBarExt" [[object]] name = "Handy.Leaflet" child_type = "Gtk.Widget" status = "generate" [[object.child_prop]] name = "icon-name" type = "utf8" [[object.child_prop]] name = "name" type = "utf8" [[object.child_prop]] name = "needs-attention" type = "gboolean" [[object.child_prop]] name = "position" type = "gint" [[object.child_prop]] name = "title" type = "utf8" [[object]] name = "Handy.SearchBar" trait_name = "HdySearchBarExt" status = "generate" [[object.function]] name = "handle_event" [[object.function.parameter]] name = "event" const = true [[object]] name = "Handy.StyleManager" status = "generate" version = "1.6" generate_builder = false [[object.function]] name = "get_system_supports_color_schemes" rename = "system_supports_color_schemes" [[object]] name = "Handy.ValueObject" status = "generate" [[object.function]] name = "dup_string" ignore = true [[object.function]] name = "copy_value" ignore = true [[object.function]] name = "new_take_string" ignore = true [[object.function]] name = "new_string" ignore = true [[object.property]] name = "value" ignore = true [[object]] name = "Gtk.Window" status = "manual" trait_name = "GtkWindowExt" rust-libhandy-0.11-0.11.1/LICENSE000066400000000000000000000635341470255135400157620ustar00rootroot00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. libhandy-rs Copyright (C) 2021 World / Rust This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! rust-libhandy-0.11-0.11.1/src/000077500000000000000000000000001470255135400155315ustar00rootroot00000000000000rust-libhandy-0.11-0.11.1/src/auto/000077500000000000000000000000001470255135400165015ustar00rootroot00000000000000rust-libhandy-0.11-0.11.1/src/auto/action_row.rs000066400000000000000000000474321470255135400212250ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT use crate::PreferencesRow; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "HdyActionRow")] pub struct ActionRow(Object) @extends PreferencesRow, gtk::ListBoxRow, gtk::Bin, gtk::Container, gtk::Widget, @implements gtk::Buildable, gtk::Actionable; match fn { type_ => || ffi::hdy_action_row_get_type(), } } impl ActionRow { pub const NONE: Option<&'static ActionRow> = None; #[doc(alias = "hdy_action_row_new")] pub fn new() -> ActionRow { assert_initialized_main_thread!(); unsafe { gtk::Widget::from_glib_none(ffi::hdy_action_row_new()).unsafe_cast() } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`ActionRow`] objects. /// /// This method returns an instance of [`ActionRowBuilder`](crate::builders::ActionRowBuilder) which can be used to create [`ActionRow`] objects. pub fn builder() -> ActionRowBuilder { ActionRowBuilder::new() } } impl Default for ActionRow { fn default() -> Self { Self::new() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`ActionRow`] 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 ActionRowBuilder { builder: glib::object::ObjectBuilder<'static, ActionRow>, } impl ActionRowBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } pub fn activatable_widget(self, activatable_widget: &impl IsA) -> Self { Self { builder: self .builder .property("activatable-widget", activatable_widget.clone().upcast()), } } pub fn icon_name(self, icon_name: impl Into) -> Self { Self { builder: self.builder.property("icon-name", icon_name.into()), } } pub fn subtitle(self, subtitle: impl Into) -> Self { Self { builder: self.builder.property("subtitle", subtitle.into()), } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn subtitle_lines(self, subtitle_lines: i32) -> Self { Self { builder: self.builder.property("subtitle-lines", subtitle_lines), } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn title_lines(self, title_lines: i32) -> Self { Self { builder: self.builder.property("title-lines", title_lines), } } pub fn use_underline(self, use_underline: bool) -> Self { Self { builder: self.builder.property("use-underline", use_underline), } } pub fn title(self, title: impl Into) -> Self { Self { builder: self.builder.property("title", title.into()), } } pub fn activatable(self, activatable: bool) -> Self { Self { builder: self.builder.property("activatable", activatable), } } pub fn selectable(self, selectable: bool) -> Self { Self { builder: self.builder.property("selectable", selectable), } } pub fn border_width(self, border_width: u32) -> Self { Self { builder: self.builder.property("border-width", border_width), } } pub fn child(self, child: &impl IsA) -> Self { Self { builder: self.builder.property("child", child.clone().upcast()), } } pub fn resize_mode(self, resize_mode: gtk::ResizeMode) -> Self { Self { builder: self.builder.property("resize-mode", resize_mode), } } pub fn app_paintable(self, app_paintable: bool) -> Self { Self { builder: self.builder.property("app-paintable", app_paintable), } } pub fn can_default(self, can_default: bool) -> Self { Self { builder: self.builder.property("can-default", can_default), } } pub fn can_focus(self, can_focus: bool) -> Self { Self { builder: self.builder.property("can-focus", can_focus), } } pub fn events(self, events: gdk::EventMask) -> Self { Self { builder: self.builder.property("events", events), } } pub fn expand(self, expand: bool) -> Self { Self { builder: self.builder.property("expand", expand), } } pub fn focus_on_click(self, focus_on_click: bool) -> Self { Self { builder: self.builder.property("focus-on-click", focus_on_click), } } pub fn halign(self, halign: gtk::Align) -> Self { Self { builder: self.builder.property("halign", halign), } } pub fn has_default(self, has_default: bool) -> Self { Self { builder: self.builder.property("has-default", has_default), } } pub fn has_focus(self, has_focus: bool) -> Self { Self { builder: self.builder.property("has-focus", has_focus), } } pub fn has_tooltip(self, has_tooltip: bool) -> Self { Self { builder: self.builder.property("has-tooltip", has_tooltip), } } pub fn height_request(self, height_request: i32) -> Self { Self { builder: self.builder.property("height-request", height_request), } } pub fn hexpand(self, hexpand: bool) -> Self { Self { builder: self.builder.property("hexpand", hexpand), } } pub fn hexpand_set(self, hexpand_set: bool) -> Self { Self { builder: self.builder.property("hexpand-set", hexpand_set), } } pub fn is_focus(self, is_focus: bool) -> Self { Self { builder: self.builder.property("is-focus", is_focus), } } pub fn margin(self, margin: i32) -> Self { Self { builder: self.builder.property("margin", margin), } } pub fn margin_bottom(self, margin_bottom: i32) -> Self { Self { builder: self.builder.property("margin-bottom", margin_bottom), } } pub fn margin_end(self, margin_end: i32) -> Self { Self { builder: self.builder.property("margin-end", margin_end), } } pub fn margin_start(self, margin_start: i32) -> Self { Self { builder: self.builder.property("margin-start", margin_start), } } pub fn margin_top(self, margin_top: i32) -> Self { Self { builder: self.builder.property("margin-top", margin_top), } } pub fn name(self, name: impl Into) -> Self { Self { builder: self.builder.property("name", name.into()), } } pub fn no_show_all(self, no_show_all: bool) -> Self { Self { builder: self.builder.property("no-show-all", no_show_all), } } pub fn opacity(self, opacity: f64) -> Self { Self { builder: self.builder.property("opacity", opacity), } } pub fn parent(self, parent: &impl IsA) -> Self { Self { builder: self.builder.property("parent", parent.clone().upcast()), } } pub fn receives_default(self, receives_default: bool) -> Self { Self { builder: self.builder.property("receives-default", receives_default), } } pub fn sensitive(self, sensitive: bool) -> Self { Self { builder: self.builder.property("sensitive", sensitive), } } //pub fn style(self, style: &impl IsA) -> Self { // Self { builder: self.builder.property("style", style.clone().upcast()), } //} pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { Self { builder: self .builder .property("tooltip-markup", tooltip_markup.into()), } } pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } } pub fn valign(self, valign: gtk::Align) -> Self { Self { builder: self.builder.property("valign", valign), } } pub fn vexpand(self, vexpand: bool) -> Self { Self { builder: self.builder.property("vexpand", vexpand), } } pub fn vexpand_set(self, vexpand_set: bool) -> Self { Self { builder: self.builder.property("vexpand-set", vexpand_set), } } pub fn visible(self, visible: bool) -> Self { Self { builder: self.builder.property("visible", visible), } } pub fn width_request(self, width_request: i32) -> Self { Self { builder: self.builder.property("width-request", width_request), } } pub fn action_name(self, action_name: impl Into) -> Self { Self { builder: self.builder.property("action-name", action_name.into()), } } pub fn action_target(self, action_target: &glib::Variant) -> Self { Self { builder: self .builder .property("action-target", action_target.clone()), } } // rustdoc-stripper-ignore-next /// Build the [`ActionRow`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> ActionRow { self.builder.build() } } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait ActionRowExt: IsA + sealed::Sealed + 'static { #[doc(alias = "hdy_action_row_activate")] fn activate(&self) { unsafe { ffi::hdy_action_row_activate(self.as_ref().to_glib_none().0); } } #[doc(alias = "hdy_action_row_add_prefix")] fn add_prefix(&self, widget: &impl IsA) { unsafe { ffi::hdy_action_row_add_prefix( self.as_ref().to_glib_none().0, widget.as_ref().to_glib_none().0, ); } } #[doc(alias = "hdy_action_row_get_activatable_widget")] #[doc(alias = "get_activatable_widget")] fn activatable_widget(&self) -> Option { unsafe { from_glib_none(ffi::hdy_action_row_get_activatable_widget( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_action_row_get_icon_name")] #[doc(alias = "get_icon_name")] fn icon_name(&self) -> Option { unsafe { from_glib_none(ffi::hdy_action_row_get_icon_name( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_action_row_get_subtitle")] #[doc(alias = "get_subtitle")] fn subtitle(&self) -> Option { unsafe { from_glib_none(ffi::hdy_action_row_get_subtitle( self.as_ref().to_glib_none().0, )) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "hdy_action_row_get_subtitle_lines")] #[doc(alias = "get_subtitle_lines")] fn subtitle_lines(&self) -> i32 { unsafe { ffi::hdy_action_row_get_subtitle_lines(self.as_ref().to_glib_none().0) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "hdy_action_row_get_title_lines")] #[doc(alias = "get_title_lines")] fn title_lines(&self) -> i32 { unsafe { ffi::hdy_action_row_get_title_lines(self.as_ref().to_glib_none().0) } } #[doc(alias = "hdy_action_row_get_use_underline")] #[doc(alias = "get_use_underline")] fn uses_underline(&self) -> bool { unsafe { from_glib(ffi::hdy_action_row_get_use_underline( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_action_row_set_activatable_widget")] fn set_activatable_widget(&self, widget: Option<&impl IsA>) { unsafe { ffi::hdy_action_row_set_activatable_widget( self.as_ref().to_glib_none().0, widget.map(|p| p.as_ref()).to_glib_none().0, ); } } #[doc(alias = "hdy_action_row_set_icon_name")] fn set_icon_name(&self, icon_name: &str) { unsafe { ffi::hdy_action_row_set_icon_name( self.as_ref().to_glib_none().0, icon_name.to_glib_none().0, ); } } #[doc(alias = "hdy_action_row_set_subtitle")] fn set_subtitle(&self, subtitle: Option<&str>) { unsafe { ffi::hdy_action_row_set_subtitle( self.as_ref().to_glib_none().0, subtitle.to_glib_none().0, ); } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "hdy_action_row_set_subtitle_lines")] fn set_subtitle_lines(&self, subtitle_lines: i32) { unsafe { ffi::hdy_action_row_set_subtitle_lines(self.as_ref().to_glib_none().0, subtitle_lines); } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "hdy_action_row_set_title_lines")] fn set_title_lines(&self, title_lines: i32) { unsafe { ffi::hdy_action_row_set_title_lines(self.as_ref().to_glib_none().0, title_lines); } } #[doc(alias = "hdy_action_row_set_use_underline")] fn set_use_underline(&self, use_underline: bool) { unsafe { ffi::hdy_action_row_set_use_underline( self.as_ref().to_glib_none().0, use_underline.into_glib(), ); } } #[doc(alias = "activated")] fn connect_activated(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn activated_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::HdyActionRow, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(ActionRow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"activated\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( activated_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "activatable-widget")] fn connect_activatable_widget_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_activatable_widget_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyActionRow, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(ActionRow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::activatable-widget\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_activatable_widget_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "icon-name")] fn connect_icon_name_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_icon_name_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::HdyActionRow, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(ActionRow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::icon-name\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_icon_name_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "subtitle")] fn connect_subtitle_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_subtitle_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::HdyActionRow, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(ActionRow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::subtitle\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_subtitle_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "subtitle-lines")] fn connect_subtitle_lines_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_subtitle_lines_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyActionRow, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(ActionRow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::subtitle-lines\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_subtitle_lines_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "title-lines")] fn connect_title_lines_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_title_lines_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyActionRow, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(ActionRow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::title-lines\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_title_lines_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl> ActionRowExt for O {} impl fmt::Display for ActionRow { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("ActionRow") } } rust-libhandy-0.11-0.11.1/src/auto/application_window.rs000066400000000000000000000321571470255135400227510ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT use glib::{prelude::*, translate::*}; use std::fmt; glib::wrapper! { #[doc(alias = "HdyApplicationWindow")] pub struct ApplicationWindow(Object) @extends gtk::ApplicationWindow, gtk::Window, gtk::Bin, gtk::Container, gtk::Widget, @implements gtk::Buildable, gio::ActionGroup, gio::ActionMap; match fn { type_ => || ffi::hdy_application_window_get_type(), } } impl ApplicationWindow { pub const NONE: Option<&'static ApplicationWindow> = None; #[doc(alias = "hdy_application_window_new")] pub fn new() -> ApplicationWindow { assert_initialized_main_thread!(); unsafe { gtk::Widget::from_glib_none(ffi::hdy_application_window_new()).unsafe_cast() } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`ApplicationWindow`] objects. /// /// This method returns an instance of [`ApplicationWindowBuilder`](crate::builders::ApplicationWindowBuilder) which can be used to create [`ApplicationWindow`] objects. pub fn builder() -> ApplicationWindowBuilder { ApplicationWindowBuilder::new() } } impl Default for ApplicationWindow { fn default() -> Self { Self::new() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`ApplicationWindow`] 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 ApplicationWindowBuilder { builder: glib::object::ObjectBuilder<'static, ApplicationWindow>, } impl ApplicationWindowBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } pub fn show_menubar(self, show_menubar: bool) -> Self { Self { builder: self.builder.property("show-menubar", show_menubar), } } pub fn accept_focus(self, accept_focus: bool) -> Self { Self { builder: self.builder.property("accept-focus", accept_focus), } } //pub fn application(self, application: &impl IsA) -> Self { // Self { builder: self.builder.property("application", application.clone().upcast()), } //} pub fn attached_to(self, attached_to: &impl IsA) -> Self { Self { builder: self .builder .property("attached-to", attached_to.clone().upcast()), } } pub fn decorated(self, decorated: bool) -> Self { Self { builder: self.builder.property("decorated", decorated), } } pub fn default_height(self, default_height: i32) -> Self { Self { builder: self.builder.property("default-height", default_height), } } pub fn default_width(self, default_width: i32) -> Self { Self { builder: self.builder.property("default-width", default_width), } } pub fn deletable(self, deletable: bool) -> Self { Self { builder: self.builder.property("deletable", deletable), } } pub fn destroy_with_parent(self, destroy_with_parent: bool) -> Self { Self { builder: self .builder .property("destroy-with-parent", destroy_with_parent), } } pub fn focus_on_map(self, focus_on_map: bool) -> Self { Self { builder: self.builder.property("focus-on-map", focus_on_map), } } pub fn focus_visible(self, focus_visible: bool) -> Self { Self { builder: self.builder.property("focus-visible", focus_visible), } } //pub fn gravity(self, gravity: /*Ignored*/gdk::Gravity) -> Self { // Self { builder: self.builder.property("gravity", gravity), } //} pub fn hide_titlebar_when_maximized(self, hide_titlebar_when_maximized: bool) -> Self { Self { builder: self .builder .property("hide-titlebar-when-maximized", hide_titlebar_when_maximized), } } pub fn icon(self, icon: &gdk_pixbuf::Pixbuf) -> Self { Self { builder: self.builder.property("icon", icon.clone()), } } pub fn icon_name(self, icon_name: impl Into) -> Self { Self { builder: self.builder.property("icon-name", icon_name.into()), } } pub fn mnemonics_visible(self, mnemonics_visible: bool) -> Self { Self { builder: self .builder .property("mnemonics-visible", mnemonics_visible), } } pub fn modal(self, modal: bool) -> Self { Self { builder: self.builder.property("modal", modal), } } pub fn resizable(self, resizable: bool) -> Self { Self { builder: self.builder.property("resizable", resizable), } } pub fn role(self, role: impl Into) -> Self { Self { builder: self.builder.property("role", role.into()), } } //pub fn screen(self, screen: /*Ignored*/&gdk::Screen) -> Self { // Self { builder: self.builder.property("screen", screen), } //} pub fn skip_pager_hint(self, skip_pager_hint: bool) -> Self { Self { builder: self.builder.property("skip-pager-hint", skip_pager_hint), } } pub fn skip_taskbar_hint(self, skip_taskbar_hint: bool) -> Self { Self { builder: self .builder .property("skip-taskbar-hint", skip_taskbar_hint), } } pub fn startup_id(self, startup_id: impl Into) -> Self { Self { builder: self.builder.property("startup-id", startup_id.into()), } } pub fn title(self, title: impl Into) -> Self { Self { builder: self.builder.property("title", title.into()), } } pub fn transient_for(self, transient_for: &impl IsA) -> Self { Self { builder: self .builder .property("transient-for", transient_for.clone().upcast()), } } //pub fn type_(self, type_: /*Ignored*/gtk::WindowType) -> Self { // Self { builder: self.builder.property("type", type_), } //} //pub fn type_hint(self, type_hint: /*Ignored*/gdk::WindowTypeHint) -> Self { // Self { builder: self.builder.property("type-hint", type_hint), } //} pub fn urgency_hint(self, urgency_hint: bool) -> Self { Self { builder: self.builder.property("urgency-hint", urgency_hint), } } //pub fn window_position(self, window_position: /*Ignored*/gtk::WindowPosition) -> Self { // Self { builder: self.builder.property("window-position", window_position), } //} pub fn border_width(self, border_width: u32) -> Self { Self { builder: self.builder.property("border-width", border_width), } } pub fn child(self, child: &impl IsA) -> Self { Self { builder: self.builder.property("child", child.clone().upcast()), } } pub fn resize_mode(self, resize_mode: gtk::ResizeMode) -> Self { Self { builder: self.builder.property("resize-mode", resize_mode), } } pub fn app_paintable(self, app_paintable: bool) -> Self { Self { builder: self.builder.property("app-paintable", app_paintable), } } pub fn can_default(self, can_default: bool) -> Self { Self { builder: self.builder.property("can-default", can_default), } } pub fn can_focus(self, can_focus: bool) -> Self { Self { builder: self.builder.property("can-focus", can_focus), } } pub fn events(self, events: gdk::EventMask) -> Self { Self { builder: self.builder.property("events", events), } } pub fn expand(self, expand: bool) -> Self { Self { builder: self.builder.property("expand", expand), } } pub fn focus_on_click(self, focus_on_click: bool) -> Self { Self { builder: self.builder.property("focus-on-click", focus_on_click), } } pub fn halign(self, halign: gtk::Align) -> Self { Self { builder: self.builder.property("halign", halign), } } pub fn has_default(self, has_default: bool) -> Self { Self { builder: self.builder.property("has-default", has_default), } } pub fn has_focus(self, has_focus: bool) -> Self { Self { builder: self.builder.property("has-focus", has_focus), } } pub fn has_tooltip(self, has_tooltip: bool) -> Self { Self { builder: self.builder.property("has-tooltip", has_tooltip), } } pub fn height_request(self, height_request: i32) -> Self { Self { builder: self.builder.property("height-request", height_request), } } pub fn hexpand(self, hexpand: bool) -> Self { Self { builder: self.builder.property("hexpand", hexpand), } } pub fn hexpand_set(self, hexpand_set: bool) -> Self { Self { builder: self.builder.property("hexpand-set", hexpand_set), } } pub fn is_focus(self, is_focus: bool) -> Self { Self { builder: self.builder.property("is-focus", is_focus), } } pub fn margin(self, margin: i32) -> Self { Self { builder: self.builder.property("margin", margin), } } pub fn margin_bottom(self, margin_bottom: i32) -> Self { Self { builder: self.builder.property("margin-bottom", margin_bottom), } } pub fn margin_end(self, margin_end: i32) -> Self { Self { builder: self.builder.property("margin-end", margin_end), } } pub fn margin_start(self, margin_start: i32) -> Self { Self { builder: self.builder.property("margin-start", margin_start), } } pub fn margin_top(self, margin_top: i32) -> Self { Self { builder: self.builder.property("margin-top", margin_top), } } pub fn name(self, name: impl Into) -> Self { Self { builder: self.builder.property("name", name.into()), } } pub fn no_show_all(self, no_show_all: bool) -> Self { Self { builder: self.builder.property("no-show-all", no_show_all), } } pub fn opacity(self, opacity: f64) -> Self { Self { builder: self.builder.property("opacity", opacity), } } pub fn parent(self, parent: &impl IsA) -> Self { Self { builder: self.builder.property("parent", parent.clone().upcast()), } } pub fn receives_default(self, receives_default: bool) -> Self { Self { builder: self.builder.property("receives-default", receives_default), } } pub fn sensitive(self, sensitive: bool) -> Self { Self { builder: self.builder.property("sensitive", sensitive), } } //pub fn style(self, style: &impl IsA) -> Self { // Self { builder: self.builder.property("style", style.clone().upcast()), } //} pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { Self { builder: self .builder .property("tooltip-markup", tooltip_markup.into()), } } pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } } pub fn valign(self, valign: gtk::Align) -> Self { Self { builder: self.builder.property("valign", valign), } } pub fn vexpand(self, vexpand: bool) -> Self { Self { builder: self.builder.property("vexpand", vexpand), } } pub fn vexpand_set(self, vexpand_set: bool) -> Self { Self { builder: self.builder.property("vexpand-set", vexpand_set), } } pub fn visible(self, visible: bool) -> Self { Self { builder: self.builder.property("visible", visible), } } pub fn width_request(self, width_request: i32) -> Self { Self { builder: self.builder.property("width-request", width_request), } } // rustdoc-stripper-ignore-next /// Build the [`ApplicationWindow`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> ApplicationWindow { self.builder.build() } } impl fmt::Display for ApplicationWindow { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("ApplicationWindow") } } rust-libhandy-0.11-0.11.1/src/auto/avatar.rs000066400000000000000000000421371470255135400203340ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT #![allow(deprecated)] use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "HdyAvatar")] pub struct Avatar(Object) @extends gtk::DrawingArea, gtk::Widget, @implements gtk::Buildable; match fn { type_ => || ffi::hdy_avatar_get_type(), } } impl Avatar { #[doc(alias = "hdy_avatar_new")] pub fn new(size: i32, text: Option<&str>, show_initials: bool) -> Avatar { assert_initialized_main_thread!(); unsafe { gtk::Widget::from_glib_none(ffi::hdy_avatar_new( size, text.to_glib_none().0, show_initials.into_glib(), )) .unsafe_cast() } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`Avatar`] objects. /// /// This method returns an instance of [`AvatarBuilder`](crate::builders::AvatarBuilder) which can be used to create [`Avatar`] objects. pub fn builder() -> AvatarBuilder { AvatarBuilder::new() } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "hdy_avatar_draw_to_pixbuf")] pub fn draw_to_pixbuf(&self, size: i32, scale_factor: i32) -> Option { unsafe { from_glib_full(ffi::hdy_avatar_draw_to_pixbuf( self.to_glib_none().0, size, scale_factor, )) } } #[doc(alias = "hdy_avatar_get_icon_name")] #[doc(alias = "get_icon_name")] pub fn icon_name(&self) -> Option { unsafe { from_glib_none(ffi::hdy_avatar_get_icon_name(self.to_glib_none().0)) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "hdy_avatar_get_loadable_icon")] #[doc(alias = "get_loadable_icon")] pub fn loadable_icon(&self) -> Option { unsafe { from_glib_none(ffi::hdy_avatar_get_loadable_icon(self.to_glib_none().0)) } } #[doc(alias = "hdy_avatar_get_show_initials")] #[doc(alias = "get_show_initials")] pub fn shows_initials(&self) -> bool { unsafe { from_glib(ffi::hdy_avatar_get_show_initials(self.to_glib_none().0)) } } #[doc(alias = "hdy_avatar_get_size")] #[doc(alias = "get_size")] pub fn size(&self) -> i32 { unsafe { ffi::hdy_avatar_get_size(self.to_glib_none().0) } } #[doc(alias = "hdy_avatar_get_text")] #[doc(alias = "get_text")] pub fn text(&self) -> Option { unsafe { from_glib_none(ffi::hdy_avatar_get_text(self.to_glib_none().0)) } } #[doc(alias = "hdy_avatar_set_icon_name")] pub fn set_icon_name(&self, icon_name: Option<&str>) { unsafe { ffi::hdy_avatar_set_icon_name(self.to_glib_none().0, icon_name.to_glib_none().0); } } #[cfg_attr(feature = "v1_2", deprecated = "Since 1.2")] #[allow(deprecated)] #[doc(alias = "hdy_avatar_set_image_load_func")] pub fn set_image_load_func( &self, load_image: Option Option + 'static>>, ) { let load_image_data: Box_< Option Option + 'static>>, > = Box_::new(load_image); unsafe extern "C" fn load_image_func( size: libc::c_int, user_data: glib::ffi::gpointer, ) -> *mut gdk_pixbuf::ffi::GdkPixbuf { let callback: &Option Option + 'static>> = &*(user_data as *mut _); if let Some(ref callback) = *callback { callback(size) } else { panic!("cannot get closure...") } .to_glib_full() } let load_image = if load_image_data.is_some() { Some(load_image_func as _) } else { None }; unsafe extern "C" fn destroy_func(data: glib::ffi::gpointer) { let _callback: Box_ Option + 'static>>> = Box_::from_raw(data as *mut _); } let destroy_call3 = Some(destroy_func as _); let super_callback0: Box_< Option Option + 'static>>, > = load_image_data; unsafe { ffi::hdy_avatar_set_image_load_func( self.to_glib_none().0, load_image, Box_::into_raw(super_callback0) as *mut _, destroy_call3, ); } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "hdy_avatar_set_loadable_icon")] pub fn set_loadable_icon(&self, icon: Option<&impl IsA>) { unsafe { ffi::hdy_avatar_set_loadable_icon( self.to_glib_none().0, icon.map(|p| p.as_ref()).to_glib_none().0, ); } } #[doc(alias = "hdy_avatar_set_show_initials")] pub fn set_show_initials(&self, show_initials: bool) { unsafe { ffi::hdy_avatar_set_show_initials(self.to_glib_none().0, show_initials.into_glib()); } } #[doc(alias = "hdy_avatar_set_size")] pub fn set_size(&self, size: i32) { unsafe { ffi::hdy_avatar_set_size(self.to_glib_none().0, size); } } #[doc(alias = "hdy_avatar_set_text")] pub fn set_text(&self, text: Option<&str>) { unsafe { ffi::hdy_avatar_set_text(self.to_glib_none().0, text.to_glib_none().0); } } #[doc(alias = "icon-name")] pub fn connect_icon_name_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_icon_name_trampoline( this: *mut ffi::HdyAvatar, _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 _, b"notify::icon-name\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_icon_name_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "loadable-icon")] pub fn connect_loadable_icon_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_loadable_icon_trampoline( this: *mut ffi::HdyAvatar, _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 _, b"notify::loadable-icon\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_loadable_icon_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "show-initials")] pub fn connect_show_initials_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_show_initials_trampoline( this: *mut ffi::HdyAvatar, _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 _, b"notify::show-initials\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_show_initials_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "size")] pub fn connect_size_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_size_trampoline( this: *mut ffi::HdyAvatar, _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 _, b"notify::size\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_size_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "text")] pub fn connect_text_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_text_trampoline( this: *mut ffi::HdyAvatar, _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 _, b"notify::text\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_text_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl Default for Avatar { fn default() -> Self { glib::object::Object::new::() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`Avatar`] 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 AvatarBuilder { builder: glib::object::ObjectBuilder<'static, Avatar>, } impl AvatarBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } pub fn icon_name(self, icon_name: impl Into) -> Self { Self { builder: self.builder.property("icon-name", icon_name.into()), } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn loadable_icon(self, loadable_icon: &impl IsA) -> Self { Self { builder: self .builder .property("loadable-icon", loadable_icon.clone().upcast()), } } pub fn show_initials(self, show_initials: bool) -> Self { Self { builder: self.builder.property("show-initials", show_initials), } } pub fn size(self, size: i32) -> Self { Self { builder: self.builder.property("size", size), } } pub fn text(self, text: impl Into) -> Self { Self { builder: self.builder.property("text", text.into()), } } pub fn app_paintable(self, app_paintable: bool) -> Self { Self { builder: self.builder.property("app-paintable", app_paintable), } } pub fn can_default(self, can_default: bool) -> Self { Self { builder: self.builder.property("can-default", can_default), } } pub fn can_focus(self, can_focus: bool) -> Self { Self { builder: self.builder.property("can-focus", can_focus), } } pub fn events(self, events: gdk::EventMask) -> Self { Self { builder: self.builder.property("events", events), } } pub fn expand(self, expand: bool) -> Self { Self { builder: self.builder.property("expand", expand), } } pub fn focus_on_click(self, focus_on_click: bool) -> Self { Self { builder: self.builder.property("focus-on-click", focus_on_click), } } pub fn halign(self, halign: gtk::Align) -> Self { Self { builder: self.builder.property("halign", halign), } } pub fn has_default(self, has_default: bool) -> Self { Self { builder: self.builder.property("has-default", has_default), } } pub fn has_focus(self, has_focus: bool) -> Self { Self { builder: self.builder.property("has-focus", has_focus), } } pub fn has_tooltip(self, has_tooltip: bool) -> Self { Self { builder: self.builder.property("has-tooltip", has_tooltip), } } pub fn height_request(self, height_request: i32) -> Self { Self { builder: self.builder.property("height-request", height_request), } } pub fn hexpand(self, hexpand: bool) -> Self { Self { builder: self.builder.property("hexpand", hexpand), } } pub fn hexpand_set(self, hexpand_set: bool) -> Self { Self { builder: self.builder.property("hexpand-set", hexpand_set), } } pub fn is_focus(self, is_focus: bool) -> Self { Self { builder: self.builder.property("is-focus", is_focus), } } pub fn margin(self, margin: i32) -> Self { Self { builder: self.builder.property("margin", margin), } } pub fn margin_bottom(self, margin_bottom: i32) -> Self { Self { builder: self.builder.property("margin-bottom", margin_bottom), } } pub fn margin_end(self, margin_end: i32) -> Self { Self { builder: self.builder.property("margin-end", margin_end), } } pub fn margin_start(self, margin_start: i32) -> Self { Self { builder: self.builder.property("margin-start", margin_start), } } pub fn margin_top(self, margin_top: i32) -> Self { Self { builder: self.builder.property("margin-top", margin_top), } } pub fn name(self, name: impl Into) -> Self { Self { builder: self.builder.property("name", name.into()), } } pub fn no_show_all(self, no_show_all: bool) -> Self { Self { builder: self.builder.property("no-show-all", no_show_all), } } pub fn opacity(self, opacity: f64) -> Self { Self { builder: self.builder.property("opacity", opacity), } } pub fn parent(self, parent: &impl IsA) -> Self { Self { builder: self.builder.property("parent", parent.clone().upcast()), } } pub fn receives_default(self, receives_default: bool) -> Self { Self { builder: self.builder.property("receives-default", receives_default), } } pub fn sensitive(self, sensitive: bool) -> Self { Self { builder: self.builder.property("sensitive", sensitive), } } //pub fn style(self, style: &impl IsA) -> Self { // Self { builder: self.builder.property("style", style.clone().upcast()), } //} pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { Self { builder: self .builder .property("tooltip-markup", tooltip_markup.into()), } } pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } } pub fn valign(self, valign: gtk::Align) -> Self { Self { builder: self.builder.property("valign", valign), } } pub fn vexpand(self, vexpand: bool) -> Self { Self { builder: self.builder.property("vexpand", vexpand), } } pub fn vexpand_set(self, vexpand_set: bool) -> Self { Self { builder: self.builder.property("vexpand-set", vexpand_set), } } pub fn visible(self, visible: bool) -> Self { Self { builder: self.builder.property("visible", visible), } } pub fn width_request(self, width_request: i32) -> Self { Self { builder: self.builder.property("width-request", width_request), } } // rustdoc-stripper-ignore-next /// Build the [`Avatar`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> Avatar { self.builder.build() } } impl fmt::Display for Avatar { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Avatar") } } rust-libhandy-0.11-0.11.1/src/auto/carousel.rs000066400000000000000000000600671470255135400206750ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT use crate::Swipeable; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "HdyCarousel")] pub struct Carousel(Object) @extends gtk::EventBox, gtk::Bin, gtk::Container, gtk::Widget, @implements gtk::Buildable, gtk::Orientable, Swipeable; match fn { type_ => || ffi::hdy_carousel_get_type(), } } impl Carousel { #[doc(alias = "hdy_carousel_new")] pub fn new() -> Carousel { assert_initialized_main_thread!(); unsafe { gtk::Widget::from_glib_none(ffi::hdy_carousel_new()).unsafe_cast() } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`Carousel`] objects. /// /// This method returns an instance of [`CarouselBuilder`](crate::builders::CarouselBuilder) which can be used to create [`Carousel`] objects. pub fn builder() -> CarouselBuilder { CarouselBuilder::new() } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "hdy_carousel_get_allow_long_swipes")] #[doc(alias = "get_allow_long_swipes")] pub fn allows_long_swipes(&self) -> bool { unsafe { from_glib(ffi::hdy_carousel_get_allow_long_swipes( self.to_glib_none().0, )) } } #[doc(alias = "hdy_carousel_get_allow_mouse_drag")] #[doc(alias = "get_allow_mouse_drag")] pub fn allows_mouse_drag(&self) -> bool { unsafe { from_glib(ffi::hdy_carousel_get_allow_mouse_drag( self.to_glib_none().0, )) } } #[cfg(feature = "v1_4")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))] #[doc(alias = "hdy_carousel_get_allow_scroll_wheel")] #[doc(alias = "get_allow_scroll_wheel")] pub fn allows_scroll_wheel(&self) -> bool { unsafe { from_glib(ffi::hdy_carousel_get_allow_scroll_wheel( self.to_glib_none().0, )) } } #[doc(alias = "hdy_carousel_get_animation_duration")] #[doc(alias = "get_animation_duration")] pub fn animation_duration(&self) -> u32 { unsafe { ffi::hdy_carousel_get_animation_duration(self.to_glib_none().0) } } #[doc(alias = "hdy_carousel_get_interactive")] #[doc(alias = "get_interactive")] pub fn is_interactive(&self) -> bool { unsafe { from_glib(ffi::hdy_carousel_get_interactive(self.to_glib_none().0)) } } #[doc(alias = "hdy_carousel_get_n_pages")] #[doc(alias = "get_n_pages")] pub fn n_pages(&self) -> u32 { unsafe { ffi::hdy_carousel_get_n_pages(self.to_glib_none().0) } } #[doc(alias = "hdy_carousel_get_position")] #[doc(alias = "get_position")] pub fn position(&self) -> f64 { unsafe { ffi::hdy_carousel_get_position(self.to_glib_none().0) } } #[doc(alias = "hdy_carousel_get_reveal_duration")] #[doc(alias = "get_reveal_duration")] pub fn reveal_duration(&self) -> u32 { unsafe { ffi::hdy_carousel_get_reveal_duration(self.to_glib_none().0) } } #[doc(alias = "hdy_carousel_get_spacing")] #[doc(alias = "get_spacing")] pub fn spacing(&self) -> u32 { unsafe { ffi::hdy_carousel_get_spacing(self.to_glib_none().0) } } #[doc(alias = "hdy_carousel_insert")] pub fn insert(&self, child: &impl IsA, position: i32) { unsafe { ffi::hdy_carousel_insert( self.to_glib_none().0, child.as_ref().to_glib_none().0, position, ); } } #[doc(alias = "hdy_carousel_prepend")] pub fn prepend(&self, child: &impl IsA) { unsafe { ffi::hdy_carousel_prepend(self.to_glib_none().0, child.as_ref().to_glib_none().0); } } #[doc(alias = "hdy_carousel_reorder")] pub fn reorder(&self, child: &impl IsA, position: i32) { unsafe { ffi::hdy_carousel_reorder( self.to_glib_none().0, child.as_ref().to_glib_none().0, position, ); } } #[doc(alias = "hdy_carousel_scroll_to")] pub fn scroll_to(&self, widget: &impl IsA) { unsafe { ffi::hdy_carousel_scroll_to(self.to_glib_none().0, widget.as_ref().to_glib_none().0); } } #[doc(alias = "hdy_carousel_scroll_to_full")] pub fn scroll_to_full(&self, widget: &impl IsA, duration: i64) { unsafe { ffi::hdy_carousel_scroll_to_full( self.to_glib_none().0, widget.as_ref().to_glib_none().0, duration, ); } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "hdy_carousel_set_allow_long_swipes")] pub fn set_allow_long_swipes(&self, allow_long_swipes: bool) { unsafe { ffi::hdy_carousel_set_allow_long_swipes( self.to_glib_none().0, allow_long_swipes.into_glib(), ); } } #[doc(alias = "hdy_carousel_set_allow_mouse_drag")] pub fn set_allow_mouse_drag(&self, allow_mouse_drag: bool) { unsafe { ffi::hdy_carousel_set_allow_mouse_drag( self.to_glib_none().0, allow_mouse_drag.into_glib(), ); } } #[cfg(feature = "v1_4")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))] #[doc(alias = "hdy_carousel_set_allow_scroll_wheel")] pub fn set_allow_scroll_wheel(&self, allow_scroll_wheel: bool) { unsafe { ffi::hdy_carousel_set_allow_scroll_wheel( self.to_glib_none().0, allow_scroll_wheel.into_glib(), ); } } #[doc(alias = "hdy_carousel_set_animation_duration")] pub fn set_animation_duration(&self, duration: u32) { unsafe { ffi::hdy_carousel_set_animation_duration(self.to_glib_none().0, duration); } } #[doc(alias = "hdy_carousel_set_interactive")] pub fn set_interactive(&self, interactive: bool) { unsafe { ffi::hdy_carousel_set_interactive(self.to_glib_none().0, interactive.into_glib()); } } #[doc(alias = "hdy_carousel_set_reveal_duration")] pub fn set_reveal_duration(&self, reveal_duration: u32) { unsafe { ffi::hdy_carousel_set_reveal_duration(self.to_glib_none().0, reveal_duration); } } #[doc(alias = "hdy_carousel_set_spacing")] pub fn set_spacing(&self, spacing: u32) { unsafe { ffi::hdy_carousel_set_spacing(self.to_glib_none().0, spacing); } } #[doc(alias = "page-changed")] pub fn connect_page_changed(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn page_changed_trampoline( this: *mut ffi::HdyCarousel, index: libc::c_uint, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this), index) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"page-changed\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( page_changed_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "allow-long-swipes")] pub fn connect_allow_long_swipes_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_allow_long_swipes_trampoline( this: *mut ffi::HdyCarousel, _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 _, b"notify::allow-long-swipes\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_allow_long_swipes_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "allow-mouse-drag")] pub fn connect_allow_mouse_drag_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_allow_mouse_drag_trampoline( this: *mut ffi::HdyCarousel, _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 _, b"notify::allow-mouse-drag\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_allow_mouse_drag_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_4")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))] #[doc(alias = "allow-scroll-wheel")] pub fn connect_allow_scroll_wheel_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_allow_scroll_wheel_trampoline( this: *mut ffi::HdyCarousel, _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 _, b"notify::allow-scroll-wheel\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_allow_scroll_wheel_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "animation-duration")] pub fn connect_animation_duration_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_animation_duration_trampoline( this: *mut ffi::HdyCarousel, _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 _, b"notify::animation-duration\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_animation_duration_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "interactive")] pub fn connect_interactive_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_interactive_trampoline( this: *mut ffi::HdyCarousel, _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 _, b"notify::interactive\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_interactive_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "n-pages")] pub fn connect_n_pages_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_n_pages_trampoline( this: *mut ffi::HdyCarousel, _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 _, b"notify::n-pages\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_n_pages_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "position")] pub fn connect_position_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_position_trampoline( this: *mut ffi::HdyCarousel, _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 _, b"notify::position\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_position_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "reveal-duration")] pub fn connect_reveal_duration_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_reveal_duration_trampoline( this: *mut ffi::HdyCarousel, _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 _, b"notify::reveal-duration\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_reveal_duration_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "spacing")] pub fn connect_spacing_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_spacing_trampoline( this: *mut ffi::HdyCarousel, _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 _, b"notify::spacing\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_spacing_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl Default for Carousel { fn default() -> Self { Self::new() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`Carousel`] 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 CarouselBuilder { builder: glib::object::ObjectBuilder<'static, Carousel>, } impl CarouselBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn allow_long_swipes(self, allow_long_swipes: bool) -> Self { Self { builder: self .builder .property("allow-long-swipes", allow_long_swipes), } } pub fn allow_mouse_drag(self, allow_mouse_drag: bool) -> Self { Self { builder: self.builder.property("allow-mouse-drag", allow_mouse_drag), } } #[cfg(feature = "v1_4")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))] pub fn allow_scroll_wheel(self, allow_scroll_wheel: bool) -> Self { Self { builder: self .builder .property("allow-scroll-wheel", allow_scroll_wheel), } } pub fn animation_duration(self, animation_duration: u32) -> Self { Self { builder: self .builder .property("animation-duration", animation_duration), } } pub fn interactive(self, interactive: bool) -> Self { Self { builder: self.builder.property("interactive", interactive), } } pub fn reveal_duration(self, reveal_duration: u32) -> Self { Self { builder: self.builder.property("reveal-duration", reveal_duration), } } pub fn spacing(self, spacing: u32) -> Self { Self { builder: self.builder.property("spacing", spacing), } } pub fn above_child(self, above_child: bool) -> Self { Self { builder: self.builder.property("above-child", above_child), } } pub fn visible_window(self, visible_window: bool) -> Self { Self { builder: self.builder.property("visible-window", visible_window), } } pub fn border_width(self, border_width: u32) -> Self { Self { builder: self.builder.property("border-width", border_width), } } pub fn child(self, child: &impl IsA) -> Self { Self { builder: self.builder.property("child", child.clone().upcast()), } } pub fn resize_mode(self, resize_mode: gtk::ResizeMode) -> Self { Self { builder: self.builder.property("resize-mode", resize_mode), } } pub fn app_paintable(self, app_paintable: bool) -> Self { Self { builder: self.builder.property("app-paintable", app_paintable), } } pub fn can_default(self, can_default: bool) -> Self { Self { builder: self.builder.property("can-default", can_default), } } pub fn can_focus(self, can_focus: bool) -> Self { Self { builder: self.builder.property("can-focus", can_focus), } } pub fn events(self, events: gdk::EventMask) -> Self { Self { builder: self.builder.property("events", events), } } pub fn expand(self, expand: bool) -> Self { Self { builder: self.builder.property("expand", expand), } } pub fn focus_on_click(self, focus_on_click: bool) -> Self { Self { builder: self.builder.property("focus-on-click", focus_on_click), } } pub fn halign(self, halign: gtk::Align) -> Self { Self { builder: self.builder.property("halign", halign), } } pub fn has_default(self, has_default: bool) -> Self { Self { builder: self.builder.property("has-default", has_default), } } pub fn has_focus(self, has_focus: bool) -> Self { Self { builder: self.builder.property("has-focus", has_focus), } } pub fn has_tooltip(self, has_tooltip: bool) -> Self { Self { builder: self.builder.property("has-tooltip", has_tooltip), } } pub fn height_request(self, height_request: i32) -> Self { Self { builder: self.builder.property("height-request", height_request), } } pub fn hexpand(self, hexpand: bool) -> Self { Self { builder: self.builder.property("hexpand", hexpand), } } pub fn hexpand_set(self, hexpand_set: bool) -> Self { Self { builder: self.builder.property("hexpand-set", hexpand_set), } } pub fn is_focus(self, is_focus: bool) -> Self { Self { builder: self.builder.property("is-focus", is_focus), } } pub fn margin(self, margin: i32) -> Self { Self { builder: self.builder.property("margin", margin), } } pub fn margin_bottom(self, margin_bottom: i32) -> Self { Self { builder: self.builder.property("margin-bottom", margin_bottom), } } pub fn margin_end(self, margin_end: i32) -> Self { Self { builder: self.builder.property("margin-end", margin_end), } } pub fn margin_start(self, margin_start: i32) -> Self { Self { builder: self.builder.property("margin-start", margin_start), } } pub fn margin_top(self, margin_top: i32) -> Self { Self { builder: self.builder.property("margin-top", margin_top), } } pub fn name(self, name: impl Into) -> Self { Self { builder: self.builder.property("name", name.into()), } } pub fn no_show_all(self, no_show_all: bool) -> Self { Self { builder: self.builder.property("no-show-all", no_show_all), } } pub fn opacity(self, opacity: f64) -> Self { Self { builder: self.builder.property("opacity", opacity), } } pub fn parent(self, parent: &impl IsA) -> Self { Self { builder: self.builder.property("parent", parent.clone().upcast()), } } pub fn receives_default(self, receives_default: bool) -> Self { Self { builder: self.builder.property("receives-default", receives_default), } } pub fn sensitive(self, sensitive: bool) -> Self { Self { builder: self.builder.property("sensitive", sensitive), } } //pub fn style(self, style: &impl IsA) -> Self { // Self { builder: self.builder.property("style", style.clone().upcast()), } //} pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { Self { builder: self .builder .property("tooltip-markup", tooltip_markup.into()), } } pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } } pub fn valign(self, valign: gtk::Align) -> Self { Self { builder: self.builder.property("valign", valign), } } pub fn vexpand(self, vexpand: bool) -> Self { Self { builder: self.builder.property("vexpand", vexpand), } } pub fn vexpand_set(self, vexpand_set: bool) -> Self { Self { builder: self.builder.property("vexpand-set", vexpand_set), } } pub fn visible(self, visible: bool) -> Self { Self { builder: self.builder.property("visible", visible), } } pub fn width_request(self, width_request: i32) -> Self { Self { builder: self.builder.property("width-request", width_request), } } pub fn orientation(self, orientation: gtk::Orientation) -> Self { Self { builder: self.builder.property("orientation", orientation), } } // rustdoc-stripper-ignore-next /// Build the [`Carousel`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> Carousel { self.builder.build() } } impl fmt::Display for Carousel { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Carousel") } } rust-libhandy-0.11-0.11.1/src/auto/carousel_indicator_dots.rs000066400000000000000000000226221470255135400237550ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT use crate::Carousel; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "HdyCarouselIndicatorDots")] pub struct CarouselIndicatorDots(Object) @extends gtk::DrawingArea, gtk::Widget, @implements gtk::Buildable, gtk::Orientable; match fn { type_ => || ffi::hdy_carousel_indicator_dots_get_type(), } } impl CarouselIndicatorDots { #[doc(alias = "hdy_carousel_indicator_dots_new")] pub fn new() -> CarouselIndicatorDots { assert_initialized_main_thread!(); unsafe { gtk::Widget::from_glib_none(ffi::hdy_carousel_indicator_dots_new()).unsafe_cast() } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`CarouselIndicatorDots`] objects. /// /// This method returns an instance of [`CarouselIndicatorDotsBuilder`](crate::builders::CarouselIndicatorDotsBuilder) which can be used to create [`CarouselIndicatorDots`] objects. pub fn builder() -> CarouselIndicatorDotsBuilder { CarouselIndicatorDotsBuilder::new() } #[doc(alias = "hdy_carousel_indicator_dots_get_carousel")] #[doc(alias = "get_carousel")] pub fn carousel(&self) -> Option { unsafe { from_glib_none(ffi::hdy_carousel_indicator_dots_get_carousel( self.to_glib_none().0, )) } } #[doc(alias = "hdy_carousel_indicator_dots_set_carousel")] pub fn set_carousel(&self, carousel: Option<&Carousel>) { unsafe { ffi::hdy_carousel_indicator_dots_set_carousel( self.to_glib_none().0, carousel.to_glib_none().0, ); } } #[doc(alias = "carousel")] pub fn connect_carousel_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_carousel_trampoline( this: *mut ffi::HdyCarouselIndicatorDots, _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 _, b"notify::carousel\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_carousel_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl Default for CarouselIndicatorDots { fn default() -> Self { Self::new() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`CarouselIndicatorDots`] 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 CarouselIndicatorDotsBuilder { builder: glib::object::ObjectBuilder<'static, CarouselIndicatorDots>, } impl CarouselIndicatorDotsBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } pub fn carousel(self, carousel: &Carousel) -> Self { Self { builder: self.builder.property("carousel", carousel.clone()), } } pub fn app_paintable(self, app_paintable: bool) -> Self { Self { builder: self.builder.property("app-paintable", app_paintable), } } pub fn can_default(self, can_default: bool) -> Self { Self { builder: self.builder.property("can-default", can_default), } } pub fn can_focus(self, can_focus: bool) -> Self { Self { builder: self.builder.property("can-focus", can_focus), } } pub fn events(self, events: gdk::EventMask) -> Self { Self { builder: self.builder.property("events", events), } } pub fn expand(self, expand: bool) -> Self { Self { builder: self.builder.property("expand", expand), } } pub fn focus_on_click(self, focus_on_click: bool) -> Self { Self { builder: self.builder.property("focus-on-click", focus_on_click), } } pub fn halign(self, halign: gtk::Align) -> Self { Self { builder: self.builder.property("halign", halign), } } pub fn has_default(self, has_default: bool) -> Self { Self { builder: self.builder.property("has-default", has_default), } } pub fn has_focus(self, has_focus: bool) -> Self { Self { builder: self.builder.property("has-focus", has_focus), } } pub fn has_tooltip(self, has_tooltip: bool) -> Self { Self { builder: self.builder.property("has-tooltip", has_tooltip), } } pub fn height_request(self, height_request: i32) -> Self { Self { builder: self.builder.property("height-request", height_request), } } pub fn hexpand(self, hexpand: bool) -> Self { Self { builder: self.builder.property("hexpand", hexpand), } } pub fn hexpand_set(self, hexpand_set: bool) -> Self { Self { builder: self.builder.property("hexpand-set", hexpand_set), } } pub fn is_focus(self, is_focus: bool) -> Self { Self { builder: self.builder.property("is-focus", is_focus), } } pub fn margin(self, margin: i32) -> Self { Self { builder: self.builder.property("margin", margin), } } pub fn margin_bottom(self, margin_bottom: i32) -> Self { Self { builder: self.builder.property("margin-bottom", margin_bottom), } } pub fn margin_end(self, margin_end: i32) -> Self { Self { builder: self.builder.property("margin-end", margin_end), } } pub fn margin_start(self, margin_start: i32) -> Self { Self { builder: self.builder.property("margin-start", margin_start), } } pub fn margin_top(self, margin_top: i32) -> Self { Self { builder: self.builder.property("margin-top", margin_top), } } pub fn name(self, name: impl Into) -> Self { Self { builder: self.builder.property("name", name.into()), } } pub fn no_show_all(self, no_show_all: bool) -> Self { Self { builder: self.builder.property("no-show-all", no_show_all), } } pub fn opacity(self, opacity: f64) -> Self { Self { builder: self.builder.property("opacity", opacity), } } pub fn parent(self, parent: &impl IsA) -> Self { Self { builder: self.builder.property("parent", parent.clone().upcast()), } } pub fn receives_default(self, receives_default: bool) -> Self { Self { builder: self.builder.property("receives-default", receives_default), } } pub fn sensitive(self, sensitive: bool) -> Self { Self { builder: self.builder.property("sensitive", sensitive), } } //pub fn style(self, style: &impl IsA) -> Self { // Self { builder: self.builder.property("style", style.clone().upcast()), } //} pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { Self { builder: self .builder .property("tooltip-markup", tooltip_markup.into()), } } pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } } pub fn valign(self, valign: gtk::Align) -> Self { Self { builder: self.builder.property("valign", valign), } } pub fn vexpand(self, vexpand: bool) -> Self { Self { builder: self.builder.property("vexpand", vexpand), } } pub fn vexpand_set(self, vexpand_set: bool) -> Self { Self { builder: self.builder.property("vexpand-set", vexpand_set), } } pub fn visible(self, visible: bool) -> Self { Self { builder: self.builder.property("visible", visible), } } pub fn width_request(self, width_request: i32) -> Self { Self { builder: self.builder.property("width-request", width_request), } } pub fn orientation(self, orientation: gtk::Orientation) -> Self { Self { builder: self.builder.property("orientation", orientation), } } // rustdoc-stripper-ignore-next /// Build the [`CarouselIndicatorDots`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> CarouselIndicatorDots { self.builder.build() } } impl fmt::Display for CarouselIndicatorDots { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("CarouselIndicatorDots") } } rust-libhandy-0.11-0.11.1/src/auto/carousel_indicator_lines.rs000066400000000000000000000227331470255135400241210ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT use crate::Carousel; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "HdyCarouselIndicatorLines")] pub struct CarouselIndicatorLines(Object) @extends gtk::DrawingArea, gtk::Widget, @implements gtk::Buildable, gtk::Orientable; match fn { type_ => || ffi::hdy_carousel_indicator_lines_get_type(), } } impl CarouselIndicatorLines { #[doc(alias = "hdy_carousel_indicator_lines_new")] pub fn new() -> CarouselIndicatorLines { assert_initialized_main_thread!(); unsafe { gtk::Widget::from_glib_none(ffi::hdy_carousel_indicator_lines_new()).unsafe_cast() } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`CarouselIndicatorLines`] objects. /// /// This method returns an instance of [`CarouselIndicatorLinesBuilder`](crate::builders::CarouselIndicatorLinesBuilder) which can be used to create [`CarouselIndicatorLines`] objects. pub fn builder() -> CarouselIndicatorLinesBuilder { CarouselIndicatorLinesBuilder::new() } #[doc(alias = "hdy_carousel_indicator_lines_get_carousel")] #[doc(alias = "get_carousel")] pub fn carousel(&self) -> Option { unsafe { from_glib_none(ffi::hdy_carousel_indicator_lines_get_carousel( self.to_glib_none().0, )) } } #[doc(alias = "hdy_carousel_indicator_lines_set_carousel")] pub fn set_carousel(&self, carousel: Option<&Carousel>) { unsafe { ffi::hdy_carousel_indicator_lines_set_carousel( self.to_glib_none().0, carousel.to_glib_none().0, ); } } #[doc(alias = "carousel")] pub fn connect_carousel_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_carousel_trampoline< F: Fn(&CarouselIndicatorLines) + 'static, >( this: *mut ffi::HdyCarouselIndicatorLines, _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 _, b"notify::carousel\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_carousel_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl Default for CarouselIndicatorLines { fn default() -> Self { Self::new() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`CarouselIndicatorLines`] 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 CarouselIndicatorLinesBuilder { builder: glib::object::ObjectBuilder<'static, CarouselIndicatorLines>, } impl CarouselIndicatorLinesBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } pub fn carousel(self, carousel: &Carousel) -> Self { Self { builder: self.builder.property("carousel", carousel.clone()), } } pub fn app_paintable(self, app_paintable: bool) -> Self { Self { builder: self.builder.property("app-paintable", app_paintable), } } pub fn can_default(self, can_default: bool) -> Self { Self { builder: self.builder.property("can-default", can_default), } } pub fn can_focus(self, can_focus: bool) -> Self { Self { builder: self.builder.property("can-focus", can_focus), } } pub fn events(self, events: gdk::EventMask) -> Self { Self { builder: self.builder.property("events", events), } } pub fn expand(self, expand: bool) -> Self { Self { builder: self.builder.property("expand", expand), } } pub fn focus_on_click(self, focus_on_click: bool) -> Self { Self { builder: self.builder.property("focus-on-click", focus_on_click), } } pub fn halign(self, halign: gtk::Align) -> Self { Self { builder: self.builder.property("halign", halign), } } pub fn has_default(self, has_default: bool) -> Self { Self { builder: self.builder.property("has-default", has_default), } } pub fn has_focus(self, has_focus: bool) -> Self { Self { builder: self.builder.property("has-focus", has_focus), } } pub fn has_tooltip(self, has_tooltip: bool) -> Self { Self { builder: self.builder.property("has-tooltip", has_tooltip), } } pub fn height_request(self, height_request: i32) -> Self { Self { builder: self.builder.property("height-request", height_request), } } pub fn hexpand(self, hexpand: bool) -> Self { Self { builder: self.builder.property("hexpand", hexpand), } } pub fn hexpand_set(self, hexpand_set: bool) -> Self { Self { builder: self.builder.property("hexpand-set", hexpand_set), } } pub fn is_focus(self, is_focus: bool) -> Self { Self { builder: self.builder.property("is-focus", is_focus), } } pub fn margin(self, margin: i32) -> Self { Self { builder: self.builder.property("margin", margin), } } pub fn margin_bottom(self, margin_bottom: i32) -> Self { Self { builder: self.builder.property("margin-bottom", margin_bottom), } } pub fn margin_end(self, margin_end: i32) -> Self { Self { builder: self.builder.property("margin-end", margin_end), } } pub fn margin_start(self, margin_start: i32) -> Self { Self { builder: self.builder.property("margin-start", margin_start), } } pub fn margin_top(self, margin_top: i32) -> Self { Self { builder: self.builder.property("margin-top", margin_top), } } pub fn name(self, name: impl Into) -> Self { Self { builder: self.builder.property("name", name.into()), } } pub fn no_show_all(self, no_show_all: bool) -> Self { Self { builder: self.builder.property("no-show-all", no_show_all), } } pub fn opacity(self, opacity: f64) -> Self { Self { builder: self.builder.property("opacity", opacity), } } pub fn parent(self, parent: &impl IsA) -> Self { Self { builder: self.builder.property("parent", parent.clone().upcast()), } } pub fn receives_default(self, receives_default: bool) -> Self { Self { builder: self.builder.property("receives-default", receives_default), } } pub fn sensitive(self, sensitive: bool) -> Self { Self { builder: self.builder.property("sensitive", sensitive), } } //pub fn style(self, style: &impl IsA) -> Self { // Self { builder: self.builder.property("style", style.clone().upcast()), } //} pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { Self { builder: self .builder .property("tooltip-markup", tooltip_markup.into()), } } pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } } pub fn valign(self, valign: gtk::Align) -> Self { Self { builder: self.builder.property("valign", valign), } } pub fn vexpand(self, vexpand: bool) -> Self { Self { builder: self.builder.property("vexpand", vexpand), } } pub fn vexpand_set(self, vexpand_set: bool) -> Self { Self { builder: self.builder.property("vexpand-set", vexpand_set), } } pub fn visible(self, visible: bool) -> Self { Self { builder: self.builder.property("visible", visible), } } pub fn width_request(self, width_request: i32) -> Self { Self { builder: self.builder.property("width-request", width_request), } } pub fn orientation(self, orientation: gtk::Orientation) -> Self { Self { builder: self.builder.property("orientation", orientation), } } // rustdoc-stripper-ignore-next /// Build the [`CarouselIndicatorLines`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> CarouselIndicatorLines { self.builder.build() } } impl fmt::Display for CarouselIndicatorLines { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("CarouselIndicatorLines") } } rust-libhandy-0.11-0.11.1/src/auto/clamp.rs000066400000000000000000000256371470255135400201600ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "HdyClamp")] pub struct Clamp(Object) @extends gtk::Bin, gtk::Container, gtk::Widget, @implements gtk::Buildable, gtk::Orientable; match fn { type_ => || ffi::hdy_clamp_get_type(), } } impl Clamp { #[doc(alias = "hdy_clamp_new")] pub fn new() -> Clamp { assert_initialized_main_thread!(); unsafe { gtk::Widget::from_glib_none(ffi::hdy_clamp_new()).unsafe_cast() } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`Clamp`] objects. /// /// This method returns an instance of [`ClampBuilder`](crate::builders::ClampBuilder) which can be used to create [`Clamp`] objects. pub fn builder() -> ClampBuilder { ClampBuilder::new() } #[doc(alias = "hdy_clamp_get_maximum_size")] #[doc(alias = "get_maximum_size")] pub fn maximum_size(&self) -> i32 { unsafe { ffi::hdy_clamp_get_maximum_size(self.to_glib_none().0) } } #[doc(alias = "hdy_clamp_get_tightening_threshold")] #[doc(alias = "get_tightening_threshold")] pub fn tightening_threshold(&self) -> i32 { unsafe { ffi::hdy_clamp_get_tightening_threshold(self.to_glib_none().0) } } #[doc(alias = "hdy_clamp_set_maximum_size")] pub fn set_maximum_size(&self, maximum_size: i32) { unsafe { ffi::hdy_clamp_set_maximum_size(self.to_glib_none().0, maximum_size); } } #[doc(alias = "hdy_clamp_set_tightening_threshold")] pub fn set_tightening_threshold(&self, tightening_threshold: i32) { unsafe { ffi::hdy_clamp_set_tightening_threshold(self.to_glib_none().0, tightening_threshold); } } #[doc(alias = "maximum-size")] pub fn connect_maximum_size_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_maximum_size_trampoline( this: *mut ffi::HdyClamp, _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 _, b"notify::maximum-size\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_maximum_size_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "tightening-threshold")] pub fn connect_tightening_threshold_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_tightening_threshold_trampoline( this: *mut ffi::HdyClamp, _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 _, b"notify::tightening-threshold\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_tightening_threshold_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl Default for Clamp { fn default() -> Self { Self::new() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`Clamp`] 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 ClampBuilder { builder: glib::object::ObjectBuilder<'static, Clamp>, } impl ClampBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } pub fn maximum_size(self, maximum_size: i32) -> Self { Self { builder: self.builder.property("maximum-size", maximum_size), } } pub fn tightening_threshold(self, tightening_threshold: i32) -> Self { Self { builder: self .builder .property("tightening-threshold", tightening_threshold), } } pub fn border_width(self, border_width: u32) -> Self { Self { builder: self.builder.property("border-width", border_width), } } pub fn child(self, child: &impl IsA) -> Self { Self { builder: self.builder.property("child", child.clone().upcast()), } } pub fn resize_mode(self, resize_mode: gtk::ResizeMode) -> Self { Self { builder: self.builder.property("resize-mode", resize_mode), } } pub fn app_paintable(self, app_paintable: bool) -> Self { Self { builder: self.builder.property("app-paintable", app_paintable), } } pub fn can_default(self, can_default: bool) -> Self { Self { builder: self.builder.property("can-default", can_default), } } pub fn can_focus(self, can_focus: bool) -> Self { Self { builder: self.builder.property("can-focus", can_focus), } } pub fn events(self, events: gdk::EventMask) -> Self { Self { builder: self.builder.property("events", events), } } pub fn expand(self, expand: bool) -> Self { Self { builder: self.builder.property("expand", expand), } } pub fn focus_on_click(self, focus_on_click: bool) -> Self { Self { builder: self.builder.property("focus-on-click", focus_on_click), } } pub fn halign(self, halign: gtk::Align) -> Self { Self { builder: self.builder.property("halign", halign), } } pub fn has_default(self, has_default: bool) -> Self { Self { builder: self.builder.property("has-default", has_default), } } pub fn has_focus(self, has_focus: bool) -> Self { Self { builder: self.builder.property("has-focus", has_focus), } } pub fn has_tooltip(self, has_tooltip: bool) -> Self { Self { builder: self.builder.property("has-tooltip", has_tooltip), } } pub fn height_request(self, height_request: i32) -> Self { Self { builder: self.builder.property("height-request", height_request), } } pub fn hexpand(self, hexpand: bool) -> Self { Self { builder: self.builder.property("hexpand", hexpand), } } pub fn hexpand_set(self, hexpand_set: bool) -> Self { Self { builder: self.builder.property("hexpand-set", hexpand_set), } } pub fn is_focus(self, is_focus: bool) -> Self { Self { builder: self.builder.property("is-focus", is_focus), } } pub fn margin(self, margin: i32) -> Self { Self { builder: self.builder.property("margin", margin), } } pub fn margin_bottom(self, margin_bottom: i32) -> Self { Self { builder: self.builder.property("margin-bottom", margin_bottom), } } pub fn margin_end(self, margin_end: i32) -> Self { Self { builder: self.builder.property("margin-end", margin_end), } } pub fn margin_start(self, margin_start: i32) -> Self { Self { builder: self.builder.property("margin-start", margin_start), } } pub fn margin_top(self, margin_top: i32) -> Self { Self { builder: self.builder.property("margin-top", margin_top), } } pub fn name(self, name: impl Into) -> Self { Self { builder: self.builder.property("name", name.into()), } } pub fn no_show_all(self, no_show_all: bool) -> Self { Self { builder: self.builder.property("no-show-all", no_show_all), } } pub fn opacity(self, opacity: f64) -> Self { Self { builder: self.builder.property("opacity", opacity), } } pub fn parent(self, parent: &impl IsA) -> Self { Self { builder: self.builder.property("parent", parent.clone().upcast()), } } pub fn receives_default(self, receives_default: bool) -> Self { Self { builder: self.builder.property("receives-default", receives_default), } } pub fn sensitive(self, sensitive: bool) -> Self { Self { builder: self.builder.property("sensitive", sensitive), } } //pub fn style(self, style: &impl IsA) -> Self { // Self { builder: self.builder.property("style", style.clone().upcast()), } //} pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { Self { builder: self .builder .property("tooltip-markup", tooltip_markup.into()), } } pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } } pub fn valign(self, valign: gtk::Align) -> Self { Self { builder: self.builder.property("valign", valign), } } pub fn vexpand(self, vexpand: bool) -> Self { Self { builder: self.builder.property("vexpand", vexpand), } } pub fn vexpand_set(self, vexpand_set: bool) -> Self { Self { builder: self.builder.property("vexpand-set", vexpand_set), } } pub fn visible(self, visible: bool) -> Self { Self { builder: self.builder.property("visible", visible), } } pub fn width_request(self, width_request: i32) -> Self { Self { builder: self.builder.property("width-request", width_request), } } pub fn orientation(self, orientation: gtk::Orientation) -> Self { Self { builder: self.builder.property("orientation", orientation), } } // rustdoc-stripper-ignore-next /// Build the [`Clamp`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> Clamp { self.builder.build() } } impl fmt::Display for Clamp { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Clamp") } } rust-libhandy-0.11-0.11.1/src/auto/combo_row.rs000066400000000000000000000463561470255135400210530ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT use crate::{ActionRow, EnumValueObject, PreferencesRow}; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "HdyComboRow")] pub struct ComboRow(Object) @extends ActionRow, PreferencesRow, gtk::ListBoxRow, gtk::Bin, gtk::Container, gtk::Widget, @implements gtk::Buildable, gtk::Actionable; match fn { type_ => || ffi::hdy_combo_row_get_type(), } } impl ComboRow { pub const NONE: Option<&'static ComboRow> = None; #[doc(alias = "hdy_combo_row_new")] pub fn new() -> ComboRow { assert_initialized_main_thread!(); unsafe { gtk::Widget::from_glib_none(ffi::hdy_combo_row_new()).unsafe_cast() } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`ComboRow`] objects. /// /// This method returns an instance of [`ComboRowBuilder`](crate::builders::ComboRowBuilder) which can be used to create [`ComboRow`] objects. pub fn builder() -> ComboRowBuilder { ComboRowBuilder::new() } } impl Default for ComboRow { fn default() -> Self { Self::new() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`ComboRow`] 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 ComboRowBuilder { builder: glib::object::ObjectBuilder<'static, ComboRow>, } impl ComboRowBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } pub fn selected_index(self, selected_index: i32) -> Self { Self { builder: self.builder.property("selected-index", selected_index), } } pub fn use_subtitle(self, use_subtitle: bool) -> Self { Self { builder: self.builder.property("use-subtitle", use_subtitle), } } pub fn activatable_widget(self, activatable_widget: &impl IsA) -> Self { Self { builder: self .builder .property("activatable-widget", activatable_widget.clone().upcast()), } } pub fn icon_name(self, icon_name: impl Into) -> Self { Self { builder: self.builder.property("icon-name", icon_name.into()), } } pub fn subtitle(self, subtitle: impl Into) -> Self { Self { builder: self.builder.property("subtitle", subtitle.into()), } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn subtitle_lines(self, subtitle_lines: i32) -> Self { Self { builder: self.builder.property("subtitle-lines", subtitle_lines), } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn title_lines(self, title_lines: i32) -> Self { Self { builder: self.builder.property("title-lines", title_lines), } } pub fn use_underline(self, use_underline: bool) -> Self { Self { builder: self.builder.property("use-underline", use_underline), } } pub fn title(self, title: impl Into) -> Self { Self { builder: self.builder.property("title", title.into()), } } pub fn activatable(self, activatable: bool) -> Self { Self { builder: self.builder.property("activatable", activatable), } } pub fn selectable(self, selectable: bool) -> Self { Self { builder: self.builder.property("selectable", selectable), } } pub fn border_width(self, border_width: u32) -> Self { Self { builder: self.builder.property("border-width", border_width), } } pub fn child(self, child: &impl IsA) -> Self { Self { builder: self.builder.property("child", child.clone().upcast()), } } pub fn resize_mode(self, resize_mode: gtk::ResizeMode) -> Self { Self { builder: self.builder.property("resize-mode", resize_mode), } } pub fn app_paintable(self, app_paintable: bool) -> Self { Self { builder: self.builder.property("app-paintable", app_paintable), } } pub fn can_default(self, can_default: bool) -> Self { Self { builder: self.builder.property("can-default", can_default), } } pub fn can_focus(self, can_focus: bool) -> Self { Self { builder: self.builder.property("can-focus", can_focus), } } pub fn events(self, events: gdk::EventMask) -> Self { Self { builder: self.builder.property("events", events), } } pub fn expand(self, expand: bool) -> Self { Self { builder: self.builder.property("expand", expand), } } pub fn focus_on_click(self, focus_on_click: bool) -> Self { Self { builder: self.builder.property("focus-on-click", focus_on_click), } } pub fn halign(self, halign: gtk::Align) -> Self { Self { builder: self.builder.property("halign", halign), } } pub fn has_default(self, has_default: bool) -> Self { Self { builder: self.builder.property("has-default", has_default), } } pub fn has_focus(self, has_focus: bool) -> Self { Self { builder: self.builder.property("has-focus", has_focus), } } pub fn has_tooltip(self, has_tooltip: bool) -> Self { Self { builder: self.builder.property("has-tooltip", has_tooltip), } } pub fn height_request(self, height_request: i32) -> Self { Self { builder: self.builder.property("height-request", height_request), } } pub fn hexpand(self, hexpand: bool) -> Self { Self { builder: self.builder.property("hexpand", hexpand), } } pub fn hexpand_set(self, hexpand_set: bool) -> Self { Self { builder: self.builder.property("hexpand-set", hexpand_set), } } pub fn is_focus(self, is_focus: bool) -> Self { Self { builder: self.builder.property("is-focus", is_focus), } } pub fn margin(self, margin: i32) -> Self { Self { builder: self.builder.property("margin", margin), } } pub fn margin_bottom(self, margin_bottom: i32) -> Self { Self { builder: self.builder.property("margin-bottom", margin_bottom), } } pub fn margin_end(self, margin_end: i32) -> Self { Self { builder: self.builder.property("margin-end", margin_end), } } pub fn margin_start(self, margin_start: i32) -> Self { Self { builder: self.builder.property("margin-start", margin_start), } } pub fn margin_top(self, margin_top: i32) -> Self { Self { builder: self.builder.property("margin-top", margin_top), } } pub fn name(self, name: impl Into) -> Self { Self { builder: self.builder.property("name", name.into()), } } pub fn no_show_all(self, no_show_all: bool) -> Self { Self { builder: self.builder.property("no-show-all", no_show_all), } } pub fn opacity(self, opacity: f64) -> Self { Self { builder: self.builder.property("opacity", opacity), } } pub fn parent(self, parent: &impl IsA) -> Self { Self { builder: self.builder.property("parent", parent.clone().upcast()), } } pub fn receives_default(self, receives_default: bool) -> Self { Self { builder: self.builder.property("receives-default", receives_default), } } pub fn sensitive(self, sensitive: bool) -> Self { Self { builder: self.builder.property("sensitive", sensitive), } } //pub fn style(self, style: &impl IsA) -> Self { // Self { builder: self.builder.property("style", style.clone().upcast()), } //} pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { Self { builder: self .builder .property("tooltip-markup", tooltip_markup.into()), } } pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } } pub fn valign(self, valign: gtk::Align) -> Self { Self { builder: self.builder.property("valign", valign), } } pub fn vexpand(self, vexpand: bool) -> Self { Self { builder: self.builder.property("vexpand", vexpand), } } pub fn vexpand_set(self, vexpand_set: bool) -> Self { Self { builder: self.builder.property("vexpand-set", vexpand_set), } } pub fn visible(self, visible: bool) -> Self { Self { builder: self.builder.property("visible", visible), } } pub fn width_request(self, width_request: i32) -> Self { Self { builder: self.builder.property("width-request", width_request), } } pub fn action_name(self, action_name: impl Into) -> Self { Self { builder: self.builder.property("action-name", action_name.into()), } } pub fn action_target(self, action_target: &glib::Variant) -> Self { Self { builder: self .builder .property("action-target", action_target.clone()), } } // rustdoc-stripper-ignore-next /// Build the [`ComboRow`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> ComboRow { self.builder.build() } } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait ComboRowExt: IsA + sealed::Sealed + 'static { //#[doc(alias = "hdy_combo_row_bind_model")] //fn bind_model(&self, model: Option<&impl IsA>, create_list_widget_func: Option<&mut dyn (FnMut(&glib::Object) -> gtk::Widget)>, create_current_widget_func: Option gtk::Widget + 'static>>) { // unsafe { TODO: call ffi:hdy_combo_row_bind_model() } //} #[doc(alias = "hdy_combo_row_bind_name_model")] fn bind_name_model( &self, model: Option<&impl IsA>, get_name_func: Option String + 'static>>, ) { let get_name_func_data: Box_ String + 'static>>> = Box_::new(get_name_func); unsafe extern "C" fn get_name_func_func( item: *mut glib::gobject_ffi::GObject, user_data: glib::ffi::gpointer, ) -> *mut libc::c_char { let item = from_glib_borrow(item); let callback: &Option String + 'static>> = &*(user_data as *mut _); if let Some(ref callback) = *callback { callback(&item) } else { panic!("cannot get closure...") } .to_glib_full() } let get_name_func = if get_name_func_data.is_some() { Some(get_name_func_func as _) } else { None }; unsafe extern "C" fn user_data_free_func_func(data: glib::ffi::gpointer) { let _callback: Box_ String + 'static>>> = Box_::from_raw(data as *mut _); } let destroy_call4 = Some(user_data_free_func_func as _); let super_callback0: Box_ String + 'static>>> = get_name_func_data; unsafe { ffi::hdy_combo_row_bind_name_model( self.as_ref().to_glib_none().0, model.map(|p| p.as_ref()).to_glib_none().0, get_name_func, Box_::into_raw(super_callback0) as *mut _, destroy_call4, ); } } #[doc(alias = "hdy_combo_row_get_model")] #[doc(alias = "get_model")] fn model(&self) -> Option { unsafe { from_glib_none(ffi::hdy_combo_row_get_model(self.as_ref().to_glib_none().0)) } } #[doc(alias = "hdy_combo_row_get_selected_index")] #[doc(alias = "get_selected_index")] fn selected_index(&self) -> i32 { unsafe { ffi::hdy_combo_row_get_selected_index(self.as_ref().to_glib_none().0) } } #[doc(alias = "hdy_combo_row_get_use_subtitle")] #[doc(alias = "get_use_subtitle")] fn uses_subtitle(&self) -> bool { unsafe { from_glib(ffi::hdy_combo_row_get_use_subtitle( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_combo_row_set_for_enum")] fn set_for_enum( &self, enum_type: glib::types::Type, get_name_func: Option String + 'static>>, ) { let get_name_func_data: Box_ String + 'static>>> = Box_::new(get_name_func); unsafe extern "C" fn get_name_func_func( value: *mut ffi::HdyEnumValueObject, user_data: glib::ffi::gpointer, ) -> *mut libc::c_char { let value = from_glib_borrow(value); let callback: &Option String + 'static>> = &*(user_data as *mut _); if let Some(ref callback) = *callback { callback(&value) } else { panic!("cannot get closure...") } .to_glib_full() } let get_name_func = if get_name_func_data.is_some() { Some(get_name_func_func as _) } else { None }; unsafe extern "C" fn user_data_free_func_func(data: glib::ffi::gpointer) { let _callback: Box_ String + 'static>>> = Box_::from_raw(data as *mut _); } let destroy_call4 = Some(user_data_free_func_func as _); let super_callback0: Box_ String + 'static>>> = get_name_func_data; unsafe { ffi::hdy_combo_row_set_for_enum( self.as_ref().to_glib_none().0, enum_type.into_glib(), get_name_func, Box_::into_raw(super_callback0) as *mut _, destroy_call4, ); } } #[doc(alias = "hdy_combo_row_set_get_name_func")] fn set_get_name_func( &self, get_name_func: Option String + 'static>>, ) { let get_name_func_data: Box_ String + 'static>>> = Box_::new(get_name_func); unsafe extern "C" fn get_name_func_func( item: *mut glib::gobject_ffi::GObject, user_data: glib::ffi::gpointer, ) -> *mut libc::c_char { let item = from_glib_borrow(item); let callback: &Option String + 'static>> = &*(user_data as *mut _); if let Some(ref callback) = *callback { callback(&item) } else { panic!("cannot get closure...") } .to_glib_full() } let get_name_func = if get_name_func_data.is_some() { Some(get_name_func_func as _) } else { None }; unsafe extern "C" fn user_data_free_func_func(data: glib::ffi::gpointer) { let _callback: Box_ String + 'static>>> = Box_::from_raw(data as *mut _); } let destroy_call3 = Some(user_data_free_func_func as _); let super_callback0: Box_ String + 'static>>> = get_name_func_data; unsafe { ffi::hdy_combo_row_set_get_name_func( self.as_ref().to_glib_none().0, get_name_func, Box_::into_raw(super_callback0) as *mut _, destroy_call3, ); } } #[doc(alias = "hdy_combo_row_set_selected_index")] fn set_selected_index(&self, selected_index: i32) { unsafe { ffi::hdy_combo_row_set_selected_index(self.as_ref().to_glib_none().0, selected_index); } } #[doc(alias = "hdy_combo_row_set_use_subtitle")] fn set_use_subtitle(&self, use_subtitle: bool) { unsafe { ffi::hdy_combo_row_set_use_subtitle( self.as_ref().to_glib_none().0, use_subtitle.into_glib(), ); } } #[doc(alias = "selected-index")] fn connect_selected_index_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_selected_index_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyComboRow, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(ComboRow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::selected-index\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_selected_index_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "use-subtitle")] fn connect_use_subtitle_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_use_subtitle_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyComboRow, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(ComboRow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::use-subtitle\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_use_subtitle_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl> ComboRowExt for O {} impl fmt::Display for ComboRow { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("ComboRow") } } rust-libhandy-0.11-0.11.1/src/auto/deck.rs000066400000000000000000000663551470255135400177740ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT use crate::{DeckTransitionType, NavigationDirection, Swipeable}; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "HdyDeck")] pub struct Deck(Object) @extends gtk::Container, gtk::Widget, @implements gtk::Buildable, gtk::Orientable, Swipeable; match fn { type_ => || ffi::hdy_deck_get_type(), } } impl Deck { pub const NONE: Option<&'static Deck> = None; #[doc(alias = "hdy_deck_new")] pub fn new() -> Deck { assert_initialized_main_thread!(); unsafe { gtk::Widget::from_glib_none(ffi::hdy_deck_new()).unsafe_cast() } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`Deck`] objects. /// /// This method returns an instance of [`DeckBuilder`](crate::builders::DeckBuilder) which can be used to create [`Deck`] objects. pub fn builder() -> DeckBuilder { DeckBuilder::new() } } impl Default for Deck { fn default() -> Self { Self::new() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`Deck`] 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 DeckBuilder { builder: glib::object::ObjectBuilder<'static, Deck>, } impl DeckBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } pub fn can_swipe_back(self, can_swipe_back: bool) -> Self { Self { builder: self.builder.property("can-swipe-back", can_swipe_back), } } pub fn can_swipe_forward(self, can_swipe_forward: bool) -> Self { Self { builder: self .builder .property("can-swipe-forward", can_swipe_forward), } } pub fn hhomogeneous(self, hhomogeneous: bool) -> Self { Self { builder: self.builder.property("hhomogeneous", hhomogeneous), } } pub fn interpolate_size(self, interpolate_size: bool) -> Self { Self { builder: self.builder.property("interpolate-size", interpolate_size), } } pub fn transition_duration(self, transition_duration: u32) -> Self { Self { builder: self .builder .property("transition-duration", transition_duration), } } pub fn transition_type(self, transition_type: DeckTransitionType) -> Self { Self { builder: self.builder.property("transition-type", transition_type), } } pub fn vhomogeneous(self, vhomogeneous: bool) -> Self { Self { builder: self.builder.property("vhomogeneous", vhomogeneous), } } pub fn visible_child(self, visible_child: &impl IsA) -> Self { Self { builder: self .builder .property("visible-child", visible_child.clone().upcast()), } } pub fn visible_child_name(self, visible_child_name: impl Into) -> Self { Self { builder: self .builder .property("visible-child-name", visible_child_name.into()), } } pub fn border_width(self, border_width: u32) -> Self { Self { builder: self.builder.property("border-width", border_width), } } pub fn child(self, child: &impl IsA) -> Self { Self { builder: self.builder.property("child", child.clone().upcast()), } } pub fn resize_mode(self, resize_mode: gtk::ResizeMode) -> Self { Self { builder: self.builder.property("resize-mode", resize_mode), } } pub fn app_paintable(self, app_paintable: bool) -> Self { Self { builder: self.builder.property("app-paintable", app_paintable), } } pub fn can_default(self, can_default: bool) -> Self { Self { builder: self.builder.property("can-default", can_default), } } pub fn can_focus(self, can_focus: bool) -> Self { Self { builder: self.builder.property("can-focus", can_focus), } } pub fn events(self, events: gdk::EventMask) -> Self { Self { builder: self.builder.property("events", events), } } pub fn expand(self, expand: bool) -> Self { Self { builder: self.builder.property("expand", expand), } } pub fn focus_on_click(self, focus_on_click: bool) -> Self { Self { builder: self.builder.property("focus-on-click", focus_on_click), } } pub fn halign(self, halign: gtk::Align) -> Self { Self { builder: self.builder.property("halign", halign), } } pub fn has_default(self, has_default: bool) -> Self { Self { builder: self.builder.property("has-default", has_default), } } pub fn has_focus(self, has_focus: bool) -> Self { Self { builder: self.builder.property("has-focus", has_focus), } } pub fn has_tooltip(self, has_tooltip: bool) -> Self { Self { builder: self.builder.property("has-tooltip", has_tooltip), } } pub fn height_request(self, height_request: i32) -> Self { Self { builder: self.builder.property("height-request", height_request), } } pub fn hexpand(self, hexpand: bool) -> Self { Self { builder: self.builder.property("hexpand", hexpand), } } pub fn hexpand_set(self, hexpand_set: bool) -> Self { Self { builder: self.builder.property("hexpand-set", hexpand_set), } } pub fn is_focus(self, is_focus: bool) -> Self { Self { builder: self.builder.property("is-focus", is_focus), } } pub fn margin(self, margin: i32) -> Self { Self { builder: self.builder.property("margin", margin), } } pub fn margin_bottom(self, margin_bottom: i32) -> Self { Self { builder: self.builder.property("margin-bottom", margin_bottom), } } pub fn margin_end(self, margin_end: i32) -> Self { Self { builder: self.builder.property("margin-end", margin_end), } } pub fn margin_start(self, margin_start: i32) -> Self { Self { builder: self.builder.property("margin-start", margin_start), } } pub fn margin_top(self, margin_top: i32) -> Self { Self { builder: self.builder.property("margin-top", margin_top), } } pub fn name(self, name: impl Into) -> Self { Self { builder: self.builder.property("name", name.into()), } } pub fn no_show_all(self, no_show_all: bool) -> Self { Self { builder: self.builder.property("no-show-all", no_show_all), } } pub fn opacity(self, opacity: f64) -> Self { Self { builder: self.builder.property("opacity", opacity), } } pub fn parent(self, parent: &impl IsA) -> Self { Self { builder: self.builder.property("parent", parent.clone().upcast()), } } pub fn receives_default(self, receives_default: bool) -> Self { Self { builder: self.builder.property("receives-default", receives_default), } } pub fn sensitive(self, sensitive: bool) -> Self { Self { builder: self.builder.property("sensitive", sensitive), } } //pub fn style(self, style: &impl IsA) -> Self { // Self { builder: self.builder.property("style", style.clone().upcast()), } //} pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { Self { builder: self .builder .property("tooltip-markup", tooltip_markup.into()), } } pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } } pub fn valign(self, valign: gtk::Align) -> Self { Self { builder: self.builder.property("valign", valign), } } pub fn vexpand(self, vexpand: bool) -> Self { Self { builder: self.builder.property("vexpand", vexpand), } } pub fn vexpand_set(self, vexpand_set: bool) -> Self { Self { builder: self.builder.property("vexpand-set", vexpand_set), } } pub fn visible(self, visible: bool) -> Self { Self { builder: self.builder.property("visible", visible), } } pub fn width_request(self, width_request: i32) -> Self { Self { builder: self.builder.property("width-request", width_request), } } pub fn orientation(self, orientation: gtk::Orientation) -> Self { Self { builder: self.builder.property("orientation", orientation), } } // rustdoc-stripper-ignore-next /// Build the [`Deck`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> Deck { self.builder.build() } } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait DeckExt: IsA + sealed::Sealed + 'static { #[doc(alias = "hdy_deck_get_adjacent_child")] #[doc(alias = "get_adjacent_child")] fn adjacent_child(&self, direction: NavigationDirection) -> Option { unsafe { from_glib_none(ffi::hdy_deck_get_adjacent_child( self.as_ref().to_glib_none().0, direction.into_glib(), )) } } #[doc(alias = "hdy_deck_get_can_swipe_back")] #[doc(alias = "get_can_swipe_back")] fn can_swipe_back(&self) -> bool { unsafe { from_glib(ffi::hdy_deck_get_can_swipe_back( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_deck_get_can_swipe_forward")] #[doc(alias = "get_can_swipe_forward")] fn can_swipe_forward(&self) -> bool { unsafe { from_glib(ffi::hdy_deck_get_can_swipe_forward( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_deck_get_child_by_name")] #[doc(alias = "get_child_by_name")] fn child_by_name(&self, name: &str) -> Option { unsafe { from_glib_none(ffi::hdy_deck_get_child_by_name( self.as_ref().to_glib_none().0, name.to_glib_none().0, )) } } #[doc(alias = "hdy_deck_get_homogeneous")] #[doc(alias = "get_homogeneous")] fn is_homogeneous(&self, orientation: gtk::Orientation) -> bool { unsafe { from_glib(ffi::hdy_deck_get_homogeneous( self.as_ref().to_glib_none().0, orientation.into_glib(), )) } } #[doc(alias = "hdy_deck_get_interpolate_size")] #[doc(alias = "get_interpolate_size")] fn is_interpolate_size(&self) -> bool { unsafe { from_glib(ffi::hdy_deck_get_interpolate_size( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_deck_get_transition_duration")] #[doc(alias = "get_transition_duration")] fn transition_duration(&self) -> u32 { unsafe { ffi::hdy_deck_get_transition_duration(self.as_ref().to_glib_none().0) } } #[doc(alias = "hdy_deck_get_transition_running")] #[doc(alias = "get_transition_running")] fn is_transition_running(&self) -> bool { unsafe { from_glib(ffi::hdy_deck_get_transition_running( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_deck_get_transition_type")] #[doc(alias = "get_transition_type")] fn transition_type(&self) -> DeckTransitionType { unsafe { from_glib(ffi::hdy_deck_get_transition_type( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_deck_get_visible_child")] #[doc(alias = "get_visible_child")] fn visible_child(&self) -> Option { unsafe { from_glib_none(ffi::hdy_deck_get_visible_child( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_deck_get_visible_child_name")] #[doc(alias = "get_visible_child_name")] fn visible_child_name(&self) -> Option { unsafe { from_glib_none(ffi::hdy_deck_get_visible_child_name( self.as_ref().to_glib_none().0, )) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "hdy_deck_insert_child_after")] fn insert_child_after( &self, child: &impl IsA, sibling: Option<&impl IsA>, ) { unsafe { ffi::hdy_deck_insert_child_after( self.as_ref().to_glib_none().0, child.as_ref().to_glib_none().0, sibling.map(|p| p.as_ref()).to_glib_none().0, ); } } #[doc(alias = "hdy_deck_navigate")] fn navigate(&self, direction: NavigationDirection) -> bool { unsafe { from_glib(ffi::hdy_deck_navigate( self.as_ref().to_glib_none().0, direction.into_glib(), )) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "hdy_deck_prepend")] fn prepend(&self, child: &impl IsA) { unsafe { ffi::hdy_deck_prepend( self.as_ref().to_glib_none().0, child.as_ref().to_glib_none().0, ); } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "hdy_deck_reorder_child_after")] fn reorder_child_after( &self, child: &impl IsA, sibling: Option<&impl IsA>, ) { unsafe { ffi::hdy_deck_reorder_child_after( self.as_ref().to_glib_none().0, child.as_ref().to_glib_none().0, sibling.map(|p| p.as_ref()).to_glib_none().0, ); } } #[doc(alias = "hdy_deck_set_can_swipe_back")] fn set_can_swipe_back(&self, can_swipe_back: bool) { unsafe { ffi::hdy_deck_set_can_swipe_back( self.as_ref().to_glib_none().0, can_swipe_back.into_glib(), ); } } #[doc(alias = "hdy_deck_set_can_swipe_forward")] fn set_can_swipe_forward(&self, can_swipe_forward: bool) { unsafe { ffi::hdy_deck_set_can_swipe_forward( self.as_ref().to_glib_none().0, can_swipe_forward.into_glib(), ); } } #[doc(alias = "hdy_deck_set_homogeneous")] fn set_homogeneous(&self, orientation: gtk::Orientation, homogeneous: bool) { unsafe { ffi::hdy_deck_set_homogeneous( self.as_ref().to_glib_none().0, orientation.into_glib(), homogeneous.into_glib(), ); } } #[doc(alias = "hdy_deck_set_interpolate_size")] fn set_interpolate_size(&self, interpolate_size: bool) { unsafe { ffi::hdy_deck_set_interpolate_size( self.as_ref().to_glib_none().0, interpolate_size.into_glib(), ); } } #[doc(alias = "hdy_deck_set_transition_duration")] fn set_transition_duration(&self, duration: u32) { unsafe { ffi::hdy_deck_set_transition_duration(self.as_ref().to_glib_none().0, duration); } } #[doc(alias = "hdy_deck_set_transition_type")] fn set_transition_type(&self, transition: DeckTransitionType) { unsafe { ffi::hdy_deck_set_transition_type( self.as_ref().to_glib_none().0, transition.into_glib(), ); } } #[doc(alias = "hdy_deck_set_visible_child")] fn set_visible_child(&self, visible_child: &impl IsA) { unsafe { ffi::hdy_deck_set_visible_child( self.as_ref().to_glib_none().0, visible_child.as_ref().to_glib_none().0, ); } } #[doc(alias = "hdy_deck_set_visible_child_name")] fn set_visible_child_name(&self, name: &str) { unsafe { ffi::hdy_deck_set_visible_child_name( self.as_ref().to_glib_none().0, name.to_glib_none().0, ); } } fn is_hhomogeneous(&self) -> bool { ObjectExt::property(self.as_ref(), "hhomogeneous") } fn set_hhomogeneous(&self, hhomogeneous: bool) { ObjectExt::set_property(self.as_ref(), "hhomogeneous", hhomogeneous) } fn is_vhomogeneous(&self) -> bool { ObjectExt::property(self.as_ref(), "vhomogeneous") } fn set_vhomogeneous(&self, vhomogeneous: bool) { ObjectExt::set_property(self.as_ref(), "vhomogeneous", vhomogeneous) } fn child_name>(&self, item: &T) -> Option { gtk::prelude::ContainerExtManual::child_property( self.as_ref(), &item.clone().upcast(), "name", ) } fn set_child_name>(&self, item: &T, name: Option<&str>) { gtk::prelude::ContainerExtManual::child_set_property( self.as_ref(), &item.clone().upcast(), "name", &name, ) } #[doc(alias = "can-swipe-back")] fn connect_can_swipe_back_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_can_swipe_back_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::HdyDeck, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Deck::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::can-swipe-back\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_can_swipe_back_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "can-swipe-forward")] fn connect_can_swipe_forward_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_can_swipe_forward_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyDeck, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Deck::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::can-swipe-forward\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_can_swipe_forward_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "hhomogeneous")] fn connect_hhomogeneous_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_hhomogeneous_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::HdyDeck, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Deck::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::hhomogeneous\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_hhomogeneous_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "interpolate-size")] fn connect_interpolate_size_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_interpolate_size_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyDeck, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Deck::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::interpolate-size\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_interpolate_size_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "transition-duration")] fn connect_transition_duration_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_transition_duration_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyDeck, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Deck::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::transition-duration\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_transition_duration_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "transition-running")] fn connect_transition_running_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_transition_running_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyDeck, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Deck::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::transition-running\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_transition_running_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "transition-type")] fn connect_transition_type_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_transition_type_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyDeck, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Deck::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::transition-type\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_transition_type_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "vhomogeneous")] fn connect_vhomogeneous_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_vhomogeneous_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::HdyDeck, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Deck::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::vhomogeneous\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_vhomogeneous_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "visible-child")] fn connect_visible_child_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_visible_child_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::HdyDeck, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Deck::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::visible-child\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_visible_child_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "visible-child-name")] fn connect_visible_child_name_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_visible_child_name_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyDeck, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Deck::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::visible-child-name\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_visible_child_name_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl> DeckExt for O {} impl fmt::Display for Deck { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Deck") } } rust-libhandy-0.11-0.11.1/src/auto/enum_value_object.rs000066400000000000000000000027061470255135400225420ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT use glib::translate::*; use std::fmt; glib::wrapper! { #[doc(alias = "HdyEnumValueObject")] pub struct EnumValueObject(Object); match fn { type_ => || ffi::hdy_enum_value_object_get_type(), } } impl EnumValueObject { //#[doc(alias = "hdy_enum_value_object_new")] //pub fn new(enum_value: /*Ignored*/&mut glib::EnumValue) -> EnumValueObject { // unsafe { TODO: call ffi:hdy_enum_value_object_new() } //} #[doc(alias = "hdy_enum_value_object_get_name")] #[doc(alias = "get_name")] pub fn name(&self) -> Option { unsafe { from_glib_none(ffi::hdy_enum_value_object_get_name(self.to_glib_none().0)) } } #[doc(alias = "hdy_enum_value_object_get_nick")] #[doc(alias = "get_nick")] pub fn nick(&self) -> Option { unsafe { from_glib_none(ffi::hdy_enum_value_object_get_nick(self.to_glib_none().0)) } } #[doc(alias = "hdy_enum_value_object_get_value")] #[doc(alias = "get_value")] pub fn value(&self) -> i32 { unsafe { ffi::hdy_enum_value_object_get_value(self.to_glib_none().0) } } } impl fmt::Display for EnumValueObject { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("EnumValueObject") } } rust-libhandy-0.11-0.11.1/src/auto/enums.rs000066400000000000000000001030601470255135400201760ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT use glib::{prelude::*, translate::*}; use std::fmt; #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "HdyCenteringPolicy")] pub enum CenteringPolicy { #[doc(alias = "HDY_CENTERING_POLICY_LOOSE")] Loose, #[doc(alias = "HDY_CENTERING_POLICY_STRICT")] Strict, #[doc(hidden)] __Unknown(i32), } impl fmt::Display for CenteringPolicy { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "CenteringPolicy::{}", match *self { Self::Loose => "Loose", Self::Strict => "Strict", _ => "Unknown", } ) } } #[doc(hidden)] impl IntoGlib for CenteringPolicy { type GlibType = ffi::HdyCenteringPolicy; #[inline] fn into_glib(self) -> ffi::HdyCenteringPolicy { match self { Self::Loose => ffi::HDY_CENTERING_POLICY_LOOSE, Self::Strict => ffi::HDY_CENTERING_POLICY_STRICT, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for CenteringPolicy { #[inline] unsafe fn from_glib(value: ffi::HdyCenteringPolicy) -> Self { skip_assert_initialized!(); match value { ffi::HDY_CENTERING_POLICY_LOOSE => Self::Loose, ffi::HDY_CENTERING_POLICY_STRICT => Self::Strict, value => Self::__Unknown(value), } } } impl StaticType for CenteringPolicy { #[inline] #[doc(alias = "hdy_centering_policy_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::hdy_centering_policy_get_type()) } } } impl glib::HasParamSpec for CenteringPolicy { 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 CenteringPolicy { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for CenteringPolicy { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { skip_assert_initialized!(); from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for CenteringPolicy { #[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: CenteringPolicy) -> Self { skip_assert_initialized!(); ToValue::to_value(&v) } } #[cfg(feature = "v1_6")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))] #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "HdyColorScheme")] pub enum ColorScheme { #[doc(alias = "HDY_COLOR_SCHEME_DEFAULT")] Default, #[doc(alias = "HDY_COLOR_SCHEME_FORCE_LIGHT")] ForceLight, #[doc(alias = "HDY_COLOR_SCHEME_PREFER_LIGHT")] PreferLight, #[doc(alias = "HDY_COLOR_SCHEME_PREFER_DARK")] PreferDark, #[doc(alias = "HDY_COLOR_SCHEME_FORCE_DARK")] ForceDark, #[doc(hidden)] __Unknown(i32), } #[cfg(feature = "v1_6")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))] impl fmt::Display for ColorScheme { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "ColorScheme::{}", match *self { Self::Default => "Default", Self::ForceLight => "ForceLight", Self::PreferLight => "PreferLight", Self::PreferDark => "PreferDark", Self::ForceDark => "ForceDark", _ => "Unknown", } ) } } #[cfg(feature = "v1_6")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))] #[doc(hidden)] impl IntoGlib for ColorScheme { type GlibType = ffi::HdyColorScheme; #[inline] fn into_glib(self) -> ffi::HdyColorScheme { match self { Self::Default => ffi::HDY_COLOR_SCHEME_DEFAULT, Self::ForceLight => ffi::HDY_COLOR_SCHEME_FORCE_LIGHT, Self::PreferLight => ffi::HDY_COLOR_SCHEME_PREFER_LIGHT, Self::PreferDark => ffi::HDY_COLOR_SCHEME_PREFER_DARK, Self::ForceDark => ffi::HDY_COLOR_SCHEME_FORCE_DARK, Self::__Unknown(value) => value, } } } #[cfg(feature = "v1_6")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))] #[doc(hidden)] impl FromGlib for ColorScheme { #[inline] unsafe fn from_glib(value: ffi::HdyColorScheme) -> Self { skip_assert_initialized!(); match value { ffi::HDY_COLOR_SCHEME_DEFAULT => Self::Default, ffi::HDY_COLOR_SCHEME_FORCE_LIGHT => Self::ForceLight, ffi::HDY_COLOR_SCHEME_PREFER_LIGHT => Self::PreferLight, ffi::HDY_COLOR_SCHEME_PREFER_DARK => Self::PreferDark, ffi::HDY_COLOR_SCHEME_FORCE_DARK => Self::ForceDark, value => Self::__Unknown(value), } } } #[cfg(feature = "v1_6")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))] impl StaticType for ColorScheme { #[inline] #[doc(alias = "hdy_color_scheme_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::hdy_color_scheme_get_type()) } } } #[cfg(feature = "v1_6")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))] impl glib::HasParamSpec for ColorScheme { 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 = "v1_6")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))] impl glib::value::ValueType for ColorScheme { type Type = Self; } #[cfg(feature = "v1_6")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))] unsafe impl<'a> glib::value::FromValue<'a> for ColorScheme { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { skip_assert_initialized!(); from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } #[cfg(feature = "v1_6")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))] impl ToValue for ColorScheme { #[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 = "v1_6")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))] impl From for glib::Value { #[inline] fn from(v: ColorScheme) -> Self { skip_assert_initialized!(); ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "HdyDeckTransitionType")] pub enum DeckTransitionType { #[doc(alias = "HDY_DECK_TRANSITION_TYPE_OVER")] Over, #[doc(alias = "HDY_DECK_TRANSITION_TYPE_UNDER")] Under, #[doc(alias = "HDY_DECK_TRANSITION_TYPE_SLIDE")] Slide, #[doc(hidden)] __Unknown(i32), } impl fmt::Display for DeckTransitionType { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "DeckTransitionType::{}", match *self { Self::Over => "Over", Self::Under => "Under", Self::Slide => "Slide", _ => "Unknown", } ) } } #[doc(hidden)] impl IntoGlib for DeckTransitionType { type GlibType = ffi::HdyDeckTransitionType; #[inline] fn into_glib(self) -> ffi::HdyDeckTransitionType { match self { Self::Over => ffi::HDY_DECK_TRANSITION_TYPE_OVER, Self::Under => ffi::HDY_DECK_TRANSITION_TYPE_UNDER, Self::Slide => ffi::HDY_DECK_TRANSITION_TYPE_SLIDE, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for DeckTransitionType { #[inline] unsafe fn from_glib(value: ffi::HdyDeckTransitionType) -> Self { skip_assert_initialized!(); match value { ffi::HDY_DECK_TRANSITION_TYPE_OVER => Self::Over, ffi::HDY_DECK_TRANSITION_TYPE_UNDER => Self::Under, ffi::HDY_DECK_TRANSITION_TYPE_SLIDE => Self::Slide, value => Self::__Unknown(value), } } } impl StaticType for DeckTransitionType { #[inline] #[doc(alias = "hdy_deck_transition_type_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::hdy_deck_transition_type_get_type()) } } } impl glib::HasParamSpec for DeckTransitionType { 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 DeckTransitionType { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for DeckTransitionType { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { skip_assert_initialized!(); from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for DeckTransitionType { #[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: DeckTransitionType) -> Self { skip_assert_initialized!(); ToValue::to_value(&v) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "HdyFlapFoldPolicy")] pub enum FlapFoldPolicy { #[doc(alias = "HDY_FLAP_FOLD_POLICY_NEVER")] Never, #[doc(alias = "HDY_FLAP_FOLD_POLICY_ALWAYS")] Always, #[doc(alias = "HDY_FLAP_FOLD_POLICY_AUTO")] Auto, #[doc(hidden)] __Unknown(i32), } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] impl fmt::Display for FlapFoldPolicy { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "FlapFoldPolicy::{}", match *self { Self::Never => "Never", Self::Always => "Always", Self::Auto => "Auto", _ => "Unknown", } ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(hidden)] impl IntoGlib for FlapFoldPolicy { type GlibType = ffi::HdyFlapFoldPolicy; #[inline] fn into_glib(self) -> ffi::HdyFlapFoldPolicy { match self { Self::Never => ffi::HDY_FLAP_FOLD_POLICY_NEVER, Self::Always => ffi::HDY_FLAP_FOLD_POLICY_ALWAYS, Self::Auto => ffi::HDY_FLAP_FOLD_POLICY_AUTO, Self::__Unknown(value) => value, } } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(hidden)] impl FromGlib for FlapFoldPolicy { #[inline] unsafe fn from_glib(value: ffi::HdyFlapFoldPolicy) -> Self { skip_assert_initialized!(); match value { ffi::HDY_FLAP_FOLD_POLICY_NEVER => Self::Never, ffi::HDY_FLAP_FOLD_POLICY_ALWAYS => Self::Always, ffi::HDY_FLAP_FOLD_POLICY_AUTO => Self::Auto, value => Self::__Unknown(value), } } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] impl StaticType for FlapFoldPolicy { #[inline] #[doc(alias = "hdy_flap_fold_policy_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::hdy_flap_fold_policy_get_type()) } } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] impl glib::HasParamSpec for FlapFoldPolicy { 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 = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] impl glib::value::ValueType for FlapFoldPolicy { type Type = Self; } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] unsafe impl<'a> glib::value::FromValue<'a> for FlapFoldPolicy { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { skip_assert_initialized!(); from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] impl ToValue for FlapFoldPolicy { #[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 = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] impl From for glib::Value { #[inline] fn from(v: FlapFoldPolicy) -> Self { skip_assert_initialized!(); ToValue::to_value(&v) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "HdyFlapTransitionType")] pub enum FlapTransitionType { #[doc(alias = "HDY_FLAP_TRANSITION_TYPE_OVER")] Over, #[doc(alias = "HDY_FLAP_TRANSITION_TYPE_UNDER")] Under, #[doc(alias = "HDY_FLAP_TRANSITION_TYPE_SLIDE")] Slide, #[doc(hidden)] __Unknown(i32), } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] impl fmt::Display for FlapTransitionType { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "FlapTransitionType::{}", match *self { Self::Over => "Over", Self::Under => "Under", Self::Slide => "Slide", _ => "Unknown", } ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(hidden)] impl IntoGlib for FlapTransitionType { type GlibType = ffi::HdyFlapTransitionType; #[inline] fn into_glib(self) -> ffi::HdyFlapTransitionType { match self { Self::Over => ffi::HDY_FLAP_TRANSITION_TYPE_OVER, Self::Under => ffi::HDY_FLAP_TRANSITION_TYPE_UNDER, Self::Slide => ffi::HDY_FLAP_TRANSITION_TYPE_SLIDE, Self::__Unknown(value) => value, } } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(hidden)] impl FromGlib for FlapTransitionType { #[inline] unsafe fn from_glib(value: ffi::HdyFlapTransitionType) -> Self { skip_assert_initialized!(); match value { ffi::HDY_FLAP_TRANSITION_TYPE_OVER => Self::Over, ffi::HDY_FLAP_TRANSITION_TYPE_UNDER => Self::Under, ffi::HDY_FLAP_TRANSITION_TYPE_SLIDE => Self::Slide, value => Self::__Unknown(value), } } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] impl StaticType for FlapTransitionType { #[inline] #[doc(alias = "hdy_flap_transition_type_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::hdy_flap_transition_type_get_type()) } } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] impl glib::HasParamSpec for FlapTransitionType { 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 = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] impl glib::value::ValueType for FlapTransitionType { type Type = Self; } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] unsafe impl<'a> glib::value::FromValue<'a> for FlapTransitionType { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { skip_assert_initialized!(); from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] impl ToValue for FlapTransitionType { #[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 = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] impl From for glib::Value { #[inline] fn from(v: FlapTransitionType) -> Self { skip_assert_initialized!(); ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "HdyHeaderGroupChildType")] pub enum HeaderGroupChildType { #[doc(alias = "HDY_HEADER_GROUP_CHILD_TYPE_HEADER_BAR")] HeaderBar, #[doc(alias = "HDY_HEADER_GROUP_CHILD_TYPE_GTK_HEADER_BAR")] GtkHeaderBar, #[doc(alias = "HDY_HEADER_GROUP_CHILD_TYPE_HEADER_GROUP")] HeaderGroup, #[doc(hidden)] __Unknown(i32), } impl fmt::Display for HeaderGroupChildType { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "HeaderGroupChildType::{}", match *self { Self::HeaderBar => "HeaderBar", Self::GtkHeaderBar => "GtkHeaderBar", Self::HeaderGroup => "HeaderGroup", _ => "Unknown", } ) } } #[doc(hidden)] impl IntoGlib for HeaderGroupChildType { type GlibType = ffi::HdyHeaderGroupChildType; #[inline] fn into_glib(self) -> ffi::HdyHeaderGroupChildType { match self { Self::HeaderBar => ffi::HDY_HEADER_GROUP_CHILD_TYPE_HEADER_BAR, Self::GtkHeaderBar => ffi::HDY_HEADER_GROUP_CHILD_TYPE_GTK_HEADER_BAR, Self::HeaderGroup => ffi::HDY_HEADER_GROUP_CHILD_TYPE_HEADER_GROUP, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for HeaderGroupChildType { #[inline] unsafe fn from_glib(value: ffi::HdyHeaderGroupChildType) -> Self { skip_assert_initialized!(); match value { ffi::HDY_HEADER_GROUP_CHILD_TYPE_HEADER_BAR => Self::HeaderBar, ffi::HDY_HEADER_GROUP_CHILD_TYPE_GTK_HEADER_BAR => Self::GtkHeaderBar, ffi::HDY_HEADER_GROUP_CHILD_TYPE_HEADER_GROUP => Self::HeaderGroup, value => Self::__Unknown(value), } } } impl StaticType for HeaderGroupChildType { #[inline] #[doc(alias = "hdy_header_group_child_type_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::hdy_header_group_child_type_get_type()) } } } impl glib::HasParamSpec for HeaderGroupChildType { 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 HeaderGroupChildType { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for HeaderGroupChildType { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { skip_assert_initialized!(); from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for HeaderGroupChildType { #[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: HeaderGroupChildType) -> Self { skip_assert_initialized!(); ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "HdyLeafletTransitionType")] pub enum LeafletTransitionType { #[doc(alias = "HDY_LEAFLET_TRANSITION_TYPE_OVER")] Over, #[doc(alias = "HDY_LEAFLET_TRANSITION_TYPE_UNDER")] Under, #[doc(alias = "HDY_LEAFLET_TRANSITION_TYPE_SLIDE")] Slide, #[doc(hidden)] __Unknown(i32), } impl fmt::Display for LeafletTransitionType { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "LeafletTransitionType::{}", match *self { Self::Over => "Over", Self::Under => "Under", Self::Slide => "Slide", _ => "Unknown", } ) } } #[doc(hidden)] impl IntoGlib for LeafletTransitionType { type GlibType = ffi::HdyLeafletTransitionType; #[inline] fn into_glib(self) -> ffi::HdyLeafletTransitionType { match self { Self::Over => ffi::HDY_LEAFLET_TRANSITION_TYPE_OVER, Self::Under => ffi::HDY_LEAFLET_TRANSITION_TYPE_UNDER, Self::Slide => ffi::HDY_LEAFLET_TRANSITION_TYPE_SLIDE, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for LeafletTransitionType { #[inline] unsafe fn from_glib(value: ffi::HdyLeafletTransitionType) -> Self { skip_assert_initialized!(); match value { ffi::HDY_LEAFLET_TRANSITION_TYPE_OVER => Self::Over, ffi::HDY_LEAFLET_TRANSITION_TYPE_UNDER => Self::Under, ffi::HDY_LEAFLET_TRANSITION_TYPE_SLIDE => Self::Slide, value => Self::__Unknown(value), } } } impl StaticType for LeafletTransitionType { #[inline] #[doc(alias = "hdy_leaflet_transition_type_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::hdy_leaflet_transition_type_get_type()) } } } impl glib::HasParamSpec for LeafletTransitionType { 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 LeafletTransitionType { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for LeafletTransitionType { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { skip_assert_initialized!(); from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for LeafletTransitionType { #[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: LeafletTransitionType) -> Self { skip_assert_initialized!(); ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "HdyNavigationDirection")] pub enum NavigationDirection { #[doc(alias = "HDY_NAVIGATION_DIRECTION_BACK")] Back, #[doc(alias = "HDY_NAVIGATION_DIRECTION_FORWARD")] Forward, #[doc(hidden)] __Unknown(i32), } impl fmt::Display for NavigationDirection { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "NavigationDirection::{}", match *self { Self::Back => "Back", Self::Forward => "Forward", _ => "Unknown", } ) } } #[doc(hidden)] impl IntoGlib for NavigationDirection { type GlibType = ffi::HdyNavigationDirection; #[inline] fn into_glib(self) -> ffi::HdyNavigationDirection { match self { Self::Back => ffi::HDY_NAVIGATION_DIRECTION_BACK, Self::Forward => ffi::HDY_NAVIGATION_DIRECTION_FORWARD, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for NavigationDirection { #[inline] unsafe fn from_glib(value: ffi::HdyNavigationDirection) -> Self { skip_assert_initialized!(); match value { ffi::HDY_NAVIGATION_DIRECTION_BACK => Self::Back, ffi::HDY_NAVIGATION_DIRECTION_FORWARD => Self::Forward, value => Self::__Unknown(value), } } } impl StaticType for NavigationDirection { #[inline] #[doc(alias = "hdy_navigation_direction_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::hdy_navigation_direction_get_type()) } } } impl glib::HasParamSpec for NavigationDirection { 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 NavigationDirection { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for NavigationDirection { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { skip_assert_initialized!(); from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for NavigationDirection { #[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: NavigationDirection) -> Self { skip_assert_initialized!(); ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "HdySqueezerTransitionType")] pub enum SqueezerTransitionType { #[doc(alias = "HDY_SQUEEZER_TRANSITION_TYPE_NONE")] None, #[doc(alias = "HDY_SQUEEZER_TRANSITION_TYPE_CROSSFADE")] Crossfade, #[doc(hidden)] __Unknown(i32), } impl fmt::Display for SqueezerTransitionType { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "SqueezerTransitionType::{}", match *self { Self::None => "None", Self::Crossfade => "Crossfade", _ => "Unknown", } ) } } #[doc(hidden)] impl IntoGlib for SqueezerTransitionType { type GlibType = ffi::HdySqueezerTransitionType; #[inline] fn into_glib(self) -> ffi::HdySqueezerTransitionType { match self { Self::None => ffi::HDY_SQUEEZER_TRANSITION_TYPE_NONE, Self::Crossfade => ffi::HDY_SQUEEZER_TRANSITION_TYPE_CROSSFADE, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for SqueezerTransitionType { #[inline] unsafe fn from_glib(value: ffi::HdySqueezerTransitionType) -> Self { skip_assert_initialized!(); match value { ffi::HDY_SQUEEZER_TRANSITION_TYPE_NONE => Self::None, ffi::HDY_SQUEEZER_TRANSITION_TYPE_CROSSFADE => Self::Crossfade, value => Self::__Unknown(value), } } } impl StaticType for SqueezerTransitionType { #[inline] #[doc(alias = "hdy_squeezer_transition_type_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::hdy_squeezer_transition_type_get_type()) } } } impl glib::HasParamSpec for SqueezerTransitionType { 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 SqueezerTransitionType { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for SqueezerTransitionType { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { skip_assert_initialized!(); from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for SqueezerTransitionType { #[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: SqueezerTransitionType) -> Self { skip_assert_initialized!(); ToValue::to_value(&v) } } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[non_exhaustive] #[doc(alias = "HdyViewSwitcherPolicy")] pub enum ViewSwitcherPolicy { #[doc(alias = "HDY_VIEW_SWITCHER_POLICY_AUTO")] Auto, #[doc(alias = "HDY_VIEW_SWITCHER_POLICY_NARROW")] Narrow, #[doc(alias = "HDY_VIEW_SWITCHER_POLICY_WIDE")] Wide, #[doc(hidden)] __Unknown(i32), } impl fmt::Display for ViewSwitcherPolicy { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "ViewSwitcherPolicy::{}", match *self { Self::Auto => "Auto", Self::Narrow => "Narrow", Self::Wide => "Wide", _ => "Unknown", } ) } } #[doc(hidden)] impl IntoGlib for ViewSwitcherPolicy { type GlibType = ffi::HdyViewSwitcherPolicy; #[inline] fn into_glib(self) -> ffi::HdyViewSwitcherPolicy { match self { Self::Auto => ffi::HDY_VIEW_SWITCHER_POLICY_AUTO, Self::Narrow => ffi::HDY_VIEW_SWITCHER_POLICY_NARROW, Self::Wide => ffi::HDY_VIEW_SWITCHER_POLICY_WIDE, Self::__Unknown(value) => value, } } } #[doc(hidden)] impl FromGlib for ViewSwitcherPolicy { #[inline] unsafe fn from_glib(value: ffi::HdyViewSwitcherPolicy) -> Self { skip_assert_initialized!(); match value { ffi::HDY_VIEW_SWITCHER_POLICY_AUTO => Self::Auto, ffi::HDY_VIEW_SWITCHER_POLICY_NARROW => Self::Narrow, ffi::HDY_VIEW_SWITCHER_POLICY_WIDE => Self::Wide, value => Self::__Unknown(value), } } } impl StaticType for ViewSwitcherPolicy { #[inline] #[doc(alias = "hdy_view_switcher_policy_get_type")] fn static_type() -> glib::Type { unsafe { from_glib(ffi::hdy_view_switcher_policy_get_type()) } } } impl glib::HasParamSpec for ViewSwitcherPolicy { 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 ViewSwitcherPolicy { type Type = Self; } unsafe impl<'a> glib::value::FromValue<'a> for ViewSwitcherPolicy { type Checker = glib::value::GenericValueTypeChecker; #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { skip_assert_initialized!(); from_glib(glib::gobject_ffi::g_value_get_enum(value.to_glib_none().0)) } } impl ToValue for ViewSwitcherPolicy { #[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: ViewSwitcherPolicy) -> Self { skip_assert_initialized!(); ToValue::to_value(&v) } } rust-libhandy-0.11-0.11.1/src/auto/expander_row.rs000066400000000000000000000455221470255135400215540ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT use crate::PreferencesRow; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "HdyExpanderRow")] pub struct ExpanderRow(Object) @extends PreferencesRow, gtk::ListBoxRow, gtk::Bin, gtk::Container, gtk::Widget, @implements gtk::Buildable, gtk::Actionable; match fn { type_ => || ffi::hdy_expander_row_get_type(), } } impl ExpanderRow { pub const NONE: Option<&'static ExpanderRow> = None; #[doc(alias = "hdy_expander_row_new")] pub fn new() -> ExpanderRow { assert_initialized_main_thread!(); unsafe { gtk::Widget::from_glib_none(ffi::hdy_expander_row_new()).unsafe_cast() } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`ExpanderRow`] objects. /// /// This method returns an instance of [`ExpanderRowBuilder`](crate::builders::ExpanderRowBuilder) which can be used to create [`ExpanderRow`] objects. pub fn builder() -> ExpanderRowBuilder { ExpanderRowBuilder::new() } } impl Default for ExpanderRow { fn default() -> Self { Self::new() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`ExpanderRow`] 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 ExpanderRowBuilder { builder: glib::object::ObjectBuilder<'static, ExpanderRow>, } impl ExpanderRowBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } pub fn enable_expansion(self, enable_expansion: bool) -> Self { Self { builder: self.builder.property("enable-expansion", enable_expansion), } } pub fn expanded(self, expanded: bool) -> Self { Self { builder: self.builder.property("expanded", expanded), } } pub fn icon_name(self, icon_name: impl Into) -> Self { Self { builder: self.builder.property("icon-name", icon_name.into()), } } pub fn show_enable_switch(self, show_enable_switch: bool) -> Self { Self { builder: self .builder .property("show-enable-switch", show_enable_switch), } } pub fn subtitle(self, subtitle: impl Into) -> Self { Self { builder: self.builder.property("subtitle", subtitle.into()), } } pub fn use_underline(self, use_underline: bool) -> Self { Self { builder: self.builder.property("use-underline", use_underline), } } pub fn title(self, title: impl Into) -> Self { Self { builder: self.builder.property("title", title.into()), } } pub fn activatable(self, activatable: bool) -> Self { Self { builder: self.builder.property("activatable", activatable), } } pub fn selectable(self, selectable: bool) -> Self { Self { builder: self.builder.property("selectable", selectable), } } pub fn border_width(self, border_width: u32) -> Self { Self { builder: self.builder.property("border-width", border_width), } } pub fn child(self, child: &impl IsA) -> Self { Self { builder: self.builder.property("child", child.clone().upcast()), } } pub fn resize_mode(self, resize_mode: gtk::ResizeMode) -> Self { Self { builder: self.builder.property("resize-mode", resize_mode), } } pub fn app_paintable(self, app_paintable: bool) -> Self { Self { builder: self.builder.property("app-paintable", app_paintable), } } pub fn can_default(self, can_default: bool) -> Self { Self { builder: self.builder.property("can-default", can_default), } } pub fn can_focus(self, can_focus: bool) -> Self { Self { builder: self.builder.property("can-focus", can_focus), } } pub fn events(self, events: gdk::EventMask) -> Self { Self { builder: self.builder.property("events", events), } } pub fn expand(self, expand: bool) -> Self { Self { builder: self.builder.property("expand", expand), } } pub fn focus_on_click(self, focus_on_click: bool) -> Self { Self { builder: self.builder.property("focus-on-click", focus_on_click), } } pub fn halign(self, halign: gtk::Align) -> Self { Self { builder: self.builder.property("halign", halign), } } pub fn has_default(self, has_default: bool) -> Self { Self { builder: self.builder.property("has-default", has_default), } } pub fn has_focus(self, has_focus: bool) -> Self { Self { builder: self.builder.property("has-focus", has_focus), } } pub fn has_tooltip(self, has_tooltip: bool) -> Self { Self { builder: self.builder.property("has-tooltip", has_tooltip), } } pub fn height_request(self, height_request: i32) -> Self { Self { builder: self.builder.property("height-request", height_request), } } pub fn hexpand(self, hexpand: bool) -> Self { Self { builder: self.builder.property("hexpand", hexpand), } } pub fn hexpand_set(self, hexpand_set: bool) -> Self { Self { builder: self.builder.property("hexpand-set", hexpand_set), } } pub fn is_focus(self, is_focus: bool) -> Self { Self { builder: self.builder.property("is-focus", is_focus), } } pub fn margin(self, margin: i32) -> Self { Self { builder: self.builder.property("margin", margin), } } pub fn margin_bottom(self, margin_bottom: i32) -> Self { Self { builder: self.builder.property("margin-bottom", margin_bottom), } } pub fn margin_end(self, margin_end: i32) -> Self { Self { builder: self.builder.property("margin-end", margin_end), } } pub fn margin_start(self, margin_start: i32) -> Self { Self { builder: self.builder.property("margin-start", margin_start), } } pub fn margin_top(self, margin_top: i32) -> Self { Self { builder: self.builder.property("margin-top", margin_top), } } pub fn name(self, name: impl Into) -> Self { Self { builder: self.builder.property("name", name.into()), } } pub fn no_show_all(self, no_show_all: bool) -> Self { Self { builder: self.builder.property("no-show-all", no_show_all), } } pub fn opacity(self, opacity: f64) -> Self { Self { builder: self.builder.property("opacity", opacity), } } pub fn parent(self, parent: &impl IsA) -> Self { Self { builder: self.builder.property("parent", parent.clone().upcast()), } } pub fn receives_default(self, receives_default: bool) -> Self { Self { builder: self.builder.property("receives-default", receives_default), } } pub fn sensitive(self, sensitive: bool) -> Self { Self { builder: self.builder.property("sensitive", sensitive), } } //pub fn style(self, style: &impl IsA) -> Self { // Self { builder: self.builder.property("style", style.clone().upcast()), } //} pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { Self { builder: self .builder .property("tooltip-markup", tooltip_markup.into()), } } pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } } pub fn valign(self, valign: gtk::Align) -> Self { Self { builder: self.builder.property("valign", valign), } } pub fn vexpand(self, vexpand: bool) -> Self { Self { builder: self.builder.property("vexpand", vexpand), } } pub fn vexpand_set(self, vexpand_set: bool) -> Self { Self { builder: self.builder.property("vexpand-set", vexpand_set), } } pub fn visible(self, visible: bool) -> Self { Self { builder: self.builder.property("visible", visible), } } pub fn width_request(self, width_request: i32) -> Self { Self { builder: self.builder.property("width-request", width_request), } } pub fn action_name(self, action_name: impl Into) -> Self { Self { builder: self.builder.property("action-name", action_name.into()), } } pub fn action_target(self, action_target: &glib::Variant) -> Self { Self { builder: self .builder .property("action-target", action_target.clone()), } } // rustdoc-stripper-ignore-next /// Build the [`ExpanderRow`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> ExpanderRow { self.builder.build() } } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait ExpanderRowExt: IsA + sealed::Sealed + 'static { #[doc(alias = "hdy_expander_row_add_action")] fn add_action(&self, widget: &impl IsA) { unsafe { ffi::hdy_expander_row_add_action( self.as_ref().to_glib_none().0, widget.as_ref().to_glib_none().0, ); } } #[doc(alias = "hdy_expander_row_add_prefix")] fn add_prefix(&self, widget: &impl IsA) { unsafe { ffi::hdy_expander_row_add_prefix( self.as_ref().to_glib_none().0, widget.as_ref().to_glib_none().0, ); } } #[doc(alias = "hdy_expander_row_get_enable_expansion")] #[doc(alias = "get_enable_expansion")] fn enables_expansion(&self) -> bool { unsafe { from_glib(ffi::hdy_expander_row_get_enable_expansion( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_expander_row_get_expanded")] #[doc(alias = "get_expanded")] fn is_expanded(&self) -> bool { unsafe { from_glib(ffi::hdy_expander_row_get_expanded( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_expander_row_get_icon_name")] #[doc(alias = "get_icon_name")] fn icon_name(&self) -> Option { unsafe { from_glib_none(ffi::hdy_expander_row_get_icon_name( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_expander_row_get_show_enable_switch")] #[doc(alias = "get_show_enable_switch")] fn shows_enable_switch(&self) -> bool { unsafe { from_glib(ffi::hdy_expander_row_get_show_enable_switch( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_expander_row_get_subtitle")] #[doc(alias = "get_subtitle")] fn subtitle(&self) -> Option { unsafe { from_glib_none(ffi::hdy_expander_row_get_subtitle( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_expander_row_get_use_underline")] #[doc(alias = "get_use_underline")] fn uses_underline(&self) -> bool { unsafe { from_glib(ffi::hdy_expander_row_get_use_underline( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_expander_row_set_enable_expansion")] fn set_enable_expansion(&self, enable_expansion: bool) { unsafe { ffi::hdy_expander_row_set_enable_expansion( self.as_ref().to_glib_none().0, enable_expansion.into_glib(), ); } } #[doc(alias = "hdy_expander_row_set_expanded")] fn set_expanded(&self, expanded: bool) { unsafe { ffi::hdy_expander_row_set_expanded( self.as_ref().to_glib_none().0, expanded.into_glib(), ); } } #[doc(alias = "hdy_expander_row_set_icon_name")] fn set_icon_name(&self, icon_name: &str) { unsafe { ffi::hdy_expander_row_set_icon_name( self.as_ref().to_glib_none().0, icon_name.to_glib_none().0, ); } } #[doc(alias = "hdy_expander_row_set_show_enable_switch")] fn set_show_enable_switch(&self, show_enable_switch: bool) { unsafe { ffi::hdy_expander_row_set_show_enable_switch( self.as_ref().to_glib_none().0, show_enable_switch.into_glib(), ); } } #[doc(alias = "hdy_expander_row_set_subtitle")] fn set_subtitle(&self, subtitle: Option<&str>) { unsafe { ffi::hdy_expander_row_set_subtitle( self.as_ref().to_glib_none().0, subtitle.to_glib_none().0, ); } } #[doc(alias = "hdy_expander_row_set_use_underline")] fn set_use_underline(&self, use_underline: bool) { unsafe { ffi::hdy_expander_row_set_use_underline( self.as_ref().to_glib_none().0, use_underline.into_glib(), ); } } #[doc(alias = "enable-expansion")] fn connect_enable_expansion_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_enable_expansion_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyExpanderRow, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(ExpanderRow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::enable-expansion\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_enable_expansion_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "expanded")] fn connect_expanded_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_expanded_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyExpanderRow, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(ExpanderRow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::expanded\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_expanded_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "icon-name")] fn connect_icon_name_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_icon_name_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyExpanderRow, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(ExpanderRow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::icon-name\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_icon_name_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "show-enable-switch")] fn connect_show_enable_switch_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_show_enable_switch_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyExpanderRow, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(ExpanderRow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::show-enable-switch\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_show_enable_switch_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "subtitle")] fn connect_subtitle_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_subtitle_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyExpanderRow, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(ExpanderRow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::subtitle\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_subtitle_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl> ExpanderRowExt for O {} impl fmt::Display for ExpanderRow { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("ExpanderRow") } } rust-libhandy-0.11-0.11.1/src/auto/flap.rs000066400000000000000000000757651470255135400200150ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT use crate::{FlapFoldPolicy, FlapTransitionType, Swipeable}; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "HdyFlap")] pub struct Flap(Object) @extends gtk::Container, gtk::Widget, @implements gtk::Buildable, gtk::Orientable, Swipeable; match fn { type_ => || ffi::hdy_flap_get_type(), } } impl Flap { #[doc(alias = "hdy_flap_new")] pub fn new() -> Flap { assert_initialized_main_thread!(); unsafe { gtk::Widget::from_glib_none(ffi::hdy_flap_new()).unsafe_cast() } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`Flap`] objects. /// /// This method returns an instance of [`FlapBuilder`](crate::builders::FlapBuilder) which can be used to create [`Flap`] objects. pub fn builder() -> FlapBuilder { FlapBuilder::new() } #[doc(alias = "hdy_flap_get_content")] #[doc(alias = "get_content")] pub fn content(&self) -> Option { unsafe { from_glib_none(ffi::hdy_flap_get_content(self.to_glib_none().0)) } } #[doc(alias = "hdy_flap_get_flap")] #[doc(alias = "get_flap")] pub fn flap(&self) -> Option { unsafe { from_glib_none(ffi::hdy_flap_get_flap(self.to_glib_none().0)) } } #[doc(alias = "hdy_flap_get_flap_position")] #[doc(alias = "get_flap_position")] pub fn flap_position(&self) -> gtk::PackType { unsafe { from_glib(ffi::hdy_flap_get_flap_position(self.to_glib_none().0)) } } #[doc(alias = "hdy_flap_get_fold_duration")] #[doc(alias = "get_fold_duration")] pub fn fold_duration(&self) -> u32 { unsafe { ffi::hdy_flap_get_fold_duration(self.to_glib_none().0) } } #[doc(alias = "hdy_flap_get_fold_policy")] #[doc(alias = "get_fold_policy")] pub fn fold_policy(&self) -> FlapFoldPolicy { unsafe { from_glib(ffi::hdy_flap_get_fold_policy(self.to_glib_none().0)) } } #[doc(alias = "hdy_flap_get_folded")] #[doc(alias = "get_folded")] pub fn is_folded(&self) -> bool { unsafe { from_glib(ffi::hdy_flap_get_folded(self.to_glib_none().0)) } } #[doc(alias = "hdy_flap_get_locked")] #[doc(alias = "get_locked")] pub fn is_locked(&self) -> bool { unsafe { from_glib(ffi::hdy_flap_get_locked(self.to_glib_none().0)) } } #[doc(alias = "hdy_flap_get_modal")] #[doc(alias = "get_modal")] pub fn is_modal(&self) -> bool { unsafe { from_glib(ffi::hdy_flap_get_modal(self.to_glib_none().0)) } } #[doc(alias = "hdy_flap_get_reveal_duration")] #[doc(alias = "get_reveal_duration")] pub fn reveal_duration(&self) -> u32 { unsafe { ffi::hdy_flap_get_reveal_duration(self.to_glib_none().0) } } #[doc(alias = "hdy_flap_get_reveal_flap")] #[doc(alias = "get_reveal_flap")] pub fn reveals_flap(&self) -> bool { unsafe { from_glib(ffi::hdy_flap_get_reveal_flap(self.to_glib_none().0)) } } #[doc(alias = "hdy_flap_get_reveal_progress")] #[doc(alias = "get_reveal_progress")] pub fn reveal_progress(&self) -> f64 { unsafe { ffi::hdy_flap_get_reveal_progress(self.to_glib_none().0) } } #[doc(alias = "hdy_flap_get_separator")] #[doc(alias = "get_separator")] pub fn separator(&self) -> Option { unsafe { from_glib_none(ffi::hdy_flap_get_separator(self.to_glib_none().0)) } } #[doc(alias = "hdy_flap_get_swipe_to_close")] #[doc(alias = "get_swipe_to_close")] pub fn is_swipe_to_close(&self) -> bool { unsafe { from_glib(ffi::hdy_flap_get_swipe_to_close(self.to_glib_none().0)) } } #[doc(alias = "hdy_flap_get_swipe_to_open")] #[doc(alias = "get_swipe_to_open")] pub fn is_swipe_to_open(&self) -> bool { unsafe { from_glib(ffi::hdy_flap_get_swipe_to_open(self.to_glib_none().0)) } } #[doc(alias = "hdy_flap_get_transition_type")] #[doc(alias = "get_transition_type")] pub fn transition_type(&self) -> FlapTransitionType { unsafe { from_glib(ffi::hdy_flap_get_transition_type(self.to_glib_none().0)) } } #[doc(alias = "hdy_flap_set_content")] pub fn set_content(&self, content: Option<&impl IsA>) { unsafe { ffi::hdy_flap_set_content( self.to_glib_none().0, content.map(|p| p.as_ref()).to_glib_none().0, ); } } #[doc(alias = "hdy_flap_set_flap")] pub fn set_flap(&self, flap: Option<&impl IsA>) { unsafe { ffi::hdy_flap_set_flap( self.to_glib_none().0, flap.map(|p| p.as_ref()).to_glib_none().0, ); } } #[doc(alias = "hdy_flap_set_flap_position")] pub fn set_flap_position(&self, position: gtk::PackType) { unsafe { ffi::hdy_flap_set_flap_position(self.to_glib_none().0, position.into_glib()); } } #[doc(alias = "hdy_flap_set_fold_duration")] pub fn set_fold_duration(&self, duration: u32) { unsafe { ffi::hdy_flap_set_fold_duration(self.to_glib_none().0, duration); } } #[doc(alias = "hdy_flap_set_fold_policy")] pub fn set_fold_policy(&self, policy: FlapFoldPolicy) { unsafe { ffi::hdy_flap_set_fold_policy(self.to_glib_none().0, policy.into_glib()); } } #[doc(alias = "hdy_flap_set_locked")] pub fn set_locked(&self, locked: bool) { unsafe { ffi::hdy_flap_set_locked(self.to_glib_none().0, locked.into_glib()); } } #[doc(alias = "hdy_flap_set_modal")] pub fn set_modal(&self, modal: bool) { unsafe { ffi::hdy_flap_set_modal(self.to_glib_none().0, modal.into_glib()); } } #[doc(alias = "hdy_flap_set_reveal_duration")] pub fn set_reveal_duration(&self, duration: u32) { unsafe { ffi::hdy_flap_set_reveal_duration(self.to_glib_none().0, duration); } } #[doc(alias = "hdy_flap_set_reveal_flap")] pub fn set_reveal_flap(&self, reveal_flap: bool) { unsafe { ffi::hdy_flap_set_reveal_flap(self.to_glib_none().0, reveal_flap.into_glib()); } } #[doc(alias = "hdy_flap_set_separator")] pub fn set_separator(&self, separator: Option<&impl IsA>) { unsafe { ffi::hdy_flap_set_separator( self.to_glib_none().0, separator.map(|p| p.as_ref()).to_glib_none().0, ); } } #[doc(alias = "hdy_flap_set_swipe_to_close")] pub fn set_swipe_to_close(&self, swipe_to_close: bool) { unsafe { ffi::hdy_flap_set_swipe_to_close(self.to_glib_none().0, swipe_to_close.into_glib()); } } #[doc(alias = "hdy_flap_set_swipe_to_open")] pub fn set_swipe_to_open(&self, swipe_to_open: bool) { unsafe { ffi::hdy_flap_set_swipe_to_open(self.to_glib_none().0, swipe_to_open.into_glib()); } } #[doc(alias = "hdy_flap_set_transition_type")] pub fn set_transition_type(&self, transition_type: FlapTransitionType) { unsafe { ffi::hdy_flap_set_transition_type(self.to_glib_none().0, transition_type.into_glib()); } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "content")] pub fn connect_content_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_content_trampoline( this: *mut ffi::HdyFlap, _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 _, b"notify::content\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_content_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "flap")] pub fn connect_flap_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_flap_trampoline( this: *mut ffi::HdyFlap, _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 _, b"notify::flap\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_flap_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "flap-position")] pub fn connect_flap_position_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_flap_position_trampoline( this: *mut ffi::HdyFlap, _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 _, b"notify::flap-position\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_flap_position_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "fold-duration")] pub fn connect_fold_duration_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_fold_duration_trampoline( this: *mut ffi::HdyFlap, _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 _, b"notify::fold-duration\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_fold_duration_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "fold-policy")] pub fn connect_fold_policy_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_fold_policy_trampoline( this: *mut ffi::HdyFlap, _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 _, b"notify::fold-policy\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_fold_policy_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "folded")] pub fn connect_folded_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_folded_trampoline( this: *mut ffi::HdyFlap, _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 _, b"notify::folded\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_folded_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "locked")] pub fn connect_locked_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_locked_trampoline( this: *mut ffi::HdyFlap, _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 _, b"notify::locked\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_locked_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "modal")] pub fn connect_modal_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_modal_trampoline( this: *mut ffi::HdyFlap, _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 _, b"notify::modal\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_modal_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "reveal-duration")] pub fn connect_reveal_duration_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_reveal_duration_trampoline( this: *mut ffi::HdyFlap, _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 _, b"notify::reveal-duration\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_reveal_duration_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "reveal-flap")] pub fn connect_reveal_flap_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_reveal_flap_trampoline( this: *mut ffi::HdyFlap, _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 _, b"notify::reveal-flap\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_reveal_flap_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "reveal-progress")] pub fn connect_reveal_progress_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_reveal_progress_trampoline( this: *mut ffi::HdyFlap, _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 _, b"notify::reveal-progress\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_reveal_progress_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "separator")] pub fn connect_separator_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_separator_trampoline( this: *mut ffi::HdyFlap, _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 _, b"notify::separator\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_separator_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "swipe-to-close")] pub fn connect_swipe_to_close_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_swipe_to_close_trampoline( this: *mut ffi::HdyFlap, _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 _, b"notify::swipe-to-close\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_swipe_to_close_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "swipe-to-open")] pub fn connect_swipe_to_open_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_swipe_to_open_trampoline( this: *mut ffi::HdyFlap, _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 _, b"notify::swipe-to-open\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_swipe_to_open_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "transition-type")] pub fn connect_transition_type_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_transition_type_trampoline( this: *mut ffi::HdyFlap, _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 _, b"notify::transition-type\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_transition_type_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] impl Default for Flap { fn default() -> Self { Self::new() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`Flap`] 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 FlapBuilder { builder: glib::object::ObjectBuilder<'static, Flap>, } impl FlapBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn content(self, content: &impl IsA) -> Self { Self { builder: self.builder.property("content", content.clone().upcast()), } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn flap(self, flap: &impl IsA) -> Self { Self { builder: self.builder.property("flap", flap.clone().upcast()), } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn flap_position(self, flap_position: gtk::PackType) -> Self { Self { builder: self.builder.property("flap-position", flap_position), } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn fold_duration(self, fold_duration: u32) -> Self { Self { builder: self.builder.property("fold-duration", fold_duration), } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn fold_policy(self, fold_policy: FlapFoldPolicy) -> Self { Self { builder: self.builder.property("fold-policy", fold_policy), } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn locked(self, locked: bool) -> Self { Self { builder: self.builder.property("locked", locked), } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn modal(self, modal: bool) -> Self { Self { builder: self.builder.property("modal", modal), } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn reveal_duration(self, reveal_duration: u32) -> Self { Self { builder: self.builder.property("reveal-duration", reveal_duration), } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn reveal_flap(self, reveal_flap: bool) -> Self { Self { builder: self.builder.property("reveal-flap", reveal_flap), } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn separator(self, separator: &impl IsA) -> Self { Self { builder: self .builder .property("separator", separator.clone().upcast()), } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn swipe_to_close(self, swipe_to_close: bool) -> Self { Self { builder: self.builder.property("swipe-to-close", swipe_to_close), } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn swipe_to_open(self, swipe_to_open: bool) -> Self { Self { builder: self.builder.property("swipe-to-open", swipe_to_open), } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn transition_type(self, transition_type: FlapTransitionType) -> Self { Self { builder: self.builder.property("transition-type", transition_type), } } pub fn border_width(self, border_width: u32) -> Self { Self { builder: self.builder.property("border-width", border_width), } } pub fn child(self, child: &impl IsA) -> Self { Self { builder: self.builder.property("child", child.clone().upcast()), } } pub fn resize_mode(self, resize_mode: gtk::ResizeMode) -> Self { Self { builder: self.builder.property("resize-mode", resize_mode), } } pub fn app_paintable(self, app_paintable: bool) -> Self { Self { builder: self.builder.property("app-paintable", app_paintable), } } pub fn can_default(self, can_default: bool) -> Self { Self { builder: self.builder.property("can-default", can_default), } } pub fn can_focus(self, can_focus: bool) -> Self { Self { builder: self.builder.property("can-focus", can_focus), } } pub fn events(self, events: gdk::EventMask) -> Self { Self { builder: self.builder.property("events", events), } } pub fn expand(self, expand: bool) -> Self { Self { builder: self.builder.property("expand", expand), } } pub fn focus_on_click(self, focus_on_click: bool) -> Self { Self { builder: self.builder.property("focus-on-click", focus_on_click), } } pub fn halign(self, halign: gtk::Align) -> Self { Self { builder: self.builder.property("halign", halign), } } pub fn has_default(self, has_default: bool) -> Self { Self { builder: self.builder.property("has-default", has_default), } } pub fn has_focus(self, has_focus: bool) -> Self { Self { builder: self.builder.property("has-focus", has_focus), } } pub fn has_tooltip(self, has_tooltip: bool) -> Self { Self { builder: self.builder.property("has-tooltip", has_tooltip), } } pub fn height_request(self, height_request: i32) -> Self { Self { builder: self.builder.property("height-request", height_request), } } pub fn hexpand(self, hexpand: bool) -> Self { Self { builder: self.builder.property("hexpand", hexpand), } } pub fn hexpand_set(self, hexpand_set: bool) -> Self { Self { builder: self.builder.property("hexpand-set", hexpand_set), } } pub fn is_focus(self, is_focus: bool) -> Self { Self { builder: self.builder.property("is-focus", is_focus), } } pub fn margin(self, margin: i32) -> Self { Self { builder: self.builder.property("margin", margin), } } pub fn margin_bottom(self, margin_bottom: i32) -> Self { Self { builder: self.builder.property("margin-bottom", margin_bottom), } } pub fn margin_end(self, margin_end: i32) -> Self { Self { builder: self.builder.property("margin-end", margin_end), } } pub fn margin_start(self, margin_start: i32) -> Self { Self { builder: self.builder.property("margin-start", margin_start), } } pub fn margin_top(self, margin_top: i32) -> Self { Self { builder: self.builder.property("margin-top", margin_top), } } pub fn name(self, name: impl Into) -> Self { Self { builder: self.builder.property("name", name.into()), } } pub fn no_show_all(self, no_show_all: bool) -> Self { Self { builder: self.builder.property("no-show-all", no_show_all), } } pub fn opacity(self, opacity: f64) -> Self { Self { builder: self.builder.property("opacity", opacity), } } pub fn parent(self, parent: &impl IsA) -> Self { Self { builder: self.builder.property("parent", parent.clone().upcast()), } } pub fn receives_default(self, receives_default: bool) -> Self { Self { builder: self.builder.property("receives-default", receives_default), } } pub fn sensitive(self, sensitive: bool) -> Self { Self { builder: self.builder.property("sensitive", sensitive), } } //pub fn style(self, style: &impl IsA) -> Self { // Self { builder: self.builder.property("style", style.clone().upcast()), } //} pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { Self { builder: self .builder .property("tooltip-markup", tooltip_markup.into()), } } pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } } pub fn valign(self, valign: gtk::Align) -> Self { Self { builder: self.builder.property("valign", valign), } } pub fn vexpand(self, vexpand: bool) -> Self { Self { builder: self.builder.property("vexpand", vexpand), } } pub fn vexpand_set(self, vexpand_set: bool) -> Self { Self { builder: self.builder.property("vexpand-set", vexpand_set), } } pub fn visible(self, visible: bool) -> Self { Self { builder: self.builder.property("visible", visible), } } pub fn width_request(self, width_request: i32) -> Self { Self { builder: self.builder.property("width-request", width_request), } } pub fn orientation(self, orientation: gtk::Orientation) -> Self { Self { builder: self.builder.property("orientation", orientation), } } // rustdoc-stripper-ignore-next /// Build the [`Flap`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> Flap { self.builder.build() } } impl fmt::Display for Flap { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Flap") } } rust-libhandy-0.11-0.11.1/src/auto/functions.rs000066400000000000000000000020151470255135400210550ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT use glib::{prelude::*, translate::*}; #[doc(alias = "hdy_ease_out_cubic")] pub fn ease_out_cubic(t: f64) -> f64 { assert_initialized_main_thread!(); unsafe { ffi::hdy_ease_out_cubic(t) } } //#[doc(alias = "hdy_enum_value_row_name")] //pub fn enum_value_row_name(value: &EnumValueObject, user_data: /*Unimplemented*/Option) -> Option { // unsafe { TODO: call ffi:hdy_enum_value_row_name() } //} #[doc(alias = "hdy_get_enable_animations")] #[doc(alias = "get_enable_animations")] pub fn enables_animations(widget: &impl IsA) -> bool { assert_initialized_main_thread!(); unsafe { from_glib(ffi::hdy_get_enable_animations( widget.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_init")] pub fn init() { assert_initialized_main_thread!(); unsafe { ffi::hdy_init(); } } rust-libhandy-0.11-0.11.1/src/auto/header_bar.rs000066400000000000000000000676431470255135400211430ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT use crate::CenteringPolicy; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "HdyHeaderBar")] pub struct HeaderBar(Object) @extends gtk::Container, gtk::Widget, @implements gtk::Buildable; match fn { type_ => || ffi::hdy_header_bar_get_type(), } } impl HeaderBar { pub const NONE: Option<&'static HeaderBar> = None; #[doc(alias = "hdy_header_bar_new")] pub fn new() -> HeaderBar { assert_initialized_main_thread!(); unsafe { gtk::Widget::from_glib_none(ffi::hdy_header_bar_new()).unsafe_cast() } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`HeaderBar`] objects. /// /// This method returns an instance of [`HeaderBarBuilder`](crate::builders::HeaderBarBuilder) which can be used to create [`HeaderBar`] objects. pub fn builder() -> HeaderBarBuilder { HeaderBarBuilder::new() } } impl Default for HeaderBar { fn default() -> Self { Self::new() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`HeaderBar`] 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 HeaderBarBuilder { builder: glib::object::ObjectBuilder<'static, HeaderBar>, } impl HeaderBarBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } pub fn centering_policy(self, centering_policy: CenteringPolicy) -> Self { Self { builder: self.builder.property("centering-policy", centering_policy), } } pub fn custom_title(self, custom_title: &impl IsA) -> Self { Self { builder: self .builder .property("custom-title", custom_title.clone().upcast()), } } pub fn decoration_layout(self, decoration_layout: impl Into) -> Self { Self { builder: self .builder .property("decoration-layout", decoration_layout.into()), } } pub fn decoration_layout_set(self, decoration_layout_set: bool) -> Self { Self { builder: self .builder .property("decoration-layout-set", decoration_layout_set), } } pub fn has_subtitle(self, has_subtitle: bool) -> Self { Self { builder: self.builder.property("has-subtitle", has_subtitle), } } pub fn interpolate_size(self, interpolate_size: bool) -> Self { Self { builder: self.builder.property("interpolate-size", interpolate_size), } } pub fn show_close_button(self, show_close_button: bool) -> Self { Self { builder: self .builder .property("show-close-button", show_close_button), } } pub fn spacing(self, spacing: i32) -> Self { Self { builder: self.builder.property("spacing", spacing), } } pub fn subtitle(self, subtitle: impl Into) -> Self { Self { builder: self.builder.property("subtitle", subtitle.into()), } } pub fn title(self, title: impl Into) -> Self { Self { builder: self.builder.property("title", title.into()), } } pub fn transition_duration(self, transition_duration: u32) -> Self { Self { builder: self .builder .property("transition-duration", transition_duration), } } pub fn border_width(self, border_width: u32) -> Self { Self { builder: self.builder.property("border-width", border_width), } } pub fn child(self, child: &impl IsA) -> Self { Self { builder: self.builder.property("child", child.clone().upcast()), } } pub fn resize_mode(self, resize_mode: gtk::ResizeMode) -> Self { Self { builder: self.builder.property("resize-mode", resize_mode), } } pub fn app_paintable(self, app_paintable: bool) -> Self { Self { builder: self.builder.property("app-paintable", app_paintable), } } pub fn can_default(self, can_default: bool) -> Self { Self { builder: self.builder.property("can-default", can_default), } } pub fn can_focus(self, can_focus: bool) -> Self { Self { builder: self.builder.property("can-focus", can_focus), } } pub fn events(self, events: gdk::EventMask) -> Self { Self { builder: self.builder.property("events", events), } } pub fn expand(self, expand: bool) -> Self { Self { builder: self.builder.property("expand", expand), } } pub fn focus_on_click(self, focus_on_click: bool) -> Self { Self { builder: self.builder.property("focus-on-click", focus_on_click), } } pub fn halign(self, halign: gtk::Align) -> Self { Self { builder: self.builder.property("halign", halign), } } pub fn has_default(self, has_default: bool) -> Self { Self { builder: self.builder.property("has-default", has_default), } } pub fn has_focus(self, has_focus: bool) -> Self { Self { builder: self.builder.property("has-focus", has_focus), } } pub fn has_tooltip(self, has_tooltip: bool) -> Self { Self { builder: self.builder.property("has-tooltip", has_tooltip), } } pub fn height_request(self, height_request: i32) -> Self { Self { builder: self.builder.property("height-request", height_request), } } pub fn hexpand(self, hexpand: bool) -> Self { Self { builder: self.builder.property("hexpand", hexpand), } } pub fn hexpand_set(self, hexpand_set: bool) -> Self { Self { builder: self.builder.property("hexpand-set", hexpand_set), } } pub fn is_focus(self, is_focus: bool) -> Self { Self { builder: self.builder.property("is-focus", is_focus), } } pub fn margin(self, margin: i32) -> Self { Self { builder: self.builder.property("margin", margin), } } pub fn margin_bottom(self, margin_bottom: i32) -> Self { Self { builder: self.builder.property("margin-bottom", margin_bottom), } } pub fn margin_end(self, margin_end: i32) -> Self { Self { builder: self.builder.property("margin-end", margin_end), } } pub fn margin_start(self, margin_start: i32) -> Self { Self { builder: self.builder.property("margin-start", margin_start), } } pub fn margin_top(self, margin_top: i32) -> Self { Self { builder: self.builder.property("margin-top", margin_top), } } pub fn name(self, name: impl Into) -> Self { Self { builder: self.builder.property("name", name.into()), } } pub fn no_show_all(self, no_show_all: bool) -> Self { Self { builder: self.builder.property("no-show-all", no_show_all), } } pub fn opacity(self, opacity: f64) -> Self { Self { builder: self.builder.property("opacity", opacity), } } pub fn parent(self, parent: &impl IsA) -> Self { Self { builder: self.builder.property("parent", parent.clone().upcast()), } } pub fn receives_default(self, receives_default: bool) -> Self { Self { builder: self.builder.property("receives-default", receives_default), } } pub fn sensitive(self, sensitive: bool) -> Self { Self { builder: self.builder.property("sensitive", sensitive), } } //pub fn style(self, style: &impl IsA) -> Self { // Self { builder: self.builder.property("style", style.clone().upcast()), } //} pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { Self { builder: self .builder .property("tooltip-markup", tooltip_markup.into()), } } pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } } pub fn valign(self, valign: gtk::Align) -> Self { Self { builder: self.builder.property("valign", valign), } } pub fn vexpand(self, vexpand: bool) -> Self { Self { builder: self.builder.property("vexpand", vexpand), } } pub fn vexpand_set(self, vexpand_set: bool) -> Self { Self { builder: self.builder.property("vexpand-set", vexpand_set), } } pub fn visible(self, visible: bool) -> Self { Self { builder: self.builder.property("visible", visible), } } pub fn width_request(self, width_request: i32) -> Self { Self { builder: self.builder.property("width-request", width_request), } } // rustdoc-stripper-ignore-next /// Build the [`HeaderBar`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> HeaderBar { self.builder.build() } } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait HdyHeaderBarExt: IsA + sealed::Sealed + 'static { #[doc(alias = "hdy_header_bar_get_centering_policy")] #[doc(alias = "get_centering_policy")] fn centering_policy(&self) -> CenteringPolicy { unsafe { from_glib(ffi::hdy_header_bar_get_centering_policy( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_header_bar_get_custom_title")] #[doc(alias = "get_custom_title")] fn custom_title(&self) -> Option { unsafe { from_glib_none(ffi::hdy_header_bar_get_custom_title( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_header_bar_get_decoration_layout")] #[doc(alias = "get_decoration_layout")] fn decoration_layout(&self) -> Option { unsafe { from_glib_none(ffi::hdy_header_bar_get_decoration_layout( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_header_bar_get_has_subtitle")] #[doc(alias = "get_has_subtitle")] fn has_subtitle(&self) -> bool { unsafe { from_glib(ffi::hdy_header_bar_get_has_subtitle( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_header_bar_get_interpolate_size")] #[doc(alias = "get_interpolate_size")] fn is_interpolate_size(&self) -> bool { unsafe { from_glib(ffi::hdy_header_bar_get_interpolate_size( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_header_bar_get_show_close_button")] #[doc(alias = "get_show_close_button")] fn shows_close_button(&self) -> bool { unsafe { from_glib(ffi::hdy_header_bar_get_show_close_button( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_header_bar_get_subtitle")] #[doc(alias = "get_subtitle")] fn subtitle(&self) -> Option { unsafe { from_glib_none(ffi::hdy_header_bar_get_subtitle( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_header_bar_get_title")] #[doc(alias = "get_title")] fn title(&self) -> Option { unsafe { from_glib_none(ffi::hdy_header_bar_get_title( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_header_bar_get_transition_duration")] #[doc(alias = "get_transition_duration")] fn transition_duration(&self) -> u32 { unsafe { ffi::hdy_header_bar_get_transition_duration(self.as_ref().to_glib_none().0) } } #[doc(alias = "hdy_header_bar_get_transition_running")] #[doc(alias = "get_transition_running")] fn is_transition_running(&self) -> bool { unsafe { from_glib(ffi::hdy_header_bar_get_transition_running( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_header_bar_pack_end")] fn pack_end(&self, child: &impl IsA) { unsafe { ffi::hdy_header_bar_pack_end( self.as_ref().to_glib_none().0, child.as_ref().to_glib_none().0, ); } } #[doc(alias = "hdy_header_bar_pack_start")] fn pack_start(&self, child: &impl IsA) { unsafe { ffi::hdy_header_bar_pack_start( self.as_ref().to_glib_none().0, child.as_ref().to_glib_none().0, ); } } #[doc(alias = "hdy_header_bar_set_centering_policy")] fn set_centering_policy(&self, centering_policy: CenteringPolicy) { unsafe { ffi::hdy_header_bar_set_centering_policy( self.as_ref().to_glib_none().0, centering_policy.into_glib(), ); } } #[doc(alias = "hdy_header_bar_set_custom_title")] fn set_custom_title(&self, title_widget: Option<&impl IsA>) { unsafe { ffi::hdy_header_bar_set_custom_title( self.as_ref().to_glib_none().0, title_widget.map(|p| p.as_ref()).to_glib_none().0, ); } } #[doc(alias = "hdy_header_bar_set_decoration_layout")] fn set_decoration_layout(&self, layout: Option<&str>) { unsafe { ffi::hdy_header_bar_set_decoration_layout( self.as_ref().to_glib_none().0, layout.to_glib_none().0, ); } } #[doc(alias = "hdy_header_bar_set_has_subtitle")] fn set_has_subtitle(&self, setting: bool) { unsafe { ffi::hdy_header_bar_set_has_subtitle( self.as_ref().to_glib_none().0, setting.into_glib(), ); } } #[doc(alias = "hdy_header_bar_set_interpolate_size")] fn set_interpolate_size(&self, interpolate_size: bool) { unsafe { ffi::hdy_header_bar_set_interpolate_size( self.as_ref().to_glib_none().0, interpolate_size.into_glib(), ); } } #[doc(alias = "hdy_header_bar_set_show_close_button")] fn set_show_close_button(&self, setting: bool) { unsafe { ffi::hdy_header_bar_set_show_close_button( self.as_ref().to_glib_none().0, setting.into_glib(), ); } } #[doc(alias = "hdy_header_bar_set_subtitle")] fn set_subtitle(&self, subtitle: Option<&str>) { unsafe { ffi::hdy_header_bar_set_subtitle( self.as_ref().to_glib_none().0, subtitle.to_glib_none().0, ); } } #[doc(alias = "hdy_header_bar_set_title")] fn set_title(&self, title: Option<&str>) { unsafe { ffi::hdy_header_bar_set_title(self.as_ref().to_glib_none().0, title.to_glib_none().0); } } #[doc(alias = "hdy_header_bar_set_transition_duration")] fn set_transition_duration(&self, duration: u32) { unsafe { ffi::hdy_header_bar_set_transition_duration(self.as_ref().to_glib_none().0, duration); } } #[doc(alias = "decoration-layout-set")] fn is_decoration_layout_set(&self) -> bool { ObjectExt::property(self.as_ref(), "decoration-layout-set") } #[doc(alias = "decoration-layout-set")] fn set_decoration_layout_set(&self, decoration_layout_set: bool) { ObjectExt::set_property( self.as_ref(), "decoration-layout-set", decoration_layout_set, ) } fn spacing(&self) -> i32 { ObjectExt::property(self.as_ref(), "spacing") } fn set_spacing(&self, spacing: i32) { ObjectExt::set_property(self.as_ref(), "spacing", spacing) } #[doc(alias = "centering-policy")] fn connect_centering_policy_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_centering_policy_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyHeaderBar, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(HeaderBar::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::centering-policy\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_centering_policy_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "custom-title")] fn connect_custom_title_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_custom_title_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyHeaderBar, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(HeaderBar::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::custom-title\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_custom_title_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "decoration-layout")] fn connect_decoration_layout_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_decoration_layout_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyHeaderBar, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(HeaderBar::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::decoration-layout\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_decoration_layout_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "decoration-layout-set")] fn connect_decoration_layout_set_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_decoration_layout_set_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyHeaderBar, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(HeaderBar::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::decoration-layout-set\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_decoration_layout_set_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "has-subtitle")] fn connect_has_subtitle_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_has_subtitle_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyHeaderBar, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(HeaderBar::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::has-subtitle\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_has_subtitle_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "interpolate-size")] fn connect_interpolate_size_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_interpolate_size_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyHeaderBar, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(HeaderBar::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::interpolate-size\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_interpolate_size_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "show-close-button")] fn connect_show_close_button_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_show_close_button_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyHeaderBar, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(HeaderBar::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::show-close-button\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_show_close_button_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "spacing")] fn connect_spacing_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_spacing_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::HdyHeaderBar, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(HeaderBar::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::spacing\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_spacing_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "subtitle")] fn connect_subtitle_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_subtitle_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::HdyHeaderBar, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(HeaderBar::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::subtitle\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_subtitle_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "title")] fn connect_title_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_title_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::HdyHeaderBar, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(HeaderBar::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::title\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_title_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "transition-duration")] fn connect_transition_duration_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_transition_duration_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyHeaderBar, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(HeaderBar::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::transition-duration\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_transition_duration_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "transition-running")] fn connect_transition_running_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_transition_running_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyHeaderBar, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(HeaderBar::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::transition-running\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_transition_running_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl> HdyHeaderBarExt for O {} impl fmt::Display for HeaderBar { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("HeaderBar") } } rust-libhandy-0.11-0.11.1/src/auto/header_group.rs000066400000000000000000000156331470255135400215230ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT use crate::{HeaderBar, HeaderGroupChild}; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "HdyHeaderGroup")] pub struct HeaderGroup(Object) @implements gtk::Buildable; match fn { type_ => || ffi::hdy_header_group_get_type(), } } impl HeaderGroup { #[doc(alias = "hdy_header_group_new")] pub fn new() -> HeaderGroup { assert_initialized_main_thread!(); unsafe { from_glib_full(ffi::hdy_header_group_new()) } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`HeaderGroup`] objects. /// /// This method returns an instance of [`HeaderGroupBuilder`](crate::builders::HeaderGroupBuilder) which can be used to create [`HeaderGroup`] objects. pub fn builder() -> HeaderGroupBuilder { HeaderGroupBuilder::new() } #[doc(alias = "hdy_header_group_add_gtk_header_bar")] pub fn add_gtk_header_bar(&self, header_bar: &impl IsA) { unsafe { ffi::hdy_header_group_add_gtk_header_bar( self.to_glib_none().0, header_bar.as_ref().to_glib_none().0, ); } } #[doc(alias = "hdy_header_group_add_header_bar")] pub fn add_header_bar(&self, header_bar: &impl IsA) { unsafe { ffi::hdy_header_group_add_header_bar( self.to_glib_none().0, header_bar.as_ref().to_glib_none().0, ); } } #[doc(alias = "hdy_header_group_add_header_group")] pub fn add_header_group(&self, header_group: &HeaderGroup) { unsafe { ffi::hdy_header_group_add_header_group( self.to_glib_none().0, header_group.to_glib_none().0, ); } } #[doc(alias = "hdy_header_group_get_children")] #[doc(alias = "get_children")] pub fn children(&self) -> Vec { unsafe { FromGlibPtrContainer::from_glib_none(ffi::hdy_header_group_get_children( self.to_glib_none().0, )) } } #[doc(alias = "hdy_header_group_get_decorate_all")] #[doc(alias = "get_decorate_all")] pub fn is_decorate_all(&self) -> bool { unsafe { from_glib(ffi::hdy_header_group_get_decorate_all( self.to_glib_none().0, )) } } #[doc(alias = "hdy_header_group_remove_child")] pub fn remove_child(&self, child: &HeaderGroupChild) { unsafe { ffi::hdy_header_group_remove_child(self.to_glib_none().0, child.to_glib_none().0); } } #[doc(alias = "hdy_header_group_remove_gtk_header_bar")] pub fn remove_gtk_header_bar(&self, header_bar: &impl IsA) { unsafe { ffi::hdy_header_group_remove_gtk_header_bar( self.to_glib_none().0, header_bar.as_ref().to_glib_none().0, ); } } #[doc(alias = "hdy_header_group_remove_header_bar")] pub fn remove_header_bar(&self, header_bar: &impl IsA) { unsafe { ffi::hdy_header_group_remove_header_bar( self.to_glib_none().0, header_bar.as_ref().to_glib_none().0, ); } } #[doc(alias = "hdy_header_group_remove_header_group")] pub fn remove_header_group(&self, header_group: &HeaderGroup) { unsafe { ffi::hdy_header_group_remove_header_group( self.to_glib_none().0, header_group.to_glib_none().0, ); } } #[doc(alias = "hdy_header_group_set_decorate_all")] pub fn set_decorate_all(&self, decorate_all: bool) { unsafe { ffi::hdy_header_group_set_decorate_all(self.to_glib_none().0, decorate_all.into_glib()); } } #[doc(alias = "update-decoration-layouts")] pub fn connect_update_decoration_layouts( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn update_decoration_layouts_trampoline( this: *mut ffi::HdyHeaderGroup, 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 _, b"update-decoration-layouts\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( update_decoration_layouts_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "decorate-all")] pub fn connect_decorate_all_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_decorate_all_trampoline( this: *mut ffi::HdyHeaderGroup, _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 _, b"notify::decorate-all\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_decorate_all_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl Default for HeaderGroup { fn default() -> Self { Self::new() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`HeaderGroup`] 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 HeaderGroupBuilder { builder: glib::object::ObjectBuilder<'static, HeaderGroup>, } impl HeaderGroupBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } pub fn decorate_all(self, decorate_all: bool) -> Self { Self { builder: self.builder.property("decorate-all", decorate_all), } } // rustdoc-stripper-ignore-next /// Build the [`HeaderGroup`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> HeaderGroup { self.builder.build() } } impl fmt::Display for HeaderGroup { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("HeaderGroup") } } rust-libhandy-0.11-0.11.1/src/auto/header_group_child.rs000066400000000000000000000036051470255135400226620ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT use crate::{HeaderBar, HeaderGroup, HeaderGroupChildType}; use glib::translate::*; use std::fmt; glib::wrapper! { #[doc(alias = "HdyHeaderGroupChild")] pub struct HeaderGroupChild(Object); match fn { type_ => || ffi::hdy_header_group_child_get_type(), } } impl HeaderGroupChild { #[doc(alias = "hdy_header_group_child_get_child_type")] #[doc(alias = "get_child_type")] pub fn child_type(&self) -> HeaderGroupChildType { unsafe { from_glib(ffi::hdy_header_group_child_get_child_type( self.to_glib_none().0, )) } } #[doc(alias = "hdy_header_group_child_get_gtk_header_bar")] #[doc(alias = "get_gtk_header_bar")] pub fn gtk_header_bar(&self) -> Option { unsafe { from_glib_none(ffi::hdy_header_group_child_get_gtk_header_bar( self.to_glib_none().0, )) } } #[doc(alias = "hdy_header_group_child_get_header_bar")] #[doc(alias = "get_header_bar")] pub fn header_bar(&self) -> Option { unsafe { from_glib_none(ffi::hdy_header_group_child_get_header_bar( self.to_glib_none().0, )) } } #[doc(alias = "hdy_header_group_child_get_header_group")] #[doc(alias = "get_header_group")] pub fn header_group(&self) -> Option { unsafe { from_glib_none(ffi::hdy_header_group_child_get_header_group( self.to_glib_none().0, )) } } } impl fmt::Display for HeaderGroupChild { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("HeaderGroupChild") } } rust-libhandy-0.11-0.11.1/src/auto/keypad.rs000066400000000000000000000466231470255135400203370ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "HdyKeypad")] pub struct Keypad(Object) @extends gtk::Bin, gtk::Container, gtk::Widget, @implements gtk::Buildable; match fn { type_ => || ffi::hdy_keypad_get_type(), } } impl Keypad { pub const NONE: Option<&'static Keypad> = None; #[doc(alias = "hdy_keypad_new")] pub fn new(symbols_visible: bool, letters_visible: bool) -> Keypad { assert_initialized_main_thread!(); unsafe { gtk::Widget::from_glib_none(ffi::hdy_keypad_new( symbols_visible.into_glib(), letters_visible.into_glib(), )) .unsafe_cast() } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`Keypad`] objects. /// /// This method returns an instance of [`KeypadBuilder`](crate::builders::KeypadBuilder) which can be used to create [`Keypad`] objects. pub fn builder() -> KeypadBuilder { KeypadBuilder::new() } } impl Default for Keypad { fn default() -> Self { glib::object::Object::new::() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`Keypad`] 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 KeypadBuilder { builder: glib::object::ObjectBuilder<'static, Keypad>, } impl KeypadBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } pub fn column_spacing(self, column_spacing: u32) -> Self { Self { builder: self.builder.property("column-spacing", column_spacing), } } pub fn end_action(self, end_action: &impl IsA) -> Self { Self { builder: self .builder .property("end-action", end_action.clone().upcast()), } } pub fn entry(self, entry: &impl IsA) -> Self { Self { builder: self.builder.property("entry", entry.clone().upcast()), } } pub fn letters_visible(self, letters_visible: bool) -> Self { Self { builder: self.builder.property("letters-visible", letters_visible), } } pub fn row_spacing(self, row_spacing: u32) -> Self { Self { builder: self.builder.property("row-spacing", row_spacing), } } pub fn start_action(self, start_action: &impl IsA) -> Self { Self { builder: self .builder .property("start-action", start_action.clone().upcast()), } } pub fn symbols_visible(self, symbols_visible: bool) -> Self { Self { builder: self.builder.property("symbols-visible", symbols_visible), } } pub fn border_width(self, border_width: u32) -> Self { Self { builder: self.builder.property("border-width", border_width), } } pub fn child(self, child: &impl IsA) -> Self { Self { builder: self.builder.property("child", child.clone().upcast()), } } pub fn resize_mode(self, resize_mode: gtk::ResizeMode) -> Self { Self { builder: self.builder.property("resize-mode", resize_mode), } } pub fn app_paintable(self, app_paintable: bool) -> Self { Self { builder: self.builder.property("app-paintable", app_paintable), } } pub fn can_default(self, can_default: bool) -> Self { Self { builder: self.builder.property("can-default", can_default), } } pub fn can_focus(self, can_focus: bool) -> Self { Self { builder: self.builder.property("can-focus", can_focus), } } pub fn events(self, events: gdk::EventMask) -> Self { Self { builder: self.builder.property("events", events), } } pub fn expand(self, expand: bool) -> Self { Self { builder: self.builder.property("expand", expand), } } pub fn focus_on_click(self, focus_on_click: bool) -> Self { Self { builder: self.builder.property("focus-on-click", focus_on_click), } } pub fn halign(self, halign: gtk::Align) -> Self { Self { builder: self.builder.property("halign", halign), } } pub fn has_default(self, has_default: bool) -> Self { Self { builder: self.builder.property("has-default", has_default), } } pub fn has_focus(self, has_focus: bool) -> Self { Self { builder: self.builder.property("has-focus", has_focus), } } pub fn has_tooltip(self, has_tooltip: bool) -> Self { Self { builder: self.builder.property("has-tooltip", has_tooltip), } } pub fn height_request(self, height_request: i32) -> Self { Self { builder: self.builder.property("height-request", height_request), } } pub fn hexpand(self, hexpand: bool) -> Self { Self { builder: self.builder.property("hexpand", hexpand), } } pub fn hexpand_set(self, hexpand_set: bool) -> Self { Self { builder: self.builder.property("hexpand-set", hexpand_set), } } pub fn is_focus(self, is_focus: bool) -> Self { Self { builder: self.builder.property("is-focus", is_focus), } } pub fn margin(self, margin: i32) -> Self { Self { builder: self.builder.property("margin", margin), } } pub fn margin_bottom(self, margin_bottom: i32) -> Self { Self { builder: self.builder.property("margin-bottom", margin_bottom), } } pub fn margin_end(self, margin_end: i32) -> Self { Self { builder: self.builder.property("margin-end", margin_end), } } pub fn margin_start(self, margin_start: i32) -> Self { Self { builder: self.builder.property("margin-start", margin_start), } } pub fn margin_top(self, margin_top: i32) -> Self { Self { builder: self.builder.property("margin-top", margin_top), } } pub fn name(self, name: impl Into) -> Self { Self { builder: self.builder.property("name", name.into()), } } pub fn no_show_all(self, no_show_all: bool) -> Self { Self { builder: self.builder.property("no-show-all", no_show_all), } } pub fn opacity(self, opacity: f64) -> Self { Self { builder: self.builder.property("opacity", opacity), } } pub fn parent(self, parent: &impl IsA) -> Self { Self { builder: self.builder.property("parent", parent.clone().upcast()), } } pub fn receives_default(self, receives_default: bool) -> Self { Self { builder: self.builder.property("receives-default", receives_default), } } pub fn sensitive(self, sensitive: bool) -> Self { Self { builder: self.builder.property("sensitive", sensitive), } } //pub fn style(self, style: &impl IsA) -> Self { // Self { builder: self.builder.property("style", style.clone().upcast()), } //} pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { Self { builder: self .builder .property("tooltip-markup", tooltip_markup.into()), } } pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } } pub fn valign(self, valign: gtk::Align) -> Self { Self { builder: self.builder.property("valign", valign), } } pub fn vexpand(self, vexpand: bool) -> Self { Self { builder: self.builder.property("vexpand", vexpand), } } pub fn vexpand_set(self, vexpand_set: bool) -> Self { Self { builder: self.builder.property("vexpand-set", vexpand_set), } } pub fn visible(self, visible: bool) -> Self { Self { builder: self.builder.property("visible", visible), } } pub fn width_request(self, width_request: i32) -> Self { Self { builder: self.builder.property("width-request", width_request), } } // rustdoc-stripper-ignore-next /// Build the [`Keypad`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> Keypad { self.builder.build() } } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait KeypadExt: IsA + sealed::Sealed + 'static { #[doc(alias = "hdy_keypad_get_column_spacing")] #[doc(alias = "get_column_spacing")] fn column_spacing(&self) -> u32 { unsafe { ffi::hdy_keypad_get_column_spacing(self.as_ref().to_glib_none().0) } } #[doc(alias = "hdy_keypad_get_end_action")] #[doc(alias = "get_end_action")] fn end_action(&self) -> Option { unsafe { from_glib_none(ffi::hdy_keypad_get_end_action( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_keypad_get_entry")] #[doc(alias = "get_entry")] fn entry(&self) -> Option { unsafe { from_glib_none(ffi::hdy_keypad_get_entry(self.as_ref().to_glib_none().0)) } } #[doc(alias = "hdy_keypad_get_letters_visible")] #[doc(alias = "get_letters_visible")] fn is_letters_visible(&self) -> bool { unsafe { from_glib(ffi::hdy_keypad_get_letters_visible( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_keypad_get_row_spacing")] #[doc(alias = "get_row_spacing")] fn row_spacing(&self) -> u32 { unsafe { ffi::hdy_keypad_get_row_spacing(self.as_ref().to_glib_none().0) } } #[doc(alias = "hdy_keypad_get_start_action")] #[doc(alias = "get_start_action")] fn start_action(&self) -> Option { unsafe { from_glib_none(ffi::hdy_keypad_get_start_action( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_keypad_get_symbols_visible")] #[doc(alias = "get_symbols_visible")] fn is_symbols_visible(&self) -> bool { unsafe { from_glib(ffi::hdy_keypad_get_symbols_visible( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_keypad_set_column_spacing")] fn set_column_spacing(&self, spacing: u32) { unsafe { ffi::hdy_keypad_set_column_spacing(self.as_ref().to_glib_none().0, spacing); } } #[doc(alias = "hdy_keypad_set_end_action")] fn set_end_action(&self, end_action: Option<&impl IsA>) { unsafe { ffi::hdy_keypad_set_end_action( self.as_ref().to_glib_none().0, end_action.map(|p| p.as_ref()).to_glib_none().0, ); } } #[doc(alias = "hdy_keypad_set_entry")] fn set_entry(&self, entry: Option<&impl IsA>) { unsafe { ffi::hdy_keypad_set_entry( self.as_ref().to_glib_none().0, entry.map(|p| p.as_ref()).to_glib_none().0, ); } } #[doc(alias = "hdy_keypad_set_letters_visible")] fn set_letters_visible(&self, letters_visible: bool) { unsafe { ffi::hdy_keypad_set_letters_visible( self.as_ref().to_glib_none().0, letters_visible.into_glib(), ); } } #[doc(alias = "hdy_keypad_set_row_spacing")] fn set_row_spacing(&self, spacing: u32) { unsafe { ffi::hdy_keypad_set_row_spacing(self.as_ref().to_glib_none().0, spacing); } } #[doc(alias = "hdy_keypad_set_start_action")] fn set_start_action(&self, start_action: Option<&impl IsA>) { unsafe { ffi::hdy_keypad_set_start_action( self.as_ref().to_glib_none().0, start_action.map(|p| p.as_ref()).to_glib_none().0, ); } } #[doc(alias = "hdy_keypad_set_symbols_visible")] fn set_symbols_visible(&self, symbols_visible: bool) { unsafe { ffi::hdy_keypad_set_symbols_visible( self.as_ref().to_glib_none().0, symbols_visible.into_glib(), ); } } #[doc(alias = "column-spacing")] fn connect_column_spacing_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_column_spacing_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyKeypad, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Keypad::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::column-spacing\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_column_spacing_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "end-action")] fn connect_end_action_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_end_action_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::HdyKeypad, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Keypad::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::end-action\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_end_action_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "entry")] fn connect_entry_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_entry_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::HdyKeypad, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Keypad::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::entry\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_entry_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "letters-visible")] fn connect_letters_visible_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_letters_visible_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyKeypad, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Keypad::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::letters-visible\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_letters_visible_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "row-spacing")] fn connect_row_spacing_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_row_spacing_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::HdyKeypad, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Keypad::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::row-spacing\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_row_spacing_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "start-action")] fn connect_start_action_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_start_action_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::HdyKeypad, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Keypad::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::start-action\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_start_action_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "symbols-visible")] fn connect_symbols_visible_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_symbols_visible_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyKeypad, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Keypad::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::symbols-visible\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_symbols_visible_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl> KeypadExt for O {} impl fmt::Display for Keypad { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Keypad") } } rust-libhandy-0.11-0.11.1/src/auto/leaflet.rs000066400000000000000000001113101470255135400204600ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT use crate::{LeafletTransitionType, NavigationDirection, Swipeable}; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "HdyLeaflet")] pub struct Leaflet(Object) @extends gtk::Container, gtk::Widget, @implements gtk::Buildable, gtk::Orientable, Swipeable; match fn { type_ => || ffi::hdy_leaflet_get_type(), } } impl Leaflet { pub const NONE: Option<&'static Leaflet> = None; #[doc(alias = "hdy_leaflet_new")] pub fn new() -> Leaflet { assert_initialized_main_thread!(); unsafe { gtk::Widget::from_glib_none(ffi::hdy_leaflet_new()).unsafe_cast() } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`Leaflet`] objects. /// /// This method returns an instance of [`LeafletBuilder`](crate::builders::LeafletBuilder) which can be used to create [`Leaflet`] objects. pub fn builder() -> LeafletBuilder { LeafletBuilder::new() } } impl Default for Leaflet { fn default() -> Self { Self::new() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`Leaflet`] 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 LeafletBuilder { builder: glib::object::ObjectBuilder<'static, Leaflet>, } impl LeafletBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } pub fn can_swipe_back(self, can_swipe_back: bool) -> Self { Self { builder: self.builder.property("can-swipe-back", can_swipe_back), } } pub fn can_swipe_forward(self, can_swipe_forward: bool) -> Self { Self { builder: self .builder .property("can-swipe-forward", can_swipe_forward), } } pub fn child_transition_duration(self, child_transition_duration: u32) -> Self { Self { builder: self .builder .property("child-transition-duration", child_transition_duration), } } pub fn hhomogeneous_folded(self, hhomogeneous_folded: bool) -> Self { Self { builder: self .builder .property("hhomogeneous-folded", hhomogeneous_folded), } } pub fn hhomogeneous_unfolded(self, hhomogeneous_unfolded: bool) -> Self { Self { builder: self .builder .property("hhomogeneous-unfolded", hhomogeneous_unfolded), } } pub fn interpolate_size(self, interpolate_size: bool) -> Self { Self { builder: self.builder.property("interpolate-size", interpolate_size), } } pub fn mode_transition_duration(self, mode_transition_duration: u32) -> Self { Self { builder: self .builder .property("mode-transition-duration", mode_transition_duration), } } pub fn transition_type(self, transition_type: LeafletTransitionType) -> Self { Self { builder: self.builder.property("transition-type", transition_type), } } pub fn vhomogeneous_folded(self, vhomogeneous_folded: bool) -> Self { Self { builder: self .builder .property("vhomogeneous-folded", vhomogeneous_folded), } } pub fn vhomogeneous_unfolded(self, vhomogeneous_unfolded: bool) -> Self { Self { builder: self .builder .property("vhomogeneous-unfolded", vhomogeneous_unfolded), } } pub fn visible_child(self, visible_child: &impl IsA) -> Self { Self { builder: self .builder .property("visible-child", visible_child.clone().upcast()), } } pub fn visible_child_name(self, visible_child_name: impl Into) -> Self { Self { builder: self .builder .property("visible-child-name", visible_child_name.into()), } } pub fn border_width(self, border_width: u32) -> Self { Self { builder: self.builder.property("border-width", border_width), } } pub fn child(self, child: &impl IsA) -> Self { Self { builder: self.builder.property("child", child.clone().upcast()), } } pub fn resize_mode(self, resize_mode: gtk::ResizeMode) -> Self { Self { builder: self.builder.property("resize-mode", resize_mode), } } pub fn app_paintable(self, app_paintable: bool) -> Self { Self { builder: self.builder.property("app-paintable", app_paintable), } } pub fn can_default(self, can_default: bool) -> Self { Self { builder: self.builder.property("can-default", can_default), } } pub fn can_focus(self, can_focus: bool) -> Self { Self { builder: self.builder.property("can-focus", can_focus), } } pub fn events(self, events: gdk::EventMask) -> Self { Self { builder: self.builder.property("events", events), } } pub fn expand(self, expand: bool) -> Self { Self { builder: self.builder.property("expand", expand), } } pub fn focus_on_click(self, focus_on_click: bool) -> Self { Self { builder: self.builder.property("focus-on-click", focus_on_click), } } pub fn halign(self, halign: gtk::Align) -> Self { Self { builder: self.builder.property("halign", halign), } } pub fn has_default(self, has_default: bool) -> Self { Self { builder: self.builder.property("has-default", has_default), } } pub fn has_focus(self, has_focus: bool) -> Self { Self { builder: self.builder.property("has-focus", has_focus), } } pub fn has_tooltip(self, has_tooltip: bool) -> Self { Self { builder: self.builder.property("has-tooltip", has_tooltip), } } pub fn height_request(self, height_request: i32) -> Self { Self { builder: self.builder.property("height-request", height_request), } } pub fn hexpand(self, hexpand: bool) -> Self { Self { builder: self.builder.property("hexpand", hexpand), } } pub fn hexpand_set(self, hexpand_set: bool) -> Self { Self { builder: self.builder.property("hexpand-set", hexpand_set), } } pub fn is_focus(self, is_focus: bool) -> Self { Self { builder: self.builder.property("is-focus", is_focus), } } pub fn margin(self, margin: i32) -> Self { Self { builder: self.builder.property("margin", margin), } } pub fn margin_bottom(self, margin_bottom: i32) -> Self { Self { builder: self.builder.property("margin-bottom", margin_bottom), } } pub fn margin_end(self, margin_end: i32) -> Self { Self { builder: self.builder.property("margin-end", margin_end), } } pub fn margin_start(self, margin_start: i32) -> Self { Self { builder: self.builder.property("margin-start", margin_start), } } pub fn margin_top(self, margin_top: i32) -> Self { Self { builder: self.builder.property("margin-top", margin_top), } } pub fn name(self, name: impl Into) -> Self { Self { builder: self.builder.property("name", name.into()), } } pub fn no_show_all(self, no_show_all: bool) -> Self { Self { builder: self.builder.property("no-show-all", no_show_all), } } pub fn opacity(self, opacity: f64) -> Self { Self { builder: self.builder.property("opacity", opacity), } } pub fn parent(self, parent: &impl IsA) -> Self { Self { builder: self.builder.property("parent", parent.clone().upcast()), } } pub fn receives_default(self, receives_default: bool) -> Self { Self { builder: self.builder.property("receives-default", receives_default), } } pub fn sensitive(self, sensitive: bool) -> Self { Self { builder: self.builder.property("sensitive", sensitive), } } //pub fn style(self, style: &impl IsA) -> Self { // Self { builder: self.builder.property("style", style.clone().upcast()), } //} pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { Self { builder: self .builder .property("tooltip-markup", tooltip_markup.into()), } } pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } } pub fn valign(self, valign: gtk::Align) -> Self { Self { builder: self.builder.property("valign", valign), } } pub fn vexpand(self, vexpand: bool) -> Self { Self { builder: self.builder.property("vexpand", vexpand), } } pub fn vexpand_set(self, vexpand_set: bool) -> Self { Self { builder: self.builder.property("vexpand-set", vexpand_set), } } pub fn visible(self, visible: bool) -> Self { Self { builder: self.builder.property("visible", visible), } } pub fn width_request(self, width_request: i32) -> Self { Self { builder: self.builder.property("width-request", width_request), } } pub fn orientation(self, orientation: gtk::Orientation) -> Self { Self { builder: self.builder.property("orientation", orientation), } } // rustdoc-stripper-ignore-next /// Build the [`Leaflet`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> Leaflet { self.builder.build() } } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait LeafletExt: IsA + sealed::Sealed + 'static { #[doc(alias = "hdy_leaflet_get_adjacent_child")] #[doc(alias = "get_adjacent_child")] fn adjacent_child(&self, direction: NavigationDirection) -> Option { unsafe { from_glib_none(ffi::hdy_leaflet_get_adjacent_child( self.as_ref().to_glib_none().0, direction.into_glib(), )) } } #[doc(alias = "hdy_leaflet_get_can_swipe_back")] #[doc(alias = "get_can_swipe_back")] fn can_swipe_back(&self) -> bool { unsafe { from_glib(ffi::hdy_leaflet_get_can_swipe_back( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_leaflet_get_can_swipe_forward")] #[doc(alias = "get_can_swipe_forward")] fn can_swipe_forward(&self) -> bool { unsafe { from_glib(ffi::hdy_leaflet_get_can_swipe_forward( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_leaflet_get_child_by_name")] #[doc(alias = "get_child_by_name")] fn child_by_name(&self, name: &str) -> Option { unsafe { from_glib_none(ffi::hdy_leaflet_get_child_by_name( self.as_ref().to_glib_none().0, name.to_glib_none().0, )) } } #[doc(alias = "hdy_leaflet_get_child_transition_duration")] #[doc(alias = "get_child_transition_duration")] fn child_transition_duration(&self) -> u32 { unsafe { ffi::hdy_leaflet_get_child_transition_duration(self.as_ref().to_glib_none().0) } } #[doc(alias = "hdy_leaflet_get_child_transition_running")] #[doc(alias = "get_child_transition_running")] fn is_child_transition_running(&self) -> bool { unsafe { from_glib(ffi::hdy_leaflet_get_child_transition_running( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_leaflet_get_folded")] #[doc(alias = "get_folded")] fn is_folded(&self) -> bool { unsafe { from_glib(ffi::hdy_leaflet_get_folded(self.as_ref().to_glib_none().0)) } } #[doc(alias = "hdy_leaflet_get_homogeneous")] #[doc(alias = "get_homogeneous")] fn is_homogeneous(&self, folded: bool, orientation: gtk::Orientation) -> bool { unsafe { from_glib(ffi::hdy_leaflet_get_homogeneous( self.as_ref().to_glib_none().0, folded.into_glib(), orientation.into_glib(), )) } } #[doc(alias = "hdy_leaflet_get_interpolate_size")] #[doc(alias = "get_interpolate_size")] fn is_interpolate_size(&self) -> bool { unsafe { from_glib(ffi::hdy_leaflet_get_interpolate_size( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_leaflet_get_mode_transition_duration")] #[doc(alias = "get_mode_transition_duration")] fn mode_transition_duration(&self) -> u32 { unsafe { ffi::hdy_leaflet_get_mode_transition_duration(self.as_ref().to_glib_none().0) } } #[doc(alias = "hdy_leaflet_get_transition_type")] #[doc(alias = "get_transition_type")] fn transition_type(&self) -> LeafletTransitionType { unsafe { from_glib(ffi::hdy_leaflet_get_transition_type( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_leaflet_get_visible_child")] #[doc(alias = "get_visible_child")] fn visible_child(&self) -> Option { unsafe { from_glib_none(ffi::hdy_leaflet_get_visible_child( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_leaflet_get_visible_child_name")] #[doc(alias = "get_visible_child_name")] fn visible_child_name(&self) -> Option { unsafe { from_glib_none(ffi::hdy_leaflet_get_visible_child_name( self.as_ref().to_glib_none().0, )) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "hdy_leaflet_insert_child_after")] fn insert_child_after( &self, child: &impl IsA, sibling: Option<&impl IsA>, ) { unsafe { ffi::hdy_leaflet_insert_child_after( self.as_ref().to_glib_none().0, child.as_ref().to_glib_none().0, sibling.map(|p| p.as_ref()).to_glib_none().0, ); } } #[doc(alias = "hdy_leaflet_navigate")] fn navigate(&self, direction: NavigationDirection) -> bool { unsafe { from_glib(ffi::hdy_leaflet_navigate( self.as_ref().to_glib_none().0, direction.into_glib(), )) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "hdy_leaflet_prepend")] fn prepend(&self, child: &impl IsA) { unsafe { ffi::hdy_leaflet_prepend( self.as_ref().to_glib_none().0, child.as_ref().to_glib_none().0, ); } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "hdy_leaflet_reorder_child_after")] fn reorder_child_after( &self, child: &impl IsA, sibling: Option<&impl IsA>, ) { unsafe { ffi::hdy_leaflet_reorder_child_after( self.as_ref().to_glib_none().0, child.as_ref().to_glib_none().0, sibling.map(|p| p.as_ref()).to_glib_none().0, ); } } #[doc(alias = "hdy_leaflet_set_can_swipe_back")] fn set_can_swipe_back(&self, can_swipe_back: bool) { unsafe { ffi::hdy_leaflet_set_can_swipe_back( self.as_ref().to_glib_none().0, can_swipe_back.into_glib(), ); } } #[doc(alias = "hdy_leaflet_set_can_swipe_forward")] fn set_can_swipe_forward(&self, can_swipe_forward: bool) { unsafe { ffi::hdy_leaflet_set_can_swipe_forward( self.as_ref().to_glib_none().0, can_swipe_forward.into_glib(), ); } } #[doc(alias = "hdy_leaflet_set_child_transition_duration")] fn set_child_transition_duration(&self, duration: u32) { unsafe { ffi::hdy_leaflet_set_child_transition_duration( self.as_ref().to_glib_none().0, duration, ); } } #[doc(alias = "hdy_leaflet_set_homogeneous")] fn set_homogeneous(&self, folded: bool, orientation: gtk::Orientation, homogeneous: bool) { unsafe { ffi::hdy_leaflet_set_homogeneous( self.as_ref().to_glib_none().0, folded.into_glib(), orientation.into_glib(), homogeneous.into_glib(), ); } } #[doc(alias = "hdy_leaflet_set_interpolate_size")] fn set_interpolate_size(&self, interpolate_size: bool) { unsafe { ffi::hdy_leaflet_set_interpolate_size( self.as_ref().to_glib_none().0, interpolate_size.into_glib(), ); } } #[doc(alias = "hdy_leaflet_set_mode_transition_duration")] fn set_mode_transition_duration(&self, duration: u32) { unsafe { ffi::hdy_leaflet_set_mode_transition_duration(self.as_ref().to_glib_none().0, duration); } } #[doc(alias = "hdy_leaflet_set_transition_type")] fn set_transition_type(&self, transition: LeafletTransitionType) { unsafe { ffi::hdy_leaflet_set_transition_type( self.as_ref().to_glib_none().0, transition.into_glib(), ); } } #[doc(alias = "hdy_leaflet_set_visible_child")] fn set_visible_child(&self, visible_child: &impl IsA) { unsafe { ffi::hdy_leaflet_set_visible_child( self.as_ref().to_glib_none().0, visible_child.as_ref().to_glib_none().0, ); } } #[doc(alias = "hdy_leaflet_set_visible_child_name")] fn set_visible_child_name(&self, name: &str) { unsafe { ffi::hdy_leaflet_set_visible_child_name( self.as_ref().to_glib_none().0, name.to_glib_none().0, ); } } #[doc(alias = "hhomogeneous-folded")] fn is_hhomogeneous_folded(&self) -> bool { ObjectExt::property(self.as_ref(), "hhomogeneous-folded") } #[doc(alias = "hhomogeneous-folded")] fn set_hhomogeneous_folded(&self, hhomogeneous_folded: bool) { ObjectExt::set_property(self.as_ref(), "hhomogeneous-folded", hhomogeneous_folded) } #[doc(alias = "hhomogeneous-unfolded")] fn is_hhomogeneous_unfolded(&self) -> bool { ObjectExt::property(self.as_ref(), "hhomogeneous-unfolded") } #[doc(alias = "hhomogeneous-unfolded")] fn set_hhomogeneous_unfolded(&self, hhomogeneous_unfolded: bool) { ObjectExt::set_property( self.as_ref(), "hhomogeneous-unfolded", hhomogeneous_unfolded, ) } #[doc(alias = "vhomogeneous-folded")] fn is_vhomogeneous_folded(&self) -> bool { ObjectExt::property(self.as_ref(), "vhomogeneous-folded") } #[doc(alias = "vhomogeneous-folded")] fn set_vhomogeneous_folded(&self, vhomogeneous_folded: bool) { ObjectExt::set_property(self.as_ref(), "vhomogeneous-folded", vhomogeneous_folded) } #[doc(alias = "vhomogeneous-unfolded")] fn is_vhomogeneous_unfolded(&self) -> bool { ObjectExt::property(self.as_ref(), "vhomogeneous-unfolded") } #[doc(alias = "vhomogeneous-unfolded")] fn set_vhomogeneous_unfolded(&self, vhomogeneous_unfolded: bool) { ObjectExt::set_property( self.as_ref(), "vhomogeneous-unfolded", vhomogeneous_unfolded, ) } #[doc(alias = "child.icon-name")] fn child_icon_name>(&self, item: &T) -> Option { gtk::prelude::ContainerExtManual::child_property( self.as_ref(), &item.clone().upcast(), "icon-name", ) } #[doc(alias = "child.icon-name")] fn set_child_icon_name>(&self, item: &T, icon_name: Option<&str>) { gtk::prelude::ContainerExtManual::child_set_property( self.as_ref(), &item.clone().upcast(), "icon-name", &icon_name, ) } fn child_name>(&self, item: &T) -> Option { gtk::prelude::ContainerExtManual::child_property( self.as_ref(), &item.clone().upcast(), "name", ) } fn set_child_name>(&self, item: &T, name: Option<&str>) { gtk::prelude::ContainerExtManual::child_set_property( self.as_ref(), &item.clone().upcast(), "name", &name, ) } #[doc(alias = "child.needs-attention")] fn child_needs_attention>(&self, item: &T) -> bool { gtk::prelude::ContainerExtManual::child_property( self.as_ref(), &item.clone().upcast(), "needs-attention", ) } #[doc(alias = "child.needs-attention")] fn set_child_needs_attention>(&self, item: &T, needs_attention: bool) { gtk::prelude::ContainerExtManual::child_set_property( self.as_ref(), &item.clone().upcast(), "needs-attention", &needs_attention, ) } fn child_position>(&self, item: &T) -> i32 { gtk::prelude::ContainerExtManual::child_property( self.as_ref(), &item.clone().upcast(), "position", ) } fn set_child_position>(&self, item: &T, position: i32) { gtk::prelude::ContainerExtManual::child_set_property( self.as_ref(), &item.clone().upcast(), "position", &position, ) } fn child_title>(&self, item: &T) -> Option { gtk::prelude::ContainerExtManual::child_property( self.as_ref(), &item.clone().upcast(), "title", ) } fn set_child_title>(&self, item: &T, title: Option<&str>) { gtk::prelude::ContainerExtManual::child_set_property( self.as_ref(), &item.clone().upcast(), "title", &title, ) } #[doc(alias = "can-swipe-back")] fn connect_can_swipe_back_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_can_swipe_back_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyLeaflet, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Leaflet::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::can-swipe-back\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_can_swipe_back_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "can-swipe-forward")] fn connect_can_swipe_forward_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_can_swipe_forward_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyLeaflet, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Leaflet::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::can-swipe-forward\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_can_swipe_forward_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "child-transition-duration")] fn connect_child_transition_duration_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_child_transition_duration_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyLeaflet, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Leaflet::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::child-transition-duration\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_child_transition_duration_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "child-transition-running")] fn connect_child_transition_running_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_child_transition_running_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyLeaflet, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Leaflet::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::child-transition-running\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_child_transition_running_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "folded")] fn connect_folded_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_folded_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::HdyLeaflet, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Leaflet::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::folded\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_folded_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "hhomogeneous-folded")] fn connect_hhomogeneous_folded_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_hhomogeneous_folded_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyLeaflet, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Leaflet::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::hhomogeneous-folded\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_hhomogeneous_folded_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "hhomogeneous-unfolded")] fn connect_hhomogeneous_unfolded_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_hhomogeneous_unfolded_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyLeaflet, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Leaflet::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::hhomogeneous-unfolded\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_hhomogeneous_unfolded_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "interpolate-size")] fn connect_interpolate_size_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_interpolate_size_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyLeaflet, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Leaflet::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::interpolate-size\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_interpolate_size_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "mode-transition-duration")] fn connect_mode_transition_duration_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_mode_transition_duration_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyLeaflet, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Leaflet::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::mode-transition-duration\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_mode_transition_duration_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "transition-type")] fn connect_transition_type_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_transition_type_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyLeaflet, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Leaflet::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::transition-type\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_transition_type_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "vhomogeneous-folded")] fn connect_vhomogeneous_folded_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_vhomogeneous_folded_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyLeaflet, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Leaflet::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::vhomogeneous-folded\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_vhomogeneous_folded_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "vhomogeneous-unfolded")] fn connect_vhomogeneous_unfolded_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_vhomogeneous_unfolded_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyLeaflet, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Leaflet::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::vhomogeneous-unfolded\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_vhomogeneous_unfolded_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "visible-child")] fn connect_visible_child_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_visible_child_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyLeaflet, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Leaflet::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::visible-child\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_visible_child_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "visible-child-name")] fn connect_visible_child_name_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_visible_child_name_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyLeaflet, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Leaflet::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::visible-child-name\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_visible_child_name_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl> LeafletExt for O {} impl fmt::Display for Leaflet { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Leaflet") } } rust-libhandy-0.11-0.11.1/src/auto/mod.rs000066400000000000000000000155061470255135400176350ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT mod action_row; pub use self::action_row::ActionRow; mod application_window; pub use self::application_window::ApplicationWindow; mod avatar; pub use self::avatar::Avatar; mod carousel; pub use self::carousel::Carousel; mod carousel_indicator_dots; pub use self::carousel_indicator_dots::CarouselIndicatorDots; mod carousel_indicator_lines; pub use self::carousel_indicator_lines::CarouselIndicatorLines; mod clamp; pub use self::clamp::Clamp; mod combo_row; pub use self::combo_row::ComboRow; mod deck; pub use self::deck::Deck; mod enum_value_object; pub use self::enum_value_object::EnumValueObject; mod expander_row; pub use self::expander_row::ExpanderRow; #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] mod flap; #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub use self::flap::Flap; mod header_bar; pub use self::header_bar::HeaderBar; mod header_group; pub use self::header_group::HeaderGroup; mod header_group_child; pub use self::header_group_child::HeaderGroupChild; mod keypad; pub use self::keypad::Keypad; mod leaflet; pub use self::leaflet::Leaflet; mod preferences_group; pub use self::preferences_group::PreferencesGroup; mod preferences_page; pub use self::preferences_page::PreferencesPage; mod preferences_row; pub use self::preferences_row::PreferencesRow; mod preferences_window; pub use self::preferences_window::PreferencesWindow; mod search_bar; pub use self::search_bar::SearchBar; mod squeezer; pub use self::squeezer::Squeezer; #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] mod status_page; #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub use self::status_page::StatusPage; #[cfg(feature = "v1_6")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))] mod style_manager; #[cfg(feature = "v1_6")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))] pub use self::style_manager::StyleManager; #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")] mod swipe_group; #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")] pub use self::swipe_group::SwipeGroup; mod swipe_tracker; pub use self::swipe_tracker::SwipeTracker; mod swipeable; pub use self::swipeable::Swipeable; #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] mod tab_bar; #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub use self::tab_bar::TabBar; #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] mod tab_page; #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub use self::tab_page::TabPage; #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] mod tab_view; #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub use self::tab_view::TabView; #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")] mod title_bar; #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")] pub use self::title_bar::TitleBar; mod value_object; pub use self::value_object::ValueObject; mod view_switcher; pub use self::view_switcher::ViewSwitcher; mod view_switcher_bar; pub use self::view_switcher_bar::ViewSwitcherBar; mod view_switcher_title; pub use self::view_switcher_title::ViewSwitcherTitle; mod window; pub use self::window::Window; mod window_handle; pub use self::window_handle::WindowHandle; mod enums; pub use self::enums::CenteringPolicy; #[cfg(feature = "v1_6")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))] pub use self::enums::ColorScheme; pub use self::enums::DeckTransitionType; #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub use self::enums::FlapFoldPolicy; #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub use self::enums::FlapTransitionType; pub use self::enums::HeaderGroupChildType; pub use self::enums::LeafletTransitionType; pub use self::enums::NavigationDirection; pub use self::enums::SqueezerTransitionType; pub use self::enums::ViewSwitcherPolicy; pub mod functions; #[doc(hidden)] pub mod traits { pub use super::action_row::ActionRowExt; pub use super::combo_row::ComboRowExt; pub use super::deck::DeckExt; pub use super::expander_row::ExpanderRowExt; pub use super::header_bar::HdyHeaderBarExt; pub use super::keypad::KeypadExt; pub use super::leaflet::LeafletExt; pub use super::preferences_group::PreferencesGroupExt; pub use super::preferences_page::PreferencesPageExt; pub use super::preferences_row::PreferencesRowExt; pub use super::preferences_window::PreferencesWindowExt; pub use super::search_bar::HdySearchBarExt; pub use super::swipeable::SwipeableExt; } #[doc(hidden)] pub mod builders { pub use super::action_row::ActionRowBuilder; pub use super::application_window::ApplicationWindowBuilder; pub use super::avatar::AvatarBuilder; pub use super::carousel::CarouselBuilder; pub use super::carousel_indicator_dots::CarouselIndicatorDotsBuilder; pub use super::carousel_indicator_lines::CarouselIndicatorLinesBuilder; pub use super::clamp::ClampBuilder; pub use super::combo_row::ComboRowBuilder; pub use super::deck::DeckBuilder; pub use super::expander_row::ExpanderRowBuilder; #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub use super::flap::FlapBuilder; pub use super::header_bar::HeaderBarBuilder; pub use super::header_group::HeaderGroupBuilder; pub use super::keypad::KeypadBuilder; pub use super::leaflet::LeafletBuilder; pub use super::preferences_group::PreferencesGroupBuilder; pub use super::preferences_page::PreferencesPageBuilder; pub use super::preferences_row::PreferencesRowBuilder; pub use super::preferences_window::PreferencesWindowBuilder; pub use super::search_bar::SearchBarBuilder; pub use super::squeezer::SqueezerBuilder; #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub use super::status_page::StatusPageBuilder; pub use super::swipe_tracker::SwipeTrackerBuilder; #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub use super::tab_bar::TabBarBuilder; #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub use super::tab_page::TabPageBuilder; #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub use super::tab_view::TabViewBuilder; #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")] pub use super::title_bar::TitleBarBuilder; pub use super::view_switcher::ViewSwitcherBuilder; pub use super::view_switcher_bar::ViewSwitcherBarBuilder; pub use super::view_switcher_title::ViewSwitcherTitleBuilder; pub use super::window::WindowBuilder; pub use super::window_handle::WindowHandleBuilder; } rust-libhandy-0.11-0.11.1/src/auto/preferences_group.rs000066400000000000000000000331311470255135400225650ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "HdyPreferencesGroup")] pub struct PreferencesGroup(Object) @extends gtk::Bin, gtk::Container, gtk::Widget, @implements gtk::Buildable; match fn { type_ => || ffi::hdy_preferences_group_get_type(), } } impl PreferencesGroup { pub const NONE: Option<&'static PreferencesGroup> = None; #[doc(alias = "hdy_preferences_group_new")] pub fn new() -> PreferencesGroup { assert_initialized_main_thread!(); unsafe { gtk::Widget::from_glib_none(ffi::hdy_preferences_group_new()).unsafe_cast() } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`PreferencesGroup`] objects. /// /// This method returns an instance of [`PreferencesGroupBuilder`](crate::builders::PreferencesGroupBuilder) which can be used to create [`PreferencesGroup`] objects. pub fn builder() -> PreferencesGroupBuilder { PreferencesGroupBuilder::new() } } impl Default for PreferencesGroup { fn default() -> Self { Self::new() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`PreferencesGroup`] 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 PreferencesGroupBuilder { builder: glib::object::ObjectBuilder<'static, PreferencesGroup>, } impl PreferencesGroupBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } pub fn description(self, description: impl Into) -> Self { Self { builder: self.builder.property("description", description.into()), } } pub fn title(self, title: impl Into) -> Self { Self { builder: self.builder.property("title", title.into()), } } #[cfg(feature = "v1_4")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))] pub fn use_markup(self, use_markup: bool) -> Self { Self { builder: self.builder.property("use-markup", use_markup), } } pub fn border_width(self, border_width: u32) -> Self { Self { builder: self.builder.property("border-width", border_width), } } pub fn child(self, child: &impl IsA) -> Self { Self { builder: self.builder.property("child", child.clone().upcast()), } } pub fn resize_mode(self, resize_mode: gtk::ResizeMode) -> Self { Self { builder: self.builder.property("resize-mode", resize_mode), } } pub fn app_paintable(self, app_paintable: bool) -> Self { Self { builder: self.builder.property("app-paintable", app_paintable), } } pub fn can_default(self, can_default: bool) -> Self { Self { builder: self.builder.property("can-default", can_default), } } pub fn can_focus(self, can_focus: bool) -> Self { Self { builder: self.builder.property("can-focus", can_focus), } } pub fn events(self, events: gdk::EventMask) -> Self { Self { builder: self.builder.property("events", events), } } pub fn expand(self, expand: bool) -> Self { Self { builder: self.builder.property("expand", expand), } } pub fn focus_on_click(self, focus_on_click: bool) -> Self { Self { builder: self.builder.property("focus-on-click", focus_on_click), } } pub fn halign(self, halign: gtk::Align) -> Self { Self { builder: self.builder.property("halign", halign), } } pub fn has_default(self, has_default: bool) -> Self { Self { builder: self.builder.property("has-default", has_default), } } pub fn has_focus(self, has_focus: bool) -> Self { Self { builder: self.builder.property("has-focus", has_focus), } } pub fn has_tooltip(self, has_tooltip: bool) -> Self { Self { builder: self.builder.property("has-tooltip", has_tooltip), } } pub fn height_request(self, height_request: i32) -> Self { Self { builder: self.builder.property("height-request", height_request), } } pub fn hexpand(self, hexpand: bool) -> Self { Self { builder: self.builder.property("hexpand", hexpand), } } pub fn hexpand_set(self, hexpand_set: bool) -> Self { Self { builder: self.builder.property("hexpand-set", hexpand_set), } } pub fn is_focus(self, is_focus: bool) -> Self { Self { builder: self.builder.property("is-focus", is_focus), } } pub fn margin(self, margin: i32) -> Self { Self { builder: self.builder.property("margin", margin), } } pub fn margin_bottom(self, margin_bottom: i32) -> Self { Self { builder: self.builder.property("margin-bottom", margin_bottom), } } pub fn margin_end(self, margin_end: i32) -> Self { Self { builder: self.builder.property("margin-end", margin_end), } } pub fn margin_start(self, margin_start: i32) -> Self { Self { builder: self.builder.property("margin-start", margin_start), } } pub fn margin_top(self, margin_top: i32) -> Self { Self { builder: self.builder.property("margin-top", margin_top), } } pub fn name(self, name: impl Into) -> Self { Self { builder: self.builder.property("name", name.into()), } } pub fn no_show_all(self, no_show_all: bool) -> Self { Self { builder: self.builder.property("no-show-all", no_show_all), } } pub fn opacity(self, opacity: f64) -> Self { Self { builder: self.builder.property("opacity", opacity), } } pub fn parent(self, parent: &impl IsA) -> Self { Self { builder: self.builder.property("parent", parent.clone().upcast()), } } pub fn receives_default(self, receives_default: bool) -> Self { Self { builder: self.builder.property("receives-default", receives_default), } } pub fn sensitive(self, sensitive: bool) -> Self { Self { builder: self.builder.property("sensitive", sensitive), } } //pub fn style(self, style: &impl IsA) -> Self { // Self { builder: self.builder.property("style", style.clone().upcast()), } //} pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { Self { builder: self .builder .property("tooltip-markup", tooltip_markup.into()), } } pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } } pub fn valign(self, valign: gtk::Align) -> Self { Self { builder: self.builder.property("valign", valign), } } pub fn vexpand(self, vexpand: bool) -> Self { Self { builder: self.builder.property("vexpand", vexpand), } } pub fn vexpand_set(self, vexpand_set: bool) -> Self { Self { builder: self.builder.property("vexpand-set", vexpand_set), } } pub fn visible(self, visible: bool) -> Self { Self { builder: self.builder.property("visible", visible), } } pub fn width_request(self, width_request: i32) -> Self { Self { builder: self.builder.property("width-request", width_request), } } // rustdoc-stripper-ignore-next /// Build the [`PreferencesGroup`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> PreferencesGroup { self.builder.build() } } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait PreferencesGroupExt: IsA + sealed::Sealed + 'static { #[doc(alias = "hdy_preferences_group_get_description")] #[doc(alias = "get_description")] fn description(&self) -> Option { unsafe { from_glib_none(ffi::hdy_preferences_group_get_description( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_preferences_group_get_title")] #[doc(alias = "get_title")] fn title(&self) -> Option { unsafe { from_glib_none(ffi::hdy_preferences_group_get_title( self.as_ref().to_glib_none().0, )) } } #[cfg(feature = "v1_4")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))] #[doc(alias = "hdy_preferences_group_get_use_markup")] #[doc(alias = "get_use_markup")] fn uses_markup(&self) -> bool { unsafe { from_glib(ffi::hdy_preferences_group_get_use_markup( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_preferences_group_set_description")] fn set_description(&self, description: &str) { unsafe { ffi::hdy_preferences_group_set_description( self.as_ref().to_glib_none().0, description.to_glib_none().0, ); } } #[doc(alias = "hdy_preferences_group_set_title")] fn set_title(&self, title: &str) { unsafe { ffi::hdy_preferences_group_set_title( self.as_ref().to_glib_none().0, title.to_glib_none().0, ); } } #[cfg(feature = "v1_4")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))] #[doc(alias = "hdy_preferences_group_set_use_markup")] fn set_use_markup(&self, use_markup: bool) { unsafe { ffi::hdy_preferences_group_set_use_markup( self.as_ref().to_glib_none().0, use_markup.into_glib(), ); } } #[doc(alias = "description")] fn connect_description_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_description_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyPreferencesGroup, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(PreferencesGroup::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::description\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_description_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "title")] fn connect_title_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_title_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyPreferencesGroup, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(PreferencesGroup::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::title\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_title_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_4")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))] #[doc(alias = "use-markup")] fn connect_use_markup_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_use_markup_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyPreferencesGroup, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(PreferencesGroup::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::use-markup\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_use_markup_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl> PreferencesGroupExt for O {} impl fmt::Display for PreferencesGroup { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("PreferencesGroup") } } rust-libhandy-0.11-0.11.1/src/auto/preferences_page.rs000066400000000000000000000270651470255135400223560ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "HdyPreferencesPage")] pub struct PreferencesPage(Object) @extends gtk::Bin, gtk::Container, gtk::Widget, @implements gtk::Buildable; match fn { type_ => || ffi::hdy_preferences_page_get_type(), } } impl PreferencesPage { pub const NONE: Option<&'static PreferencesPage> = None; #[doc(alias = "hdy_preferences_page_new")] pub fn new() -> PreferencesPage { assert_initialized_main_thread!(); unsafe { gtk::Widget::from_glib_none(ffi::hdy_preferences_page_new()).unsafe_cast() } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`PreferencesPage`] objects. /// /// This method returns an instance of [`PreferencesPageBuilder`](crate::builders::PreferencesPageBuilder) which can be used to create [`PreferencesPage`] objects. pub fn builder() -> PreferencesPageBuilder { PreferencesPageBuilder::new() } } impl Default for PreferencesPage { fn default() -> Self { Self::new() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`PreferencesPage`] 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 PreferencesPageBuilder { builder: glib::object::ObjectBuilder<'static, PreferencesPage>, } impl PreferencesPageBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } pub fn icon_name(self, icon_name: impl Into) -> Self { Self { builder: self.builder.property("icon-name", icon_name.into()), } } pub fn title(self, title: impl Into) -> Self { Self { builder: self.builder.property("title", title.into()), } } pub fn border_width(self, border_width: u32) -> Self { Self { builder: self.builder.property("border-width", border_width), } } pub fn child(self, child: &impl IsA) -> Self { Self { builder: self.builder.property("child", child.clone().upcast()), } } pub fn resize_mode(self, resize_mode: gtk::ResizeMode) -> Self { Self { builder: self.builder.property("resize-mode", resize_mode), } } pub fn app_paintable(self, app_paintable: bool) -> Self { Self { builder: self.builder.property("app-paintable", app_paintable), } } pub fn can_default(self, can_default: bool) -> Self { Self { builder: self.builder.property("can-default", can_default), } } pub fn can_focus(self, can_focus: bool) -> Self { Self { builder: self.builder.property("can-focus", can_focus), } } pub fn events(self, events: gdk::EventMask) -> Self { Self { builder: self.builder.property("events", events), } } pub fn expand(self, expand: bool) -> Self { Self { builder: self.builder.property("expand", expand), } } pub fn focus_on_click(self, focus_on_click: bool) -> Self { Self { builder: self.builder.property("focus-on-click", focus_on_click), } } pub fn halign(self, halign: gtk::Align) -> Self { Self { builder: self.builder.property("halign", halign), } } pub fn has_default(self, has_default: bool) -> Self { Self { builder: self.builder.property("has-default", has_default), } } pub fn has_focus(self, has_focus: bool) -> Self { Self { builder: self.builder.property("has-focus", has_focus), } } pub fn has_tooltip(self, has_tooltip: bool) -> Self { Self { builder: self.builder.property("has-tooltip", has_tooltip), } } pub fn height_request(self, height_request: i32) -> Self { Self { builder: self.builder.property("height-request", height_request), } } pub fn hexpand(self, hexpand: bool) -> Self { Self { builder: self.builder.property("hexpand", hexpand), } } pub fn hexpand_set(self, hexpand_set: bool) -> Self { Self { builder: self.builder.property("hexpand-set", hexpand_set), } } pub fn is_focus(self, is_focus: bool) -> Self { Self { builder: self.builder.property("is-focus", is_focus), } } pub fn margin(self, margin: i32) -> Self { Self { builder: self.builder.property("margin", margin), } } pub fn margin_bottom(self, margin_bottom: i32) -> Self { Self { builder: self.builder.property("margin-bottom", margin_bottom), } } pub fn margin_end(self, margin_end: i32) -> Self { Self { builder: self.builder.property("margin-end", margin_end), } } pub fn margin_start(self, margin_start: i32) -> Self { Self { builder: self.builder.property("margin-start", margin_start), } } pub fn margin_top(self, margin_top: i32) -> Self { Self { builder: self.builder.property("margin-top", margin_top), } } pub fn name(self, name: impl Into) -> Self { Self { builder: self.builder.property("name", name.into()), } } pub fn no_show_all(self, no_show_all: bool) -> Self { Self { builder: self.builder.property("no-show-all", no_show_all), } } pub fn opacity(self, opacity: f64) -> Self { Self { builder: self.builder.property("opacity", opacity), } } pub fn parent(self, parent: &impl IsA) -> Self { Self { builder: self.builder.property("parent", parent.clone().upcast()), } } pub fn receives_default(self, receives_default: bool) -> Self { Self { builder: self.builder.property("receives-default", receives_default), } } pub fn sensitive(self, sensitive: bool) -> Self { Self { builder: self.builder.property("sensitive", sensitive), } } //pub fn style(self, style: &impl IsA) -> Self { // Self { builder: self.builder.property("style", style.clone().upcast()), } //} pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { Self { builder: self .builder .property("tooltip-markup", tooltip_markup.into()), } } pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } } pub fn valign(self, valign: gtk::Align) -> Self { Self { builder: self.builder.property("valign", valign), } } pub fn vexpand(self, vexpand: bool) -> Self { Self { builder: self.builder.property("vexpand", vexpand), } } pub fn vexpand_set(self, vexpand_set: bool) -> Self { Self { builder: self.builder.property("vexpand-set", vexpand_set), } } pub fn visible(self, visible: bool) -> Self { Self { builder: self.builder.property("visible", visible), } } pub fn width_request(self, width_request: i32) -> Self { Self { builder: self.builder.property("width-request", width_request), } } // rustdoc-stripper-ignore-next /// Build the [`PreferencesPage`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> PreferencesPage { self.builder.build() } } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait PreferencesPageExt: IsA + sealed::Sealed + 'static { #[doc(alias = "hdy_preferences_page_get_icon_name")] #[doc(alias = "get_icon_name")] fn icon_name(&self) -> Option { unsafe { from_glib_none(ffi::hdy_preferences_page_get_icon_name( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_preferences_page_get_title")] #[doc(alias = "get_title")] fn title(&self) -> Option { unsafe { from_glib_none(ffi::hdy_preferences_page_get_title( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_preferences_page_set_icon_name")] fn set_icon_name(&self, icon_name: Option<&str>) { unsafe { ffi::hdy_preferences_page_set_icon_name( self.as_ref().to_glib_none().0, icon_name.to_glib_none().0, ); } } #[doc(alias = "hdy_preferences_page_set_title")] fn set_title(&self, title: Option<&str>) { unsafe { ffi::hdy_preferences_page_set_title( self.as_ref().to_glib_none().0, title.to_glib_none().0, ); } } #[doc(alias = "icon-name")] fn connect_icon_name_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_icon_name_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyPreferencesPage, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(PreferencesPage::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::icon-name\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_icon_name_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "title")] fn connect_title_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_title_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyPreferencesPage, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(PreferencesPage::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::title\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_title_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl> PreferencesPageExt for O {} impl fmt::Display for PreferencesPage { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("PreferencesPage") } } rust-libhandy-0.11-0.11.1/src/auto/preferences_row.rs000066400000000000000000000304211470255135400222370ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "HdyPreferencesRow")] pub struct PreferencesRow(Object) @extends gtk::ListBoxRow, gtk::Bin, gtk::Container, gtk::Widget, @implements gtk::Buildable, gtk::Actionable; match fn { type_ => || ffi::hdy_preferences_row_get_type(), } } impl PreferencesRow { pub const NONE: Option<&'static PreferencesRow> = None; #[doc(alias = "hdy_preferences_row_new")] pub fn new() -> PreferencesRow { assert_initialized_main_thread!(); unsafe { gtk::Widget::from_glib_none(ffi::hdy_preferences_row_new()).unsafe_cast() } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`PreferencesRow`] objects. /// /// This method returns an instance of [`PreferencesRowBuilder`](crate::builders::PreferencesRowBuilder) which can be used to create [`PreferencesRow`] objects. pub fn builder() -> PreferencesRowBuilder { PreferencesRowBuilder::new() } } impl Default for PreferencesRow { fn default() -> Self { Self::new() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`PreferencesRow`] 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 PreferencesRowBuilder { builder: glib::object::ObjectBuilder<'static, PreferencesRow>, } impl PreferencesRowBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } pub fn title(self, title: impl Into) -> Self { Self { builder: self.builder.property("title", title.into()), } } pub fn use_underline(self, use_underline: bool) -> Self { Self { builder: self.builder.property("use-underline", use_underline), } } pub fn activatable(self, activatable: bool) -> Self { Self { builder: self.builder.property("activatable", activatable), } } pub fn selectable(self, selectable: bool) -> Self { Self { builder: self.builder.property("selectable", selectable), } } pub fn border_width(self, border_width: u32) -> Self { Self { builder: self.builder.property("border-width", border_width), } } pub fn child(self, child: &impl IsA) -> Self { Self { builder: self.builder.property("child", child.clone().upcast()), } } pub fn resize_mode(self, resize_mode: gtk::ResizeMode) -> Self { Self { builder: self.builder.property("resize-mode", resize_mode), } } pub fn app_paintable(self, app_paintable: bool) -> Self { Self { builder: self.builder.property("app-paintable", app_paintable), } } pub fn can_default(self, can_default: bool) -> Self { Self { builder: self.builder.property("can-default", can_default), } } pub fn can_focus(self, can_focus: bool) -> Self { Self { builder: self.builder.property("can-focus", can_focus), } } pub fn events(self, events: gdk::EventMask) -> Self { Self { builder: self.builder.property("events", events), } } pub fn expand(self, expand: bool) -> Self { Self { builder: self.builder.property("expand", expand), } } pub fn focus_on_click(self, focus_on_click: bool) -> Self { Self { builder: self.builder.property("focus-on-click", focus_on_click), } } pub fn halign(self, halign: gtk::Align) -> Self { Self { builder: self.builder.property("halign", halign), } } pub fn has_default(self, has_default: bool) -> Self { Self { builder: self.builder.property("has-default", has_default), } } pub fn has_focus(self, has_focus: bool) -> Self { Self { builder: self.builder.property("has-focus", has_focus), } } pub fn has_tooltip(self, has_tooltip: bool) -> Self { Self { builder: self.builder.property("has-tooltip", has_tooltip), } } pub fn height_request(self, height_request: i32) -> Self { Self { builder: self.builder.property("height-request", height_request), } } pub fn hexpand(self, hexpand: bool) -> Self { Self { builder: self.builder.property("hexpand", hexpand), } } pub fn hexpand_set(self, hexpand_set: bool) -> Self { Self { builder: self.builder.property("hexpand-set", hexpand_set), } } pub fn is_focus(self, is_focus: bool) -> Self { Self { builder: self.builder.property("is-focus", is_focus), } } pub fn margin(self, margin: i32) -> Self { Self { builder: self.builder.property("margin", margin), } } pub fn margin_bottom(self, margin_bottom: i32) -> Self { Self { builder: self.builder.property("margin-bottom", margin_bottom), } } pub fn margin_end(self, margin_end: i32) -> Self { Self { builder: self.builder.property("margin-end", margin_end), } } pub fn margin_start(self, margin_start: i32) -> Self { Self { builder: self.builder.property("margin-start", margin_start), } } pub fn margin_top(self, margin_top: i32) -> Self { Self { builder: self.builder.property("margin-top", margin_top), } } pub fn name(self, name: impl Into) -> Self { Self { builder: self.builder.property("name", name.into()), } } pub fn no_show_all(self, no_show_all: bool) -> Self { Self { builder: self.builder.property("no-show-all", no_show_all), } } pub fn opacity(self, opacity: f64) -> Self { Self { builder: self.builder.property("opacity", opacity), } } pub fn parent(self, parent: &impl IsA) -> Self { Self { builder: self.builder.property("parent", parent.clone().upcast()), } } pub fn receives_default(self, receives_default: bool) -> Self { Self { builder: self.builder.property("receives-default", receives_default), } } pub fn sensitive(self, sensitive: bool) -> Self { Self { builder: self.builder.property("sensitive", sensitive), } } //pub fn style(self, style: &impl IsA) -> Self { // Self { builder: self.builder.property("style", style.clone().upcast()), } //} pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { Self { builder: self .builder .property("tooltip-markup", tooltip_markup.into()), } } pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } } pub fn valign(self, valign: gtk::Align) -> Self { Self { builder: self.builder.property("valign", valign), } } pub fn vexpand(self, vexpand: bool) -> Self { Self { builder: self.builder.property("vexpand", vexpand), } } pub fn vexpand_set(self, vexpand_set: bool) -> Self { Self { builder: self.builder.property("vexpand-set", vexpand_set), } } pub fn visible(self, visible: bool) -> Self { Self { builder: self.builder.property("visible", visible), } } pub fn width_request(self, width_request: i32) -> Self { Self { builder: self.builder.property("width-request", width_request), } } pub fn action_name(self, action_name: impl Into) -> Self { Self { builder: self.builder.property("action-name", action_name.into()), } } pub fn action_target(self, action_target: &glib::Variant) -> Self { Self { builder: self .builder .property("action-target", action_target.clone()), } } // rustdoc-stripper-ignore-next /// Build the [`PreferencesRow`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> PreferencesRow { self.builder.build() } } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait PreferencesRowExt: IsA + sealed::Sealed + 'static { #[doc(alias = "hdy_preferences_row_get_title")] #[doc(alias = "get_title")] fn title(&self) -> Option { unsafe { from_glib_none(ffi::hdy_preferences_row_get_title( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_preferences_row_get_use_underline")] #[doc(alias = "get_use_underline")] fn uses_underline(&self) -> bool { unsafe { from_glib(ffi::hdy_preferences_row_get_use_underline( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_preferences_row_set_title")] fn set_title(&self, title: Option<&str>) { unsafe { ffi::hdy_preferences_row_set_title( self.as_ref().to_glib_none().0, title.to_glib_none().0, ); } } #[doc(alias = "hdy_preferences_row_set_use_underline")] fn set_use_underline(&self, use_underline: bool) { unsafe { ffi::hdy_preferences_row_set_use_underline( self.as_ref().to_glib_none().0, use_underline.into_glib(), ); } } #[doc(alias = "title")] fn connect_title_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_title_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyPreferencesRow, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(PreferencesRow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::title\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_title_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "use-underline")] fn connect_use_underline_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_use_underline_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyPreferencesRow, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(PreferencesRow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::use-underline\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_use_underline_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl> PreferencesRowExt for O {} impl fmt::Display for PreferencesRow { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("PreferencesRow") } } rust-libhandy-0.11-0.11.1/src/auto/preferences_window.rs000066400000000000000000000424021470255135400227410ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT use crate::Window; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "HdyPreferencesWindow")] pub struct PreferencesWindow(Object) @extends Window, gtk::Window, gtk::Bin, gtk::Container, gtk::Widget, @implements gtk::Buildable; match fn { type_ => || ffi::hdy_preferences_window_get_type(), } } impl PreferencesWindow { pub const NONE: Option<&'static PreferencesWindow> = None; #[doc(alias = "hdy_preferences_window_new")] pub fn new() -> PreferencesWindow { assert_initialized_main_thread!(); unsafe { gtk::Widget::from_glib_none(ffi::hdy_preferences_window_new()).unsafe_cast() } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`PreferencesWindow`] objects. /// /// This method returns an instance of [`PreferencesWindowBuilder`](crate::builders::PreferencesWindowBuilder) which can be used to create [`PreferencesWindow`] objects. pub fn builder() -> PreferencesWindowBuilder { PreferencesWindowBuilder::new() } } impl Default for PreferencesWindow { fn default() -> Self { Self::new() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`PreferencesWindow`] 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 PreferencesWindowBuilder { builder: glib::object::ObjectBuilder<'static, PreferencesWindow>, } impl PreferencesWindowBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } pub fn can_swipe_back(self, can_swipe_back: bool) -> Self { Self { builder: self.builder.property("can-swipe-back", can_swipe_back), } } pub fn search_enabled(self, search_enabled: bool) -> Self { Self { builder: self.builder.property("search-enabled", search_enabled), } } pub fn accept_focus(self, accept_focus: bool) -> Self { Self { builder: self.builder.property("accept-focus", accept_focus), } } //pub fn application(self, application: &impl IsA) -> Self { // Self { builder: self.builder.property("application", application.clone().upcast()), } //} pub fn attached_to(self, attached_to: &impl IsA) -> Self { Self { builder: self .builder .property("attached-to", attached_to.clone().upcast()), } } pub fn decorated(self, decorated: bool) -> Self { Self { builder: self.builder.property("decorated", decorated), } } pub fn default_height(self, default_height: i32) -> Self { Self { builder: self.builder.property("default-height", default_height), } } pub fn default_width(self, default_width: i32) -> Self { Self { builder: self.builder.property("default-width", default_width), } } pub fn deletable(self, deletable: bool) -> Self { Self { builder: self.builder.property("deletable", deletable), } } pub fn destroy_with_parent(self, destroy_with_parent: bool) -> Self { Self { builder: self .builder .property("destroy-with-parent", destroy_with_parent), } } pub fn focus_on_map(self, focus_on_map: bool) -> Self { Self { builder: self.builder.property("focus-on-map", focus_on_map), } } pub fn focus_visible(self, focus_visible: bool) -> Self { Self { builder: self.builder.property("focus-visible", focus_visible), } } //pub fn gravity(self, gravity: /*Ignored*/gdk::Gravity) -> Self { // Self { builder: self.builder.property("gravity", gravity), } //} pub fn hide_titlebar_when_maximized(self, hide_titlebar_when_maximized: bool) -> Self { Self { builder: self .builder .property("hide-titlebar-when-maximized", hide_titlebar_when_maximized), } } pub fn icon(self, icon: &gdk_pixbuf::Pixbuf) -> Self { Self { builder: self.builder.property("icon", icon.clone()), } } pub fn icon_name(self, icon_name: impl Into) -> Self { Self { builder: self.builder.property("icon-name", icon_name.into()), } } pub fn mnemonics_visible(self, mnemonics_visible: bool) -> Self { Self { builder: self .builder .property("mnemonics-visible", mnemonics_visible), } } pub fn modal(self, modal: bool) -> Self { Self { builder: self.builder.property("modal", modal), } } pub fn resizable(self, resizable: bool) -> Self { Self { builder: self.builder.property("resizable", resizable), } } pub fn role(self, role: impl Into) -> Self { Self { builder: self.builder.property("role", role.into()), } } //pub fn screen(self, screen: /*Ignored*/&gdk::Screen) -> Self { // Self { builder: self.builder.property("screen", screen), } //} pub fn skip_pager_hint(self, skip_pager_hint: bool) -> Self { Self { builder: self.builder.property("skip-pager-hint", skip_pager_hint), } } pub fn skip_taskbar_hint(self, skip_taskbar_hint: bool) -> Self { Self { builder: self .builder .property("skip-taskbar-hint", skip_taskbar_hint), } } pub fn startup_id(self, startup_id: impl Into) -> Self { Self { builder: self.builder.property("startup-id", startup_id.into()), } } pub fn title(self, title: impl Into) -> Self { Self { builder: self.builder.property("title", title.into()), } } pub fn transient_for(self, transient_for: &impl IsA) -> Self { Self { builder: self .builder .property("transient-for", transient_for.clone().upcast()), } } //pub fn type_(self, type_: /*Ignored*/gtk::WindowType) -> Self { // Self { builder: self.builder.property("type", type_), } //} //pub fn type_hint(self, type_hint: /*Ignored*/gdk::WindowTypeHint) -> Self { // Self { builder: self.builder.property("type-hint", type_hint), } //} pub fn urgency_hint(self, urgency_hint: bool) -> Self { Self { builder: self.builder.property("urgency-hint", urgency_hint), } } //pub fn window_position(self, window_position: /*Ignored*/gtk::WindowPosition) -> Self { // Self { builder: self.builder.property("window-position", window_position), } //} pub fn border_width(self, border_width: u32) -> Self { Self { builder: self.builder.property("border-width", border_width), } } pub fn child(self, child: &impl IsA) -> Self { Self { builder: self.builder.property("child", child.clone().upcast()), } } pub fn resize_mode(self, resize_mode: gtk::ResizeMode) -> Self { Self { builder: self.builder.property("resize-mode", resize_mode), } } pub fn app_paintable(self, app_paintable: bool) -> Self { Self { builder: self.builder.property("app-paintable", app_paintable), } } pub fn can_default(self, can_default: bool) -> Self { Self { builder: self.builder.property("can-default", can_default), } } pub fn can_focus(self, can_focus: bool) -> Self { Self { builder: self.builder.property("can-focus", can_focus), } } pub fn events(self, events: gdk::EventMask) -> Self { Self { builder: self.builder.property("events", events), } } pub fn expand(self, expand: bool) -> Self { Self { builder: self.builder.property("expand", expand), } } pub fn focus_on_click(self, focus_on_click: bool) -> Self { Self { builder: self.builder.property("focus-on-click", focus_on_click), } } pub fn halign(self, halign: gtk::Align) -> Self { Self { builder: self.builder.property("halign", halign), } } pub fn has_default(self, has_default: bool) -> Self { Self { builder: self.builder.property("has-default", has_default), } } pub fn has_focus(self, has_focus: bool) -> Self { Self { builder: self.builder.property("has-focus", has_focus), } } pub fn has_tooltip(self, has_tooltip: bool) -> Self { Self { builder: self.builder.property("has-tooltip", has_tooltip), } } pub fn height_request(self, height_request: i32) -> Self { Self { builder: self.builder.property("height-request", height_request), } } pub fn hexpand(self, hexpand: bool) -> Self { Self { builder: self.builder.property("hexpand", hexpand), } } pub fn hexpand_set(self, hexpand_set: bool) -> Self { Self { builder: self.builder.property("hexpand-set", hexpand_set), } } pub fn is_focus(self, is_focus: bool) -> Self { Self { builder: self.builder.property("is-focus", is_focus), } } pub fn margin(self, margin: i32) -> Self { Self { builder: self.builder.property("margin", margin), } } pub fn margin_bottom(self, margin_bottom: i32) -> Self { Self { builder: self.builder.property("margin-bottom", margin_bottom), } } pub fn margin_end(self, margin_end: i32) -> Self { Self { builder: self.builder.property("margin-end", margin_end), } } pub fn margin_start(self, margin_start: i32) -> Self { Self { builder: self.builder.property("margin-start", margin_start), } } pub fn margin_top(self, margin_top: i32) -> Self { Self { builder: self.builder.property("margin-top", margin_top), } } pub fn name(self, name: impl Into) -> Self { Self { builder: self.builder.property("name", name.into()), } } pub fn no_show_all(self, no_show_all: bool) -> Self { Self { builder: self.builder.property("no-show-all", no_show_all), } } pub fn opacity(self, opacity: f64) -> Self { Self { builder: self.builder.property("opacity", opacity), } } pub fn parent(self, parent: &impl IsA) -> Self { Self { builder: self.builder.property("parent", parent.clone().upcast()), } } pub fn receives_default(self, receives_default: bool) -> Self { Self { builder: self.builder.property("receives-default", receives_default), } } pub fn sensitive(self, sensitive: bool) -> Self { Self { builder: self.builder.property("sensitive", sensitive), } } //pub fn style(self, style: &impl IsA) -> Self { // Self { builder: self.builder.property("style", style.clone().upcast()), } //} pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { Self { builder: self .builder .property("tooltip-markup", tooltip_markup.into()), } } pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } } pub fn valign(self, valign: gtk::Align) -> Self { Self { builder: self.builder.property("valign", valign), } } pub fn vexpand(self, vexpand: bool) -> Self { Self { builder: self.builder.property("vexpand", vexpand), } } pub fn vexpand_set(self, vexpand_set: bool) -> Self { Self { builder: self.builder.property("vexpand-set", vexpand_set), } } pub fn visible(self, visible: bool) -> Self { Self { builder: self.builder.property("visible", visible), } } pub fn width_request(self, width_request: i32) -> Self { Self { builder: self.builder.property("width-request", width_request), } } // rustdoc-stripper-ignore-next /// Build the [`PreferencesWindow`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> PreferencesWindow { self.builder.build() } } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait PreferencesWindowExt: IsA + sealed::Sealed + 'static { #[doc(alias = "hdy_preferences_window_close_subpage")] fn close_subpage(&self) { unsafe { ffi::hdy_preferences_window_close_subpage(self.as_ref().to_glib_none().0); } } #[doc(alias = "hdy_preferences_window_get_can_swipe_back")] #[doc(alias = "get_can_swipe_back")] fn can_swipe_back(&self) -> bool { unsafe { from_glib(ffi::hdy_preferences_window_get_can_swipe_back( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_preferences_window_get_search_enabled")] #[doc(alias = "get_search_enabled")] fn is_search_enabled(&self) -> bool { unsafe { from_glib(ffi::hdy_preferences_window_get_search_enabled( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_preferences_window_present_subpage")] fn present_subpage(&self, subpage: &impl IsA) { unsafe { ffi::hdy_preferences_window_present_subpage( self.as_ref().to_glib_none().0, subpage.as_ref().to_glib_none().0, ); } } #[doc(alias = "hdy_preferences_window_set_can_swipe_back")] fn set_can_swipe_back(&self, can_swipe_back: bool) { unsafe { ffi::hdy_preferences_window_set_can_swipe_back( self.as_ref().to_glib_none().0, can_swipe_back.into_glib(), ); } } #[doc(alias = "hdy_preferences_window_set_search_enabled")] fn set_search_enabled(&self, search_enabled: bool) { unsafe { ffi::hdy_preferences_window_set_search_enabled( self.as_ref().to_glib_none().0, search_enabled.into_glib(), ); } } #[doc(alias = "can-swipe-back")] fn connect_can_swipe_back_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_can_swipe_back_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyPreferencesWindow, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(PreferencesWindow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::can-swipe-back\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_can_swipe_back_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "search-enabled")] fn connect_search_enabled_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_search_enabled_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdyPreferencesWindow, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(PreferencesWindow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::search-enabled\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_search_enabled_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl> PreferencesWindowExt for O {} impl fmt::Display for PreferencesWindow { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("PreferencesWindow") } } rust-libhandy-0.11-0.11.1/src/auto/search_bar.rs000066400000000000000000000310121470255135400211350ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "HdySearchBar")] pub struct SearchBar(Object) @extends gtk::Bin, gtk::Container, gtk::Widget, @implements gtk::Buildable; match fn { type_ => || ffi::hdy_search_bar_get_type(), } } impl SearchBar { pub const NONE: Option<&'static SearchBar> = None; #[doc(alias = "hdy_search_bar_new")] pub fn new() -> SearchBar { assert_initialized_main_thread!(); unsafe { gtk::Widget::from_glib_none(ffi::hdy_search_bar_new()).unsafe_cast() } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`SearchBar`] objects. /// /// This method returns an instance of [`SearchBarBuilder`](crate::builders::SearchBarBuilder) which can be used to create [`SearchBar`] objects. pub fn builder() -> SearchBarBuilder { SearchBarBuilder::new() } } impl Default for SearchBar { fn default() -> Self { Self::new() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`SearchBar`] 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 SearchBarBuilder { builder: glib::object::ObjectBuilder<'static, SearchBar>, } impl SearchBarBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } pub fn search_mode_enabled(self, search_mode_enabled: bool) -> Self { Self { builder: self .builder .property("search-mode-enabled", search_mode_enabled), } } pub fn show_close_button(self, show_close_button: bool) -> Self { Self { builder: self .builder .property("show-close-button", show_close_button), } } pub fn border_width(self, border_width: u32) -> Self { Self { builder: self.builder.property("border-width", border_width), } } pub fn child(self, child: &impl IsA) -> Self { Self { builder: self.builder.property("child", child.clone().upcast()), } } pub fn resize_mode(self, resize_mode: gtk::ResizeMode) -> Self { Self { builder: self.builder.property("resize-mode", resize_mode), } } pub fn app_paintable(self, app_paintable: bool) -> Self { Self { builder: self.builder.property("app-paintable", app_paintable), } } pub fn can_default(self, can_default: bool) -> Self { Self { builder: self.builder.property("can-default", can_default), } } pub fn can_focus(self, can_focus: bool) -> Self { Self { builder: self.builder.property("can-focus", can_focus), } } pub fn events(self, events: gdk::EventMask) -> Self { Self { builder: self.builder.property("events", events), } } pub fn expand(self, expand: bool) -> Self { Self { builder: self.builder.property("expand", expand), } } pub fn focus_on_click(self, focus_on_click: bool) -> Self { Self { builder: self.builder.property("focus-on-click", focus_on_click), } } pub fn halign(self, halign: gtk::Align) -> Self { Self { builder: self.builder.property("halign", halign), } } pub fn has_default(self, has_default: bool) -> Self { Self { builder: self.builder.property("has-default", has_default), } } pub fn has_focus(self, has_focus: bool) -> Self { Self { builder: self.builder.property("has-focus", has_focus), } } pub fn has_tooltip(self, has_tooltip: bool) -> Self { Self { builder: self.builder.property("has-tooltip", has_tooltip), } } pub fn height_request(self, height_request: i32) -> Self { Self { builder: self.builder.property("height-request", height_request), } } pub fn hexpand(self, hexpand: bool) -> Self { Self { builder: self.builder.property("hexpand", hexpand), } } pub fn hexpand_set(self, hexpand_set: bool) -> Self { Self { builder: self.builder.property("hexpand-set", hexpand_set), } } pub fn is_focus(self, is_focus: bool) -> Self { Self { builder: self.builder.property("is-focus", is_focus), } } pub fn margin(self, margin: i32) -> Self { Self { builder: self.builder.property("margin", margin), } } pub fn margin_bottom(self, margin_bottom: i32) -> Self { Self { builder: self.builder.property("margin-bottom", margin_bottom), } } pub fn margin_end(self, margin_end: i32) -> Self { Self { builder: self.builder.property("margin-end", margin_end), } } pub fn margin_start(self, margin_start: i32) -> Self { Self { builder: self.builder.property("margin-start", margin_start), } } pub fn margin_top(self, margin_top: i32) -> Self { Self { builder: self.builder.property("margin-top", margin_top), } } pub fn name(self, name: impl Into) -> Self { Self { builder: self.builder.property("name", name.into()), } } pub fn no_show_all(self, no_show_all: bool) -> Self { Self { builder: self.builder.property("no-show-all", no_show_all), } } pub fn opacity(self, opacity: f64) -> Self { Self { builder: self.builder.property("opacity", opacity), } } pub fn parent(self, parent: &impl IsA) -> Self { Self { builder: self.builder.property("parent", parent.clone().upcast()), } } pub fn receives_default(self, receives_default: bool) -> Self { Self { builder: self.builder.property("receives-default", receives_default), } } pub fn sensitive(self, sensitive: bool) -> Self { Self { builder: self.builder.property("sensitive", sensitive), } } //pub fn style(self, style: &impl IsA) -> Self { // Self { builder: self.builder.property("style", style.clone().upcast()), } //} pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { Self { builder: self .builder .property("tooltip-markup", tooltip_markup.into()), } } pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } } pub fn valign(self, valign: gtk::Align) -> Self { Self { builder: self.builder.property("valign", valign), } } pub fn vexpand(self, vexpand: bool) -> Self { Self { builder: self.builder.property("vexpand", vexpand), } } pub fn vexpand_set(self, vexpand_set: bool) -> Self { Self { builder: self.builder.property("vexpand-set", vexpand_set), } } pub fn visible(self, visible: bool) -> Self { Self { builder: self.builder.property("visible", visible), } } pub fn width_request(self, width_request: i32) -> Self { Self { builder: self.builder.property("width-request", width_request), } } // rustdoc-stripper-ignore-next /// Build the [`SearchBar`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> SearchBar { self.builder.build() } } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait HdySearchBarExt: IsA + sealed::Sealed + 'static { #[doc(alias = "hdy_search_bar_connect_entry")] fn connect_entry(&self, entry: &impl IsA) { unsafe { ffi::hdy_search_bar_connect_entry( self.as_ref().to_glib_none().0, entry.as_ref().to_glib_none().0, ); } } #[doc(alias = "hdy_search_bar_get_search_mode")] #[doc(alias = "get_search_mode")] fn is_search_mode(&self) -> bool { unsafe { from_glib(ffi::hdy_search_bar_get_search_mode( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_search_bar_get_show_close_button")] #[doc(alias = "get_show_close_button")] fn shows_close_button(&self) -> bool { unsafe { from_glib(ffi::hdy_search_bar_get_show_close_button( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_search_bar_handle_event")] fn handle_event(&self, event: &gdk::Event) -> bool { unsafe { from_glib(ffi::hdy_search_bar_handle_event( self.as_ref().to_glib_none().0, mut_override(event.to_glib_none().0), )) } } #[doc(alias = "hdy_search_bar_set_search_mode")] fn set_search_mode(&self, search_mode: bool) { unsafe { ffi::hdy_search_bar_set_search_mode( self.as_ref().to_glib_none().0, search_mode.into_glib(), ); } } #[doc(alias = "hdy_search_bar_set_show_close_button")] fn set_show_close_button(&self, visible: bool) { unsafe { ffi::hdy_search_bar_set_show_close_button( self.as_ref().to_glib_none().0, visible.into_glib(), ); } } #[doc(alias = "search-mode-enabled")] fn is_search_mode_enabled(&self) -> bool { ObjectExt::property(self.as_ref(), "search-mode-enabled") } #[doc(alias = "search-mode-enabled")] fn set_search_mode_enabled(&self, search_mode_enabled: bool) { ObjectExt::set_property(self.as_ref(), "search-mode-enabled", search_mode_enabled) } #[doc(alias = "search-mode-enabled")] fn connect_search_mode_enabled_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_search_mode_enabled_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdySearchBar, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(SearchBar::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::search-mode-enabled\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_search_mode_enabled_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "show-close-button")] fn connect_show_close_button_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_show_close_button_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::HdySearchBar, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(SearchBar::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::show-close-button\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_show_close_button_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl> HdySearchBarExt for O {} impl fmt::Display for SearchBar { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("SearchBar") } } rust-libhandy-0.11-0.11.1/src/auto/squeezer.rs000066400000000000000000000474631470255135400207300ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT use crate::SqueezerTransitionType; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "HdySqueezer")] pub struct Squeezer(Object) @extends gtk::Container, gtk::Widget, @implements gtk::Buildable, gtk::Orientable; match fn { type_ => || ffi::hdy_squeezer_get_type(), } } impl Squeezer { #[doc(alias = "hdy_squeezer_new")] pub fn new() -> Squeezer { assert_initialized_main_thread!(); unsafe { gtk::Widget::from_glib_none(ffi::hdy_squeezer_new()).unsafe_cast() } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`Squeezer`] objects. /// /// This method returns an instance of [`SqueezerBuilder`](crate::builders::SqueezerBuilder) which can be used to create [`Squeezer`] objects. pub fn builder() -> SqueezerBuilder { SqueezerBuilder::new() } #[doc(alias = "hdy_squeezer_get_child_enabled")] #[doc(alias = "get_child_enabled")] pub fn is_child_enabled(&self, child: &impl IsA) -> bool { unsafe { from_glib(ffi::hdy_squeezer_get_child_enabled( self.to_glib_none().0, child.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_squeezer_get_homogeneous")] #[doc(alias = "get_homogeneous")] pub fn is_homogeneous(&self) -> bool { unsafe { from_glib(ffi::hdy_squeezer_get_homogeneous(self.to_glib_none().0)) } } #[doc(alias = "hdy_squeezer_get_interpolate_size")] #[doc(alias = "get_interpolate_size")] pub fn is_interpolate_size(&self) -> bool { unsafe { from_glib(ffi::hdy_squeezer_get_interpolate_size( self.to_glib_none().0, )) } } #[doc(alias = "hdy_squeezer_get_transition_duration")] #[doc(alias = "get_transition_duration")] pub fn transition_duration(&self) -> u32 { unsafe { ffi::hdy_squeezer_get_transition_duration(self.to_glib_none().0) } } #[doc(alias = "hdy_squeezer_get_transition_running")] #[doc(alias = "get_transition_running")] pub fn is_transition_running(&self) -> bool { unsafe { from_glib(ffi::hdy_squeezer_get_transition_running( self.to_glib_none().0, )) } } #[doc(alias = "hdy_squeezer_get_transition_type")] #[doc(alias = "get_transition_type")] pub fn transition_type(&self) -> SqueezerTransitionType { unsafe { from_glib(ffi::hdy_squeezer_get_transition_type(self.to_glib_none().0)) } } #[doc(alias = "hdy_squeezer_get_visible_child")] #[doc(alias = "get_visible_child")] pub fn visible_child(&self) -> Option { unsafe { from_glib_none(ffi::hdy_squeezer_get_visible_child(self.to_glib_none().0)) } } #[doc(alias = "hdy_squeezer_get_xalign")] #[doc(alias = "get_xalign")] pub fn xalign(&self) -> f32 { unsafe { ffi::hdy_squeezer_get_xalign(self.to_glib_none().0) } } #[doc(alias = "hdy_squeezer_get_yalign")] #[doc(alias = "get_yalign")] pub fn yalign(&self) -> f32 { unsafe { ffi::hdy_squeezer_get_yalign(self.to_glib_none().0) } } #[doc(alias = "hdy_squeezer_set_child_enabled")] pub fn set_child_enabled(&self, child: &impl IsA, enabled: bool) { unsafe { ffi::hdy_squeezer_set_child_enabled( self.to_glib_none().0, child.as_ref().to_glib_none().0, enabled.into_glib(), ); } } #[doc(alias = "hdy_squeezer_set_homogeneous")] pub fn set_homogeneous(&self, homogeneous: bool) { unsafe { ffi::hdy_squeezer_set_homogeneous(self.to_glib_none().0, homogeneous.into_glib()); } } #[doc(alias = "hdy_squeezer_set_interpolate_size")] pub fn set_interpolate_size(&self, interpolate_size: bool) { unsafe { ffi::hdy_squeezer_set_interpolate_size( self.to_glib_none().0, interpolate_size.into_glib(), ); } } #[doc(alias = "hdy_squeezer_set_transition_duration")] pub fn set_transition_duration(&self, duration: u32) { unsafe { ffi::hdy_squeezer_set_transition_duration(self.to_glib_none().0, duration); } } #[doc(alias = "hdy_squeezer_set_transition_type")] pub fn set_transition_type(&self, transition: SqueezerTransitionType) { unsafe { ffi::hdy_squeezer_set_transition_type(self.to_glib_none().0, transition.into_glib()); } } #[doc(alias = "hdy_squeezer_set_xalign")] pub fn set_xalign(&self, xalign: f32) { unsafe { ffi::hdy_squeezer_set_xalign(self.to_glib_none().0, xalign); } } #[doc(alias = "hdy_squeezer_set_yalign")] pub fn set_yalign(&self, yalign: f32) { unsafe { ffi::hdy_squeezer_set_yalign(self.to_glib_none().0, yalign); } } #[doc(alias = "homogeneous")] pub fn connect_homogeneous_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_homogeneous_trampoline( this: *mut ffi::HdySqueezer, _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 _, b"notify::homogeneous\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_homogeneous_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "interpolate-size")] pub fn connect_interpolate_size_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_interpolate_size_trampoline( this: *mut ffi::HdySqueezer, _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 _, b"notify::interpolate-size\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_interpolate_size_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "transition-duration")] pub fn connect_transition_duration_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_transition_duration_trampoline( this: *mut ffi::HdySqueezer, _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 _, b"notify::transition-duration\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_transition_duration_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "transition-running")] pub fn connect_transition_running_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_transition_running_trampoline( this: *mut ffi::HdySqueezer, _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 _, b"notify::transition-running\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_transition_running_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "transition-type")] pub fn connect_transition_type_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_transition_type_trampoline( this: *mut ffi::HdySqueezer, _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 _, b"notify::transition-type\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_transition_type_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "visible-child")] pub fn connect_visible_child_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_visible_child_trampoline( this: *mut ffi::HdySqueezer, _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 _, b"notify::visible-child\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_visible_child_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "xalign")] pub fn connect_xalign_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_xalign_trampoline( this: *mut ffi::HdySqueezer, _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 _, b"notify::xalign\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_xalign_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "yalign")] pub fn connect_yalign_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_yalign_trampoline( this: *mut ffi::HdySqueezer, _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 _, b"notify::yalign\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_yalign_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl Default for Squeezer { fn default() -> Self { Self::new() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`Squeezer`] 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 SqueezerBuilder { builder: glib::object::ObjectBuilder<'static, Squeezer>, } impl SqueezerBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } pub fn homogeneous(self, homogeneous: bool) -> Self { Self { builder: self.builder.property("homogeneous", homogeneous), } } pub fn interpolate_size(self, interpolate_size: bool) -> Self { Self { builder: self.builder.property("interpolate-size", interpolate_size), } } pub fn transition_duration(self, transition_duration: u32) -> Self { Self { builder: self .builder .property("transition-duration", transition_duration), } } pub fn transition_type(self, transition_type: SqueezerTransitionType) -> Self { Self { builder: self.builder.property("transition-type", transition_type), } } pub fn xalign(self, xalign: f32) -> Self { Self { builder: self.builder.property("xalign", xalign), } } pub fn yalign(self, yalign: f32) -> Self { Self { builder: self.builder.property("yalign", yalign), } } pub fn border_width(self, border_width: u32) -> Self { Self { builder: self.builder.property("border-width", border_width), } } pub fn child(self, child: &impl IsA) -> Self { Self { builder: self.builder.property("child", child.clone().upcast()), } } pub fn resize_mode(self, resize_mode: gtk::ResizeMode) -> Self { Self { builder: self.builder.property("resize-mode", resize_mode), } } pub fn app_paintable(self, app_paintable: bool) -> Self { Self { builder: self.builder.property("app-paintable", app_paintable), } } pub fn can_default(self, can_default: bool) -> Self { Self { builder: self.builder.property("can-default", can_default), } } pub fn can_focus(self, can_focus: bool) -> Self { Self { builder: self.builder.property("can-focus", can_focus), } } pub fn events(self, events: gdk::EventMask) -> Self { Self { builder: self.builder.property("events", events), } } pub fn expand(self, expand: bool) -> Self { Self { builder: self.builder.property("expand", expand), } } pub fn focus_on_click(self, focus_on_click: bool) -> Self { Self { builder: self.builder.property("focus-on-click", focus_on_click), } } pub fn halign(self, halign: gtk::Align) -> Self { Self { builder: self.builder.property("halign", halign), } } pub fn has_default(self, has_default: bool) -> Self { Self { builder: self.builder.property("has-default", has_default), } } pub fn has_focus(self, has_focus: bool) -> Self { Self { builder: self.builder.property("has-focus", has_focus), } } pub fn has_tooltip(self, has_tooltip: bool) -> Self { Self { builder: self.builder.property("has-tooltip", has_tooltip), } } pub fn height_request(self, height_request: i32) -> Self { Self { builder: self.builder.property("height-request", height_request), } } pub fn hexpand(self, hexpand: bool) -> Self { Self { builder: self.builder.property("hexpand", hexpand), } } pub fn hexpand_set(self, hexpand_set: bool) -> Self { Self { builder: self.builder.property("hexpand-set", hexpand_set), } } pub fn is_focus(self, is_focus: bool) -> Self { Self { builder: self.builder.property("is-focus", is_focus), } } pub fn margin(self, margin: i32) -> Self { Self { builder: self.builder.property("margin", margin), } } pub fn margin_bottom(self, margin_bottom: i32) -> Self { Self { builder: self.builder.property("margin-bottom", margin_bottom), } } pub fn margin_end(self, margin_end: i32) -> Self { Self { builder: self.builder.property("margin-end", margin_end), } } pub fn margin_start(self, margin_start: i32) -> Self { Self { builder: self.builder.property("margin-start", margin_start), } } pub fn margin_top(self, margin_top: i32) -> Self { Self { builder: self.builder.property("margin-top", margin_top), } } pub fn name(self, name: impl Into) -> Self { Self { builder: self.builder.property("name", name.into()), } } pub fn no_show_all(self, no_show_all: bool) -> Self { Self { builder: self.builder.property("no-show-all", no_show_all), } } pub fn opacity(self, opacity: f64) -> Self { Self { builder: self.builder.property("opacity", opacity), } } pub fn parent(self, parent: &impl IsA) -> Self { Self { builder: self.builder.property("parent", parent.clone().upcast()), } } pub fn receives_default(self, receives_default: bool) -> Self { Self { builder: self.builder.property("receives-default", receives_default), } } pub fn sensitive(self, sensitive: bool) -> Self { Self { builder: self.builder.property("sensitive", sensitive), } } //pub fn style(self, style: &impl IsA) -> Self { // Self { builder: self.builder.property("style", style.clone().upcast()), } //} pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { Self { builder: self .builder .property("tooltip-markup", tooltip_markup.into()), } } pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } } pub fn valign(self, valign: gtk::Align) -> Self { Self { builder: self.builder.property("valign", valign), } } pub fn vexpand(self, vexpand: bool) -> Self { Self { builder: self.builder.property("vexpand", vexpand), } } pub fn vexpand_set(self, vexpand_set: bool) -> Self { Self { builder: self.builder.property("vexpand-set", vexpand_set), } } pub fn visible(self, visible: bool) -> Self { Self { builder: self.builder.property("visible", visible), } } pub fn width_request(self, width_request: i32) -> Self { Self { builder: self.builder.property("width-request", width_request), } } pub fn orientation(self, orientation: gtk::Orientation) -> Self { Self { builder: self.builder.property("orientation", orientation), } } // rustdoc-stripper-ignore-next /// Build the [`Squeezer`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> Squeezer { self.builder.build() } } impl fmt::Display for Squeezer { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Squeezer") } } rust-libhandy-0.11-0.11.1/src/auto/status_page.rs000066400000000000000000000314741470255135400213770ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "HdyStatusPage")] pub struct StatusPage(Object) @extends gtk::Bin, gtk::Container, gtk::Widget, @implements gtk::Buildable; match fn { type_ => || ffi::hdy_status_page_get_type(), } } impl StatusPage { #[doc(alias = "hdy_status_page_new")] pub fn new() -> StatusPage { assert_initialized_main_thread!(); unsafe { gtk::Widget::from_glib_none(ffi::hdy_status_page_new()).unsafe_cast() } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`StatusPage`] objects. /// /// This method returns an instance of [`StatusPageBuilder`](crate::builders::StatusPageBuilder) which can be used to create [`StatusPage`] objects. pub fn builder() -> StatusPageBuilder { StatusPageBuilder::new() } #[doc(alias = "hdy_status_page_get_description")] #[doc(alias = "get_description")] pub fn description(&self) -> Option { unsafe { from_glib_none(ffi::hdy_status_page_get_description(self.to_glib_none().0)) } } #[doc(alias = "hdy_status_page_get_icon_name")] #[doc(alias = "get_icon_name")] pub fn icon_name(&self) -> Option { unsafe { from_glib_none(ffi::hdy_status_page_get_icon_name(self.to_glib_none().0)) } } #[doc(alias = "hdy_status_page_get_title")] #[doc(alias = "get_title")] pub fn title(&self) -> Option { unsafe { from_glib_none(ffi::hdy_status_page_get_title(self.to_glib_none().0)) } } #[doc(alias = "hdy_status_page_set_description")] pub fn set_description(&self, description: Option<&str>) { unsafe { ffi::hdy_status_page_set_description( self.to_glib_none().0, description.to_glib_none().0, ); } } #[doc(alias = "hdy_status_page_set_icon_name")] pub fn set_icon_name(&self, icon_name: Option<&str>) { unsafe { ffi::hdy_status_page_set_icon_name(self.to_glib_none().0, icon_name.to_glib_none().0); } } #[doc(alias = "hdy_status_page_set_title")] pub fn set_title(&self, title: Option<&str>) { unsafe { ffi::hdy_status_page_set_title(self.to_glib_none().0, title.to_glib_none().0); } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "description")] pub fn connect_description_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_description_trampoline( this: *mut ffi::HdyStatusPage, _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 _, b"notify::description\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_description_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "icon-name")] pub fn connect_icon_name_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_icon_name_trampoline( this: *mut ffi::HdyStatusPage, _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 _, b"notify::icon-name\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_icon_name_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "title")] pub fn connect_title_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_title_trampoline( this: *mut ffi::HdyStatusPage, _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 _, b"notify::title\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_title_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] impl Default for StatusPage { fn default() -> Self { Self::new() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`StatusPage`] 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 StatusPageBuilder { builder: glib::object::ObjectBuilder<'static, StatusPage>, } impl StatusPageBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn description(self, description: impl Into) -> Self { Self { builder: self.builder.property("description", description.into()), } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn icon_name(self, icon_name: impl Into) -> Self { Self { builder: self.builder.property("icon-name", icon_name.into()), } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn title(self, title: impl Into) -> Self { Self { builder: self.builder.property("title", title.into()), } } pub fn border_width(self, border_width: u32) -> Self { Self { builder: self.builder.property("border-width", border_width), } } pub fn child(self, child: &impl IsA) -> Self { Self { builder: self.builder.property("child", child.clone().upcast()), } } pub fn resize_mode(self, resize_mode: gtk::ResizeMode) -> Self { Self { builder: self.builder.property("resize-mode", resize_mode), } } pub fn app_paintable(self, app_paintable: bool) -> Self { Self { builder: self.builder.property("app-paintable", app_paintable), } } pub fn can_default(self, can_default: bool) -> Self { Self { builder: self.builder.property("can-default", can_default), } } pub fn can_focus(self, can_focus: bool) -> Self { Self { builder: self.builder.property("can-focus", can_focus), } } pub fn events(self, events: gdk::EventMask) -> Self { Self { builder: self.builder.property("events", events), } } pub fn expand(self, expand: bool) -> Self { Self { builder: self.builder.property("expand", expand), } } pub fn focus_on_click(self, focus_on_click: bool) -> Self { Self { builder: self.builder.property("focus-on-click", focus_on_click), } } pub fn halign(self, halign: gtk::Align) -> Self { Self { builder: self.builder.property("halign", halign), } } pub fn has_default(self, has_default: bool) -> Self { Self { builder: self.builder.property("has-default", has_default), } } pub fn has_focus(self, has_focus: bool) -> Self { Self { builder: self.builder.property("has-focus", has_focus), } } pub fn has_tooltip(self, has_tooltip: bool) -> Self { Self { builder: self.builder.property("has-tooltip", has_tooltip), } } pub fn height_request(self, height_request: i32) -> Self { Self { builder: self.builder.property("height-request", height_request), } } pub fn hexpand(self, hexpand: bool) -> Self { Self { builder: self.builder.property("hexpand", hexpand), } } pub fn hexpand_set(self, hexpand_set: bool) -> Self { Self { builder: self.builder.property("hexpand-set", hexpand_set), } } pub fn is_focus(self, is_focus: bool) -> Self { Self { builder: self.builder.property("is-focus", is_focus), } } pub fn margin(self, margin: i32) -> Self { Self { builder: self.builder.property("margin", margin), } } pub fn margin_bottom(self, margin_bottom: i32) -> Self { Self { builder: self.builder.property("margin-bottom", margin_bottom), } } pub fn margin_end(self, margin_end: i32) -> Self { Self { builder: self.builder.property("margin-end", margin_end), } } pub fn margin_start(self, margin_start: i32) -> Self { Self { builder: self.builder.property("margin-start", margin_start), } } pub fn margin_top(self, margin_top: i32) -> Self { Self { builder: self.builder.property("margin-top", margin_top), } } pub fn name(self, name: impl Into) -> Self { Self { builder: self.builder.property("name", name.into()), } } pub fn no_show_all(self, no_show_all: bool) -> Self { Self { builder: self.builder.property("no-show-all", no_show_all), } } pub fn opacity(self, opacity: f64) -> Self { Self { builder: self.builder.property("opacity", opacity), } } pub fn parent(self, parent: &impl IsA) -> Self { Self { builder: self.builder.property("parent", parent.clone().upcast()), } } pub fn receives_default(self, receives_default: bool) -> Self { Self { builder: self.builder.property("receives-default", receives_default), } } pub fn sensitive(self, sensitive: bool) -> Self { Self { builder: self.builder.property("sensitive", sensitive), } } //pub fn style(self, style: &impl IsA) -> Self { // Self { builder: self.builder.property("style", style.clone().upcast()), } //} pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { Self { builder: self .builder .property("tooltip-markup", tooltip_markup.into()), } } pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } } pub fn valign(self, valign: gtk::Align) -> Self { Self { builder: self.builder.property("valign", valign), } } pub fn vexpand(self, vexpand: bool) -> Self { Self { builder: self.builder.property("vexpand", vexpand), } } pub fn vexpand_set(self, vexpand_set: bool) -> Self { Self { builder: self.builder.property("vexpand-set", vexpand_set), } } pub fn visible(self, visible: bool) -> Self { Self { builder: self.builder.property("visible", visible), } } pub fn width_request(self, width_request: i32) -> Self { Self { builder: self.builder.property("width-request", width_request), } } // rustdoc-stripper-ignore-next /// Build the [`StatusPage`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> StatusPage { self.builder.build() } } impl fmt::Display for StatusPage { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("StatusPage") } } rust-libhandy-0.11-0.11.1/src/auto/style_manager.rs000066400000000000000000000154331470255135400217070ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT use crate::ColorScheme; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "HdyStyleManager")] pub struct StyleManager(Object); match fn { type_ => || ffi::hdy_style_manager_get_type(), } } impl StyleManager { #[doc(alias = "hdy_style_manager_get_color_scheme")] #[doc(alias = "get_color_scheme")] pub fn color_scheme(&self) -> ColorScheme { unsafe { from_glib(ffi::hdy_style_manager_get_color_scheme( self.to_glib_none().0, )) } } #[doc(alias = "hdy_style_manager_get_dark")] #[doc(alias = "get_dark")] pub fn is_dark(&self) -> bool { unsafe { from_glib(ffi::hdy_style_manager_get_dark(self.to_glib_none().0)) } } #[doc(alias = "hdy_style_manager_get_display")] #[doc(alias = "get_display")] pub fn display(&self) -> Option { unsafe { from_glib_none(ffi::hdy_style_manager_get_display(self.to_glib_none().0)) } } #[doc(alias = "hdy_style_manager_get_high_contrast")] #[doc(alias = "get_high_contrast")] pub fn is_high_contrast(&self) -> bool { unsafe { from_glib(ffi::hdy_style_manager_get_high_contrast( self.to_glib_none().0, )) } } #[doc(alias = "hdy_style_manager_get_system_supports_color_schemes")] #[doc(alias = "get_system_supports_color_schemes")] pub fn system_supports_color_schemes(&self) -> bool { unsafe { from_glib(ffi::hdy_style_manager_get_system_supports_color_schemes( self.to_glib_none().0, )) } } #[doc(alias = "hdy_style_manager_set_color_scheme")] pub fn set_color_scheme(&self, color_scheme: ColorScheme) { unsafe { ffi::hdy_style_manager_set_color_scheme( self.to_glib_none().0, color_scheme.into_glib(), ); } } #[doc(alias = "hdy_style_manager_get_default")] #[doc(alias = "get_default")] #[allow(clippy::should_implement_trait)] pub fn default() -> Option { assert_initialized_main_thread!(); unsafe { from_glib_none(ffi::hdy_style_manager_get_default()) } } #[doc(alias = "hdy_style_manager_get_for_display")] #[doc(alias = "get_for_display")] pub fn for_display(display: &gdk::Display) -> Option { assert_initialized_main_thread!(); unsafe { from_glib_none(ffi::hdy_style_manager_get_for_display( display.to_glib_none().0, )) } } #[cfg(feature = "v1_6")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))] #[doc(alias = "color-scheme")] pub fn connect_color_scheme_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_color_scheme_trampoline( this: *mut ffi::HdyStyleManager, _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 _, b"notify::color-scheme\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_color_scheme_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_6")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))] #[doc(alias = "dark")] pub fn connect_dark_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_dark_trampoline( this: *mut ffi::HdyStyleManager, _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 _, b"notify::dark\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_dark_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_6")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))] #[doc(alias = "high-contrast")] pub fn connect_high_contrast_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_high_contrast_trampoline( this: *mut ffi::HdyStyleManager, _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 _, b"notify::high-contrast\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_high_contrast_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_6")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_6")))] #[doc(alias = "system-supports-color-schemes")] pub fn connect_system_supports_color_schemes_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_system_supports_color_schemes_trampoline< F: Fn(&StyleManager) + 'static, >( this: *mut ffi::HdyStyleManager, _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 _, b"notify::system-supports-color-schemes\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_system_supports_color_schemes_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl fmt::Display for StyleManager { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("StyleManager") } } rust-libhandy-0.11-0.11.1/src/auto/swipe_group.rs000066400000000000000000000042201470255135400214100ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT #![allow(deprecated)] use crate::Swipeable; use glib::{prelude::*, translate::*}; use std::fmt; glib::wrapper! { #[doc(alias = "HdySwipeGroup")] pub struct SwipeGroup(Object) @implements gtk::Buildable; match fn { type_ => || ffi::hdy_swipe_group_get_type(), } } impl SwipeGroup { #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")] #[allow(deprecated)] #[doc(alias = "hdy_swipe_group_new")] pub fn new() -> SwipeGroup { assert_initialized_main_thread!(); unsafe { from_glib_full(ffi::hdy_swipe_group_new()) } } #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")] #[allow(deprecated)] #[doc(alias = "hdy_swipe_group_add_swipeable")] pub fn add_swipeable(&self, swipeable: &impl IsA) { unsafe { ffi::hdy_swipe_group_add_swipeable( self.to_glib_none().0, swipeable.as_ref().to_glib_none().0, ); } } #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")] #[allow(deprecated)] #[doc(alias = "hdy_swipe_group_get_swipeables")] #[doc(alias = "get_swipeables")] pub fn swipeables(&self) -> Vec { unsafe { FromGlibPtrContainer::from_glib_none(ffi::hdy_swipe_group_get_swipeables( self.to_glib_none().0, )) } } #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")] #[allow(deprecated)] #[doc(alias = "hdy_swipe_group_remove_swipeable")] pub fn remove_swipeable(&self, swipeable: &impl IsA) { unsafe { ffi::hdy_swipe_group_remove_swipeable( self.to_glib_none().0, swipeable.as_ref().to_glib_none().0, ); } } } impl Default for SwipeGroup { fn default() -> Self { Self::new() } } impl fmt::Display for SwipeGroup { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("SwipeGroup") } } rust-libhandy-0.11-0.11.1/src/auto/swipe_tracker.rs000066400000000000000000000304641470255135400217200ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT use crate::{NavigationDirection, Swipeable}; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "HdySwipeTracker")] pub struct SwipeTracker(Object) @implements gtk::Orientable; match fn { type_ => || ffi::hdy_swipe_tracker_get_type(), } } impl SwipeTracker { #[doc(alias = "hdy_swipe_tracker_new")] pub fn new(swipeable: &impl IsA) -> SwipeTracker { skip_assert_initialized!(); unsafe { from_glib_full(ffi::hdy_swipe_tracker_new( swipeable.as_ref().to_glib_none().0, )) } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`SwipeTracker`] objects. /// /// This method returns an instance of [`SwipeTrackerBuilder`](crate::builders::SwipeTrackerBuilder) which can be used to create [`SwipeTracker`] objects. pub fn builder() -> SwipeTrackerBuilder { SwipeTrackerBuilder::new() } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "hdy_swipe_tracker_get_allow_long_swipes")] #[doc(alias = "get_allow_long_swipes")] pub fn allows_long_swipes(&self) -> bool { unsafe { from_glib(ffi::hdy_swipe_tracker_get_allow_long_swipes( self.to_glib_none().0, )) } } #[doc(alias = "hdy_swipe_tracker_get_allow_mouse_drag")] #[doc(alias = "get_allow_mouse_drag")] pub fn allows_mouse_drag(&self) -> bool { unsafe { from_glib(ffi::hdy_swipe_tracker_get_allow_mouse_drag( self.to_glib_none().0, )) } } #[doc(alias = "hdy_swipe_tracker_get_enabled")] #[doc(alias = "get_enabled")] pub fn is_enabled(&self) -> bool { unsafe { from_glib(ffi::hdy_swipe_tracker_get_enabled(self.to_glib_none().0)) } } #[doc(alias = "hdy_swipe_tracker_get_reversed")] #[doc(alias = "get_reversed")] pub fn is_reversed(&self) -> bool { unsafe { from_glib(ffi::hdy_swipe_tracker_get_reversed(self.to_glib_none().0)) } } #[doc(alias = "hdy_swipe_tracker_get_swipeable")] #[doc(alias = "get_swipeable")] pub fn swipeable(&self) -> Option { unsafe { from_glib_none(ffi::hdy_swipe_tracker_get_swipeable(self.to_glib_none().0)) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "hdy_swipe_tracker_set_allow_long_swipes")] pub fn set_allow_long_swipes(&self, allow_long_swipes: bool) { unsafe { ffi::hdy_swipe_tracker_set_allow_long_swipes( self.to_glib_none().0, allow_long_swipes.into_glib(), ); } } #[doc(alias = "hdy_swipe_tracker_set_allow_mouse_drag")] pub fn set_allow_mouse_drag(&self, allow_mouse_drag: bool) { unsafe { ffi::hdy_swipe_tracker_set_allow_mouse_drag( self.to_glib_none().0, allow_mouse_drag.into_glib(), ); } } #[doc(alias = "hdy_swipe_tracker_set_enabled")] pub fn set_enabled(&self, enabled: bool) { unsafe { ffi::hdy_swipe_tracker_set_enabled(self.to_glib_none().0, enabled.into_glib()); } } #[doc(alias = "hdy_swipe_tracker_set_reversed")] pub fn set_reversed(&self, reversed: bool) { unsafe { ffi::hdy_swipe_tracker_set_reversed(self.to_glib_none().0, reversed.into_glib()); } } #[doc(alias = "hdy_swipe_tracker_shift_position")] pub fn shift_position(&self, delta: f64) { unsafe { ffi::hdy_swipe_tracker_shift_position(self.to_glib_none().0, delta); } } #[doc(alias = "begin-swipe")] pub fn connect_begin_swipe( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn begin_swipe_trampoline< F: Fn(&SwipeTracker, NavigationDirection, bool) + 'static, >( this: *mut ffi::HdySwipeTracker, direction: ffi::HdyNavigationDirection, direct: glib::ffi::gboolean, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f( &from_glib_borrow(this), from_glib(direction), from_glib(direct), ) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"begin-swipe\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( begin_swipe_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "end-swipe")] pub fn connect_end_swipe(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn end_swipe_trampoline( this: *mut ffi::HdySwipeTracker, duration: i64, to: libc::c_double, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this), duration, to) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"end-swipe\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( end_swipe_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "update-swipe")] pub fn connect_update_swipe(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn update_swipe_trampoline( this: *mut ffi::HdySwipeTracker, progress: libc::c_double, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this), progress) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"update-swipe\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( update_swipe_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "allow-long-swipes")] pub fn connect_allow_long_swipes_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_allow_long_swipes_trampoline( this: *mut ffi::HdySwipeTracker, _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 _, b"notify::allow-long-swipes\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_allow_long_swipes_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "allow-mouse-drag")] pub fn connect_allow_mouse_drag_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_allow_mouse_drag_trampoline( this: *mut ffi::HdySwipeTracker, _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 _, b"notify::allow-mouse-drag\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_allow_mouse_drag_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "enabled")] pub fn connect_enabled_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_enabled_trampoline( this: *mut ffi::HdySwipeTracker, _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 _, b"notify::enabled\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_enabled_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "reversed")] pub fn connect_reversed_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_reversed_trampoline( this: *mut ffi::HdySwipeTracker, _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 _, b"notify::reversed\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_reversed_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl Default for SwipeTracker { fn default() -> Self { glib::object::Object::new::() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`SwipeTracker`] 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 SwipeTrackerBuilder { builder: glib::object::ObjectBuilder<'static, SwipeTracker>, } impl SwipeTrackerBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn allow_long_swipes(self, allow_long_swipes: bool) -> Self { Self { builder: self .builder .property("allow-long-swipes", allow_long_swipes), } } pub fn allow_mouse_drag(self, allow_mouse_drag: bool) -> Self { Self { builder: self.builder.property("allow-mouse-drag", allow_mouse_drag), } } pub fn enabled(self, enabled: bool) -> Self { Self { builder: self.builder.property("enabled", enabled), } } pub fn reversed(self, reversed: bool) -> Self { Self { builder: self.builder.property("reversed", reversed), } } pub fn swipeable(self, swipeable: &impl IsA) -> Self { Self { builder: self .builder .property("swipeable", swipeable.clone().upcast()), } } pub fn orientation(self, orientation: gtk::Orientation) -> Self { Self { builder: self.builder.property("orientation", orientation), } } // rustdoc-stripper-ignore-next /// Build the [`SwipeTracker`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> SwipeTracker { self.builder.build() } } impl fmt::Display for SwipeTracker { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("SwipeTracker") } } rust-libhandy-0.11-0.11.1/src/auto/swipeable.rs000066400000000000000000000110001470255135400210120ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT use crate::{NavigationDirection, SwipeTracker}; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem, mem::transmute}; glib::wrapper! { #[doc(alias = "HdySwipeable")] pub struct Swipeable(Interface) @requires gtk::Widget, gtk::Buildable; match fn { type_ => || ffi::hdy_swipeable_get_type(), } } impl Swipeable { pub const NONE: Option<&'static Swipeable> = None; } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait SwipeableExt: IsA + sealed::Sealed + 'static { #[doc(alias = "hdy_swipeable_emit_child_switched")] fn emit_child_switched(&self, index: u32, duration: i64) { unsafe { ffi::hdy_swipeable_emit_child_switched(self.as_ref().to_glib_none().0, index, duration); } } #[doc(alias = "hdy_swipeable_get_cancel_progress")] #[doc(alias = "get_cancel_progress")] fn cancel_progress(&self) -> f64 { unsafe { ffi::hdy_swipeable_get_cancel_progress(self.as_ref().to_glib_none().0) } } #[doc(alias = "hdy_swipeable_get_distance")] #[doc(alias = "get_distance")] fn distance(&self) -> f64 { unsafe { ffi::hdy_swipeable_get_distance(self.as_ref().to_glib_none().0) } } #[doc(alias = "hdy_swipeable_get_progress")] #[doc(alias = "get_progress")] fn progress(&self) -> f64 { unsafe { ffi::hdy_swipeable_get_progress(self.as_ref().to_glib_none().0) } } #[doc(alias = "hdy_swipeable_get_snap_points")] #[doc(alias = "get_snap_points")] fn snap_points(&self) -> Vec { unsafe { let mut n_snap_points = mem::MaybeUninit::uninit(); let ret = FromGlibContainer::from_glib_full_num( ffi::hdy_swipeable_get_snap_points( self.as_ref().to_glib_none().0, n_snap_points.as_mut_ptr(), ), n_snap_points.assume_init() as _, ); ret } } #[doc(alias = "hdy_swipeable_get_swipe_area")] #[doc(alias = "get_swipe_area")] fn swipe_area( &self, navigation_direction: NavigationDirection, is_drag: bool, ) -> gdk::Rectangle { unsafe { let mut rect = gdk::Rectangle::uninitialized(); ffi::hdy_swipeable_get_swipe_area( self.as_ref().to_glib_none().0, navigation_direction.into_glib(), is_drag.into_glib(), rect.to_glib_none_mut().0, ); rect } } #[doc(alias = "hdy_swipeable_get_swipe_tracker")] #[doc(alias = "get_swipe_tracker")] fn swipe_tracker(&self) -> Option { unsafe { from_glib_none(ffi::hdy_swipeable_get_swipe_tracker( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_swipeable_switch_child")] fn switch_child(&self, index: u32, duration: i64) { unsafe { ffi::hdy_swipeable_switch_child(self.as_ref().to_glib_none().0, index, duration); } } #[doc(alias = "child-switched")] fn connect_child_switched(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn child_switched_trampoline< P: IsA, F: Fn(&P, u32, i64) + 'static, >( this: *mut ffi::HdySwipeable, index: libc::c_uint, duration: i64, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f( Swipeable::from_glib_borrow(this).unsafe_cast_ref(), index, duration, ) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"child-switched\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( child_switched_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl> SwipeableExt for O {} impl fmt::Display for Swipeable { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Swipeable") } } rust-libhandy-0.11-0.11.1/src/auto/tab_bar.rs000066400000000000000000000572011470255135400204460ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT use crate::{TabPage, TabView}; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "HdyTabBar")] pub struct TabBar(Object) @extends gtk::Bin, gtk::Container, gtk::Widget, @implements gtk::Buildable; match fn { type_ => || ffi::hdy_tab_bar_get_type(), } } impl TabBar { #[doc(alias = "hdy_tab_bar_new")] pub fn new() -> TabBar { assert_initialized_main_thread!(); unsafe { from_glib_none(ffi::hdy_tab_bar_new()) } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`TabBar`] objects. /// /// This method returns an instance of [`TabBarBuilder`](crate::builders::TabBarBuilder) which can be used to create [`TabBar`] objects. pub fn builder() -> TabBarBuilder { TabBarBuilder::new() } #[doc(alias = "hdy_tab_bar_get_autohide")] #[doc(alias = "get_autohide")] pub fn is_autohide(&self) -> bool { unsafe { from_glib(ffi::hdy_tab_bar_get_autohide(self.to_glib_none().0)) } } #[doc(alias = "hdy_tab_bar_get_end_action_widget")] #[doc(alias = "get_end_action_widget")] pub fn end_action_widget(&self) -> Option { unsafe { from_glib_none(ffi::hdy_tab_bar_get_end_action_widget( self.to_glib_none().0, )) } } #[doc(alias = "hdy_tab_bar_get_expand_tabs")] #[doc(alias = "get_expand_tabs")] pub fn expands_tabs(&self) -> bool { unsafe { from_glib(ffi::hdy_tab_bar_get_expand_tabs(self.to_glib_none().0)) } } #[doc(alias = "hdy_tab_bar_get_extra_drag_dest_targets")] #[doc(alias = "get_extra_drag_dest_targets")] pub fn extra_drag_dest_targets(&self) -> Option { unsafe { from_glib_none(ffi::hdy_tab_bar_get_extra_drag_dest_targets( self.to_glib_none().0, )) } } #[doc(alias = "hdy_tab_bar_get_inverted")] #[doc(alias = "get_inverted")] pub fn is_inverted(&self) -> bool { unsafe { from_glib(ffi::hdy_tab_bar_get_inverted(self.to_glib_none().0)) } } #[doc(alias = "hdy_tab_bar_get_is_overflowing")] #[doc(alias = "get_is_overflowing")] pub fn is_overflowing(&self) -> bool { unsafe { from_glib(ffi::hdy_tab_bar_get_is_overflowing(self.to_glib_none().0)) } } #[doc(alias = "hdy_tab_bar_get_start_action_widget")] #[doc(alias = "get_start_action_widget")] pub fn start_action_widget(&self) -> Option { unsafe { from_glib_none(ffi::hdy_tab_bar_get_start_action_widget( self.to_glib_none().0, )) } } #[doc(alias = "hdy_tab_bar_get_tabs_revealed")] #[doc(alias = "get_tabs_revealed")] pub fn is_tabs_revealed(&self) -> bool { unsafe { from_glib(ffi::hdy_tab_bar_get_tabs_revealed(self.to_glib_none().0)) } } #[doc(alias = "hdy_tab_bar_get_view")] #[doc(alias = "get_view")] pub fn view(&self) -> Option { unsafe { from_glib_none(ffi::hdy_tab_bar_get_view(self.to_glib_none().0)) } } #[doc(alias = "hdy_tab_bar_set_autohide")] pub fn set_autohide(&self, autohide: bool) { unsafe { ffi::hdy_tab_bar_set_autohide(self.to_glib_none().0, autohide.into_glib()); } } #[doc(alias = "hdy_tab_bar_set_end_action_widget")] pub fn set_end_action_widget(&self, widget: Option<&impl IsA>) { unsafe { ffi::hdy_tab_bar_set_end_action_widget( self.to_glib_none().0, widget.map(|p| p.as_ref()).to_glib_none().0, ); } } #[doc(alias = "hdy_tab_bar_set_expand_tabs")] pub fn set_expand_tabs(&self, expand_tabs: bool) { unsafe { ffi::hdy_tab_bar_set_expand_tabs(self.to_glib_none().0, expand_tabs.into_glib()); } } #[doc(alias = "hdy_tab_bar_set_extra_drag_dest_targets")] pub fn set_extra_drag_dest_targets(&self, extra_drag_dest_targets: Option<>k::TargetList>) { unsafe { ffi::hdy_tab_bar_set_extra_drag_dest_targets( self.to_glib_none().0, extra_drag_dest_targets.to_glib_none().0, ); } } #[doc(alias = "hdy_tab_bar_set_inverted")] pub fn set_inverted(&self, inverted: bool) { unsafe { ffi::hdy_tab_bar_set_inverted(self.to_glib_none().0, inverted.into_glib()); } } #[doc(alias = "hdy_tab_bar_set_start_action_widget")] pub fn set_start_action_widget(&self, widget: Option<&impl IsA>) { unsafe { ffi::hdy_tab_bar_set_start_action_widget( self.to_glib_none().0, widget.map(|p| p.as_ref()).to_glib_none().0, ); } } #[doc(alias = "hdy_tab_bar_set_view")] pub fn set_view(&self, view: Option<&TabView>) { unsafe { ffi::hdy_tab_bar_set_view(self.to_glib_none().0, view.to_glib_none().0); } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "extra-drag-data-received")] pub fn connect_extra_drag_data_received< F: Fn(&Self, &TabPage, &gdk::DragContext, >k::SelectionData, u32, u32) + 'static, >( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn extra_drag_data_received_trampoline< F: Fn(&TabBar, &TabPage, &gdk::DragContext, >k::SelectionData, u32, u32) + 'static, >( this: *mut ffi::HdyTabBar, page: *mut ffi::HdyTabPage, context: *mut gdk::ffi::GdkDragContext, data: *mut gtk::ffi::GtkSelectionData, info: libc::c_uint, time: libc::c_uint, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f( &from_glib_borrow(this), &from_glib_borrow(page), &from_glib_borrow(context), &from_glib_borrow(data), info, time, ) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"extra-drag-data-received\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( extra_drag_data_received_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "autohide")] pub fn connect_autohide_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_autohide_trampoline( this: *mut ffi::HdyTabBar, _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 _, b"notify::autohide\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_autohide_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "end-action-widget")] pub fn connect_end_action_widget_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_end_action_widget_trampoline( this: *mut ffi::HdyTabBar, _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 _, b"notify::end-action-widget\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_end_action_widget_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "expand-tabs")] pub fn connect_expand_tabs_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_expand_tabs_trampoline( this: *mut ffi::HdyTabBar, _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 _, b"notify::expand-tabs\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_expand_tabs_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "extra-drag-dest-targets")] pub fn connect_extra_drag_dest_targets_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_extra_drag_dest_targets_trampoline( this: *mut ffi::HdyTabBar, _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 _, b"notify::extra-drag-dest-targets\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_extra_drag_dest_targets_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "inverted")] pub fn connect_inverted_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_inverted_trampoline( this: *mut ffi::HdyTabBar, _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 _, b"notify::inverted\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_inverted_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "is-overflowing")] pub fn connect_is_overflowing_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_is_overflowing_trampoline( this: *mut ffi::HdyTabBar, _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 _, b"notify::is-overflowing\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_is_overflowing_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "start-action-widget")] pub fn connect_start_action_widget_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_start_action_widget_trampoline( this: *mut ffi::HdyTabBar, _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 _, b"notify::start-action-widget\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_start_action_widget_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "tabs-revealed")] pub fn connect_tabs_revealed_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_tabs_revealed_trampoline( this: *mut ffi::HdyTabBar, _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 _, b"notify::tabs-revealed\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_tabs_revealed_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "view")] pub fn connect_view_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_view_trampoline( this: *mut ffi::HdyTabBar, _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 _, b"notify::view\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_view_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] impl Default for TabBar { fn default() -> Self { Self::new() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`TabBar`] 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 TabBarBuilder { builder: glib::object::ObjectBuilder<'static, TabBar>, } impl TabBarBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn autohide(self, autohide: bool) -> Self { Self { builder: self.builder.property("autohide", autohide), } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn end_action_widget(self, end_action_widget: &impl IsA) -> Self { Self { builder: self .builder .property("end-action-widget", end_action_widget.clone().upcast()), } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn expand_tabs(self, expand_tabs: bool) -> Self { Self { builder: self.builder.property("expand-tabs", expand_tabs), } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn extra_drag_dest_targets(self, extra_drag_dest_targets: >k::TargetList) -> Self { Self { builder: self .builder .property("extra-drag-dest-targets", extra_drag_dest_targets.clone()), } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn inverted(self, inverted: bool) -> Self { Self { builder: self.builder.property("inverted", inverted), } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn start_action_widget(self, start_action_widget: &impl IsA) -> Self { Self { builder: self .builder .property("start-action-widget", start_action_widget.clone().upcast()), } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn view(self, view: &TabView) -> Self { Self { builder: self.builder.property("view", view.clone()), } } pub fn border_width(self, border_width: u32) -> Self { Self { builder: self.builder.property("border-width", border_width), } } pub fn child(self, child: &impl IsA) -> Self { Self { builder: self.builder.property("child", child.clone().upcast()), } } pub fn resize_mode(self, resize_mode: gtk::ResizeMode) -> Self { Self { builder: self.builder.property("resize-mode", resize_mode), } } pub fn app_paintable(self, app_paintable: bool) -> Self { Self { builder: self.builder.property("app-paintable", app_paintable), } } pub fn can_default(self, can_default: bool) -> Self { Self { builder: self.builder.property("can-default", can_default), } } pub fn can_focus(self, can_focus: bool) -> Self { Self { builder: self.builder.property("can-focus", can_focus), } } pub fn events(self, events: gdk::EventMask) -> Self { Self { builder: self.builder.property("events", events), } } pub fn expand(self, expand: bool) -> Self { Self { builder: self.builder.property("expand", expand), } } pub fn focus_on_click(self, focus_on_click: bool) -> Self { Self { builder: self.builder.property("focus-on-click", focus_on_click), } } pub fn halign(self, halign: gtk::Align) -> Self { Self { builder: self.builder.property("halign", halign), } } pub fn has_default(self, has_default: bool) -> Self { Self { builder: self.builder.property("has-default", has_default), } } pub fn has_focus(self, has_focus: bool) -> Self { Self { builder: self.builder.property("has-focus", has_focus), } } pub fn has_tooltip(self, has_tooltip: bool) -> Self { Self { builder: self.builder.property("has-tooltip", has_tooltip), } } pub fn height_request(self, height_request: i32) -> Self { Self { builder: self.builder.property("height-request", height_request), } } pub fn hexpand(self, hexpand: bool) -> Self { Self { builder: self.builder.property("hexpand", hexpand), } } pub fn hexpand_set(self, hexpand_set: bool) -> Self { Self { builder: self.builder.property("hexpand-set", hexpand_set), } } pub fn is_focus(self, is_focus: bool) -> Self { Self { builder: self.builder.property("is-focus", is_focus), } } pub fn margin(self, margin: i32) -> Self { Self { builder: self.builder.property("margin", margin), } } pub fn margin_bottom(self, margin_bottom: i32) -> Self { Self { builder: self.builder.property("margin-bottom", margin_bottom), } } pub fn margin_end(self, margin_end: i32) -> Self { Self { builder: self.builder.property("margin-end", margin_end), } } pub fn margin_start(self, margin_start: i32) -> Self { Self { builder: self.builder.property("margin-start", margin_start), } } pub fn margin_top(self, margin_top: i32) -> Self { Self { builder: self.builder.property("margin-top", margin_top), } } pub fn name(self, name: impl Into) -> Self { Self { builder: self.builder.property("name", name.into()), } } pub fn no_show_all(self, no_show_all: bool) -> Self { Self { builder: self.builder.property("no-show-all", no_show_all), } } pub fn opacity(self, opacity: f64) -> Self { Self { builder: self.builder.property("opacity", opacity), } } pub fn parent(self, parent: &impl IsA) -> Self { Self { builder: self.builder.property("parent", parent.clone().upcast()), } } pub fn receives_default(self, receives_default: bool) -> Self { Self { builder: self.builder.property("receives-default", receives_default), } } pub fn sensitive(self, sensitive: bool) -> Self { Self { builder: self.builder.property("sensitive", sensitive), } } //pub fn style(self, style: &impl IsA) -> Self { // Self { builder: self.builder.property("style", style.clone().upcast()), } //} pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { Self { builder: self .builder .property("tooltip-markup", tooltip_markup.into()), } } pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } } pub fn valign(self, valign: gtk::Align) -> Self { Self { builder: self.builder.property("valign", valign), } } pub fn vexpand(self, vexpand: bool) -> Self { Self { builder: self.builder.property("vexpand", vexpand), } } pub fn vexpand_set(self, vexpand_set: bool) -> Self { Self { builder: self.builder.property("vexpand-set", vexpand_set), } } pub fn visible(self, visible: bool) -> Self { Self { builder: self.builder.property("visible", visible), } } pub fn width_request(self, width_request: i32) -> Self { Self { builder: self.builder.property("width-request", width_request), } } // rustdoc-stripper-ignore-next /// Build the [`TabBar`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> TabBar { self.builder.build() } } impl fmt::Display for TabBar { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("TabBar") } } rust-libhandy-0.11-0.11.1/src/auto/tab_page.rs000066400000000000000000000407471470255135400206250ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "HdyTabPage")] pub struct TabPage(Object); match fn { type_ => || ffi::hdy_tab_page_get_type(), } } impl TabPage { // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`TabPage`] objects. /// /// This method returns an instance of [`TabPageBuilder`](crate::builders::TabPageBuilder) which can be used to create [`TabPage`] objects. pub fn builder() -> TabPageBuilder { TabPageBuilder::new() } #[doc(alias = "hdy_tab_page_get_child")] #[doc(alias = "get_child")] pub fn child(&self) -> Option { unsafe { from_glib_none(ffi::hdy_tab_page_get_child(self.to_glib_none().0)) } } #[doc(alias = "hdy_tab_page_get_icon")] #[doc(alias = "get_icon")] pub fn icon(&self) -> Option { unsafe { from_glib_none(ffi::hdy_tab_page_get_icon(self.to_glib_none().0)) } } #[doc(alias = "hdy_tab_page_get_indicator_activatable")] #[doc(alias = "get_indicator_activatable")] pub fn is_indicator_activatable(&self) -> bool { unsafe { from_glib(ffi::hdy_tab_page_get_indicator_activatable( self.to_glib_none().0, )) } } #[doc(alias = "hdy_tab_page_get_indicator_icon")] #[doc(alias = "get_indicator_icon")] pub fn indicator_icon(&self) -> Option { unsafe { from_glib_none(ffi::hdy_tab_page_get_indicator_icon(self.to_glib_none().0)) } } #[doc(alias = "hdy_tab_page_get_loading")] #[doc(alias = "get_loading")] pub fn is_loading(&self) -> bool { unsafe { from_glib(ffi::hdy_tab_page_get_loading(self.to_glib_none().0)) } } #[doc(alias = "hdy_tab_page_get_needs_attention")] #[doc(alias = "get_needs_attention")] pub fn needs_attention(&self) -> bool { unsafe { from_glib(ffi::hdy_tab_page_get_needs_attention(self.to_glib_none().0)) } } #[doc(alias = "hdy_tab_page_get_parent")] #[doc(alias = "get_parent")] #[must_use] pub fn parent(&self) -> Option { unsafe { from_glib_none(ffi::hdy_tab_page_get_parent(self.to_glib_none().0)) } } #[doc(alias = "hdy_tab_page_get_pinned")] #[doc(alias = "get_pinned")] pub fn is_pinned(&self) -> bool { unsafe { from_glib(ffi::hdy_tab_page_get_pinned(self.to_glib_none().0)) } } #[doc(alias = "hdy_tab_page_get_selected")] #[doc(alias = "get_selected")] pub fn is_selected(&self) -> bool { unsafe { from_glib(ffi::hdy_tab_page_get_selected(self.to_glib_none().0)) } } #[doc(alias = "hdy_tab_page_get_title")] #[doc(alias = "get_title")] pub fn title(&self) -> Option { unsafe { from_glib_none(ffi::hdy_tab_page_get_title(self.to_glib_none().0)) } } #[doc(alias = "hdy_tab_page_get_tooltip")] #[doc(alias = "get_tooltip")] pub fn tooltip(&self) -> Option { unsafe { from_glib_none(ffi::hdy_tab_page_get_tooltip(self.to_glib_none().0)) } } #[doc(alias = "hdy_tab_page_set_icon")] pub fn set_icon(&self, icon: Option<&impl IsA>) { unsafe { ffi::hdy_tab_page_set_icon( self.to_glib_none().0, icon.map(|p| p.as_ref()).to_glib_none().0, ); } } #[doc(alias = "hdy_tab_page_set_indicator_activatable")] pub fn set_indicator_activatable(&self, activatable: bool) { unsafe { ffi::hdy_tab_page_set_indicator_activatable( self.to_glib_none().0, activatable.into_glib(), ); } } #[doc(alias = "hdy_tab_page_set_indicator_icon")] pub fn set_indicator_icon(&self, indicator_icon: Option<&impl IsA>) { unsafe { ffi::hdy_tab_page_set_indicator_icon( self.to_glib_none().0, indicator_icon.map(|p| p.as_ref()).to_glib_none().0, ); } } #[doc(alias = "hdy_tab_page_set_loading")] pub fn set_loading(&self, loading: bool) { unsafe { ffi::hdy_tab_page_set_loading(self.to_glib_none().0, loading.into_glib()); } } #[doc(alias = "hdy_tab_page_set_needs_attention")] pub fn set_needs_attention(&self, needs_attention: bool) { unsafe { ffi::hdy_tab_page_set_needs_attention( self.to_glib_none().0, needs_attention.into_glib(), ); } } #[doc(alias = "hdy_tab_page_set_title")] pub fn set_title(&self, title: Option<&str>) { unsafe { ffi::hdy_tab_page_set_title(self.to_glib_none().0, title.to_glib_none().0); } } #[doc(alias = "hdy_tab_page_set_tooltip")] pub fn set_tooltip(&self, tooltip: Option<&str>) { unsafe { ffi::hdy_tab_page_set_tooltip(self.to_glib_none().0, tooltip.to_glib_none().0); } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "icon")] pub fn connect_icon_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_icon_trampoline( this: *mut ffi::HdyTabPage, _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 _, b"notify::icon\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_icon_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "indicator-activatable")] pub fn connect_indicator_activatable_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_indicator_activatable_trampoline( this: *mut ffi::HdyTabPage, _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 _, b"notify::indicator-activatable\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_indicator_activatable_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "indicator-icon")] pub fn connect_indicator_icon_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_indicator_icon_trampoline( this: *mut ffi::HdyTabPage, _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 _, b"notify::indicator-icon\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_indicator_icon_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "loading")] pub fn connect_loading_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_loading_trampoline( this: *mut ffi::HdyTabPage, _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 _, b"notify::loading\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_loading_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "needs-attention")] pub fn connect_needs_attention_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_needs_attention_trampoline( this: *mut ffi::HdyTabPage, _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 _, b"notify::needs-attention\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_needs_attention_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "pinned")] pub fn connect_pinned_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_pinned_trampoline( this: *mut ffi::HdyTabPage, _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 _, b"notify::pinned\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_pinned_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "selected")] pub fn connect_selected_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_selected_trampoline( this: *mut ffi::HdyTabPage, _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 _, b"notify::selected\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_selected_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "title")] pub fn connect_title_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_title_trampoline( this: *mut ffi::HdyTabPage, _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 _, b"notify::title\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_title_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "tooltip")] pub fn connect_tooltip_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_tooltip_trampoline( this: *mut ffi::HdyTabPage, _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 _, b"notify::tooltip\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_tooltip_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`TabPage`] 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 TabPageBuilder { builder: glib::object::ObjectBuilder<'static, TabPage>, } impl TabPageBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn child(self, child: &impl IsA) -> Self { Self { builder: self.builder.property("child", child.clone().upcast()), } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn icon(self, icon: &impl IsA) -> Self { Self { builder: self.builder.property("icon", icon.clone().upcast()), } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn indicator_activatable(self, indicator_activatable: bool) -> Self { Self { builder: self .builder .property("indicator-activatable", indicator_activatable), } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn indicator_icon(self, indicator_icon: &impl IsA) -> Self { Self { builder: self .builder .property("indicator-icon", indicator_icon.clone().upcast()), } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn loading(self, loading: bool) -> Self { Self { builder: self.builder.property("loading", loading), } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn needs_attention(self, needs_attention: bool) -> Self { Self { builder: self.builder.property("needs-attention", needs_attention), } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn parent(self, parent: &TabPage) -> Self { Self { builder: self.builder.property("parent", parent.clone()), } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn title(self, title: impl Into) -> Self { Self { builder: self.builder.property("title", title.into()), } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn tooltip(self, tooltip: impl Into) -> Self { Self { builder: self.builder.property("tooltip", tooltip.into()), } } // rustdoc-stripper-ignore-next /// Build the [`TabPage`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> TabPage { self.builder.build() } } impl fmt::Display for TabPage { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("TabPage") } } rust-libhandy-0.11-0.11.1/src/auto/tab_view.rs000066400000000000000000001011601470255135400206460ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT use crate::TabPage; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "HdyTabView")] pub struct TabView(Object) @extends gtk::Bin, gtk::Container, gtk::Widget, @implements gtk::Buildable; match fn { type_ => || ffi::hdy_tab_view_get_type(), } } impl TabView { #[doc(alias = "hdy_tab_view_new")] pub fn new() -> TabView { assert_initialized_main_thread!(); unsafe { from_glib_none(ffi::hdy_tab_view_new()) } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`TabView`] objects. /// /// This method returns an instance of [`TabViewBuilder`](crate::builders::TabViewBuilder) which can be used to create [`TabView`] objects. pub fn builder() -> TabViewBuilder { TabViewBuilder::new() } #[doc(alias = "hdy_tab_view_add_page")] pub fn add_page( &self, child: &impl IsA, parent: Option<&TabPage>, ) -> Option { unsafe { from_glib_none(ffi::hdy_tab_view_add_page( self.to_glib_none().0, child.as_ref().to_glib_none().0, parent.to_glib_none().0, )) } } #[doc(alias = "hdy_tab_view_append")] pub fn append(&self, child: &impl IsA) -> Option { unsafe { from_glib_none(ffi::hdy_tab_view_append( self.to_glib_none().0, child.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_tab_view_append_pinned")] pub fn append_pinned(&self, child: &impl IsA) -> Option { unsafe { from_glib_none(ffi::hdy_tab_view_append_pinned( self.to_glib_none().0, child.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_tab_view_close_other_pages")] pub fn close_other_pages(&self, page: &TabPage) { unsafe { ffi::hdy_tab_view_close_other_pages(self.to_glib_none().0, page.to_glib_none().0); } } #[doc(alias = "hdy_tab_view_close_page")] pub fn close_page(&self, page: &TabPage) { unsafe { ffi::hdy_tab_view_close_page(self.to_glib_none().0, page.to_glib_none().0); } } #[doc(alias = "hdy_tab_view_close_page_finish")] pub fn close_page_finish(&self, page: &TabPage, confirm: bool) { unsafe { ffi::hdy_tab_view_close_page_finish( self.to_glib_none().0, page.to_glib_none().0, confirm.into_glib(), ); } } #[doc(alias = "hdy_tab_view_close_pages_after")] pub fn close_pages_after(&self, page: &TabPage) { unsafe { ffi::hdy_tab_view_close_pages_after(self.to_glib_none().0, page.to_glib_none().0); } } #[doc(alias = "hdy_tab_view_close_pages_before")] pub fn close_pages_before(&self, page: &TabPage) { unsafe { ffi::hdy_tab_view_close_pages_before(self.to_glib_none().0, page.to_glib_none().0); } } #[doc(alias = "hdy_tab_view_get_default_icon")] #[doc(alias = "get_default_icon")] pub fn default_icon(&self) -> Option { unsafe { from_glib_none(ffi::hdy_tab_view_get_default_icon(self.to_glib_none().0)) } } #[doc(alias = "hdy_tab_view_get_is_transferring_page")] #[doc(alias = "get_is_transferring_page")] pub fn is_transferring_page(&self) -> bool { unsafe { from_glib(ffi::hdy_tab_view_get_is_transferring_page( self.to_glib_none().0, )) } } #[doc(alias = "hdy_tab_view_get_menu_model")] #[doc(alias = "get_menu_model")] pub fn menu_model(&self) -> Option { unsafe { from_glib_none(ffi::hdy_tab_view_get_menu_model(self.to_glib_none().0)) } } #[doc(alias = "hdy_tab_view_get_n_pages")] #[doc(alias = "get_n_pages")] pub fn n_pages(&self) -> i32 { unsafe { ffi::hdy_tab_view_get_n_pages(self.to_glib_none().0) } } #[doc(alias = "hdy_tab_view_get_n_pinned_pages")] #[doc(alias = "get_n_pinned_pages")] pub fn n_pinned_pages(&self) -> i32 { unsafe { ffi::hdy_tab_view_get_n_pinned_pages(self.to_glib_none().0) } } #[doc(alias = "hdy_tab_view_get_nth_page")] #[doc(alias = "get_nth_page")] pub fn nth_page(&self, position: i32) -> Option { unsafe { from_glib_none(ffi::hdy_tab_view_get_nth_page( self.to_glib_none().0, position, )) } } #[doc(alias = "hdy_tab_view_get_page")] #[doc(alias = "get_page")] pub fn page(&self, child: &impl IsA) -> Option { unsafe { from_glib_none(ffi::hdy_tab_view_get_page( self.to_glib_none().0, child.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_tab_view_get_page_position")] #[doc(alias = "get_page_position")] pub fn page_position(&self, page: &TabPage) -> i32 { unsafe { ffi::hdy_tab_view_get_page_position(self.to_glib_none().0, page.to_glib_none().0) } } #[doc(alias = "hdy_tab_view_get_pages")] #[doc(alias = "get_pages")] pub fn pages(&self) -> Option { unsafe { from_glib_none(ffi::hdy_tab_view_get_pages(self.to_glib_none().0)) } } #[doc(alias = "hdy_tab_view_get_selected_page")] #[doc(alias = "get_selected_page")] pub fn selected_page(&self) -> Option { unsafe { from_glib_none(ffi::hdy_tab_view_get_selected_page(self.to_glib_none().0)) } } #[doc(alias = "hdy_tab_view_get_shortcut_widget")] #[doc(alias = "get_shortcut_widget")] pub fn shortcut_widget(&self) -> Option { unsafe { from_glib_none(ffi::hdy_tab_view_get_shortcut_widget(self.to_glib_none().0)) } } #[doc(alias = "hdy_tab_view_insert")] pub fn insert(&self, child: &impl IsA, position: i32) -> Option { unsafe { from_glib_none(ffi::hdy_tab_view_insert( self.to_glib_none().0, child.as_ref().to_glib_none().0, position, )) } } #[doc(alias = "hdy_tab_view_insert_pinned")] pub fn insert_pinned(&self, child: &impl IsA, position: i32) -> Option { unsafe { from_glib_none(ffi::hdy_tab_view_insert_pinned( self.to_glib_none().0, child.as_ref().to_glib_none().0, position, )) } } #[doc(alias = "hdy_tab_view_prepend")] pub fn prepend(&self, child: &impl IsA) -> Option { unsafe { from_glib_none(ffi::hdy_tab_view_prepend( self.to_glib_none().0, child.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_tab_view_prepend_pinned")] pub fn prepend_pinned(&self, child: &impl IsA) -> Option { unsafe { from_glib_none(ffi::hdy_tab_view_prepend_pinned( self.to_glib_none().0, child.as_ref().to_glib_none().0, )) } } #[doc(alias = "hdy_tab_view_reorder_backward")] pub fn reorder_backward(&self, page: &TabPage) -> bool { unsafe { from_glib(ffi::hdy_tab_view_reorder_backward( self.to_glib_none().0, page.to_glib_none().0, )) } } #[doc(alias = "hdy_tab_view_reorder_first")] pub fn reorder_first(&self, page: &TabPage) -> bool { unsafe { from_glib(ffi::hdy_tab_view_reorder_first( self.to_glib_none().0, page.to_glib_none().0, )) } } #[doc(alias = "hdy_tab_view_reorder_forward")] pub fn reorder_forward(&self, page: &TabPage) -> bool { unsafe { from_glib(ffi::hdy_tab_view_reorder_forward( self.to_glib_none().0, page.to_glib_none().0, )) } } #[doc(alias = "hdy_tab_view_reorder_last")] pub fn reorder_last(&self, page: &TabPage) -> bool { unsafe { from_glib(ffi::hdy_tab_view_reorder_last( self.to_glib_none().0, page.to_glib_none().0, )) } } #[doc(alias = "hdy_tab_view_reorder_page")] pub fn reorder_page(&self, page: &TabPage, position: i32) -> bool { unsafe { from_glib(ffi::hdy_tab_view_reorder_page( self.to_glib_none().0, page.to_glib_none().0, position, )) } } #[doc(alias = "hdy_tab_view_select_next_page")] pub fn select_next_page(&self) -> bool { unsafe { from_glib(ffi::hdy_tab_view_select_next_page(self.to_glib_none().0)) } } #[doc(alias = "hdy_tab_view_select_previous_page")] pub fn select_previous_page(&self) -> bool { unsafe { from_glib(ffi::hdy_tab_view_select_previous_page( self.to_glib_none().0, )) } } #[doc(alias = "hdy_tab_view_set_default_icon")] pub fn set_default_icon(&self, default_icon: &impl IsA) { unsafe { ffi::hdy_tab_view_set_default_icon( self.to_glib_none().0, default_icon.as_ref().to_glib_none().0, ); } } #[doc(alias = "hdy_tab_view_set_menu_model")] pub fn set_menu_model(&self, menu_model: Option<&impl IsA>) { unsafe { ffi::hdy_tab_view_set_menu_model( self.to_glib_none().0, menu_model.map(|p| p.as_ref()).to_glib_none().0, ); } } #[doc(alias = "hdy_tab_view_set_page_pinned")] pub fn set_page_pinned(&self, page: &TabPage, pinned: bool) { unsafe { ffi::hdy_tab_view_set_page_pinned( self.to_glib_none().0, page.to_glib_none().0, pinned.into_glib(), ); } } #[doc(alias = "hdy_tab_view_set_selected_page")] pub fn set_selected_page(&self, selected_page: &TabPage) { unsafe { ffi::hdy_tab_view_set_selected_page( self.to_glib_none().0, selected_page.to_glib_none().0, ); } } #[doc(alias = "hdy_tab_view_set_shortcut_widget")] pub fn set_shortcut_widget(&self, widget: Option<&impl IsA>) { unsafe { ffi::hdy_tab_view_set_shortcut_widget( self.to_glib_none().0, widget.map(|p| p.as_ref()).to_glib_none().0, ); } } #[doc(alias = "hdy_tab_view_transfer_page")] pub fn transfer_page(&self, page: &TabPage, other_view: &TabView, position: i32) { unsafe { ffi::hdy_tab_view_transfer_page( self.to_glib_none().0, page.to_glib_none().0, other_view.to_glib_none().0, position, ); } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "close-page")] pub fn connect_close_page bool + 'static>( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn close_page_trampoline bool + 'static>( this: *mut ffi::HdyTabView, page: *mut ffi::HdyTabPage, f: glib::ffi::gpointer, ) -> glib::ffi::gboolean { let f: &F = &*(f as *const F); f(&from_glib_borrow(this), &from_glib_borrow(page)).into_glib() } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"close-page\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( close_page_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "create-window")] pub fn connect_create_window Option + 'static>( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn create_window_trampoline< F: Fn(&TabView) -> Option + 'static, >( this: *mut ffi::HdyTabView, f: glib::ffi::gpointer, ) -> *mut ffi::HdyTabView { let f: &F = &*(f as *const F); f(&from_glib_borrow(this)) /*Not checked*/ .to_glib_none() .0 } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"create-window\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( create_window_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "indicator-activated")] pub fn connect_indicator_activated( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn indicator_activated_trampoline( this: *mut ffi::HdyTabView, page: *mut ffi::HdyTabPage, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this), &from_glib_borrow(page)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"indicator-activated\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( indicator_activated_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "page-attached")] pub fn connect_page_attached( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn page_attached_trampoline( this: *mut ffi::HdyTabView, page: *mut ffi::HdyTabPage, position: libc::c_int, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this), &from_glib_borrow(page), position) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"page-attached\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( page_attached_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "page-detached")] pub fn connect_page_detached( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn page_detached_trampoline( this: *mut ffi::HdyTabView, page: *mut ffi::HdyTabPage, position: libc::c_int, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this), &from_glib_borrow(page), position) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"page-detached\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( page_detached_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "page-reordered")] pub fn connect_page_reordered( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn page_reordered_trampoline( this: *mut ffi::HdyTabView, page: *mut ffi::HdyTabPage, position: libc::c_int, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this), &from_glib_borrow(page), position) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"page-reordered\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( page_reordered_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "setup-menu")] pub fn connect_setup_menu(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn setup_menu_trampoline( this: *mut ffi::HdyTabView, page: *mut ffi::HdyTabPage, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(&from_glib_borrow(this), &from_glib_borrow(page)) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"setup-menu\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( setup_menu_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "default-icon")] pub fn connect_default_icon_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_default_icon_trampoline( this: *mut ffi::HdyTabView, _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 _, b"notify::default-icon\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_default_icon_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "is-transferring-page")] pub fn connect_is_transferring_page_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_is_transferring_page_trampoline( this: *mut ffi::HdyTabView, _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 _, b"notify::is-transferring-page\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_is_transferring_page_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "menu-model")] pub fn connect_menu_model_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_menu_model_trampoline( this: *mut ffi::HdyTabView, _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 _, b"notify::menu-model\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_menu_model_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "n-pages")] pub fn connect_n_pages_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_n_pages_trampoline( this: *mut ffi::HdyTabView, _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 _, b"notify::n-pages\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_n_pages_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "n-pinned-pages")] pub fn connect_n_pinned_pages_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_n_pinned_pages_trampoline( this: *mut ffi::HdyTabView, _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 _, b"notify::n-pinned-pages\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_n_pinned_pages_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "selected-page")] pub fn connect_selected_page_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_selected_page_trampoline( this: *mut ffi::HdyTabView, _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 _, b"notify::selected-page\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_selected_page_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] #[doc(alias = "shortcut-widget")] pub fn connect_shortcut_widget_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_shortcut_widget_trampoline( this: *mut ffi::HdyTabView, _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 _, b"notify::shortcut-widget\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_shortcut_widget_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] impl Default for TabView { fn default() -> Self { Self::new() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`TabView`] 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 TabViewBuilder { builder: glib::object::ObjectBuilder<'static, TabView>, } impl TabViewBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn default_icon(self, default_icon: &impl IsA) -> Self { Self { builder: self .builder .property("default-icon", default_icon.clone().upcast()), } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn menu_model(self, menu_model: &impl IsA) -> Self { Self { builder: self .builder .property("menu-model", menu_model.clone().upcast()), } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn selected_page(self, selected_page: &TabPage) -> Self { Self { builder: self .builder .property("selected-page", selected_page.clone()), } } #[cfg(feature = "v1_2")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))] pub fn shortcut_widget(self, shortcut_widget: &impl IsA) -> Self { Self { builder: self .builder .property("shortcut-widget", shortcut_widget.clone().upcast()), } } pub fn border_width(self, border_width: u32) -> Self { Self { builder: self.builder.property("border-width", border_width), } } pub fn child(self, child: &impl IsA) -> Self { Self { builder: self.builder.property("child", child.clone().upcast()), } } pub fn resize_mode(self, resize_mode: gtk::ResizeMode) -> Self { Self { builder: self.builder.property("resize-mode", resize_mode), } } pub fn app_paintable(self, app_paintable: bool) -> Self { Self { builder: self.builder.property("app-paintable", app_paintable), } } pub fn can_default(self, can_default: bool) -> Self { Self { builder: self.builder.property("can-default", can_default), } } pub fn can_focus(self, can_focus: bool) -> Self { Self { builder: self.builder.property("can-focus", can_focus), } } pub fn events(self, events: gdk::EventMask) -> Self { Self { builder: self.builder.property("events", events), } } pub fn expand(self, expand: bool) -> Self { Self { builder: self.builder.property("expand", expand), } } pub fn focus_on_click(self, focus_on_click: bool) -> Self { Self { builder: self.builder.property("focus-on-click", focus_on_click), } } pub fn halign(self, halign: gtk::Align) -> Self { Self { builder: self.builder.property("halign", halign), } } pub fn has_default(self, has_default: bool) -> Self { Self { builder: self.builder.property("has-default", has_default), } } pub fn has_focus(self, has_focus: bool) -> Self { Self { builder: self.builder.property("has-focus", has_focus), } } pub fn has_tooltip(self, has_tooltip: bool) -> Self { Self { builder: self.builder.property("has-tooltip", has_tooltip), } } pub fn height_request(self, height_request: i32) -> Self { Self { builder: self.builder.property("height-request", height_request), } } pub fn hexpand(self, hexpand: bool) -> Self { Self { builder: self.builder.property("hexpand", hexpand), } } pub fn hexpand_set(self, hexpand_set: bool) -> Self { Self { builder: self.builder.property("hexpand-set", hexpand_set), } } pub fn is_focus(self, is_focus: bool) -> Self { Self { builder: self.builder.property("is-focus", is_focus), } } pub fn margin(self, margin: i32) -> Self { Self { builder: self.builder.property("margin", margin), } } pub fn margin_bottom(self, margin_bottom: i32) -> Self { Self { builder: self.builder.property("margin-bottom", margin_bottom), } } pub fn margin_end(self, margin_end: i32) -> Self { Self { builder: self.builder.property("margin-end", margin_end), } } pub fn margin_start(self, margin_start: i32) -> Self { Self { builder: self.builder.property("margin-start", margin_start), } } pub fn margin_top(self, margin_top: i32) -> Self { Self { builder: self.builder.property("margin-top", margin_top), } } pub fn name(self, name: impl Into) -> Self { Self { builder: self.builder.property("name", name.into()), } } pub fn no_show_all(self, no_show_all: bool) -> Self { Self { builder: self.builder.property("no-show-all", no_show_all), } } pub fn opacity(self, opacity: f64) -> Self { Self { builder: self.builder.property("opacity", opacity), } } pub fn parent(self, parent: &impl IsA) -> Self { Self { builder: self.builder.property("parent", parent.clone().upcast()), } } pub fn receives_default(self, receives_default: bool) -> Self { Self { builder: self.builder.property("receives-default", receives_default), } } pub fn sensitive(self, sensitive: bool) -> Self { Self { builder: self.builder.property("sensitive", sensitive), } } //pub fn style(self, style: &impl IsA) -> Self { // Self { builder: self.builder.property("style", style.clone().upcast()), } //} pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { Self { builder: self .builder .property("tooltip-markup", tooltip_markup.into()), } } pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } } pub fn valign(self, valign: gtk::Align) -> Self { Self { builder: self.builder.property("valign", valign), } } pub fn vexpand(self, vexpand: bool) -> Self { Self { builder: self.builder.property("vexpand", vexpand), } } pub fn vexpand_set(self, vexpand_set: bool) -> Self { Self { builder: self.builder.property("vexpand-set", vexpand_set), } } pub fn visible(self, visible: bool) -> Self { Self { builder: self.builder.property("visible", visible), } } pub fn width_request(self, width_request: i32) -> Self { Self { builder: self.builder.property("width-request", width_request), } } // rustdoc-stripper-ignore-next /// Build the [`TabView`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> TabView { self.builder.build() } } impl fmt::Display for TabView { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("TabView") } } rust-libhandy-0.11-0.11.1/src/auto/title_bar.rs000066400000000000000000000233211470255135400210150ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT #![allow(deprecated)] use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "HdyTitleBar")] pub struct TitleBar(Object) @extends gtk::Bin, gtk::Container, gtk::Widget, @implements gtk::Buildable; match fn { type_ => || ffi::hdy_title_bar_get_type(), } } impl TitleBar { #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")] #[allow(deprecated)] #[doc(alias = "hdy_title_bar_new")] pub fn new() -> TitleBar { assert_initialized_main_thread!(); unsafe { gtk::Widget::from_glib_none(ffi::hdy_title_bar_new()).unsafe_cast() } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`TitleBar`] objects. /// /// This method returns an instance of [`TitleBarBuilder`](crate::builders::TitleBarBuilder) which can be used to create [`TitleBar`] objects. pub fn builder() -> TitleBarBuilder { TitleBarBuilder::new() } #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")] #[allow(deprecated)] #[doc(alias = "hdy_title_bar_get_selection_mode")] #[doc(alias = "get_selection_mode")] pub fn is_selection_mode(&self) -> bool { unsafe { from_glib(ffi::hdy_title_bar_get_selection_mode(self.to_glib_none().0)) } } #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")] #[allow(deprecated)] #[doc(alias = "hdy_title_bar_set_selection_mode")] pub fn set_selection_mode(&self, selection_mode: bool) { unsafe { ffi::hdy_title_bar_set_selection_mode( self.to_glib_none().0, selection_mode.into_glib(), ); } } #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")] #[doc(alias = "selection-mode")] pub fn connect_selection_mode_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_selection_mode_trampoline( this: *mut ffi::HdyTitleBar, _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 _, b"notify::selection-mode\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_selection_mode_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl Default for TitleBar { fn default() -> Self { Self::new() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`TitleBar`] 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 TitleBarBuilder { builder: glib::object::ObjectBuilder<'static, TitleBar>, } impl TitleBarBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } #[cfg_attr(feature = "v1_4", deprecated = "Since 1.4")] pub fn selection_mode(self, selection_mode: bool) -> Self { Self { builder: self.builder.property("selection-mode", selection_mode), } } pub fn border_width(self, border_width: u32) -> Self { Self { builder: self.builder.property("border-width", border_width), } } pub fn child(self, child: &impl IsA) -> Self { Self { builder: self.builder.property("child", child.clone().upcast()), } } pub fn resize_mode(self, resize_mode: gtk::ResizeMode) -> Self { Self { builder: self.builder.property("resize-mode", resize_mode), } } pub fn app_paintable(self, app_paintable: bool) -> Self { Self { builder: self.builder.property("app-paintable", app_paintable), } } pub fn can_default(self, can_default: bool) -> Self { Self { builder: self.builder.property("can-default", can_default), } } pub fn can_focus(self, can_focus: bool) -> Self { Self { builder: self.builder.property("can-focus", can_focus), } } pub fn events(self, events: gdk::EventMask) -> Self { Self { builder: self.builder.property("events", events), } } pub fn expand(self, expand: bool) -> Self { Self { builder: self.builder.property("expand", expand), } } pub fn focus_on_click(self, focus_on_click: bool) -> Self { Self { builder: self.builder.property("focus-on-click", focus_on_click), } } pub fn halign(self, halign: gtk::Align) -> Self { Self { builder: self.builder.property("halign", halign), } } pub fn has_default(self, has_default: bool) -> Self { Self { builder: self.builder.property("has-default", has_default), } } pub fn has_focus(self, has_focus: bool) -> Self { Self { builder: self.builder.property("has-focus", has_focus), } } pub fn has_tooltip(self, has_tooltip: bool) -> Self { Self { builder: self.builder.property("has-tooltip", has_tooltip), } } pub fn height_request(self, height_request: i32) -> Self { Self { builder: self.builder.property("height-request", height_request), } } pub fn hexpand(self, hexpand: bool) -> Self { Self { builder: self.builder.property("hexpand", hexpand), } } pub fn hexpand_set(self, hexpand_set: bool) -> Self { Self { builder: self.builder.property("hexpand-set", hexpand_set), } } pub fn is_focus(self, is_focus: bool) -> Self { Self { builder: self.builder.property("is-focus", is_focus), } } pub fn margin(self, margin: i32) -> Self { Self { builder: self.builder.property("margin", margin), } } pub fn margin_bottom(self, margin_bottom: i32) -> Self { Self { builder: self.builder.property("margin-bottom", margin_bottom), } } pub fn margin_end(self, margin_end: i32) -> Self { Self { builder: self.builder.property("margin-end", margin_end), } } pub fn margin_start(self, margin_start: i32) -> Self { Self { builder: self.builder.property("margin-start", margin_start), } } pub fn margin_top(self, margin_top: i32) -> Self { Self { builder: self.builder.property("margin-top", margin_top), } } pub fn name(self, name: impl Into) -> Self { Self { builder: self.builder.property("name", name.into()), } } pub fn no_show_all(self, no_show_all: bool) -> Self { Self { builder: self.builder.property("no-show-all", no_show_all), } } pub fn opacity(self, opacity: f64) -> Self { Self { builder: self.builder.property("opacity", opacity), } } pub fn parent(self, parent: &impl IsA) -> Self { Self { builder: self.builder.property("parent", parent.clone().upcast()), } } pub fn receives_default(self, receives_default: bool) -> Self { Self { builder: self.builder.property("receives-default", receives_default), } } pub fn sensitive(self, sensitive: bool) -> Self { Self { builder: self.builder.property("sensitive", sensitive), } } //pub fn style(self, style: &impl IsA) -> Self { // Self { builder: self.builder.property("style", style.clone().upcast()), } //} pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { Self { builder: self .builder .property("tooltip-markup", tooltip_markup.into()), } } pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } } pub fn valign(self, valign: gtk::Align) -> Self { Self { builder: self.builder.property("valign", valign), } } pub fn vexpand(self, vexpand: bool) -> Self { Self { builder: self.builder.property("vexpand", vexpand), } } pub fn vexpand_set(self, vexpand_set: bool) -> Self { Self { builder: self.builder.property("vexpand-set", vexpand_set), } } pub fn visible(self, visible: bool) -> Self { Self { builder: self.builder.property("visible", visible), } } pub fn width_request(self, width_request: i32) -> Self { Self { builder: self.builder.property("width-request", width_request), } } // rustdoc-stripper-ignore-next /// Build the [`TitleBar`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> TitleBar { self.builder.build() } } impl fmt::Display for TitleBar { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("TitleBar") } } rust-libhandy-0.11-0.11.1/src/auto/value_object.rs000066400000000000000000000027451470255135400215210ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT use glib::translate::*; use std::fmt; glib::wrapper! { #[doc(alias = "HdyValueObject")] pub struct ValueObject(Object); match fn { type_ => || ffi::hdy_value_object_get_type(), } } impl ValueObject { #[doc(alias = "hdy_value_object_new")] pub fn new(value: &glib::Value) -> ValueObject { assert_initialized_main_thread!(); unsafe { from_glib_full(ffi::hdy_value_object_new(value.to_glib_none().0)) } } //#[doc(alias = "hdy_value_object_new_collect")] //pub fn new_collect(type_: glib::types::Type, : /*Unknown conversion*//*Unimplemented*/Basic: VarArgs) -> ValueObject { // unsafe { TODO: call ffi:hdy_value_object_new_collect() } //} #[doc(alias = "hdy_value_object_get_string")] #[doc(alias = "get_string")] pub fn string(&self) -> Option { unsafe { from_glib_none(ffi::hdy_value_object_get_string(self.to_glib_none().0)) } } #[doc(alias = "hdy_value_object_get_value")] #[doc(alias = "get_value")] pub fn value(&self) -> Option { unsafe { from_glib_none(ffi::hdy_value_object_get_value(self.to_glib_none().0)) } } } impl fmt::Display for ValueObject { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("ValueObject") } } rust-libhandy-0.11-0.11.1/src/auto/versions.txt000066400000000000000000000002161470255135400211110ustar00rootroot00000000000000Generated by gir (https://github.com/gtk-rs/gir @ 23d7c100187c) from from gir-files (https://github.com/gtk-rs/gir-files.git @ 6415239ef435) rust-libhandy-0.11-0.11.1/src/auto/view_switcher.rs000066400000000000000000000307061470255135400217370ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT use crate::ViewSwitcherPolicy; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "HdyViewSwitcher")] pub struct ViewSwitcher(Object) @extends gtk::Bin, gtk::Container, gtk::Widget, @implements gtk::Buildable; match fn { type_ => || ffi::hdy_view_switcher_get_type(), } } impl ViewSwitcher { #[doc(alias = "hdy_view_switcher_new")] pub fn new() -> ViewSwitcher { assert_initialized_main_thread!(); unsafe { gtk::Widget::from_glib_none(ffi::hdy_view_switcher_new()).unsafe_cast() } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`ViewSwitcher`] objects. /// /// This method returns an instance of [`ViewSwitcherBuilder`](crate::builders::ViewSwitcherBuilder) which can be used to create [`ViewSwitcher`] objects. pub fn builder() -> ViewSwitcherBuilder { ViewSwitcherBuilder::new() } #[doc(alias = "hdy_view_switcher_get_narrow_ellipsize")] #[doc(alias = "get_narrow_ellipsize")] pub fn narrow_ellipsize(&self) -> pango::EllipsizeMode { unsafe { from_glib(ffi::hdy_view_switcher_get_narrow_ellipsize( self.to_glib_none().0, )) } } #[doc(alias = "hdy_view_switcher_get_policy")] #[doc(alias = "get_policy")] pub fn policy(&self) -> ViewSwitcherPolicy { unsafe { from_glib(ffi::hdy_view_switcher_get_policy(self.to_glib_none().0)) } } #[doc(alias = "hdy_view_switcher_get_stack")] #[doc(alias = "get_stack")] pub fn stack(&self) -> Option { unsafe { from_glib_none(ffi::hdy_view_switcher_get_stack(self.to_glib_none().0)) } } #[doc(alias = "hdy_view_switcher_set_narrow_ellipsize")] pub fn set_narrow_ellipsize(&self, mode: pango::EllipsizeMode) { unsafe { ffi::hdy_view_switcher_set_narrow_ellipsize(self.to_glib_none().0, mode.into_glib()); } } #[doc(alias = "hdy_view_switcher_set_policy")] pub fn set_policy(&self, policy: ViewSwitcherPolicy) { unsafe { ffi::hdy_view_switcher_set_policy(self.to_glib_none().0, policy.into_glib()); } } #[doc(alias = "hdy_view_switcher_set_stack")] pub fn set_stack(&self, stack: Option<&impl IsA>) { unsafe { ffi::hdy_view_switcher_set_stack( self.to_glib_none().0, stack.map(|p| p.as_ref()).to_glib_none().0, ); } } #[doc(alias = "narrow-ellipsize")] pub fn connect_narrow_ellipsize_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_narrow_ellipsize_trampoline( this: *mut ffi::HdyViewSwitcher, _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 _, b"notify::narrow-ellipsize\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_narrow_ellipsize_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "policy")] pub fn connect_policy_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_policy_trampoline( this: *mut ffi::HdyViewSwitcher, _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 _, b"notify::policy\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_policy_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "stack")] pub fn connect_stack_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_stack_trampoline( this: *mut ffi::HdyViewSwitcher, _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 _, b"notify::stack\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_stack_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl Default for ViewSwitcher { fn default() -> Self { Self::new() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`ViewSwitcher`] 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 ViewSwitcherBuilder { builder: glib::object::ObjectBuilder<'static, ViewSwitcher>, } impl ViewSwitcherBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } pub fn narrow_ellipsize(self, narrow_ellipsize: pango::EllipsizeMode) -> Self { Self { builder: self.builder.property("narrow-ellipsize", narrow_ellipsize), } } pub fn policy(self, policy: ViewSwitcherPolicy) -> Self { Self { builder: self.builder.property("policy", policy), } } pub fn stack(self, stack: &impl IsA) -> Self { Self { builder: self.builder.property("stack", stack.clone().upcast()), } } pub fn border_width(self, border_width: u32) -> Self { Self { builder: self.builder.property("border-width", border_width), } } pub fn child(self, child: &impl IsA) -> Self { Self { builder: self.builder.property("child", child.clone().upcast()), } } pub fn resize_mode(self, resize_mode: gtk::ResizeMode) -> Self { Self { builder: self.builder.property("resize-mode", resize_mode), } } pub fn app_paintable(self, app_paintable: bool) -> Self { Self { builder: self.builder.property("app-paintable", app_paintable), } } pub fn can_default(self, can_default: bool) -> Self { Self { builder: self.builder.property("can-default", can_default), } } pub fn can_focus(self, can_focus: bool) -> Self { Self { builder: self.builder.property("can-focus", can_focus), } } pub fn events(self, events: gdk::EventMask) -> Self { Self { builder: self.builder.property("events", events), } } pub fn expand(self, expand: bool) -> Self { Self { builder: self.builder.property("expand", expand), } } pub fn focus_on_click(self, focus_on_click: bool) -> Self { Self { builder: self.builder.property("focus-on-click", focus_on_click), } } pub fn halign(self, halign: gtk::Align) -> Self { Self { builder: self.builder.property("halign", halign), } } pub fn has_default(self, has_default: bool) -> Self { Self { builder: self.builder.property("has-default", has_default), } } pub fn has_focus(self, has_focus: bool) -> Self { Self { builder: self.builder.property("has-focus", has_focus), } } pub fn has_tooltip(self, has_tooltip: bool) -> Self { Self { builder: self.builder.property("has-tooltip", has_tooltip), } } pub fn height_request(self, height_request: i32) -> Self { Self { builder: self.builder.property("height-request", height_request), } } pub fn hexpand(self, hexpand: bool) -> Self { Self { builder: self.builder.property("hexpand", hexpand), } } pub fn hexpand_set(self, hexpand_set: bool) -> Self { Self { builder: self.builder.property("hexpand-set", hexpand_set), } } pub fn is_focus(self, is_focus: bool) -> Self { Self { builder: self.builder.property("is-focus", is_focus), } } pub fn margin(self, margin: i32) -> Self { Self { builder: self.builder.property("margin", margin), } } pub fn margin_bottom(self, margin_bottom: i32) -> Self { Self { builder: self.builder.property("margin-bottom", margin_bottom), } } pub fn margin_end(self, margin_end: i32) -> Self { Self { builder: self.builder.property("margin-end", margin_end), } } pub fn margin_start(self, margin_start: i32) -> Self { Self { builder: self.builder.property("margin-start", margin_start), } } pub fn margin_top(self, margin_top: i32) -> Self { Self { builder: self.builder.property("margin-top", margin_top), } } pub fn name(self, name: impl Into) -> Self { Self { builder: self.builder.property("name", name.into()), } } pub fn no_show_all(self, no_show_all: bool) -> Self { Self { builder: self.builder.property("no-show-all", no_show_all), } } pub fn opacity(self, opacity: f64) -> Self { Self { builder: self.builder.property("opacity", opacity), } } pub fn parent(self, parent: &impl IsA) -> Self { Self { builder: self.builder.property("parent", parent.clone().upcast()), } } pub fn receives_default(self, receives_default: bool) -> Self { Self { builder: self.builder.property("receives-default", receives_default), } } pub fn sensitive(self, sensitive: bool) -> Self { Self { builder: self.builder.property("sensitive", sensitive), } } //pub fn style(self, style: &impl IsA) -> Self { // Self { builder: self.builder.property("style", style.clone().upcast()), } //} pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { Self { builder: self .builder .property("tooltip-markup", tooltip_markup.into()), } } pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } } pub fn valign(self, valign: gtk::Align) -> Self { Self { builder: self.builder.property("valign", valign), } } pub fn vexpand(self, vexpand: bool) -> Self { Self { builder: self.builder.property("vexpand", vexpand), } } pub fn vexpand_set(self, vexpand_set: bool) -> Self { Self { builder: self.builder.property("vexpand-set", vexpand_set), } } pub fn visible(self, visible: bool) -> Self { Self { builder: self.builder.property("visible", visible), } } pub fn width_request(self, width_request: i32) -> Self { Self { builder: self.builder.property("width-request", width_request), } } // rustdoc-stripper-ignore-next /// Build the [`ViewSwitcher`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> ViewSwitcher { self.builder.build() } } impl fmt::Display for ViewSwitcher { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("ViewSwitcher") } } rust-libhandy-0.11-0.11.1/src/auto/view_switcher_bar.rs000066400000000000000000000305251470255135400225620ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT use crate::ViewSwitcherPolicy; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "HdyViewSwitcherBar")] pub struct ViewSwitcherBar(Object) @extends gtk::Bin, gtk::Container, gtk::Widget, @implements gtk::Buildable; match fn { type_ => || ffi::hdy_view_switcher_bar_get_type(), } } impl ViewSwitcherBar { #[doc(alias = "hdy_view_switcher_bar_new")] pub fn new() -> ViewSwitcherBar { assert_initialized_main_thread!(); unsafe { gtk::Widget::from_glib_none(ffi::hdy_view_switcher_bar_new()).unsafe_cast() } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`ViewSwitcherBar`] objects. /// /// This method returns an instance of [`ViewSwitcherBarBuilder`](crate::builders::ViewSwitcherBarBuilder) which can be used to create [`ViewSwitcherBar`] objects. pub fn builder() -> ViewSwitcherBarBuilder { ViewSwitcherBarBuilder::new() } #[doc(alias = "hdy_view_switcher_bar_get_policy")] #[doc(alias = "get_policy")] pub fn policy(&self) -> ViewSwitcherPolicy { unsafe { from_glib(ffi::hdy_view_switcher_bar_get_policy(self.to_glib_none().0)) } } #[doc(alias = "hdy_view_switcher_bar_get_reveal")] #[doc(alias = "get_reveal")] pub fn reveals(&self) -> bool { unsafe { from_glib(ffi::hdy_view_switcher_bar_get_reveal(self.to_glib_none().0)) } } #[doc(alias = "hdy_view_switcher_bar_get_stack")] #[doc(alias = "get_stack")] pub fn stack(&self) -> Option { unsafe { from_glib_none(ffi::hdy_view_switcher_bar_get_stack(self.to_glib_none().0)) } } #[doc(alias = "hdy_view_switcher_bar_set_policy")] pub fn set_policy(&self, policy: ViewSwitcherPolicy) { unsafe { ffi::hdy_view_switcher_bar_set_policy(self.to_glib_none().0, policy.into_glib()); } } #[doc(alias = "hdy_view_switcher_bar_set_reveal")] pub fn set_reveal(&self, reveal: bool) { unsafe { ffi::hdy_view_switcher_bar_set_reveal(self.to_glib_none().0, reveal.into_glib()); } } #[doc(alias = "hdy_view_switcher_bar_set_stack")] pub fn set_stack(&self, stack: Option<&impl IsA>) { unsafe { ffi::hdy_view_switcher_bar_set_stack( self.to_glib_none().0, stack.map(|p| p.as_ref()).to_glib_none().0, ); } } #[doc(alias = "policy")] pub fn connect_policy_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_policy_trampoline( this: *mut ffi::HdyViewSwitcherBar, _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 _, b"notify::policy\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_policy_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "reveal")] pub fn connect_reveal_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_reveal_trampoline( this: *mut ffi::HdyViewSwitcherBar, _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 _, b"notify::reveal\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_reveal_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "stack")] pub fn connect_stack_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_stack_trampoline( this: *mut ffi::HdyViewSwitcherBar, _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 _, b"notify::stack\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_stack_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl Default for ViewSwitcherBar { fn default() -> Self { Self::new() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`ViewSwitcherBar`] 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 ViewSwitcherBarBuilder { builder: glib::object::ObjectBuilder<'static, ViewSwitcherBar>, } impl ViewSwitcherBarBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } pub fn policy(self, policy: ViewSwitcherPolicy) -> Self { Self { builder: self.builder.property("policy", policy), } } pub fn reveal(self, reveal: bool) -> Self { Self { builder: self.builder.property("reveal", reveal), } } pub fn stack(self, stack: &impl IsA) -> Self { Self { builder: self.builder.property("stack", stack.clone().upcast()), } } pub fn border_width(self, border_width: u32) -> Self { Self { builder: self.builder.property("border-width", border_width), } } pub fn child(self, child: &impl IsA) -> Self { Self { builder: self.builder.property("child", child.clone().upcast()), } } pub fn resize_mode(self, resize_mode: gtk::ResizeMode) -> Self { Self { builder: self.builder.property("resize-mode", resize_mode), } } pub fn app_paintable(self, app_paintable: bool) -> Self { Self { builder: self.builder.property("app-paintable", app_paintable), } } pub fn can_default(self, can_default: bool) -> Self { Self { builder: self.builder.property("can-default", can_default), } } pub fn can_focus(self, can_focus: bool) -> Self { Self { builder: self.builder.property("can-focus", can_focus), } } pub fn events(self, events: gdk::EventMask) -> Self { Self { builder: self.builder.property("events", events), } } pub fn expand(self, expand: bool) -> Self { Self { builder: self.builder.property("expand", expand), } } pub fn focus_on_click(self, focus_on_click: bool) -> Self { Self { builder: self.builder.property("focus-on-click", focus_on_click), } } pub fn halign(self, halign: gtk::Align) -> Self { Self { builder: self.builder.property("halign", halign), } } pub fn has_default(self, has_default: bool) -> Self { Self { builder: self.builder.property("has-default", has_default), } } pub fn has_focus(self, has_focus: bool) -> Self { Self { builder: self.builder.property("has-focus", has_focus), } } pub fn has_tooltip(self, has_tooltip: bool) -> Self { Self { builder: self.builder.property("has-tooltip", has_tooltip), } } pub fn height_request(self, height_request: i32) -> Self { Self { builder: self.builder.property("height-request", height_request), } } pub fn hexpand(self, hexpand: bool) -> Self { Self { builder: self.builder.property("hexpand", hexpand), } } pub fn hexpand_set(self, hexpand_set: bool) -> Self { Self { builder: self.builder.property("hexpand-set", hexpand_set), } } pub fn is_focus(self, is_focus: bool) -> Self { Self { builder: self.builder.property("is-focus", is_focus), } } pub fn margin(self, margin: i32) -> Self { Self { builder: self.builder.property("margin", margin), } } pub fn margin_bottom(self, margin_bottom: i32) -> Self { Self { builder: self.builder.property("margin-bottom", margin_bottom), } } pub fn margin_end(self, margin_end: i32) -> Self { Self { builder: self.builder.property("margin-end", margin_end), } } pub fn margin_start(self, margin_start: i32) -> Self { Self { builder: self.builder.property("margin-start", margin_start), } } pub fn margin_top(self, margin_top: i32) -> Self { Self { builder: self.builder.property("margin-top", margin_top), } } pub fn name(self, name: impl Into) -> Self { Self { builder: self.builder.property("name", name.into()), } } pub fn no_show_all(self, no_show_all: bool) -> Self { Self { builder: self.builder.property("no-show-all", no_show_all), } } pub fn opacity(self, opacity: f64) -> Self { Self { builder: self.builder.property("opacity", opacity), } } pub fn parent(self, parent: &impl IsA) -> Self { Self { builder: self.builder.property("parent", parent.clone().upcast()), } } pub fn receives_default(self, receives_default: bool) -> Self { Self { builder: self.builder.property("receives-default", receives_default), } } pub fn sensitive(self, sensitive: bool) -> Self { Self { builder: self.builder.property("sensitive", sensitive), } } //pub fn style(self, style: &impl IsA) -> Self { // Self { builder: self.builder.property("style", style.clone().upcast()), } //} pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { Self { builder: self .builder .property("tooltip-markup", tooltip_markup.into()), } } pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } } pub fn valign(self, valign: gtk::Align) -> Self { Self { builder: self.builder.property("valign", valign), } } pub fn vexpand(self, vexpand: bool) -> Self { Self { builder: self.builder.property("vexpand", vexpand), } } pub fn vexpand_set(self, vexpand_set: bool) -> Self { Self { builder: self.builder.property("vexpand-set", vexpand_set), } } pub fn visible(self, visible: bool) -> Self { Self { builder: self.builder.property("visible", visible), } } pub fn width_request(self, width_request: i32) -> Self { Self { builder: self.builder.property("width-request", width_request), } } // rustdoc-stripper-ignore-next /// Build the [`ViewSwitcherBar`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> ViewSwitcherBar { self.builder.build() } } impl fmt::Display for ViewSwitcherBar { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("ViewSwitcherBar") } } rust-libhandy-0.11-0.11.1/src/auto/view_switcher_title.rs000066400000000000000000000422711470255135400231400ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT use crate::ViewSwitcherPolicy; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "HdyViewSwitcherTitle")] pub struct ViewSwitcherTitle(Object) @extends gtk::Bin, gtk::Container, gtk::Widget, @implements gtk::Buildable; match fn { type_ => || ffi::hdy_view_switcher_title_get_type(), } } impl ViewSwitcherTitle { #[doc(alias = "hdy_view_switcher_title_new")] pub fn new() -> ViewSwitcherTitle { assert_initialized_main_thread!(); unsafe { from_glib_none(ffi::hdy_view_switcher_title_new()) } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`ViewSwitcherTitle`] objects. /// /// This method returns an instance of [`ViewSwitcherTitleBuilder`](crate::builders::ViewSwitcherTitleBuilder) which can be used to create [`ViewSwitcherTitle`] objects. pub fn builder() -> ViewSwitcherTitleBuilder { ViewSwitcherTitleBuilder::new() } #[doc(alias = "hdy_view_switcher_title_get_policy")] #[doc(alias = "get_policy")] pub fn policy(&self) -> ViewSwitcherPolicy { unsafe { from_glib(ffi::hdy_view_switcher_title_get_policy( self.to_glib_none().0, )) } } #[doc(alias = "hdy_view_switcher_title_get_stack")] #[doc(alias = "get_stack")] pub fn stack(&self) -> Option { unsafe { from_glib_none(ffi::hdy_view_switcher_title_get_stack( self.to_glib_none().0, )) } } #[doc(alias = "hdy_view_switcher_title_get_subtitle")] #[doc(alias = "get_subtitle")] pub fn subtitle(&self) -> Option { unsafe { from_glib_none(ffi::hdy_view_switcher_title_get_subtitle( self.to_glib_none().0, )) } } #[doc(alias = "hdy_view_switcher_title_get_title")] #[doc(alias = "get_title")] pub fn title(&self) -> Option { unsafe { from_glib_none(ffi::hdy_view_switcher_title_get_title( self.to_glib_none().0, )) } } #[doc(alias = "hdy_view_switcher_title_get_title_visible")] #[doc(alias = "get_title_visible")] pub fn is_title_visible(&self) -> bool { unsafe { from_glib(ffi::hdy_view_switcher_title_get_title_visible( self.to_glib_none().0, )) } } #[doc(alias = "hdy_view_switcher_title_get_view_switcher_enabled")] #[doc(alias = "get_view_switcher_enabled")] pub fn is_view_switcher_enabled(&self) -> bool { unsafe { from_glib(ffi::hdy_view_switcher_title_get_view_switcher_enabled( self.to_glib_none().0, )) } } #[doc(alias = "hdy_view_switcher_title_set_policy")] pub fn set_policy(&self, policy: ViewSwitcherPolicy) { unsafe { ffi::hdy_view_switcher_title_set_policy(self.to_glib_none().0, policy.into_glib()); } } #[doc(alias = "hdy_view_switcher_title_set_stack")] pub fn set_stack(&self, stack: Option<&impl IsA>) { unsafe { ffi::hdy_view_switcher_title_set_stack( self.to_glib_none().0, stack.map(|p| p.as_ref()).to_glib_none().0, ); } } #[doc(alias = "hdy_view_switcher_title_set_subtitle")] pub fn set_subtitle(&self, subtitle: Option<&str>) { unsafe { ffi::hdy_view_switcher_title_set_subtitle( self.to_glib_none().0, subtitle.to_glib_none().0, ); } } #[doc(alias = "hdy_view_switcher_title_set_title")] pub fn set_title(&self, title: Option<&str>) { unsafe { ffi::hdy_view_switcher_title_set_title(self.to_glib_none().0, title.to_glib_none().0); } } #[doc(alias = "hdy_view_switcher_title_set_view_switcher_enabled")] pub fn set_view_switcher_enabled(&self, enabled: bool) { unsafe { ffi::hdy_view_switcher_title_set_view_switcher_enabled( self.to_glib_none().0, enabled.into_glib(), ); } } #[doc(alias = "policy")] pub fn connect_policy_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_policy_trampoline( this: *mut ffi::HdyViewSwitcherTitle, _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 _, b"notify::policy\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_policy_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "stack")] pub fn connect_stack_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_stack_trampoline( this: *mut ffi::HdyViewSwitcherTitle, _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 _, b"notify::stack\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_stack_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "subtitle")] pub fn connect_subtitle_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_subtitle_trampoline( this: *mut ffi::HdyViewSwitcherTitle, _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 _, b"notify::subtitle\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_subtitle_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::HdyViewSwitcherTitle, _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 _, b"notify::title\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_title_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "title-visible")] pub fn connect_title_visible_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_title_visible_trampoline< F: Fn(&ViewSwitcherTitle) + 'static, >( this: *mut ffi::HdyViewSwitcherTitle, _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 _, b"notify::title-visible\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_title_visible_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "view-switcher-enabled")] pub fn connect_view_switcher_enabled_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_view_switcher_enabled_trampoline< F: Fn(&ViewSwitcherTitle) + 'static, >( this: *mut ffi::HdyViewSwitcherTitle, _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 _, b"notify::view-switcher-enabled\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_view_switcher_enabled_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl Default for ViewSwitcherTitle { fn default() -> Self { Self::new() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`ViewSwitcherTitle`] 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 ViewSwitcherTitleBuilder { builder: glib::object::ObjectBuilder<'static, ViewSwitcherTitle>, } impl ViewSwitcherTitleBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } pub fn policy(self, policy: ViewSwitcherPolicy) -> Self { Self { builder: self.builder.property("policy", policy), } } pub fn stack(self, stack: &impl IsA) -> Self { Self { builder: self.builder.property("stack", stack.clone().upcast()), } } pub fn subtitle(self, subtitle: impl Into) -> Self { Self { builder: self.builder.property("subtitle", subtitle.into()), } } pub fn title(self, title: impl Into) -> Self { Self { builder: self.builder.property("title", title.into()), } } pub fn view_switcher_enabled(self, view_switcher_enabled: bool) -> Self { Self { builder: self .builder .property("view-switcher-enabled", view_switcher_enabled), } } pub fn border_width(self, border_width: u32) -> Self { Self { builder: self.builder.property("border-width", border_width), } } pub fn child(self, child: &impl IsA) -> Self { Self { builder: self.builder.property("child", child.clone().upcast()), } } pub fn resize_mode(self, resize_mode: gtk::ResizeMode) -> Self { Self { builder: self.builder.property("resize-mode", resize_mode), } } pub fn app_paintable(self, app_paintable: bool) -> Self { Self { builder: self.builder.property("app-paintable", app_paintable), } } pub fn can_default(self, can_default: bool) -> Self { Self { builder: self.builder.property("can-default", can_default), } } pub fn can_focus(self, can_focus: bool) -> Self { Self { builder: self.builder.property("can-focus", can_focus), } } pub fn events(self, events: gdk::EventMask) -> Self { Self { builder: self.builder.property("events", events), } } pub fn expand(self, expand: bool) -> Self { Self { builder: self.builder.property("expand", expand), } } pub fn focus_on_click(self, focus_on_click: bool) -> Self { Self { builder: self.builder.property("focus-on-click", focus_on_click), } } pub fn halign(self, halign: gtk::Align) -> Self { Self { builder: self.builder.property("halign", halign), } } pub fn has_default(self, has_default: bool) -> Self { Self { builder: self.builder.property("has-default", has_default), } } pub fn has_focus(self, has_focus: bool) -> Self { Self { builder: self.builder.property("has-focus", has_focus), } } pub fn has_tooltip(self, has_tooltip: bool) -> Self { Self { builder: self.builder.property("has-tooltip", has_tooltip), } } pub fn height_request(self, height_request: i32) -> Self { Self { builder: self.builder.property("height-request", height_request), } } pub fn hexpand(self, hexpand: bool) -> Self { Self { builder: self.builder.property("hexpand", hexpand), } } pub fn hexpand_set(self, hexpand_set: bool) -> Self { Self { builder: self.builder.property("hexpand-set", hexpand_set), } } pub fn is_focus(self, is_focus: bool) -> Self { Self { builder: self.builder.property("is-focus", is_focus), } } pub fn margin(self, margin: i32) -> Self { Self { builder: self.builder.property("margin", margin), } } pub fn margin_bottom(self, margin_bottom: i32) -> Self { Self { builder: self.builder.property("margin-bottom", margin_bottom), } } pub fn margin_end(self, margin_end: i32) -> Self { Self { builder: self.builder.property("margin-end", margin_end), } } pub fn margin_start(self, margin_start: i32) -> Self { Self { builder: self.builder.property("margin-start", margin_start), } } pub fn margin_top(self, margin_top: i32) -> Self { Self { builder: self.builder.property("margin-top", margin_top), } } pub fn name(self, name: impl Into) -> Self { Self { builder: self.builder.property("name", name.into()), } } pub fn no_show_all(self, no_show_all: bool) -> Self { Self { builder: self.builder.property("no-show-all", no_show_all), } } pub fn opacity(self, opacity: f64) -> Self { Self { builder: self.builder.property("opacity", opacity), } } pub fn parent(self, parent: &impl IsA) -> Self { Self { builder: self.builder.property("parent", parent.clone().upcast()), } } pub fn receives_default(self, receives_default: bool) -> Self { Self { builder: self.builder.property("receives-default", receives_default), } } pub fn sensitive(self, sensitive: bool) -> Self { Self { builder: self.builder.property("sensitive", sensitive), } } //pub fn style(self, style: &impl IsA) -> Self { // Self { builder: self.builder.property("style", style.clone().upcast()), } //} pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { Self { builder: self .builder .property("tooltip-markup", tooltip_markup.into()), } } pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } } pub fn valign(self, valign: gtk::Align) -> Self { Self { builder: self.builder.property("valign", valign), } } pub fn vexpand(self, vexpand: bool) -> Self { Self { builder: self.builder.property("vexpand", vexpand), } } pub fn vexpand_set(self, vexpand_set: bool) -> Self { Self { builder: self.builder.property("vexpand-set", vexpand_set), } } pub fn visible(self, visible: bool) -> Self { Self { builder: self.builder.property("visible", visible), } } pub fn width_request(self, width_request: i32) -> Self { Self { builder: self.builder.property("width-request", width_request), } } // rustdoc-stripper-ignore-next /// Build the [`ViewSwitcherTitle`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> ViewSwitcherTitle { self.builder.build() } } impl fmt::Display for ViewSwitcherTitle { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("ViewSwitcherTitle") } } rust-libhandy-0.11-0.11.1/src/auto/window.rs000066400000000000000000000311711470255135400203610ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT use glib::{prelude::*, translate::*}; use std::fmt; glib::wrapper! { #[doc(alias = "HdyWindow")] pub struct Window(Object) @extends gtk::Window, gtk::Bin, gtk::Container, gtk::Widget, @implements gtk::Buildable; match fn { type_ => || ffi::hdy_window_get_type(), } } impl Window { pub const NONE: Option<&'static Window> = None; #[doc(alias = "hdy_window_new")] pub fn new() -> Window { assert_initialized_main_thread!(); unsafe { gtk::Widget::from_glib_none(ffi::hdy_window_new()).unsafe_cast() } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`Window`] objects. /// /// This method returns an instance of [`WindowBuilder`](crate::builders::WindowBuilder) which can be used to create [`Window`] objects. pub fn builder() -> WindowBuilder { WindowBuilder::new() } } impl Default for Window { fn default() -> Self { Self::new() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`Window`] 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 WindowBuilder { builder: glib::object::ObjectBuilder<'static, Window>, } impl WindowBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } pub fn accept_focus(self, accept_focus: bool) -> Self { Self { builder: self.builder.property("accept-focus", accept_focus), } } //pub fn application(self, application: &impl IsA) -> Self { // Self { builder: self.builder.property("application", application.clone().upcast()), } //} pub fn attached_to(self, attached_to: &impl IsA) -> Self { Self { builder: self .builder .property("attached-to", attached_to.clone().upcast()), } } pub fn decorated(self, decorated: bool) -> Self { Self { builder: self.builder.property("decorated", decorated), } } pub fn default_height(self, default_height: i32) -> Self { Self { builder: self.builder.property("default-height", default_height), } } pub fn default_width(self, default_width: i32) -> Self { Self { builder: self.builder.property("default-width", default_width), } } pub fn deletable(self, deletable: bool) -> Self { Self { builder: self.builder.property("deletable", deletable), } } pub fn destroy_with_parent(self, destroy_with_parent: bool) -> Self { Self { builder: self .builder .property("destroy-with-parent", destroy_with_parent), } } pub fn focus_on_map(self, focus_on_map: bool) -> Self { Self { builder: self.builder.property("focus-on-map", focus_on_map), } } pub fn focus_visible(self, focus_visible: bool) -> Self { Self { builder: self.builder.property("focus-visible", focus_visible), } } //pub fn gravity(self, gravity: /*Ignored*/gdk::Gravity) -> Self { // Self { builder: self.builder.property("gravity", gravity), } //} pub fn hide_titlebar_when_maximized(self, hide_titlebar_when_maximized: bool) -> Self { Self { builder: self .builder .property("hide-titlebar-when-maximized", hide_titlebar_when_maximized), } } pub fn icon(self, icon: &gdk_pixbuf::Pixbuf) -> Self { Self { builder: self.builder.property("icon", icon.clone()), } } pub fn icon_name(self, icon_name: impl Into) -> Self { Self { builder: self.builder.property("icon-name", icon_name.into()), } } pub fn mnemonics_visible(self, mnemonics_visible: bool) -> Self { Self { builder: self .builder .property("mnemonics-visible", mnemonics_visible), } } pub fn modal(self, modal: bool) -> Self { Self { builder: self.builder.property("modal", modal), } } pub fn resizable(self, resizable: bool) -> Self { Self { builder: self.builder.property("resizable", resizable), } } pub fn role(self, role: impl Into) -> Self { Self { builder: self.builder.property("role", role.into()), } } //pub fn screen(self, screen: /*Ignored*/&gdk::Screen) -> Self { // Self { builder: self.builder.property("screen", screen), } //} pub fn skip_pager_hint(self, skip_pager_hint: bool) -> Self { Self { builder: self.builder.property("skip-pager-hint", skip_pager_hint), } } pub fn skip_taskbar_hint(self, skip_taskbar_hint: bool) -> Self { Self { builder: self .builder .property("skip-taskbar-hint", skip_taskbar_hint), } } pub fn startup_id(self, startup_id: impl Into) -> Self { Self { builder: self.builder.property("startup-id", startup_id.into()), } } pub fn title(self, title: impl Into) -> Self { Self { builder: self.builder.property("title", title.into()), } } pub fn transient_for(self, transient_for: &impl IsA) -> Self { Self { builder: self .builder .property("transient-for", transient_for.clone().upcast()), } } //pub fn type_(self, type_: /*Ignored*/gtk::WindowType) -> Self { // Self { builder: self.builder.property("type", type_), } //} //pub fn type_hint(self, type_hint: /*Ignored*/gdk::WindowTypeHint) -> Self { // Self { builder: self.builder.property("type-hint", type_hint), } //} pub fn urgency_hint(self, urgency_hint: bool) -> Self { Self { builder: self.builder.property("urgency-hint", urgency_hint), } } //pub fn window_position(self, window_position: /*Ignored*/gtk::WindowPosition) -> Self { // Self { builder: self.builder.property("window-position", window_position), } //} pub fn border_width(self, border_width: u32) -> Self { Self { builder: self.builder.property("border-width", border_width), } } pub fn child(self, child: &impl IsA) -> Self { Self { builder: self.builder.property("child", child.clone().upcast()), } } pub fn resize_mode(self, resize_mode: gtk::ResizeMode) -> Self { Self { builder: self.builder.property("resize-mode", resize_mode), } } pub fn app_paintable(self, app_paintable: bool) -> Self { Self { builder: self.builder.property("app-paintable", app_paintable), } } pub fn can_default(self, can_default: bool) -> Self { Self { builder: self.builder.property("can-default", can_default), } } pub fn can_focus(self, can_focus: bool) -> Self { Self { builder: self.builder.property("can-focus", can_focus), } } pub fn events(self, events: gdk::EventMask) -> Self { Self { builder: self.builder.property("events", events), } } pub fn expand(self, expand: bool) -> Self { Self { builder: self.builder.property("expand", expand), } } pub fn focus_on_click(self, focus_on_click: bool) -> Self { Self { builder: self.builder.property("focus-on-click", focus_on_click), } } pub fn halign(self, halign: gtk::Align) -> Self { Self { builder: self.builder.property("halign", halign), } } pub fn has_default(self, has_default: bool) -> Self { Self { builder: self.builder.property("has-default", has_default), } } pub fn has_focus(self, has_focus: bool) -> Self { Self { builder: self.builder.property("has-focus", has_focus), } } pub fn has_tooltip(self, has_tooltip: bool) -> Self { Self { builder: self.builder.property("has-tooltip", has_tooltip), } } pub fn height_request(self, height_request: i32) -> Self { Self { builder: self.builder.property("height-request", height_request), } } pub fn hexpand(self, hexpand: bool) -> Self { Self { builder: self.builder.property("hexpand", hexpand), } } pub fn hexpand_set(self, hexpand_set: bool) -> Self { Self { builder: self.builder.property("hexpand-set", hexpand_set), } } pub fn is_focus(self, is_focus: bool) -> Self { Self { builder: self.builder.property("is-focus", is_focus), } } pub fn margin(self, margin: i32) -> Self { Self { builder: self.builder.property("margin", margin), } } pub fn margin_bottom(self, margin_bottom: i32) -> Self { Self { builder: self.builder.property("margin-bottom", margin_bottom), } } pub fn margin_end(self, margin_end: i32) -> Self { Self { builder: self.builder.property("margin-end", margin_end), } } pub fn margin_start(self, margin_start: i32) -> Self { Self { builder: self.builder.property("margin-start", margin_start), } } pub fn margin_top(self, margin_top: i32) -> Self { Self { builder: self.builder.property("margin-top", margin_top), } } pub fn name(self, name: impl Into) -> Self { Self { builder: self.builder.property("name", name.into()), } } pub fn no_show_all(self, no_show_all: bool) -> Self { Self { builder: self.builder.property("no-show-all", no_show_all), } } pub fn opacity(self, opacity: f64) -> Self { Self { builder: self.builder.property("opacity", opacity), } } pub fn parent(self, parent: &impl IsA) -> Self { Self { builder: self.builder.property("parent", parent.clone().upcast()), } } pub fn receives_default(self, receives_default: bool) -> Self { Self { builder: self.builder.property("receives-default", receives_default), } } pub fn sensitive(self, sensitive: bool) -> Self { Self { builder: self.builder.property("sensitive", sensitive), } } //pub fn style(self, style: &impl IsA) -> Self { // Self { builder: self.builder.property("style", style.clone().upcast()), } //} pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { Self { builder: self .builder .property("tooltip-markup", tooltip_markup.into()), } } pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } } pub fn valign(self, valign: gtk::Align) -> Self { Self { builder: self.builder.property("valign", valign), } } pub fn vexpand(self, vexpand: bool) -> Self { Self { builder: self.builder.property("vexpand", vexpand), } } pub fn vexpand_set(self, vexpand_set: bool) -> Self { Self { builder: self.builder.property("vexpand-set", vexpand_set), } } pub fn visible(self, visible: bool) -> Self { Self { builder: self.builder.property("visible", visible), } } pub fn width_request(self, width_request: i32) -> Self { Self { builder: self.builder.property("width-request", width_request), } } // rustdoc-stripper-ignore-next /// Build the [`Window`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> Window { self.builder.build() } } impl fmt::Display for Window { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Window") } } rust-libhandy-0.11-0.11.1/src/auto/window_handle.rs000066400000000000000000000201741470255135400216750ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT use glib::{prelude::*, translate::*}; use std::fmt; glib::wrapper! { #[doc(alias = "HdyWindowHandle")] pub struct WindowHandle(Object) @extends gtk::EventBox, gtk::Bin, gtk::Container, gtk::Widget, @implements gtk::Buildable; match fn { type_ => || ffi::hdy_window_handle_get_type(), } } impl WindowHandle { #[doc(alias = "hdy_window_handle_new")] pub fn new() -> WindowHandle { assert_initialized_main_thread!(); unsafe { gtk::Widget::from_glib_none(ffi::hdy_window_handle_new()).unsafe_cast() } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`WindowHandle`] objects. /// /// This method returns an instance of [`WindowHandleBuilder`](crate::builders::WindowHandleBuilder) which can be used to create [`WindowHandle`] objects. pub fn builder() -> WindowHandleBuilder { WindowHandleBuilder::new() } } impl Default for WindowHandle { fn default() -> Self { Self::new() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`WindowHandle`] 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 WindowHandleBuilder { builder: glib::object::ObjectBuilder<'static, WindowHandle>, } impl WindowHandleBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } pub fn above_child(self, above_child: bool) -> Self { Self { builder: self.builder.property("above-child", above_child), } } pub fn visible_window(self, visible_window: bool) -> Self { Self { builder: self.builder.property("visible-window", visible_window), } } pub fn border_width(self, border_width: u32) -> Self { Self { builder: self.builder.property("border-width", border_width), } } pub fn child(self, child: &impl IsA) -> Self { Self { builder: self.builder.property("child", child.clone().upcast()), } } pub fn resize_mode(self, resize_mode: gtk::ResizeMode) -> Self { Self { builder: self.builder.property("resize-mode", resize_mode), } } pub fn app_paintable(self, app_paintable: bool) -> Self { Self { builder: self.builder.property("app-paintable", app_paintable), } } pub fn can_default(self, can_default: bool) -> Self { Self { builder: self.builder.property("can-default", can_default), } } pub fn can_focus(self, can_focus: bool) -> Self { Self { builder: self.builder.property("can-focus", can_focus), } } pub fn events(self, events: gdk::EventMask) -> Self { Self { builder: self.builder.property("events", events), } } pub fn expand(self, expand: bool) -> Self { Self { builder: self.builder.property("expand", expand), } } pub fn focus_on_click(self, focus_on_click: bool) -> Self { Self { builder: self.builder.property("focus-on-click", focus_on_click), } } pub fn halign(self, halign: gtk::Align) -> Self { Self { builder: self.builder.property("halign", halign), } } pub fn has_default(self, has_default: bool) -> Self { Self { builder: self.builder.property("has-default", has_default), } } pub fn has_focus(self, has_focus: bool) -> Self { Self { builder: self.builder.property("has-focus", has_focus), } } pub fn has_tooltip(self, has_tooltip: bool) -> Self { Self { builder: self.builder.property("has-tooltip", has_tooltip), } } pub fn height_request(self, height_request: i32) -> Self { Self { builder: self.builder.property("height-request", height_request), } } pub fn hexpand(self, hexpand: bool) -> Self { Self { builder: self.builder.property("hexpand", hexpand), } } pub fn hexpand_set(self, hexpand_set: bool) -> Self { Self { builder: self.builder.property("hexpand-set", hexpand_set), } } pub fn is_focus(self, is_focus: bool) -> Self { Self { builder: self.builder.property("is-focus", is_focus), } } pub fn margin(self, margin: i32) -> Self { Self { builder: self.builder.property("margin", margin), } } pub fn margin_bottom(self, margin_bottom: i32) -> Self { Self { builder: self.builder.property("margin-bottom", margin_bottom), } } pub fn margin_end(self, margin_end: i32) -> Self { Self { builder: self.builder.property("margin-end", margin_end), } } pub fn margin_start(self, margin_start: i32) -> Self { Self { builder: self.builder.property("margin-start", margin_start), } } pub fn margin_top(self, margin_top: i32) -> Self { Self { builder: self.builder.property("margin-top", margin_top), } } pub fn name(self, name: impl Into) -> Self { Self { builder: self.builder.property("name", name.into()), } } pub fn no_show_all(self, no_show_all: bool) -> Self { Self { builder: self.builder.property("no-show-all", no_show_all), } } pub fn opacity(self, opacity: f64) -> Self { Self { builder: self.builder.property("opacity", opacity), } } pub fn parent(self, parent: &impl IsA) -> Self { Self { builder: self.builder.property("parent", parent.clone().upcast()), } } pub fn receives_default(self, receives_default: bool) -> Self { Self { builder: self.builder.property("receives-default", receives_default), } } pub fn sensitive(self, sensitive: bool) -> Self { Self { builder: self.builder.property("sensitive", sensitive), } } //pub fn style(self, style: &impl IsA) -> Self { // Self { builder: self.builder.property("style", style.clone().upcast()), } //} pub fn tooltip_markup(self, tooltip_markup: impl Into) -> Self { Self { builder: self .builder .property("tooltip-markup", tooltip_markup.into()), } } pub fn tooltip_text(self, tooltip_text: impl Into) -> Self { Self { builder: self.builder.property("tooltip-text", tooltip_text.into()), } } pub fn valign(self, valign: gtk::Align) -> Self { Self { builder: self.builder.property("valign", valign), } } pub fn vexpand(self, vexpand: bool) -> Self { Self { builder: self.builder.property("vexpand", vexpand), } } pub fn vexpand_set(self, vexpand_set: bool) -> Self { Self { builder: self.builder.property("vexpand-set", vexpand_set), } } pub fn visible(self, visible: bool) -> Self { Self { builder: self.builder.property("visible", visible), } } pub fn width_request(self, width_request: i32) -> Self { Self { builder: self.builder.property("width-request", width_request), } } // rustdoc-stripper-ignore-next /// Build the [`WindowHandle`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> WindowHandle { self.builder.build() } } impl fmt::Display for WindowHandle { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("WindowHandle") } } rust-libhandy-0.11-0.11.1/src/lib.rs000066400000000000000000000065321470255135400166530ustar00rootroot00000000000000// Copyright 2018–2021, The libhandy-rs Project Developers. // See the COPYRIGHT file at the top-level directory of this distribution. // Licensed under the LGPL-2.1-only, see the LICENSE file or #![cfg_attr(docsrs, feature(doc_cfg))] #![allow(clippy::needless_doctest_main)] #![doc(html_logo_url = "https://gitlab.gnome.org/GNOME/libhandy/-/raw/main/doc/libhandy.svg")] //! # Rust Handy bindings //! //! This library contains safe Rust bindings for Handy, a library that offers //! building blocks for modern adaptive GNOME applications. //! //! See also //! //! - [GTK 3 Rust bindings documentation](mod@gtk) //! - [Libhandy documentation](https://gnome.pages.gitlab.gnome.org/libhandy/) //! - [gtk-rs project overview](https://gtk-rs.org/) //! //! # Example //! //! ```no_run //! use gtk::prelude::*; //! use gtk::{Application, Box, ListBox, Orientation}; //! use libhandy::prelude::*; //! use libhandy::{ActionRow, ApplicationWindow, HeaderBar}; //! //! fn main() { //! let application = Application::builder() //! .application_id("com.example.FirstHandyApp") //! .build(); //! //! application.connect_activate(|app| { //! libhandy::init(); //! //! // ActionRows are only available in Handy //! let row = ActionRow::builder() //! .activatable(true) //! .selectable(false) //! .margin(32) //! .title("Click me") //! .build(); //! row.connect_activated(|_| { //! eprintln!("Clicked!"); //! }); //! //! let list = ListBox::builder().child(&row).build(); //! // the content class makes the list look nicer //! list.style_context().add_class("content"); //! //! // Combine the content in a box //! let content = Box::new(Orientation::Vertical, 0); //! // Handy's ApplicationWindow does not include a HeaderBar //! content.add( //! &HeaderBar::builder() //! .show_close_button(true) //! .title("First Handy Program") //! .build(), //! ); //! content.add(&list); //! //! let window = ApplicationWindow::builder() //! .default_width(350) //! .default_height(70) //! // add content to window //! .child(&content) //! .build(); //! window.set_application(Some(app)); //! window.show_all(); //! }); //! //! application.run(); //! } //! ``` #![cfg_attr(feature = "dox", feature(doc_cfg))] #![allow(deprecated)] #![allow(dead_code)] /// Asserts that this is the main thread and `gtk::init` has been called. macro_rules! assert_initialized_main_thread { () => { if !::gtk::is_initialized_main_thread() { if ::gtk::is_initialized() { panic!("Libhandy may only be used from the main thread."); } else { panic!("Gtk has to be initialized before using libhandy."); } } }; } macro_rules! skip_assert_initialized { () => {}; } #[doc(hidden)] pub use gdk; #[doc(hidden)] pub use gio; #[doc(hidden)] pub use glib; #[doc(hidden)] pub use gtk; #[doc(hidden)] pub use pango; #[allow(clippy::type_complexity)] mod auto; mod value_object; #[macro_use] pub mod subclass; pub mod prelude; pub use auto::*; pub use auto::functions::*; rust-libhandy-0.11-0.11.1/src/prelude.rs000066400000000000000000000001111470255135400175300ustar00rootroot00000000000000#[doc(hidden)] pub use gtk::prelude::*; pub use crate::auto::traits::*; rust-libhandy-0.11-0.11.1/src/subclass/000077500000000000000000000000001470255135400173505ustar00rootroot00000000000000rust-libhandy-0.11-0.11.1/src/subclass/application_window.rs000066400000000000000000000003321470255135400236060ustar00rootroot00000000000000use crate::ApplicationWindow; use gtk::subclass::prelude::*; pub trait HdyApplicationWindowImpl: ApplicationWindowImpl + 'static {} unsafe impl IsSubclassable for ApplicationWindow {} rust-libhandy-0.11-0.11.1/src/subclass/mod.rs000066400000000000000000000002311470255135400204710ustar00rootroot00000000000000pub mod application_window; pub mod prelude { pub use super::application_window::HdyApplicationWindowImpl; pub use gio::subclass::prelude::*; } rust-libhandy-0.11-0.11.1/src/value_object.rs000066400000000000000000000004141470255135400205400ustar00rootroot00000000000000use crate::ValueObject; use glib::translate::*; impl ValueObject { pub fn new_string(string: &str) -> ValueObject { assert_initialized_main_thread!(); unsafe { from_glib_full(ffi::hdy_value_object_new_take_string(string.to_glib_full())) } } } rust-libhandy-0.11-0.11.1/tests/000077500000000000000000000000001470255135400161045ustar00rootroot00000000000000rust-libhandy-0.11-0.11.1/tests/main.rs000066400000000000000000000002641470255135400174000ustar00rootroot00000000000000#[test] fn check_build() { assert!(gtk::init().is_ok()); let column = libhandy::Clamp::new(); column.set_maximum_size(800); column.set_tightening_threshold(600); }