pax_global_header00006660000000000000000000000064146750617640014532gustar00rootroot0000000000000052 comment=2c2d8edd588e9a873d345dcf6a9d2cac80ee747a rust-gtk-0.18-0.18.1/000077500000000000000000000000001467506176400137655ustar00rootroot00000000000000rust-gtk-0.18-0.18.1/.cargo_vcs_info.json000066400000000000000000000001411467506176400177130ustar00rootroot00000000000000{ "git": { "sha1": "00133512bfc8bbb8e9be59b20e93406c6a3eeb21" }, "path_in_vcs": "gtk" }rust-gtk-0.18-0.18.1/COPYRIGHT000066400000000000000000000012131467506176400152550ustar00rootroot00000000000000The gtk-rs Project is licensed under the MIT license, see the LICENSE file or . Copyrights in the gtk-rs Project project are retained by their contributors. No copyright assignment is required to contribute to the gtk-rs Project project. For full authorship information, see the version control history. This project provides interoperability with various GNOME libraries but doesn't distribute any parts of them. Distributing compiled libraries and executables that link to those libraries may be subject to terms of the GNU LGPL or other licenses. For more information check the license of each GNOME library. rust-gtk-0.18-0.18.1/Cargo.toml000066400000000000000000000040411467506176400157140ustar00rootroot00000000000000# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2021" rust-version = "1.70" name = "gtk" version = "0.18.1" authors = ["The gtk-rs Project Developers"] build = "build.rs" exclude = ["gir-files/*"] description = "Rust bindings for the GTK+ 3 library" homepage = "https://gtk-rs.org/" documentation = "https://gtk-rs.org/gtk3-rs/stable/latest/docs/gtk/" readme = "README.md" keywords = [ "gtk", "gtk-rs", "gnome", "GUI", ] categories = [ "api-bindings", "gui", ] license = "MIT" repository = "https://github.com/gtk-rs/gtk3-rs" resolver = "1" [package.metadata.docs.rs] rustdoc-args = [ "--cfg", "docsrs", "--generate-link-to-definition", ] [lib] name = "gtk" [dependencies.atk] version = "0.18" [dependencies.cairo-rs] version = "0.18" [dependencies.ffi] version = "0.18" package = "gtk-sys" [dependencies.field-offset] version = "0.3" [dependencies.futures-channel] version = "0.3" [dependencies.gdk] version = "0.18" [dependencies.gdk-pixbuf] version = "0.18" [dependencies.gio] version = "0.18" [dependencies.glib] version = "0.18" [dependencies.gtk3-macros] version = "0.18" [dependencies.libc] version = "0.2" [dependencies.pango] version = "0.18" [dev-dependencies.gir-format-check] version = "^0.1" [build-dependencies.pkg-config] version = "0.3.7" [features] gio_v2_58 = ["gio/v2_58"] unsafe-assume-initialized = [] v3_24 = ["ffi/v3_24"] v3_24_1 = [ "v3_24", "ffi/v3_24_1", ] v3_24_11 = [ "v3_24_9", "ffi/v3_24_11", ] v3_24_30 = [ "v3_24_11", "ffi/v3_24_30", ] v3_24_8 = [ "v3_24_1", "ffi/v3_24_8", ] v3_24_9 = [ "v3_24_8", "ffi/v3_24_9", ] rust-gtk-0.18-0.18.1/Cargo.toml.orig000066400000000000000000000033031467506176400166530ustar00rootroot00000000000000[package] documentation = "https://gtk-rs.org/gtk3-rs/stable/latest/docs/gtk/" categories = ["api-bindings", "gui"] license = "MIT" description = "Rust bindings for the GTK+ 3 library" name = "gtk" homepage = "https://gtk-rs.org/" authors = ["The gtk-rs Project Developers"] readme = "README.md" version = "0.18.1" keywords = ["gtk", "gtk-rs", "gnome", "GUI"] repository = "https://github.com/gtk-rs/gtk3-rs" build = "build.rs" exclude = ["gir-files/*"] edition = "2021" rust-version = "1.70" [lib] name = "gtk" [features] v3_24 = ["ffi/v3_24"] v3_24_1 = ["v3_24", "ffi/v3_24_1"] v3_24_8 = ["v3_24_1", "ffi/v3_24_8"] v3_24_9 = ["v3_24_8", "ffi/v3_24_9"] v3_24_11 = ["v3_24_9", "ffi/v3_24_11"] v3_24_30 = ["v3_24_11", "ffi/v3_24_30"] gio_v2_58 = ["gio/v2_58"] unsafe-assume-initialized = [] [package.metadata.docs.rs] rustdoc-args = ["--cfg", "docsrs", "--generate-link-to-definition"] [build-dependencies] pkg-config = "0.3.7" [dependencies] libc = "0.2" field-offset = "0.3" futures-channel = "0.3" atk = { version = "0.18", path = "../atk" } ffi = { package = "gtk-sys", version = "0.18", path = "sys" } gtk3-macros = { version = "0.18", path = "../gtk3-macros" } cairo-rs = { branch = "0.18", version = "0.18", git = "https://github.com/gtk-rs/gtk-rs-core" } gio = { branch = "0.18", version = "0.18", git = "https://github.com/gtk-rs/gtk-rs-core" } glib = { branch = "0.18", version = "0.18", git = "https://github.com/gtk-rs/gtk-rs-core" } gdk = { version = "0.18", path = "../gdk" } gdk-pixbuf = { branch = "0.18", version = "0.18", git = "https://github.com/gtk-rs/gtk-rs-core" } pango = { branch = "0.18", version = "0.18", git = "https://github.com/gtk-rs/gtk-rs-core" } [dev-dependencies] gir-format-check = "^0.1" rust-gtk-0.18-0.18.1/Gir.toml000066400000000000000000002071011467506176400154040ustar00rootroot00000000000000[external_libraries] Gio = {min_version = "2.56"} [options] girs_directories = ["../gir-files"] library = "Gtk" version = "3.0" min_cfg_version = "3.22.30" target_path = "." work_mode = "normal" generate_safety_asserts = true deprecate_by_min_version = true single_version_file = true generate = [ "Gtk.AccelFlags", "Gtk.Align", "Gtk.ApplicationInhibitFlags", "Gtk.ArrowType", "Gtk.AssistantPageType", "Gtk.BaselinePosition", "Gtk.Bin", "Gtk.BorderStyle", "Gtk.BuilderError", "Gtk.ButtonBoxStyle", "Gtk.ButtonRole", "Gtk.ButtonsType", "Gtk.CalendarDisplayOptions", "Gtk.CellAreaContext", "Gtk.CellLayout", "Gtk.CellRendererAccelMode", "Gtk.CellRendererMode", "Gtk.CellRendererState", "Gtk.CornerType", "Gtk.CssProvider", "Gtk.CssProviderError", "Gtk.CssSection", "Gtk.CssSectionType", "Gtk.DeleteType", "Gtk.DestDefaults", "Gtk.DialogFlags", "Gtk.DirectionType", "Gtk.DragResult", "Gtk.EntryIconPosition", "Gtk.EventController", "Gtk.EventSequenceState", "Gtk.FileChooserAction", "Gtk.FileChooserConfirmation", "Gtk.FileChooserError", "Gtk.FileFilter", "Gtk.FileFilterFlags", "Gtk.GestureSingle", "Gtk.IconInfo", "Gtk.IconLookupFlags", "Gtk.IconSize", "Gtk.IconThemeError", "Gtk.IconViewDropPosition", "Gtk.ImageType", "Gtk.InputHints", "Gtk.InputPurpose", "Gtk.JunctionSides", "Gtk.Justification", "Gtk.LevelBarMode", "Gtk.License", "Gtk.MenuDirectionType", "Gtk.MessageType", "Gtk.Misc", "Gtk.MovementStep", "Gtk.NotebookTab", "Gtk.NumberUpLayout", "Gtk.Orientable", "Gtk.Orientation", "Gtk.PackDirection", "Gtk.PackType", "Gtk.PadActionType", "Gtk.PageOrientation", "Gtk.PageSet", "Gtk.PanDirection", "Gtk.PlacesOpenFlags", "Gtk.PolicyType", "Gtk.PopoverConstraint", "Gtk.PositionType", "Gtk.PrintDuplex", "Gtk.PrintError", "Gtk.PrintOperationAction", "Gtk.PrintOperationPreview", "Gtk.PrintOperationResult", "Gtk.PrintPages", "Gtk.PrintQuality", "Gtk.PrintStatus", "Gtk.PropagationPhase", "Gtk.RecentChooser", "Gtk.RecentChooserError", "Gtk.RecentFilterFlags", "Gtk.RecentInfo", "Gtk.RecentManagerError", "Gtk.RecentSortType", "Gtk.RegionFlags", "Gtk.ReliefStyle", "Gtk.ResizeMode", "Gtk.RevealerTransitionType", "Gtk.Scrollable", "Gtk.ScrollablePolicy", "Gtk.ScrollStep", "Gtk.ScrollType", "Gtk.SelectionMode", "Gtk.SensitivityType", "Gtk.ShadowType", "Gtk.ShortcutLabel", "Gtk.ShortcutType", "Gtk.SizeGroupMode", "Gtk.SizeRequestMode", "Gtk.SortType", "Gtk.SpinButtonUpdatePolicy", "Gtk.SpinType", "Gtk.StackTransitionType", "Gtk.StateFlags", "Gtk.StyleContextPrintFlags", "Gtk.StyleProperties", "Gtk.StyleProvider", "Gtk.TargetFlags", "Gtk.TextAttributes", "Gtk.TextChildAnchor", "Gtk.TextDirection", "Gtk.TextExtendSelection", "Gtk.TextSearchFlags", "Gtk.TextTagTable", "Gtk.TextViewLayer", "Gtk.TextWindowType", "Gtk.ToolbarStyle", "Gtk.ToolPaletteDragTargets", "Gtk.ToolShell", "Gtk.Tooltip", "Gtk.TreeDragDest", "Gtk.TreeDragSource", "Gtk.TreeModelFlags", "Gtk.TreeViewColumnSizing", "Gtk.TreeViewDropPosition", "Gtk.TreeViewGridLines", "Gtk.Unit", "Gtk.WidgetHelpType", "Gtk.WidgetPath", "Gtk.WindowGroup", "Gtk.WindowPosition", "Gtk.WindowType", "Gtk.WrapMode", ] ignore = [ "Gtk.Activatable", #deprecated since 3.14 "Gtk.Alignment", #deprecated since 3.14 "Gtk.Arrow", #deprecated since 3.10 "Gtk.IconFactory", #deprecated since 3.10 "Gtk.IconSet", #deprecated since 3.10 "Gtk.IconSource", #deprecated since 3.10 "Gtk.ImageMenuItem", #deprecated since 3.10 "Gtk.IMPreeditStyle", #deprecated since 3.10 "Gtk.IMStatusStyle", #deprecated since 3.14 "Gtk.StateType", #deprecated since 3.14 "Gtk.StatusIcon", #deprecated since 3.8 "Gtk.SymbolicColor", ] manual = [ "Atk.Object", "Atk.Role", "cairo.Context", "cairo.FontOptions", "cairo.RectangleInt", "cairo.Region", "cairo.Surface", "Gdk.AnchorHints", "Gdk.Atom", "Gdk.AxisUse", "Gdk.Device", "Gdk.DeviceTool", "Gdk.Display", "Gdk.DragAction", "Gdk.DragContext", "Gdk.DragProtocol", "Gdk.Event", "Gdk.EventButton", "Gdk.EventConfigure", "Gdk.EventCrossing", "Gdk.EventExpose", "Gdk.EventFocus", "Gdk.EventGrabBroken", "Gdk.EventKey", "Gdk.EventMask", "Gdk.EventMotion", "Gdk.EventProperty", "Gdk.EventProximity", "Gdk.EventScroll", "Gdk.EventSelection", "Gdk.EventSequence", "Gdk.EventVisibility", "Gdk.EventWindowState", "Gdk.FrameClock", "Gdk.Geometry", "Gdk.GLContext", "Gdk.Gravity", "Gdk.ModifierIntent", "Gdk.ModifierType", "Gdk.Monitor", "Gdk.Rectangle", "Gdk.RGBA", "Gdk.Screen", "Gdk.Visual", "Gdk.Window", "Gdk.WindowEdge", "Gdk.WindowHints", "Gdk.WindowTypeHint", "GdkPixbuf.Pixbuf", "GdkPixbuf.PixbufAnimation", "Gio.ActionGroup", "Gio.ActionMap", "Gio.AppInfo", "Gio.Application", "Gio.ApplicationFlags", "Gio.Cancellable", "Gio.File", "Gio.Icon", "Gio.ListModel", "Gio.Menu", "Gio.MenuModel", "Gio.MountOperation", "Gio.PasswordSave", "Gio.Permission", "GLib.Error", "GLib.KeyFile", "GLib.Quark", "GLib.Variant", "GLib.VariantType", "GObject.Closure", "GObject.Object", "GObject.Value", "Gtk.Allocation", "Gtk.AppChooser", "Gtk.Border", "Gtk.FileFilterInfo", "Gtk.PadActionEntry", "Gtk.RecentData", "Gtk.Requisition", "Gtk.ResponseType", "Gtk.TargetEntry", "Pango.Alignment", "Pango.AttrList", "Pango.Context", "Pango.Direction", "Pango.EllipsizeMode", "Pango.FontDescription", "Pango.FontFace", "Pango.FontFamily", "Pango.FontMap", "Pango.Language", "Pango.Layout", "Pango.Stretch", "Pango.Style", "Pango.TabArray", "Pango.Underline", "Pango.Variant", "Pango.WrapMode", "xlib.Window", ] [[object]] name = "GObject.ParamSpec" status = "manual" final_type = true [[object]] name = "Gtk.*" status = "generate" [[object.function]] pattern = ".+" [[object.function.parameter]] name = "cr" const = true [[object.function.parameter]] name = "surface" const = true [[object.function]] pattern = "tree_[gs]et_row_drag_data" [[object.function.parameter]] name = "selection_data" const = true [[object.function]] name = "selection_add_targets" #array as pointer ignore = true [[object.function]] name = "target_table_free" #array as pointer ignore = true [[object.function]] name = "target_table_new_from_list" #array as pointer ignore = true [[object.function]] name = "init" #manual ignore = true [[object.function]] name = "main_quit" #manual ignore = true [[object.function]] pattern = "get_(major|minor|micro)_version" assertion = "skip" [[object.function]] pattern = "get_(binary|interface)_age" assertion = "skip" [[object.function]] name = "check_version" assertion = "skip" [[object.function]] pattern = "drag_.+" #manual trait ignore = true [[object.function]] name = "disable_setlocale" assertion = "not-initialized" [[object.function]] name = "test_init" ignore = true # TODO: manually implement [[object.function]] name = "parse_args" ignore = true # TODO: manually implement [[object.function]] name = "init_with_args" ignore = true # TODO: manually implement [[object.function]] name = "init_check" ignore = true # TODO: manually implement [[object.function]] name = "accelerator_parse_with_keycode" manual = true [[object]] name = "Gtk.AboutDialog" status = "generate" generate_builder = true [[object.function]] name = "set_website_label" [[object.function.parameter]] name = "website_label" # Passing `NULL` here seems to influence the rendering code nullable = true [[object.signal]] name = "activate-link" inhibit = true [[object]] name = "Gtk.AccelGroup" status = "generate" manual_traits = ["AccelGroupExtManual"] [[object.function]] name = "query" # It's not a part of public API # See https://mail.gnome.org/archives/commits-list/2012-May/msg07052.html ignore = true [[object.function]] name = "connect" # More convenient implementation manual = true rename = "connect_accel_group" [[object.function]] name = "connect_by_path" # More convenient implementation manual = true rename = "connect_accel_group_by_path" [[object]] name = "Gtk.AccelLabel" status = "generate" generate_builder = true [[object]] name = "Gtk.Actionable" status = "generate" [[object.property]] name = "action-target" #has get/set function generate = ["notify"] [[object]] name = "Gtk.ActionBar" status = "generate" generate_builder = true [[object.child_prop]] name = "pack-type" type = "Gtk.PackType" [[object.child_prop]] name = "position" type = "gint" [[object]] name = "Gtk.Adjustment" status = "generate" generate_builder = true [[object]] name = "Gtk.AppChooserButton" status = "generate" generate_builder = true [[object]] name = "Gtk.AppChooserDialog" status = "generate" generate_builder = true [[object.function]] name = "get_widget" [object.function.return] nullable = false [[object]] name = "Gtk.AppChooserWidget" status = "generate" generate_builder = true [[object]] name = "Gtk.Application" status = "generate" generate_builder = true builder_postprocess = "Application::register_startup_hook(&ret);" trait_name = "GtkApplicationExt" manual_traits = ["gio::ApplicationExtManual"] [[object.function]] name = "new" ignore = true [[object]] name = "Gtk.ApplicationWindow" status = "generate" generate_builder = true [[object.function]] name = "new" ignore = true [[object]] name = "Gtk.AspectFrame" status = "generate" generate_builder = true [[object]] name = "Gtk.Assistant" status = "generate" generate_builder = true [[object.child_prop]] name = "complete" type = "gboolean" [[object.child_prop]] name = "has-padding" type = "gboolean" [[object.child_prop]] name = "page-type" type = "Gtk.AssistantPageType" [[object.child_prop]] name = "title" type = "utf8" [[object.function]] name = "get_page_has_padding" rename = "page_has_padding" [[object.function]] name = "get_page_complete" rename = "page_is_complete" [[object]] name = "Gtk.Box" status = "generate" generate_builder = true [[object.child_prop]] name = "expand" type = "gboolean" [[object.child_prop]] name = "fill" type = "gboolean" [[object.child_prop]] name = "pack-type" type = "Gtk.PackType" [[object.child_prop]] name = "padding" type = "guint" [[object.child_prop]] name = "position" type = "gint" [[object.function]] name = "get_child_non_homogeneous" rename = "child_is_non_homogeneous" [[object.function]] name = "get_child_secondary" rename = "child_is_secondary" [[object]] name = "Gtk.Buildable" status = "generate" manual_traits = ["BuildableExtManual"] [[object.function]] pattern = "[gs]et_name" ignore = true doc_trait_name = "BuildableExtManual" [[object]] name = "Gtk.Builder" status = "generate" manual_traits = ["BuilderExtManual"] [[object.function]] pattern = ".+_from_file" #path ignore = true doc_trait_name = "BuilderExtManual" [[object.function]] name = "connect_signals_full" # Connect object and swapped signal not supported manual = true [[object.function]] name = "get_object" #downcast ignore = true doc_trait_name = "BuilderExtManual" [[object.function]] pattern = "add_from_.+" #non-boolean return code manual = true doc_trait_name = "BuilderExtManual" [[object.function]] pattern = "add_objects_from_.+" #non-boolean return code manual = true doc_trait_name = "BuilderExtManual" [[object.function]] pattern = "extend_with_template" #non-boolean return code manual = true doc_trait_name = "BuilderExtManual" [[object]] name = "Gtk.Button" status = "generate" generate_builder = true [[object]] name = "Gtk.ButtonBox" status = "generate" generate_builder = true [[object.function]] name = "get_child_non_homogeneous" rename = "child_is_non_homogeneous" [[object.function]] name = "get_child_secondary" rename = "child_is_secondary" [[object]] name = "Gtk.Calendar" status = "generate" generate_builder = true [[object.function]] name = "get_day_is_marked" rename = "day_is_marked" [[object]] name = "Gtk.CellArea" status = "generate" [[object.function]] name = "render" [[object.function.parameter]] name = "cr" # cairo::Context is reference-counted const = true [[object.function]] name = "apply_attributes" [[object.function.parameter]] name = "iter" const = true [[object.function]] name = "activate_cell" [[object.function.parameter]] name = "event" const = true [[object.function]] name = "event" [[object.function.parameter]] name = "event" const = true [[object.signal]] name = "add-editable" [[object.signal.parameter]] name = "path" transformation = "treepath" [[object.signal]] name = "apply-attributes" [[object.signal.parameter]] name = "iter" transformation = "borrow" [[object.signal]] name = "focus-changed" [[object.signal.parameter]] name = "path" transformation = "treepath" [[object]] name = "Gtk.CellAreaBox" status = "generate" generate_builder = true [[object]] name = "Gtk.CellEditable" status = "generate" [[object.function]] name = "start_editing" [[object.function.parameter]] name = "event" const = true [[object]] name = "Gtk.CellRenderer" status = "generate" generate_builder = true [[object.function]] name = "render" [[object.function.parameter]] name = "cr" # cairo::Context is reference-counted const = true [[object.function]] name = "activate" [[object.function.parameter]] name = "event" const = true [[object.function]] name = "start_editing" [[object.function.parameter]] name = "event" const = true [[object.signal]] name = "editing-started" [[object.signal.parameter]] name = "path" transformation = "treepath" [[object]] name = "Gtk.CellRendererAccel" status = "generate" generate_builder = true [[object.signal]] name = "accel-cleared" [[object.signal.parameter]] name = "path_string" transformation = "treepath" new_name = "path" [[object.signal]] name = "accel-edited" [[object.signal.parameter]] name = "path_string" transformation = "treepath" new_name = "path" [[object]] name = "Gtk.CellRendererCombo" status = "generate" generate_builder = true [[object.signal]] name = "changed" [[object.signal.parameter]] name = "new_iter" transformation = "borrow" [[object.signal.parameter]] name = "path_string" transformation = "treepath" new_name = "path" [[object]] name = "Gtk.CellRendererPixbuf" status = "generate" generate_builder = true manual_traits = ["CellRendererPixbufExtManual"] [[object.property]] name = "surface" [[object.property]] name = "stock-size" #value ImageSize generate = ["notify"] doc_trait_name = "CellRendererPixbufExtManual" [[object]] name = "Gtk.CellRendererProgress" status = "generate" generate_builder = true [[object]] name = "Gtk.CellRendererSpin" status = "generate" generate_builder = true [[object]] name = "Gtk.CellRendererSpinner" status = "generate" generate_builder = true [[object]] name = "Gtk.CellRendererText" status = "generate" generate_builder = true [[object.signal]] name = "edited" [[object.signal.parameter]] name = "path" transformation = "treepath" [[object]] name = "Gtk.CellRendererToggle" status = "generate" generate_builder = true [[object.signal]] name = "toggled" [[object.signal.parameter]] name = "path" transformation = "treepath" [[object]] name = "Gtk.CellView" status = "generate" generate_builder = true [[object.function]] name = "set_displayed_row" [[object.function.parameter]] name = "path" nullable = false [[object]] name = "Gtk.CheckButton" status = "generate" generate_builder = true [[object]] name = "Gtk.CheckMenuItem" status = "generate" generate_builder = true [[object]] name = "Gtk.Clipboard" status = "generate" [[object.function]] name = "get" [object.function.return] nullable = false [[object.function]] name = "get_for_display" [object.function.return] nullable = false [[object.function]] name = "set_can_store" #array with size ignore = true [[object.function]] name = "request_targets" #array with size ignore = true [[object.function]] name = "request_uris" #array with size ignore = true [[object.function]] name = "set_with_data" #array with size ignore = true [[object.function]] name = "set_with_owner" #array with size ignore = true [[object.function]] name = "request_image" [[object.function.parameter]] name = "callback" [[object.function.parameter.callback_parameter]] name = "pixbuf" nullable = true [[object]] name = "Gtk.ColorButton" status = "generate" generate_builder = true manual_traits = ["ColorButtonExtManual"] [[object.function]] name = "new_with_color" #totally doc_trait_name = "ColorButtonExtManual" [[object.function]] name = "get_color" manual = true doc_trait_name = "ColorButtonExtManual" [[object.function]] name = "set_color" manual = true doc_trait_name = "ColorButtonExtManual" [[object]] name = "Gtk.ColorChooser" status = "generate" manual_traits = ["ColorChooserExtManual"] [[object.function]] name = "add_palette" #array with size manual = true doc_trait_name = "ColorChooserExtManual" [[object]] name = "Gtk.ColorChooserDialog" status = "generate" generate_builder = true [[object]] name = "Gtk.ColorChooserWidget" status = "generate" generate_builder = true [[object]] name = "Gtk.ComboBox" status = "generate" generate_builder = true manual_traits = ["ComboBoxExtManual"] [[object.function]] name = "set_active_iter" [[object.function.parameter]] name = "iter" const = true [[object.function]] name = "set_active" manual = true doc_trait_name = "ComboBoxExtManual" [[object.function]] name = "get_active" manual = true doc_trait_name = "ComboBoxExtManual" [[object.property]] name = "active" #manual Option generate = ["notify"] [[object]] name = "Gtk.ComboBoxText" status = "generate" generate_builder = true [[object]] name = "Gtk.Container" status = "generate" manual_traits = ["ContainerExtManual"] [[object.function]] pattern = "child_[gs]et_property" manual = true [[object.function]] name = "propagate_draw" [[object.function.parameter]] name = "cr" # cairo::Context is reference-counted const = true [[object]] name = "Gtk.Dialog" status = "generate" generate_builder = true manual_traits = ["DialogExtManual"] [[object.function]] name = "add_buttons" manual = true [[object.function]] name = "add_button" [object.function.return] nullable = false [[object.function]] name = "get_action_area" [object.function.return] nullable = false [[object.function]] name = "get_content_area" [object.function.return] nullable = false [[object.function]] name = "run" [object.function.return] type = "Gtk.ResponseType" [[object.function]] name = "get_response_for_widget" [object.function.return] type = "Gtk.ResponseType" [[object]] name = "Gtk.DrawingArea" status = "generate" generate_builder = true [[object]] name = "Gtk.Editable" status = "generate" manual_traits = ["EditableSignals"] [[object.signal]] pattern = ".+" ignore = true #out #manual doc_trait_name = "EditableSignals" [[object]] name = "Gtk.Entry" status = "generate" generate_builder = true manual_traits = ["EntryExtManual"] [[object.function]] name = "get_buffer" [object.function.return] nullable = false [[object.function]] name = "get_icon_activatable" rename = "icon_is_activatable" [[object.function]] name = "get_icon_sensitive" rename = "icon_is_sensitive" [[object.function]] name = "get_invisible_char" manual = true doc_trait_name = "EntryExtManual" [[object.function]] name = "get_text" [object.function.return] nullable = false [[object.function]] name = "set_invisible_char" [[object.function.parameter]] name = "ch" nullable = true [[object.function]] name = "set_placeholder_text" [[object.function.parameter]] name = "text" nullable = true [[object.function]] name = "im_context_filter_keypress" [[object.function.parameter]] name = "event" const = true [[object.function]] name = "set_tabs" [[object.function.parameter]] name = "tabs" const = true [[object]] name = "Gtk.EntryBuffer" status = "manual" generate_builder = true [[object]] name = "Gtk.EntryCompletion" status = "generate" generate_builder = true manual_traits = ["EntryCompletionExtManual"] [[object.signal]] name = "insert-prefix" inhibit = true [[object.signal]] name = "match-selected" inhibit = true [[object.signal]] name = "cursor-on-match" inhibit = true [[object.function]] name = "get_entry" manual = true doc_trait_name = "EntryCompletionExtManual" [[object]] name = "Gtk.EventBox" status = "generate" generate_builder = true [[object]] name = "Gtk.EventControllerKey" status = "generate" version = "3.24" [[object]] name = "Gtk.EventControllerMotion" status = "generate" version = "3.24" [[object]] name = "Gtk.EventControllerScroll" status = "generate" version = "3.24" [[object]] name = "Gtk.EventControllerScrollFlags" status = "generate" version = "3.24" [[object]] name = "Gtk.Expander" status = "generate" generate_builder = true [[object.function]] name = "new" [[object.function.parameter]] name = "label" nullable = true [[object.function]] name = "new_with_mnemonic" [[object.function.parameter]] name = "label" nullable = false [[object]] name = "Gtk.FileChooser" status = "generate" manual_traits = ["FileChooserExtManual"] [[object.function]] name = "add_choice" manual = true # rust-ify the options param [[object]] name = "Gtk.FileChooserButton" status = "generate" generate_builder = true [[object]] name = "Gtk.FileChooserDialog" status = "generate" generate_builder = true [[object]] name = "Gtk.FileChooserNative" status = "generate" generate_builder = true [[object]] name = "Gtk.FileChooserWidget" status = "generate" generate_builder = true [[object]] name = "Gtk.FileChooserWidgetAccessible" status = "generate" [[object]] name = "Gtk.Fixed" status = "generate" generate_builder = true manual_traits = ["FixedExtManual"] [[object]] name = "Gtk.FlowBox" status = "generate" generate_builder = true manual_traits = ["FlowBoxExtManual"] [[object.function]] name = "bind_model" [[object.function.parameter]] name = "create_widget_func" # we add a manual unbind() function instead nullable = false [[object]] name = "Gtk.FlowBoxChild" status = "generate" generate_builder = true [[object]] name = "Gtk.FontButton" status = "generate" generate_builder = true [[object]] name = "Gtk.FontChooser" status = "generate" [[object.property]] name = "level" version = "3.24" [[object.property]] name = "font-features" version = "3.24" [[object.property]] name = "language" version = "3.24" [[object]] name = "Gtk.FontChooserDialog" status = "generate" generate_builder = true [[object]] name = "Gtk.FontChooserLevel" status = "generate" version = "3.24" [[object]] name = "Gtk.FontChooserWidget" status = "generate" generate_builder = true [[object]] name = "Gtk.Frame" status = "generate" generate_builder = true [[object]] name = "Gtk.Gesture" status = "generate" [[object.function]] pattern = ".+" [[object.function.parameter]] name = "sequence" const = true [[object.function]] name = "group" # Precise the purpose and avoid clash with `get_group`. rename = "group_with" [[object.signal]] name = "begin" [[object.signal.parameter]] name = "sequence" nullable = true [[object.signal]] name = "end" [[object.signal.parameter]] name = "sequence" nullable = true [[object.signal]] name = "update" [[object.signal.parameter]] name = "sequence" nullable = true [[object.signal]] name = "cancel" [[object.signal.parameter]] name = "sequence" nullable = true [[object.signal]] name = "sequence-state-changed" [[object.signal.parameter]] name = "sequence" nullable = true [[object]] name = "Gtk.GestureDrag" status = "generate" generate_builder = true [[object]] name = "Gtk.GestureLongPress" status = "generate" generate_builder = true [[object]] name = "Gtk.GestureMultiPress" status = "generate" generate_builder = true [[object]] name = "Gtk.GesturePan" status = "generate" generate_builder = true [[object]] name = "Gtk.GestureRotate" status = "generate" generate_builder = true [[object]] name = "Gtk.GestureStylus" status = "generate" version = "3.24" manual_traits = ["GestureStylusExtManual"] [[object.function]] name = "get_axes" manual = true [[object]] name = "Gtk.GestureSwipe" status = "generate" generate_builder = true [[object]] name = "Gtk.GestureZoom" status = "generate" generate_builder = true [[object]] name = "Gtk.GLArea" status = "generate" generate_builder = true module_name = "gl_area" [[object.signal]] pattern = "render" inhibit = true [[object.signal]] name = "create-context" [object.signal.return] nullable = true [[object]] name = "Gtk.Grid" status = "generate" generate_builder = true child_name = "cell" [[object.child_prop]] name = "height" type = "gint" [[object.child_prop]] name = "width" type = "gint" [[object.child_prop]] name = "left-attach" type = "gint" [[object.child_prop]] name = "top-attach" type = "gint" [[object]] name = "Gtk.HeaderBar" status = "generate" generate_builder = true [[object.child_prop]] name = "pack-type" type = "Gtk.PackType" [[object.child_prop]] name = "position" type = "gint" [[object]] name = "Gtk.HeaderBarAccessible" status = "generate" generate_builder = true [[object]] name = "Gtk.IconTheme" status = "generate" [[object.function]] name = "set_search_path" ignore = true [[object.function]] name = "choose_icon" ignore = true [[object.function]] name = "choose_icon_for_scale" ignore = true [[object.function]] name = "get_icon_sizes" #array ignore = true [[object.function]] name = "get_search_path" #array ignore = true [[object]] name = "Gtk.IconView" status = "generate" generate_builder = true [[object.function]] name = "enable_model_drag_dest" #array with size ignore = true [[object.function]] name = "enable_model_drag_source" #array with size ignore = true [[object.function]] pattern = ".+" [[object.function.parameter]] name = "path" const = true [[object]] name = "Gtk.Image" status = "generate" generate_builder = false # "icon-size" field should be gint manual_traits = ["ImageExtManual"] [[object.function]] name = "new_from_surface" [[object.function.parameter]] name = "surface" # cairo::Surface is reference-counted const = true [[object.function]] name = "set_from_surface" [[object.function.parameter]] name = "surface" # cairo::Surface is reference-counted const = true [[object.function]] name = "get_icon_name" #can return NULL string ignore = true [[object.property]] name = "icon-size" ignore = true # Has to call conversions to int [[object.property]] name = "surface" [[object.property]] name = "icon-set" #value IconSet ignore = true [[object.function]] name = "get_stock" # wrong out parameter mutability and deprecated anyway ignore = true [[object]] name = "Gtk.IMContext" status = "generate" [[object.function]] name = "filter_keypress" [[object.function.parameter]] name = "event" const = true [[object]] name = "Gtk.IMContextSimple" status = "generate" generate_builder = true manual_traits = ["IMContextSimpleExtManual"] [[object.function]] name = "add_compose_file" manual = true doc_trait_name = "IMContextSimpleExtManual" [[object.function]] name = "add_table" ignore = true # We don't understand API [[object]] name = "Gtk.IMMulticontext" status = "generate" generate_builder = true [[object]] name = "Gtk.InfoBar" status = "generate" generate_builder = true [[object.property]] name = "revealed" [[object.function]] name = "get_content_area" [object.function.return] nullable = false [[object.function]] name = "get_action_area" [[object]] name = "Gtk.Invisible" status = "generate" generate_builder = true manual_traits = ["InvisibleExtManual"] [[object.function]] name = "get_screen" manual = true doc_trait_name = "InvisibleExtManual" [[object]] name = "Gtk.Label" status = "generate" generate_builder = true [[object.function]] name = "new_with_mnemonic" [[object.function.parameter]] name = "str" nullable = false [[object.function]] name = "get_label" [object.function.return] nullable = false [[object.function]] name = "get_text" [object.function.return] nullable = false [[object.signal]] name = "activate-link" inhibit = true [[object]] name = "Gtk.Layout" status = "generate" generate_builder = true [[object.child_prop]] name = "x" type = "gint" [[object.child_prop]] name = "y" type = "gint" [[object]] name = "Gtk.LevelBar" status = "generate" generate_builder = true [[object]] name = "Gtk.LinkButton" status = "generate" generate_builder = true [[object.function]] name = "new_with_label" [[object.function.parameter]] name = "label" nullable = false [[object.signal]] name = "activate-link" inhibit = true [[object]] name = "Gtk.ListBox" status = "generate" generate_builder = true manual_traits = ["ListBoxExtManual"] [[object.function]] name = "bind_model" [[object.function.parameter]] name = "create_widget_func" # we add a manual unbind() function instead nullable = false [[object]] name = "Gtk.ListBoxRow" status = "generate" generate_builder = true [[object]] name = "Gtk.ListStore" status = "generate" trait_name = "GtkListStoreExt" manual_traits = ["GtkListStoreExtManual"] [[object.function]] pattern = ".+" [[object.function.parameter]] name = "iter" const = true [[object.function.parameter]] name = "sibling" const = true [[object.function.parameter]] name = "position" const = true [[object.function]] name = "swap" [[object.function.parameter]] name = "a" const = true [[object.function.parameter]] name = "b" const = true [[object.function]] name = "reorder" manual = true doc_trait_name = "GtkListStoreExtManual" [[object.function]] name = "set" manual = true doc_trait_name = "GtkListStoreExtManual" [[object.function]] name = "set_value" manual = true doc_trait_name = "GtkListStoreExtManual" [[object]] name = "Gtk.LockButton" status = "generate" generate_builder = true [[object]] name = "Gtk.Menu" status = "generate" generate_builder = true child_type = "Gtk.MenuItem" child_name = "item" trait_name = "GtkMenuExt" manual_traits = ["GtkMenuExtManual"] [[object.child_prop]] name = "bottom-attach" type = "gint" [[object.child_prop]] name = "left-attach" type = "gint" [[object.child_prop]] name = "right-attach" type = "gint" [[object.child_prop]] name = "top-attach" type = "gint" [[object.function]] name = "attach_to_widget" ignore = true # TODO: figure out [[object]] name = "Gtk.MenuBar" status = "generate" generate_builder = true [[object]] name = "Gtk.MenuButton" status = "generate" generate_builder = true [[object]] name = "Gtk.MenuItem" status = "generate" generate_builder = true trait_name = "GtkMenuItemExt" [[object.function]] name = "activate" ignore = true [[object]] name = "Gtk.MenuShell" status = "generate" [[object.signal]] name = "move-selected" inhibit = true [[object]] name = "Gtk.MenuToolButton" status = "generate" generate_builder = true [[object]] name = "Gtk.MessageDialog" status = "generate" generate_builder = true [[object.function]] name = "get_message_area" [object.function.return] nullable = false [[object]] name = "Gtk.ModelButton" status = "generate" generate_builder = true [[object]] name = "Gtk.MountOperation" status = "generate" trait_name = "GtkMountOperationExt" generate_builder = true [[object]] name = "Gtk.NativeDialog" status = "generate" manual_traits = ["NativeDialogExtManual"] [[object.function]] name = "run" [object.function.return] type = "Gtk.ResponseType" [[object]] name = "Gtk.Notebook" status = "generate" generate_builder = true manual_traits = ["NotebookExtManual"] # The following functions need integer type adjustments [[object.function]] name = "append_page" manual = true doc_trait_name = "NotebookExtManual" [[object.function]] name = "append_page_menu" manual = true doc_trait_name = "NotebookExtManual" [[object.function]] name = "get_current_page" manual = true doc_trait_name = "NotebookExtManual" [[object.function]] name = "get_n_pages" manual = true doc_trait_name = "NotebookExtManual" [[object.function]] name = "get_nth_page" manual = true doc_trait_name = "NotebookExtManual" [[object.function]] name = "get_tab_detachable" rename = "tab_is_detachable" [[object.function]] name = "get_tab_reorderable" rename = "tab_is_reorderable" [[object.function]] name = "insert_page" manual = true doc_trait_name = "NotebookExtManual" [[object.function]] name = "insert_page_menu" manual = true doc_trait_name = "NotebookExtManual" [[object.function]] name = "page_num" manual = true doc_trait_name = "NotebookExtManual" [[object.function]] name = "prepend_page" manual = true doc_trait_name = "NotebookExtManual" [[object.function]] name = "prepend_page_menu" manual = true doc_trait_name = "NotebookExtManual" [[object.function]] name = "remove_page" manual = true doc_trait_name = "NotebookExtManual" [[object.function]] name = "reorder_child" manual = true doc_trait_name = "NotebookExtManual" [[object.function]] name = "set_current_page" manual = true doc_trait_name = "NotebookExtManual" [[object.child_prop]] name = "detachable" type = "gboolean" [[object.child_prop]] name = "menu-label" type = "utf8" [[object.child_prop]] name = "position" type = "gint" [[object.child_prop]] name = "reorderable" type = "gboolean" [[object.child_prop]] name = "tab-expand" rename_getter = "tab_expands" type = "gboolean" [[object.child_prop]] name = "tab-fill" rename_getter = "tab_fills" type = "gboolean" [[object.child_prop]] name = "tab-label" type = "utf8" [[object]] name = "Gtk.OffscreenWindow" status = "generate" generate_builder = true [[object]] name = "Gtk.Overlay" status = "generate" generate_builder = true manual_traits = ["OverlaySignals"] [[object.child_prop]] name = "index" type = "gint" [[object]] name = "Gtk.PadController" status = "generate" generate_builder = true [[object.function]] name = "set_action_entries" manual = true [[object]] name = "Gtk.PageRange" status = "manual" boxed_inline = true [[object]] name = "Gtk.PageSetup" status = "generate" [[object.function]] name = "get_paper_size" [object.function.return] nullable = false [[object.function]] pattern = "set_paper_size.*" [[object.function.parameter]] name = "size" const = true [[object]] name = "Gtk.Paned" status = "generate" generate_builder = true [[object.child_prop]] name = "resize" type = "gboolean" [[object.child_prop]] name = "shrink" type = "gboolean" [[object]] name = "Gtk.PaperSize" status = "generate" [[object.function]] pattern = "(get|is)_.*" [[object.function.parameter]] name = "size" const = true [[object.function]] name = "is_equal" [[object.function.parameter]] name = "size1" const = true [[object.function.parameter]] name = "size2" const = true [[object]] name = "Gtk.PlacesSidebar" status = "generate" generate_builder = true [[object.signal]] name = "drag-action-requested" #[gio::File] ignore = true [[object.signal]] name = "drag-perform-drop" #[gio::File] ignore = true [[object]] name = "Gtk.Plug" status = "generate" generate_builder = true cfg_condition = "gdk_backend = \"x11\"" [[object]] name = "Gtk.PlugAccessible" status = "generate" generate_builder = true cfg_condition = "gdk_backend = \"x11\"" [[object]] name = "Gtk.Popover" status = "generate" generate_builder = true [[object]] name = "Gtk.PopoverMenu" status = "generate" generate_builder = true [[object.child_prop]] name = "position" type = "gint" [[object.child_prop]] name = "submenu" type = "utf8" [[object]] name = "Gtk.PrintContext" status = "generate" [[object.function]] name = "set_cairo_context" [[object.function.parameter]] name = "cr" # cairo::Context is reference-counted const = true [[object]] name = "Gtk.PrintOperation" status = "generate" generate_builder = true [[object.function]] name = "get_error" # It quacks like a fallible function, but it isn't. ignore = true [[object]] name = "Gtk.PrintSettings" status = "generate" [[object.function]] name = "get_bool" # Retrieves the bool value of a setting rename = "bool" [[object.function]] name = "get_paper_size" [object.function.return] nullable = false [[object.function]] name = "set_page_ranges" manual = true [[object.function]] name = "set_paper_size" [[object.function.parameter]] name = "paper_size" const = true [[object]] name = "Gtk.ProgressBar" status = "generate" generate_builder = true [[object]] name = "Gtk.RadioButton" status = "generate" generate_builder = true [[object.function]] pattern = ".+_from_widget" [[object.function.parameter]] name = "radio_group_member" nullable = false [[object.function]] name = "new" manual = true [[object.function]] name = "new_with_label" manual = true [[object.function]] name = "new_with_mnemonic" manual = true [[object.function]] name = "set_group" ignore = true [[object.property]] name = "group" ignore = true [[object]] name = "Gtk.RadioMenuItem" status = "generate" generate_builder = true [[object.function]] pattern = ".+_from_widget" [[object.function.parameter]] name = "group" nullable = false [[object.function]] name = "new" manual = true [[object.function]] name = "new_with_label" manual = true [[object.function]] name = "new_with_mnemonic" manual = true [[object.function]] name = "set_group" ignore = true [[object.property]] name = "group" ignore = true [[object]] name = "Gtk.RadioToolButton" status = "generate" generate_builder = true [[object.function]] pattern = ".+_from_widget" [[object.function.parameter]] name = "group" nullable = false [[object.function]] name = "new" manual = true [[object.function]] name = "new_from_stock" manual = true [[object.function]] name = "set_group" ignore = true [[object.property]] name = "group" ignore = true [[object]] name = "Gtk.Range" status = "generate" [[object.function]] name = "get_adjustment" [object.function.return] nullable = false [[object.signal]] name = "change-value" inhibit = true [[object]] name = "Gtk.RecentChooserDialog" status = "generate" generate_builder = true [[object]] name = "Gtk.RecentChooserMenu" status = "generate" generate_builder = true [[object]] name = "Gtk.RecentChooserWidget" status = "generate" generate_builder = true [[object]] name = "Gtk.RecentFilter" status = "generate" [[object.function]] name = "filter" ignore = true # TODO: renable once RecentFilterInfo is implemented [[object]] name = "Gtk.RecentManager" status = "generate" generate_builder = true [[object]] name = "Gtk.Revealer" status = "generate" generate_builder = true [[object]] name = "Gtk.Scale" status = "generate" generate_builder = true [[object]] name = "Gtk.ScaleButton" status = "generate" generate_builder = true [[object.function]] name = "get_adjustment" [object.function.return] nullable = false [[object]] name = "Gtk.Scrollbar" status = "generate" generate_builder = true [[object]] name = "Gtk.ScrolledWindow" status = "generate" generate_builder = true [[object.function]] name = "get_hadjustment" [object.function.return] nullable = false [[object.function]] name = "get_vadjustment" [object.function.return] nullable = false [[object]] name = "Gtk.SearchBar" status = "generate" generate_builder = true [[object.function]] name = "handle_event" [[object.function.parameter]] name = "event" const = true [[object]] name = "Gtk.SearchEntry" status = "generate" generate_builder = true [[object.function]] name = "handle_event" [[object.function.parameter]] name = "event" const = true [[object]] name = "Gtk.SelectionData" status = "generate" [[object.function]] name = "get_data_type" [object.function.return] nullable = false [[object.function]] name = "get_selection" [object.function.return] nullable = false [[object.function]] name = "get_target" [object.function.return] nullable = false [[object.function]] name = "set_pixbuf" [[object.function.parameter]] name = "selection_data" const = true [[object.function]] name = "set_text" [[object.function.parameter]] name = "selection_data" const = true [[object.function]] name = "set" [[object.function.parameter]] name = "selection_data" const = true [[object.function]] name = "set_uris" [[object.function.parameter]] name = "selection_data" const = true [[object.function]] name = "get_data" #array without length manual = true [[object.function]] name = "get_data_with_length" ignore = true [[object]] name = "Gtk.Separator" status = "generate" generate_builder = true [[object]] name = "Gtk.SeparatorMenuItem" status = "generate" generate_builder = true [[object]] name = "Gtk.SeparatorToolItem" status = "generate" generate_builder = true [[object]] name = "Gtk.Settings" status = "generate" trait_name = "GtkSettingsExt" [[object.function]] pattern = "install_property.*" #deprecated in 3.16 ignore = true [[object.property]] name = "gtk-cursor-aspect-ratio" version = "3.24" [[object]] name = "Gtk.ShortcutsGroup" status = "generate" generate_builder = true [[object]] name = "Gtk.ShortcutsSection" status = "generate" generate_builder = true [[object]] name = "Gtk.ShortcutsShortcut" status = "generate" generate_builder = true [[object]] name = "Gtk.ShortcutsWindow" status = "generate" generate_builder = true [[object]] name = "Gtk.SizeGroup" status = "generate" generate_builder = true [[object]] name = "Gtk.Socket" status = "generate" generate_builder = true cfg_condition = "gdk_backend = \"x11\"" trait_name = "GtkSocketExt" [[object]] name = "Gtk.SocketAccessible" status = "generate" generate_builder = true cfg_condition = "gdk_backend = \"x11\"" [[object]] name = "Gtk.SpinButton" status = "generate" generate_builder = true manual_traits = ["SpinButtonSignals"] [[object.function]] name = "get_adjustment" [object.function.return] nullable = false [[object.signal]] pattern = ".+" #manual #out #not_standard_return ignore = true [[object]] name = "Gtk.Spinner" status = "generate" generate_builder = true [[object]] name = "Gtk.Stack" status = "generate" generate_builder = true [[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.function]] name = "get_interpolate_size" rename = "interpolates_size" [[object]] name = "Gtk.StackSidebar" status = "generate" generate_builder = true [[object]] name = "Gtk.StackSwitcher" status = "generate" generate_builder = false # "icon-size" property needs to be int internally manual_traits = ["StackSwitcherExtManual"] [[object.property]] name = "icon-size" ignore = true # "icon-size" needs conversion between IconSize and integer [[object]] name = "Gtk.Statusbar" status = "generate" generate_builder = true [[object]] name = "Gtk.StyleContext" status = "generate" generate_builder = true manual_traits = ["StyleContextExtManual"] [[object.function]] name = "get_property" rename = "style_property_for_state" # avoid collision with ObjectExt::property [[object.function]] name = "get" ignore = true # TODO: manually implement [[object]] name = "Gtk.Switch" status = "generate" generate_builder = true manual_traits = ["SwitchExtManual"] [[object.signal]] name = "state-set" inhibit = true [[object]] name = "Gtk.TargetList" status = "generate" [[object.function]] name = "add_table" #array with size ignore = true [[object.function]] name = "new" #array with size manual = true [[object]] name = "Gtk.TextBuffer" status = "generate" generate_builder = true manual_traits = ["TextBufferExtManual"] [[object.function]] name = "get_insert" # Avoid clash with the `insert` operation. # This one retrieves the insert mark. bypass_auto_rename = true [[object.function]] name = "register_deserialize_tagset" [object.function.return] nullable = false [[object.function]] name = "register_serialize_tagset" [object.function.return] nullable = false [[object.function]] name = "paste_clipboard" [[object.function.parameter]] name = "override_location" const = true [[object.function]] name = "register_serialize_format" # actually returns an array of bytes, not a single byte ignore = true [[object.signal]] name = "apply-tag" # needs mutable TextIters ignore = true doc_trait_name = "TextBufferExtManual" [[object.signal]] name = "delete-range" # needs mutable TextIters ignore = true doc_trait_name = "TextBufferExtManual" [[object.signal]] name = "insert-child-anchor" # needs mutable TextIters ignore = true doc_trait_name = "TextBufferExtManual" [[object.signal]] name = "insert-pixbuf" # needs mutable TextIters ignore = true doc_trait_name = "TextBufferExtManual" [[object.signal]] name = "insert-text" # needs mutable TextIters ignore = true doc_trait_name = "TextBufferExtManual" [[object.signal]] name = "remove-tag" # needs mutable TextIters ignore = true doc_trait_name = "TextBufferExtManual" [[object.function]] name = "create_tag" ignore = true # TODO: figure out once we have varargs [[object.function]] name = "insert_with_tags" ignore = true # TODO: figure out once we have varargs [[object.function]] name = "register_deserialize_format" ignore = true # TODO: manually implement [[object]] name = "Gtk.TextIter" status = "generate" boxed_inline = true [[object.derive]] name = "Debug" [[object.function]] name = "get_attributes" manual = true rename = "is_attributes" [[object.function]] name = "get_char" manual = true [[object]] name = "Gtk.TextMark" status = "generate" generate_builder = true [[object]] name = "Gtk.TextTag" status = "generate" generate_builder = true [[object.function]] name = "event" [[object.function.parameter]] name = "event" const = true [[object.signal]] name = "event" inhibit = true [[object]] name = "Gtk.TextView" status = "generate" generate_builder = true [[object.function]] name = "get_default_attributes" [object.function.return] nullable = false [[object.function]] name = "im_context_filter_keypress" [[object.function.parameter]] name = "event" const = true [[object.function]] name = "set_tabs" [[object.function.parameter]] name = "tabs" const = true [[object.signal]] name = "extend-selection" inhibit = true [[object]] name = "Gtk.ToggleButton" status = "generate" generate_builder = true [[object]] name = "Gtk.ToggleToolButton" status = "generate" generate_builder = true [[object]] name = "Gtk.Toolbar" status = "generate" generate_builder = true child_name = "item" [[object.signal]] name = "popup-context-menu" inhibit = true [[object.child_prop]] name = "expand" type = "gboolean" [[object.child_prop]] name = "homogeneous" type = "gboolean" [[object]] name = "Gtk.ToolButton" status = "generate" generate_builder = true [[object]] name = "Gtk.ToolItem" status = "generate" generate_builder = true [[object.signal]] name = "create-menu-proxy" inhibit = true [[object]] name = "Gtk.ToolItemGroup" status = "generate" generate_builder = true child_type = "Gtk.ToolItem" child_name = "item" [[object.child_prop]] name = "expand" type = "gboolean" [[object.child_prop]] name = "fill" type = "gboolean" [[object.child_prop]] name = "homogeneous" type = "gboolean" [[object.child_prop]] name = "new-row" type = "gboolean" [[object]] name = "Gtk.ToolPalette" status = "generate" generate_builder = true [[object]] name = "Gtk.TreeIter" status = "generate" boxed_inline = true [[object.derive]] name = "Debug" [[object]] name = "Gtk.TreeModel" status = "generate" [[object.function]] pattern = ".+" [[object.function.parameter]] name = "path" const = true [[object.function.parameter]] name = "iter" const = true [[object.function]] name = "filter_new" # Replaced by TreeModelFilter::new ignore = true [[object.function]] name = " sort_new_with_model" # Replaced by TreeModelSort::new ignore = true [[object.function]] name = "iter_children" [[object.function.parameter]] name = "parent" const = true [[object.function]] name = "iter_nth_child" [[object.function.parameter]] name = "parent" const = true [[object.function]] name = "iter_parent" [[object.function.parameter]] name = "child" const = true [[object.function]] name = 'ref_node' ignore = true [[object.function]] name = "rows_reordered" ignore = true [[object.function]] name = 'unref_node' ignore = true [[object]] name = "Gtk.TreeModelFilter" status = "generate" [[object.function]] name = "convert_child_path_to_path" [[object.function.parameter]] name = "child_path" const = true [[object.function]] name = "convert_path_to_child_path" [[object.function.parameter]] name = "filter_path" const = true [[object.function]] name = "convert_iter_to_child_iter" [[object.function.parameter]] name = "filter_iter" const = true [[object.function]] name = "convert_child_iter_to_iter" [[object.function.parameter]] name = "child_iter" const = true [[object.property]] name = "virtual-root" #value recordboxed ignore = true [[object]] name = "Gtk.TreeModelSort" status = "generate" [[object.function]] name = "convert_child_path_to_path" [[object.function.parameter]] name = "child_path" const = true [[object.function]] name = "convert_path_to_child_path" [[object.function.parameter]] name = "sorted_path" const = true [[object.function]] name = "convert_iter_to_child_iter" [[object.function.parameter]] name = "sorted_iter" const = true [[object.function]] name = "convert_child_iter_to_iter" [[object.function.parameter]] name = "child_iter" const = true [[object.function]] name = "iter_is_valid" # Bypass auto-rename so as to avoid automatic is prefixing bypass_auto_rename = true [[object.function.parameter]] name = "iter" const = true [[object.function]] name = "get_model" [object.function.return] nullable = false [[object.function]] name = "new_with_model" rename = "new" [[object]] name = "Gtk.TreePath" status = "generate" [[object.function]] name = "get_depth" [[object.function.parameter]] name = "path" const = true [[object.function]] name = "is_ancestor" [[object.function.parameter]] name = "path" const = true [[object.function.parameter]] name = "descendant" const = true [[object.function]] name = "is_descendant" [[object.function.parameter]] name = "path" const = true [[object.function.parameter]] name = "ancestor" const = true [[object.function]] name = "get_indices" manual = true [[object.function]] name = "to_string" [[object.function.parameter]] name = "path" const = true [[object]] name = "Gtk.TreeRowReference" status = "generate" [[object.function]] name = "new" [[object.function.parameter]] name = "path" const = true [object.function.return] nullable = true [[object.function]] name = "new_proxy" [[object.function.parameter]] name = "path" const = true [object.function.return] nullable = true [[object.function]] name = "get_model" [[object.function.parameter]] name = "reference" const = true [object.function.return] nullable = false [[object.function]] name = "get_path" [[object.function.parameter]] name = "reference" const = true [[object.function]] name = "valid" [[object.function.parameter]] name = "reference" const = true [[object.function]] name = "inserted" [[object.function.parameter]] name = "path" const = true [[object.function]] name = "deleted" [[object.function.parameter]] name = "path" const = true [[object]] name = "Gtk.TreeSelection" status = "generate" [[object.function]] pattern = ".+" [[object.function.parameter]] name = "iter" const = true [[object.function.parameter]] name = "path" const = true [[object.function]] pattern = "(un)?select_range" [[object.function.parameter]] name = "start_path" const = true [[object.function.parameter]] name = "end_path" const = true [[object]] name = "Gtk.TreeSortable" status = "generate" manual_traits = ["TreeSortableExtManual"] [[object.function]] pattern = "[gs]et_sort_column_id" manual = true doc_trait_name = "TreeSortableExtManual" [[object.function]] pattern = "set_sort_func" # return type u32 -> Ordering manual = true doc_trait_name = "TreeSortableExtManual" [[object.function]] pattern = "set_default_sort_func" # return type u32 -> Ordering manual = true doc_trait_name = "TreeSortableExtManual" [[object]] name = "Gtk.TreeStore" status = "generate" manual_traits = ["TreeStoreExtManual"] [[object.function]] pattern = ".+" [[object.function.parameter]] name = "iter" const = true [[object.function.parameter]] name = "parent" const = true [[object.function.parameter]] name = "sibling" const = true [[object.function]] name = "is_ancestor" [[object.function.parameter]] name = "descendant" const = true [[object.function]] name = "move_after" [[object.function.parameter]] name = "position" const = true [[object.function]] name = "move_before" [[object.function.parameter]] name = "position" const = true [[object.function]] name = "reorder" manual = true doc_trait_name = "TreeStoreExtManual" [[object.function]] name = "set" manual = true doc_trait_name = "TreeStoreExtManual" [[object.function]] name = "set_value" manual = true doc_trait_name = "TreeStoreExtManual" [[object.function]] name = "swap" [[object.function.parameter]] name = "a" const = true [[object.function.parameter]] name = "b" const = true [[object]] name = "Gtk.TreeView" status = "generate" generate_builder = true [[object.function]] name = "enable_model_drag_dest" #array with size ignore = true [[object.function]] name = "enable_model_drag_source" #array with size ignore = true [[object.function]] pattern = ".+" [[object.function.parameter]] name = "path" const = true [[object.function]] name = "get_selection" [object.function.return] nullable = false [[object.function]] name = "get_hover_expand" rename = "hover_expands" [[object.signal]] pattern = ".+" [[object.signal.parameter]] name = "iter" transformation = "borrow" [[object.signal.parameter]] name = "path" transformation = "borrow" [[object.signal]] pattern = "test-.+" inhibit = true [[object]] name = "Gtk.TreeViewColumn" status = "generate" generate_builder = true [[object.function]] name = "cell_set_cell_data" [[object.function.parameter]] name = "iter" const = true [[object.function]] name = "new_with_attributes" manual = true # va_args rename = "with_attributes" [[object]] name = "Gtk.Viewport" status = "generate" generate_builder = true [[object]] name = "Gtk.VolumeButton" status = "generate" generate_builder = true [[object]] name = "Gtk.Widget" status = "generate" manual_traits = ["WidgetExtManual"] [[object.function]] name = "drag_dest_set" #array with size manual = true doc_trait_name = "WidgetExtManual" [[object.function]] name = "drag_source_set" #array with size manual = true doc_trait_name = "WidgetExtManual" [[object.function]] name = "enable_model_drag_source" #array with size ignore = true [[object.function]] name = "draw" [[object.function.parameter]] name = "cr" # cairo::Context is reference-counted const = true [[object.function]] name = "get_clipboard" [object.function.return] nullable = false [[object.function]] name = "get_device_enabled" rename = "device_is_enabled" [[object.function]] name = "intersect" manual = true doc_trait_name = "WidgetExtManual" [[object.function]] name = "override_font" [[object.function.parameter]] name = "font_desc" nullable = false [[object.function]] pattern = ".+" [[object.function.parameter]] name = "event" const = true [[object.function]] name = "get_path" [object.function.return] nullable = false [[object.function]] name = "add_tick_callback" manual = true doc_trait_name = "WidgetExtManual" [[object.function]] name = "remove_tick_callback" ignore = true [[object.function]] name = "add_events" manual = true doc_trait_name = "WidgetExtManual" [[object.function]] name = "get_events" manual = true doc_trait_name = "WidgetExtManual" [[object.function]] name = "set_events" manual = true doc_trait_name = "WidgetExtManual" [[object.function]] name = "get_sensitive" # Avoid clash with `is_sensitive`. Differences: # - `get_sensitive`: returns the widget `sensitive` property. # - `is_sensitive`: returns whether the widget’s is effectively sensitivity. # meaning that the widget and all its parents are `sensitive`. bypass_auto_rename = true [[object.function]] name = "get_visible" # Avoid clash with `is_visible`. Differences: # - `get_visible`: returns the widget `visible` property. # - `is_visible`: returns whether the widget’s is effectively visibility. # meaning that the widget and all its parents are `visible`. bypass_auto_rename = true [[object.function]] name = "get_hexpand" rename = "hexpands" [[object.function]] name = "get_style_context" [object.function.return] nullable = false [[object.function]] name = "get_vexpand" rename = "vexpands" [[object.function]] name = "size_allocate" [[object.function.parameter]] name = "allocation" const = true [[object.function]] name = "hide_on_delete" # return Inhibit instead of bool manual = true doc_trait_name = "WidgetExtManual" [[object.signal]] name = "button-press-event" inhibit = true [[object.signal]] name = "button-release-event" inhibit = true [[object.signal]] name = "delete-event" inhibit = true [[object.signal]] name = "destroy-event" inhibit = true [[object.signal]] name = "drag-data-get" [[object.signal.parameter]] name = "data" transformation = "borrow" [[object.signal]] name = "drag-failed" inhibit = true [[object.signal]] name = "draw" inhibit = true [[object.signal]] name = "enter-notify-event" inhibit = true [[object.signal]] name = "event" inhibit = true [[object.signal]] name = "focus" inhibit = true [[object.signal]] name = "focus-in-event" inhibit = true [[object.signal]] name = "focus-out-event" inhibit = true [[object.signal]] name = "grab-broken-event" inhibit = true [[object.signal]] name = "key-press-event" inhibit = true [[object.signal]] name = "key-release-event" inhibit = true [[object.signal]] name = "keynav-failed" inhibit = true [[object.signal]] name = "leave-notify-event" inhibit = true [[object.signal]] name = "map-event" inhibit = true ignore = true #manual EventAny doc_trait_name = "WidgetExtManual" [[object.signal]] name = "mnemonic-activate" inhibit = true [[object.signal]] name = "motion-notify-event" inhibit = true [[object.signal]] name = "property-notify-event" inhibit = true [[object.signal]] name = "proximity-in-event" inhibit = true [[object.signal]] name = "proximity-out-event" inhibit = true [[object.signal]] name = "scroll-event" inhibit = true [[object.signal]] name = "selection-clear-event" inhibit = true [[object.signal]] name = "selection-notify-event" inhibit = true [[object.signal]] name = "selection-request-event" inhibit = true [[object.signal]] name = "touch-event" inhibit = true [[object.signal]] name = "unmap-event" inhibit = true ignore = true #manual EventAny doc_trait_name = "WidgetExtManual" [[object.signal]] name = "visibility-notify-event" inhibit = true [[object.signal]] name = "window-state-event" inhibit = true [[object.property]] name = "style" #deprecated ignore = true [[object.property]] name = "events" generate = ["notify"] [[object.function]] name = "input_shape_combine_region" [[object.function.parameter]] name = "region" const = true [[object.function]] name = "shape_combine_region" [[object.function.parameter]] name = "region" const = true [[object.function]] name = "set_name" rename = "set_widget_name" [[object.function]] name = "get_name" rename = "widget_name" [object.function.return] nullable = false [[object.function]] name = "destroy" # needs to be marked as unsafe manual = true [[object.function]] name = "create_pango_context" [object.function.return] nullable = false [[object.function]] name = "create_pango_layout" [object.function.return] nullable = false [[object.function]] name = "get_display" [object.function.return] nullable = false [[object.function]] name = "get_pango_context" [object.function.return] nullable = false [[object]] name = "Gtk.Window" status = "generate" generate_builder = true trait_name = "GtkWindowExt" manual_traits = ["GtkWindowExtManual"] [[object.function]] name = "activate_key" [[object.function.parameter]] name = "event" const = true [[object.function]] name = "propagate_key_event" [[object.function.parameter]] name = "event" const = true [[object.function]] name = "set_geometry_hints" [[object.function.parameter]] name = "geometry" const = true [[object.function]] name = "get_focus" rename = "focused_widget" [[object.signal]] # workaround for https://github.com/gtk-rs/gtk/issues/985 name = "set-focus" [[object.signal.parameter]] name = "object" nullable = true rust-gtk-0.18-0.18.1/LICENSE000066400000000000000000000020001467506176400147620ustar00rootroot00000000000000Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. rust-gtk-0.18-0.18.1/README.md000066400000000000000000000140741467506176400152520ustar00rootroot00000000000000# Rust GTK 3 bindings [Project site](http://gtk-rs.org/) __Rust__ bindings and wrappers for __GTK 3__, part of [gtk3-rs](https://github.com/gtk-rs/gtk3-rs), a multi-platform GUI toolkit. It is a part of [gtk-rs](http://gtk-rs.org/). GTK __3.22.30__ is the lowest supported version for the underlying library. ## Minimum supported Rust version Currently, the minimum supported Rust version is `1.70.0`. ## Building __gtk__ expects __GTK__, __GLib__ and __Cairo__ development files to be installed on your system. See the [GTK installation page](https://www.gtk.org/docs/installations/). ## Using We recommend using [crates from crates.io](https://crates.io/keywords/gtk-rs), as [demonstrated here](http://gtk-rs.org/#using). If you want to track the bleeding edge, use the git dependency instead: ```toml [dependencies] gtk = { git = "https://github.com/gtk-rs/gtk3-rs.git" } ``` Avoid mixing versioned and git crates like this: ```toml # This will not compile [dependencies] gtk = "0.13" gtk = { git = "https://github.com/gtk-rs/gtk3-rs.git" } ``` # "Hello, World!" example program //! GTK needs to be initialized before use by calling [`fn@init`]. Creating an [`struct@Application`] will call [`fn@init`] for you. ```rust,no_run use gtk::prelude::*; use gtk::{Application, ApplicationWindow}; fn main() { let app = Application::builder() .application_id("org.example.HelloWorld") .build(); app.connect_activate(|app| { // We create the main window. let win = ApplicationWindow::builder() .application(app) .default_width(320) .default_height(200) .title("Hello, World!") .build(); // Don't forget to make all widgets visible. win.show_all(); }); app.run(); } ``` # The main loop In a typical GTK application you set up the UI, assign signal handlers and run the main event loop. ```rust,no_run use gtk::prelude::*; use gtk::{Application, ApplicationWindow, Button}; fn main() { let application = Application::builder() .application_id("com.example.FirstGtkApp") .build(); application.connect_activate(|app| { let window = ApplicationWindow::builder() .application(app) .title("First GTK Program") .default_width(350) .default_height(70) .build(); let button = Button::with_label("Click me!"); button.connect_clicked(|_| { eprintln!("Clicked!"); }); window.add(&button); window.show_all(); }); application.run(); } ``` # Threads GTK is not thread-safe. Accordingly, none of this crate's structs implement [`Send`] or [`Sync`]. The thread where [`fn@init`] was called is considered the main thread. OS X has its own notion of the main thread and [`fn@init`] must be called on that thread. After successful initialization, calling any [`gtk`](mod@crate) or [`mod@gdk`] functions (including [`fn@init`]) from other threads will `panic`. Any thread can schedule a closure to be run by the main loop on the main thread via [`fn@glib::idle_add`] or [`fn@glib::timeout_add`]. While working with GTK you might need the [`fn@glib::idle_add_local`] or [`fn@glib::timeout_add_local`] version without the [`Send`] bound. Those may only be called from the main thread. # Panics The [`gtk`](mod@crate) and [`mod@gdk`] crates have some run-time safety and contract checks. - Any constructor or free function will panic if called before [`fn@init`] or on a non-main thread. - Any [`&str`] or [`&Path`](std::path::Path) parameter with an interior null (`\0`) character will cause a panic. - Some functions will panic if supplied out-of-range integer parameters. All such cases will be documented individually but they are not yet. - A panic in a closure that handles signals or in any other closure passed to a [`gtk`](mod@crate) function will abort the process. # Features ## Library versions By default this crate provides only GTK 3.22.30 APIs. You can access additional functionality by selecting one of the `v3_24`, etc. features. `Cargo.toml` example: ```toml [dependencies.gtk] version = "0.x.y" features = ["v3_24"] ``` Take care when choosing the version to target: some of your users might not have easy access to the latest ones. The higher the version, the fewer users will have it installed. ## Documentation Most of this documentation is generated from the C API. Until all parts of the documentation have been reviewed there will be incongruities with the actual Rust API. * [Rust API - Stable](https://gtk-rs.org/gtk3-rs/stable/latest/docs/gtk/) * [Rust API - Development](https://gtk-rs.org/gtk3-rs/git/docs/gtk) * [C API](https://developer.gnome.org/gtk/stable/) * [GTK Installation instructions](https://www.gtk.org/docs/installations/) Generate the docs: ```shell > RUSTFLAGS="--cfg docsrs" cargo doc ``` (if the installed GTK+ version is lower than 3.16, adjust the feature name accordingly). ## Contribute Contributor you're welcome! See the general [bindings documentation](https://gtk-rs.org/gtk-rs-core/stable/latest/docs/glib/). Most of the bindings ([`src/auto`](src/auto)) are generated by [gir](https://github.com/gtk-rs/gir) using [this configuration file](Gir.toml). After editing `Gir.toml` the sources can be regenerated with ```shell > make gir ``` When opening a PR please put the changes to the `src/auto` directory in a separate commit. You may also wish to run `cargo clippy -- -D warnings` and check that you're clean because otherwise you may be surprised when CI fails. ## See Also * [atk](https://crates.io/crates/atk) * [cairo](https://crates.io/crates/cairo-rs) * [gdk](https://crates.io/crates/gdk) * [gdk-pixbuf](https://crates.io/crates/gdk-pixbuf) * [gio](https://crates.io/crates/gio) * [glib](https://crates.io/crates/glib) * [pango](https://crates.io/crates/pango) But also: * [gtk-rs project overview](https://gtk-rs.org) * [General `GLib` family types and object system overview](mod@glib) * [GTK documentation](https://www.gtk.org/docs/) ## License __gtk__ is available under the MIT License, please refer to it. rust-gtk-0.18-0.18.1/build.rs000066400000000000000000000011421467506176400154300ustar00rootroot00000000000000fn main() { check_features(); } fn check_features() { // The pkg-config file defines a `targets` variable listing the // various backends that gdk (yes, gdk) was compiled for. // We extract that and create gdk_backend="x11" and the like // as configuration variables. // For reference, the backend set at time of writing consists of: // x11 win32 quartz broadway wayland if let Ok(targets) = pkg_config::get_variable("gtk+-3.0", "targets") { for target in targets.split_whitespace() { println!("cargo:rustc-cfg=gdk_backend=\"{target}\""); } } } rust-gtk-0.18-0.18.1/release_process.md000066400000000000000000000020431467506176400174640ustar00rootroot00000000000000# Release process Since gtk-rs has multiple crates which have inter-dependencies, it's a bit painful to make a new release. So here are the multiple steps: * Merge `master` branch into `crate` branch in every repository (starting with `sys` and ending with `gtk`). (/!\ `cairo-sys` is in `cairo` repository, not `sys` /!\) * Update crate version in `Cargo.toml` and the number of its `gtk-rs` dependencies. * Open pull requests to `crate` branches to corresponding repositories. * Once pull requests have been merged, publish all crates to `crates.io` (using the `cargo publish` command). * Merge `pending` branch into `master` in the `gtk-rs/examples` repository (by opening a pull request of course). * Update badges version number in the `_data/crates.json` in the `gtk-rs/gtk-rs.github.io` repository. * Write a blog post (add the file into `_posts` folder in `gtk-rs.github.io` repository) announcing the new release. * Update crate version of the `master` branches on every repository. NOTE: Pull requests on the `crate` branch aren't build. rust-gtk-0.18-0.18.1/src/000077500000000000000000000000001467506176400145545ustar00rootroot00000000000000rust-gtk-0.18-0.18.1/src/accel_group.rs000066400000000000000000000063751467506176400174200ustar00rootroot00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use crate::AccelFlags; use crate::AccelGroup; use glib::object::{Cast, IsA}; use glib::translate::*; use glib::ToValue; mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait AccelGroupExtManual: IsA + sealed::Sealed + 'static { fn connect_accel_group( &self, accel_key: u32, accel_mods: gdk::ModifierType, accel_flags: AccelFlags, func: F, ) -> glib::Closure where F: Fn(&Self, &glib::Object, u32, gdk::ModifierType) -> bool + 'static, { let closure = glib::Closure::new_local(move |values| { assert_eq!(values.len(), 4); let s = values[0] .get::() .expect("Wrong argument type for first closure argument"); let s = s .downcast::() .expect("Wrong argument type for first closure argument"); let obj = values[1] .get::() .expect("Wrong argument type for second closure argument"); let accel_key = values[2] .get::() .expect("Wrong argument type for third closure argument"); let accel_mods = values[3] .get::() .expect("Wrong argument type for fourth closure argument"); let ret = func(&s, &obj, accel_key, accel_mods); Some(ret.to_value()) }); unsafe { ffi::gtk_accel_group_connect( self.as_ref().to_glib_none().0, accel_key, accel_mods.into_glib(), accel_flags.into_glib(), closure.to_glib_none().0, ); } closure } fn connect_accel_group_by_path(&self, accel_path: &str, func: F) -> glib::Closure where F: Fn(&Self, &glib::Object, u32, gdk::ModifierType) -> bool + 'static, { let closure = glib::Closure::new_local(move |values| { assert_eq!(values.len(), 4); let s = values[0] .get::() .expect("Wrong argument type for first closure argument"); let s = s .downcast::() .expect("Wrong argument type for first closure argument"); let obj = values[1] .get::() .expect("Wrong argument type for second closure argument"); let accel_key = values[2] .get::() .expect("Wrong argument type for third closure argument"); let accel_mods = values[3] .get::() .expect("Wrong argument type for fourth closure argument"); let ret = func(&s, &obj, accel_key, accel_mods); Some(ret.to_value()) }); unsafe { ffi::gtk_accel_group_connect_by_path( self.as_ref().to_glib_none().0, accel_path.to_glib_none().0, closure.to_glib_none().0, ); } closure } } impl> AccelGroupExtManual for O {} rust-gtk-0.18-0.18.1/src/app_chooser.rs000066400000000000000000000024301467506176400174230ustar00rootroot00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use crate::Widget; use gio::AppInfo; use glib::object::IsA; use glib::translate::*; glib::wrapper! { pub struct AppChooser(Interface) @requires Widget; match fn { type_ => || ffi::gtk_app_chooser_get_type(), } } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait AppChooserExt: IsA + sealed::Sealed + 'static { #[doc(alias = "gtk_app_chooser_get_app_info")] #[doc(alias = "get_app_info")] fn app_info(&self) -> Option { unsafe { from_glib_full(ffi::gtk_app_chooser_get_app_info( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_app_chooser_get_content_type")] #[doc(alias = "get_content_type")] fn content_type(&self) -> Option { unsafe { from_glib_full(ffi::gtk_app_chooser_get_content_type( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_app_chooser_refresh")] fn refresh(&self) { unsafe { ffi::gtk_app_chooser_refresh(self.as_ref().to_glib_none().0) } } } impl> AppChooserExt for O {} rust-gtk-0.18-0.18.1/src/application.rs000066400000000000000000000025241467506176400174300ustar00rootroot00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use crate::rt; use crate::Application; use gio::prelude::*; use gio::ApplicationFlags; use glib::signal::SignalHandlerId; use glib::translate::*; use std::cell::RefCell; use std::rc::Rc; impl Application { #[doc(alias = "gtk_application_new")] pub fn new(application_id: Option<&str>, flags: ApplicationFlags) -> Application { skip_assert_initialized!(); let app: Application = unsafe { from_glib_full(ffi::gtk_application_new( application_id.to_glib_none().0, flags.into_glib(), )) }; Application::register_startup_hook(&app); app } pub(crate) fn register_startup_hook(app: &Application) { skip_assert_initialized!(); let signalid: Rc>> = Rc::new(RefCell::new(None)); { let signalid_ = signalid.clone(); let id = app.connect_startup(move |app| { app.disconnect( signalid_ .borrow_mut() .take() .expect("Signal ID went missing"), ); unsafe { rt::set_initialized() } }); *signalid.borrow_mut() = Some(id); } } } rust-gtk-0.18-0.18.1/src/application_window.rs000066400000000000000000000011441467506176400210140ustar00rootroot00000000000000// Take a look at the license at the top of the repository in the LICENSE file. use crate::Application; use crate::ApplicationWindow; use crate::Widget; use glib::object::Cast; use glib::object::IsA; use glib::translate::*; impl ApplicationWindow { #[doc(alias = "gtk_application_window_new")] pub fn new>(application: &P) -> ApplicationWindow { skip_assert_initialized!(); unsafe { Widget::from_glib_none(ffi::gtk_application_window_new( application.as_ref().to_glib_none().0, )) .unsafe_cast() } } } rust-gtk-0.18-0.18.1/src/auto/000077500000000000000000000000001467506176400155245ustar00rootroot00000000000000rust-gtk-0.18-0.18.1/src/auto/about_dialog.rs000066400000000000000000001170421467506176400205300ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ Align, Application, Bin, Buildable, Container, Dialog, License, ResizeMode, Widget, Window, WindowPosition, WindowType, }; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "GtkAboutDialog")] pub struct AboutDialog(Object) @extends Dialog, Window, Bin, Container, Widget, @implements Buildable; match fn { type_ => || ffi::gtk_about_dialog_get_type(), } } impl AboutDialog { pub const NONE: Option<&'static AboutDialog> = None; #[doc(alias = "gtk_about_dialog_new")] pub fn new() -> AboutDialog { assert_initialized_main_thread!(); unsafe { Widget::from_glib_none(ffi::gtk_about_dialog_new()).unsafe_cast() } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`AboutDialog`] objects. /// /// This method returns an instance of [`AboutDialogBuilder`](crate::builders::AboutDialogBuilder) which can be used to create [`AboutDialog`] objects. pub fn builder() -> AboutDialogBuilder { AboutDialogBuilder::new() } } impl Default for AboutDialog { fn default() -> Self { Self::new() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`AboutDialog`] 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 AboutDialogBuilder { builder: glib::object::ObjectBuilder<'static, AboutDialog>, } impl AboutDialogBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } pub fn artists(self, artists: impl Into) -> Self { Self { builder: self.builder.property("artists", artists.into()), } } pub fn authors(self, authors: impl Into) -> Self { Self { builder: self.builder.property("authors", authors.into()), } } pub fn comments(self, comments: impl Into) -> Self { Self { builder: self.builder.property("comments", comments.into()), } } pub fn copyright(self, copyright: impl Into) -> Self { Self { builder: self.builder.property("copyright", copyright.into()), } } pub fn documenters(self, documenters: impl Into) -> Self { Self { builder: self.builder.property("documenters", documenters.into()), } } pub fn license(self, license: impl Into) -> Self { Self { builder: self.builder.property("license", license.into()), } } pub fn license_type(self, license_type: License) -> Self { Self { builder: self.builder.property("license-type", license_type), } } pub fn logo(self, logo: &gdk_pixbuf::Pixbuf) -> Self { Self { builder: self.builder.property("logo", logo.clone()), } } pub fn logo_icon_name(self, logo_icon_name: impl Into) -> Self { Self { builder: self .builder .property("logo-icon-name", logo_icon_name.into()), } } pub fn program_name(self, program_name: impl Into) -> Self { Self { builder: self.builder.property("program-name", program_name.into()), } } pub fn translator_credits(self, translator_credits: impl Into) -> Self { Self { builder: self .builder .property("translator-credits", translator_credits.into()), } } pub fn version(self, version: impl Into) -> Self { Self { builder: self.builder.property("version", version.into()), } } pub fn website(self, website: impl Into) -> Self { Self { builder: self.builder.property("website", website.into()), } } pub fn website_label(self, website_label: impl Into) -> Self { Self { builder: self.builder.property("website-label", website_label.into()), } } pub fn wrap_license(self, wrap_license: bool) -> Self { Self { builder: self.builder.property("wrap-license", wrap_license), } } pub fn use_header_bar(self, use_header_bar: i32) -> Self { Self { builder: self.builder.property("use-header-bar", use_header_bar), } } 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: 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: &gdk::Screen) -> Self { Self { builder: self.builder.property("screen", screen.clone()), } } 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_: WindowType) -> Self { Self { builder: self.builder.property("type", type_), } } pub fn type_hint(self, type_hint: 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: 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: 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: 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 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: 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 [`AboutDialog`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> AboutDialog { self.builder.build() } } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait AboutDialogExt: IsA + sealed::Sealed + 'static { #[doc(alias = "gtk_about_dialog_add_credit_section")] fn add_credit_section(&self, section_name: &str, people: &[&str]) { unsafe { ffi::gtk_about_dialog_add_credit_section( self.as_ref().to_glib_none().0, section_name.to_glib_none().0, people.to_glib_none().0, ); } } #[doc(alias = "gtk_about_dialog_get_artists")] #[doc(alias = "get_artists")] fn artists(&self) -> Vec { unsafe { FromGlibPtrContainer::from_glib_none(ffi::gtk_about_dialog_get_artists( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_about_dialog_get_authors")] #[doc(alias = "get_authors")] fn authors(&self) -> Vec { unsafe { FromGlibPtrContainer::from_glib_none(ffi::gtk_about_dialog_get_authors( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_about_dialog_get_comments")] #[doc(alias = "get_comments")] fn comments(&self) -> Option { unsafe { from_glib_none(ffi::gtk_about_dialog_get_comments( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_about_dialog_get_copyright")] #[doc(alias = "get_copyright")] fn copyright(&self) -> Option { unsafe { from_glib_none(ffi::gtk_about_dialog_get_copyright( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_about_dialog_get_documenters")] #[doc(alias = "get_documenters")] fn documenters(&self) -> Vec { unsafe { FromGlibPtrContainer::from_glib_none(ffi::gtk_about_dialog_get_documenters( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_about_dialog_get_license")] #[doc(alias = "get_license")] fn license(&self) -> Option { unsafe { from_glib_none(ffi::gtk_about_dialog_get_license( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_about_dialog_get_license_type")] #[doc(alias = "get_license_type")] fn license_type(&self) -> License { unsafe { from_glib(ffi::gtk_about_dialog_get_license_type( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_about_dialog_get_logo")] #[doc(alias = "get_logo")] fn logo(&self) -> Option { unsafe { from_glib_none(ffi::gtk_about_dialog_get_logo( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_about_dialog_get_logo_icon_name")] #[doc(alias = "get_logo_icon_name")] fn logo_icon_name(&self) -> Option { unsafe { from_glib_none(ffi::gtk_about_dialog_get_logo_icon_name( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_about_dialog_get_program_name")] #[doc(alias = "get_program_name")] fn program_name(&self) -> Option { unsafe { from_glib_none(ffi::gtk_about_dialog_get_program_name( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_about_dialog_get_translator_credits")] #[doc(alias = "get_translator_credits")] fn translator_credits(&self) -> Option { unsafe { from_glib_none(ffi::gtk_about_dialog_get_translator_credits( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_about_dialog_get_version")] #[doc(alias = "get_version")] fn version(&self) -> Option { unsafe { from_glib_none(ffi::gtk_about_dialog_get_version( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_about_dialog_get_website")] #[doc(alias = "get_website")] fn website(&self) -> Option { unsafe { from_glib_none(ffi::gtk_about_dialog_get_website( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_about_dialog_get_website_label")] #[doc(alias = "get_website_label")] fn website_label(&self) -> Option { unsafe { from_glib_none(ffi::gtk_about_dialog_get_website_label( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_about_dialog_get_wrap_license")] #[doc(alias = "get_wrap_license")] fn wraps_license(&self) -> bool { unsafe { from_glib(ffi::gtk_about_dialog_get_wrap_license( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_about_dialog_set_artists")] fn set_artists(&self, artists: &[&str]) { unsafe { ffi::gtk_about_dialog_set_artists( self.as_ref().to_glib_none().0, artists.to_glib_none().0, ); } } #[doc(alias = "gtk_about_dialog_set_authors")] fn set_authors(&self, authors: &[&str]) { unsafe { ffi::gtk_about_dialog_set_authors( self.as_ref().to_glib_none().0, authors.to_glib_none().0, ); } } #[doc(alias = "gtk_about_dialog_set_comments")] fn set_comments(&self, comments: Option<&str>) { unsafe { ffi::gtk_about_dialog_set_comments( self.as_ref().to_glib_none().0, comments.to_glib_none().0, ); } } #[doc(alias = "gtk_about_dialog_set_copyright")] fn set_copyright(&self, copyright: Option<&str>) { unsafe { ffi::gtk_about_dialog_set_copyright( self.as_ref().to_glib_none().0, copyright.to_glib_none().0, ); } } #[doc(alias = "gtk_about_dialog_set_documenters")] fn set_documenters(&self, documenters: &[&str]) { unsafe { ffi::gtk_about_dialog_set_documenters( self.as_ref().to_glib_none().0, documenters.to_glib_none().0, ); } } #[doc(alias = "gtk_about_dialog_set_license")] fn set_license(&self, license: Option<&str>) { unsafe { ffi::gtk_about_dialog_set_license( self.as_ref().to_glib_none().0, license.to_glib_none().0, ); } } #[doc(alias = "gtk_about_dialog_set_license_type")] fn set_license_type(&self, license_type: License) { unsafe { ffi::gtk_about_dialog_set_license_type( self.as_ref().to_glib_none().0, license_type.into_glib(), ); } } #[doc(alias = "gtk_about_dialog_set_logo")] fn set_logo(&self, logo: Option<&gdk_pixbuf::Pixbuf>) { unsafe { ffi::gtk_about_dialog_set_logo(self.as_ref().to_glib_none().0, logo.to_glib_none().0); } } #[doc(alias = "gtk_about_dialog_set_logo_icon_name")] fn set_logo_icon_name(&self, icon_name: Option<&str>) { unsafe { ffi::gtk_about_dialog_set_logo_icon_name( self.as_ref().to_glib_none().0, icon_name.to_glib_none().0, ); } } #[doc(alias = "gtk_about_dialog_set_program_name")] fn set_program_name(&self, name: &str) { unsafe { ffi::gtk_about_dialog_set_program_name( self.as_ref().to_glib_none().0, name.to_glib_none().0, ); } } #[doc(alias = "gtk_about_dialog_set_translator_credits")] fn set_translator_credits(&self, translator_credits: Option<&str>) { unsafe { ffi::gtk_about_dialog_set_translator_credits( self.as_ref().to_glib_none().0, translator_credits.to_glib_none().0, ); } } #[doc(alias = "gtk_about_dialog_set_version")] fn set_version(&self, version: Option<&str>) { unsafe { ffi::gtk_about_dialog_set_version( self.as_ref().to_glib_none().0, version.to_glib_none().0, ); } } #[doc(alias = "gtk_about_dialog_set_website")] fn set_website(&self, website: Option<&str>) { unsafe { ffi::gtk_about_dialog_set_website( self.as_ref().to_glib_none().0, website.to_glib_none().0, ); } } #[doc(alias = "gtk_about_dialog_set_website_label")] fn set_website_label(&self, website_label: Option<&str>) { unsafe { ffi::gtk_about_dialog_set_website_label( self.as_ref().to_glib_none().0, website_label.to_glib_none().0, ); } } #[doc(alias = "gtk_about_dialog_set_wrap_license")] fn set_wrap_license(&self, wrap_license: bool) { unsafe { ffi::gtk_about_dialog_set_wrap_license( self.as_ref().to_glib_none().0, wrap_license.into_glib(), ); } } #[doc(alias = "activate-link")] fn connect_activate_link glib::Propagation + 'static>( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn activate_link_trampoline< P: IsA, F: Fn(&P, &str) -> glib::Propagation + 'static, >( this: *mut ffi::GtkAboutDialog, uri: *mut libc::c_char, f: glib::ffi::gpointer, ) -> glib::ffi::gboolean { let f: &F = &*(f as *const F); f( AboutDialog::from_glib_borrow(this).unsafe_cast_ref(), &glib::GString::from_glib_borrow(uri), ) .into_glib() } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"activate-link\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( activate_link_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "artists")] fn connect_artists_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_artists_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::GtkAboutDialog, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(AboutDialog::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::artists\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_artists_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "authors")] fn connect_authors_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_authors_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::GtkAboutDialog, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(AboutDialog::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::authors\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_authors_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "comments")] fn connect_comments_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_comments_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::GtkAboutDialog, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(AboutDialog::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::comments\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_comments_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "copyright")] fn connect_copyright_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_copyright_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::GtkAboutDialog, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(AboutDialog::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::copyright\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_copyright_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "documenters")] fn connect_documenters_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_documenters_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::GtkAboutDialog, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(AboutDialog::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::documenters\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_documenters_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "license")] fn connect_license_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_license_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::GtkAboutDialog, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(AboutDialog::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::license\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_license_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "license-type")] fn connect_license_type_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_license_type_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::GtkAboutDialog, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(AboutDialog::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::license-type\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_license_type_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "logo")] fn connect_logo_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_logo_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::GtkAboutDialog, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(AboutDialog::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::logo\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_logo_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "logo-icon-name")] fn connect_logo_icon_name_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_logo_icon_name_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::GtkAboutDialog, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(AboutDialog::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::logo-icon-name\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_logo_icon_name_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "program-name")] fn connect_program_name_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_program_name_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::GtkAboutDialog, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(AboutDialog::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::program-name\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_program_name_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "translator-credits")] fn connect_translator_credits_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_translator_credits_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::GtkAboutDialog, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(AboutDialog::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::translator-credits\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_translator_credits_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "version")] fn connect_version_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_version_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::GtkAboutDialog, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(AboutDialog::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::version\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_version_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "website")] fn connect_website_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_website_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::GtkAboutDialog, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(AboutDialog::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::website\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_website_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "website-label")] fn connect_website_label_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_website_label_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::GtkAboutDialog, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(AboutDialog::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::website-label\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_website_label_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "wrap-license")] fn connect_wrap_license_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_wrap_license_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::GtkAboutDialog, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(AboutDialog::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::wrap-license\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_wrap_license_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl> AboutDialogExt for O {} impl fmt::Display for AboutDialog { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("AboutDialog") } } rust-gtk-0.18-0.18.1/src/auto/accel_group.rs000066400000000000000000000214241467506176400203600ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "GtkAccelGroup")] pub struct AccelGroup(Object); match fn { type_ => || ffi::gtk_accel_group_get_type(), } } impl AccelGroup { pub const NONE: Option<&'static AccelGroup> = None; #[doc(alias = "gtk_accel_group_new")] pub fn new() -> AccelGroup { assert_initialized_main_thread!(); unsafe { from_glib_full(ffi::gtk_accel_group_new()) } } #[doc(alias = "gtk_accel_group_from_accel_closure")] pub fn from_accel_closure(closure: &glib::Closure) -> Option { assert_initialized_main_thread!(); unsafe { from_glib_none(ffi::gtk_accel_group_from_accel_closure( closure.to_glib_none().0, )) } } } impl Default for AccelGroup { fn default() -> Self { Self::new() } } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait AccelGroupExt: IsA + sealed::Sealed + 'static { #[doc(alias = "gtk_accel_group_activate")] fn activate( &self, accel_quark: glib::Quark, acceleratable: &impl IsA, accel_key: u32, accel_mods: gdk::ModifierType, ) -> bool { unsafe { from_glib(ffi::gtk_accel_group_activate( self.as_ref().to_glib_none().0, accel_quark.into_glib(), acceleratable.as_ref().to_glib_none().0, accel_key, accel_mods.into_glib(), )) } } #[doc(alias = "gtk_accel_group_disconnect")] fn disconnect(&self, closure: Option<&glib::Closure>) -> bool { unsafe { from_glib(ffi::gtk_accel_group_disconnect( self.as_ref().to_glib_none().0, closure.to_glib_none().0, )) } } #[doc(alias = "gtk_accel_group_disconnect_key")] fn disconnect_key(&self, accel_key: u32, accel_mods: gdk::ModifierType) -> bool { unsafe { from_glib(ffi::gtk_accel_group_disconnect_key( self.as_ref().to_glib_none().0, accel_key, accel_mods.into_glib(), )) } } //#[doc(alias = "gtk_accel_group_find")] //fn find(&self, find_func: /*Unimplemented*/FnMut(/*Ignored*/AccelKey, &glib::Closure) -> bool, data: /*Unimplemented*/Option) -> /*Ignored*/Option { // unsafe { TODO: call ffi:gtk_accel_group_find() } //} #[doc(alias = "gtk_accel_group_get_is_locked")] #[doc(alias = "get_is_locked")] fn is_locked(&self) -> bool { unsafe { from_glib(ffi::gtk_accel_group_get_is_locked( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_accel_group_get_modifier_mask")] #[doc(alias = "get_modifier_mask")] fn modifier_mask(&self) -> gdk::ModifierType { unsafe { from_glib(ffi::gtk_accel_group_get_modifier_mask( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_accel_group_lock")] fn lock(&self) { unsafe { ffi::gtk_accel_group_lock(self.as_ref().to_glib_none().0); } } #[doc(alias = "gtk_accel_group_unlock")] fn unlock(&self) { unsafe { ffi::gtk_accel_group_unlock(self.as_ref().to_glib_none().0); } } #[doc(alias = "accel-activate")] fn connect_accel_activate< F: Fn(&Self, &glib::Object, u32, gdk::ModifierType) -> bool + 'static, >( &self, detail: Option<&str>, f: F, ) -> SignalHandlerId { unsafe extern "C" fn accel_activate_trampoline< P: IsA, F: Fn(&P, &glib::Object, u32, gdk::ModifierType) -> bool + 'static, >( this: *mut ffi::GtkAccelGroup, acceleratable: *mut glib::gobject_ffi::GObject, keyval: libc::c_uint, modifier: gdk::ffi::GdkModifierType, f: glib::ffi::gpointer, ) -> glib::ffi::gboolean { let f: &F = &*(f as *const F); f( AccelGroup::from_glib_borrow(this).unsafe_cast_ref(), &from_glib_borrow(acceleratable), keyval, from_glib(modifier), ) .into_glib() } unsafe { let f: Box_ = Box_::new(f); let detailed_signal_name = detail.map(|name| format!("accel-activate::{name}\0")); let signal_name: &[u8] = detailed_signal_name .as_ref() .map_or(&b"accel-activate\0"[..], |n| n.as_bytes()); connect_raw( self.as_ptr() as *mut _, signal_name.as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( accel_activate_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "accel-changed")] fn connect_accel_changed( &self, detail: Option<&str>, f: F, ) -> SignalHandlerId { unsafe extern "C" fn accel_changed_trampoline< P: IsA, F: Fn(&P, u32, gdk::ModifierType, &glib::Closure) + 'static, >( this: *mut ffi::GtkAccelGroup, keyval: libc::c_uint, modifier: gdk::ffi::GdkModifierType, accel_closure: *mut glib::gobject_ffi::GClosure, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f( AccelGroup::from_glib_borrow(this).unsafe_cast_ref(), keyval, from_glib(modifier), &from_glib_borrow(accel_closure), ) } unsafe { let f: Box_ = Box_::new(f); let detailed_signal_name = detail.map(|name| format!("accel-changed::{name}\0")); let signal_name: &[u8] = detailed_signal_name .as_ref() .map_or(&b"accel-changed\0"[..], |n| n.as_bytes()); connect_raw( self.as_ptr() as *mut _, signal_name.as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( accel_changed_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "is-locked")] fn connect_is_locked_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_is_locked_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::GtkAccelGroup, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(AccelGroup::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::is-locked\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_is_locked_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "modifier-mask")] fn connect_modifier_mask_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_modifier_mask_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::GtkAccelGroup, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(AccelGroup::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::modifier-mask\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_modifier_mask_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl> AccelGroupExt for O {} impl fmt::Display for AccelGroup { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("AccelGroup") } } rust-gtk-0.18-0.18.1/src/auto/accel_label.rs000066400000000000000000000365611467506176400203130ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{Align, Buildable, Container, Justification, Label, Misc, Widget}; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem, mem::transmute}; glib::wrapper! { #[doc(alias = "GtkAccelLabel")] pub struct AccelLabel(Object) @extends Label, Misc, Widget, @implements Buildable; match fn { type_ => || ffi::gtk_accel_label_get_type(), } } impl AccelLabel { pub const NONE: Option<&'static AccelLabel> = None; #[doc(alias = "gtk_accel_label_new")] pub fn new(string: &str) -> AccelLabel { assert_initialized_main_thread!(); unsafe { Widget::from_glib_none(ffi::gtk_accel_label_new(string.to_glib_none().0)).unsafe_cast() } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`AccelLabel`] objects. /// /// This method returns an instance of [`AccelLabelBuilder`](crate::builders::AccelLabelBuilder) which can be used to create [`AccelLabel`] objects. pub fn builder() -> AccelLabelBuilder { AccelLabelBuilder::new() } } impl Default for AccelLabel { fn default() -> Self { glib::object::Object::new::() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`AccelLabel`] 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 AccelLabelBuilder { builder: glib::object::ObjectBuilder<'static, AccelLabel>, } impl AccelLabelBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } pub fn accel_closure(self, accel_closure: &glib::Closure) -> Self { Self { builder: self .builder .property("accel-closure", accel_closure.clone()), } } pub fn accel_widget(self, accel_widget: &impl IsA) -> Self { Self { builder: self .builder .property("accel-widget", accel_widget.clone().upcast()), } } pub fn angle(self, angle: f64) -> Self { Self { builder: self.builder.property("angle", angle), } } pub fn attributes(self, attributes: &pango::AttrList) -> Self { Self { builder: self.builder.property("attributes", attributes.clone()), } } pub fn ellipsize(self, ellipsize: pango::EllipsizeMode) -> Self { Self { builder: self.builder.property("ellipsize", ellipsize), } } pub fn justify(self, justify: Justification) -> Self { Self { builder: self.builder.property("justify", justify), } } pub fn label(self, label: impl Into) -> Self { Self { builder: self.builder.property("label", label.into()), } } pub fn lines(self, lines: i32) -> Self { Self { builder: self.builder.property("lines", lines), } } pub fn max_width_chars(self, max_width_chars: i32) -> Self { Self { builder: self.builder.property("max-width-chars", max_width_chars), } } pub fn mnemonic_widget(self, mnemonic_widget: &impl IsA) -> Self { Self { builder: self .builder .property("mnemonic-widget", mnemonic_widget.clone().upcast()), } } pub fn pattern(self, pattern: impl Into) -> Self { Self { builder: self.builder.property("pattern", pattern.into()), } } pub fn selectable(self, selectable: bool) -> Self { Self { builder: self.builder.property("selectable", selectable), } } pub fn single_line_mode(self, single_line_mode: bool) -> Self { Self { builder: self.builder.property("single-line-mode", single_line_mode), } } pub fn track_visited_links(self, track_visited_links: bool) -> Self { Self { builder: self .builder .property("track-visited-links", track_visited_links), } } pub fn use_markup(self, use_markup: bool) -> Self { Self { builder: self.builder.property("use-markup", use_markup), } } pub fn use_underline(self, use_underline: bool) -> Self { Self { builder: self.builder.property("use-underline", use_underline), } } pub fn width_chars(self, width_chars: i32) -> Self { Self { builder: self.builder.property("width-chars", width_chars), } } pub fn wrap(self, wrap: bool) -> Self { Self { builder: self.builder.property("wrap", wrap), } } pub fn wrap_mode(self, wrap_mode: pango::WrapMode) -> Self { Self { builder: self.builder.property("wrap-mode", wrap_mode), } } 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 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: 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 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: 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 [`AccelLabel`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> AccelLabel { self.builder.build() } } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait AccelLabelExt: IsA + sealed::Sealed + 'static { #[doc(alias = "gtk_accel_label_get_accel")] #[doc(alias = "get_accel")] fn accel(&self) -> (u32, gdk::ModifierType) { unsafe { let mut accelerator_key = mem::MaybeUninit::uninit(); let mut accelerator_mods = mem::MaybeUninit::uninit(); ffi::gtk_accel_label_get_accel( self.as_ref().to_glib_none().0, accelerator_key.as_mut_ptr(), accelerator_mods.as_mut_ptr(), ); ( accelerator_key.assume_init(), from_glib(accelerator_mods.assume_init()), ) } } #[doc(alias = "gtk_accel_label_get_accel_widget")] #[doc(alias = "get_accel_widget")] fn accel_widget(&self) -> Option { unsafe { from_glib_none(ffi::gtk_accel_label_get_accel_widget( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_accel_label_get_accel_width")] #[doc(alias = "get_accel_width")] fn accel_width(&self) -> u32 { unsafe { ffi::gtk_accel_label_get_accel_width(self.as_ref().to_glib_none().0) } } #[doc(alias = "gtk_accel_label_refetch")] fn refetch(&self) -> bool { unsafe { from_glib(ffi::gtk_accel_label_refetch(self.as_ref().to_glib_none().0)) } } #[doc(alias = "gtk_accel_label_set_accel")] fn set_accel(&self, accelerator_key: u32, accelerator_mods: gdk::ModifierType) { unsafe { ffi::gtk_accel_label_set_accel( self.as_ref().to_glib_none().0, accelerator_key, accelerator_mods.into_glib(), ); } } #[doc(alias = "gtk_accel_label_set_accel_closure")] fn set_accel_closure(&self, accel_closure: Option<&glib::Closure>) { unsafe { ffi::gtk_accel_label_set_accel_closure( self.as_ref().to_glib_none().0, accel_closure.to_glib_none().0, ); } } #[doc(alias = "gtk_accel_label_set_accel_widget")] fn set_accel_widget(&self, accel_widget: Option<&impl IsA>) { unsafe { ffi::gtk_accel_label_set_accel_widget( self.as_ref().to_glib_none().0, accel_widget.map(|p| p.as_ref()).to_glib_none().0, ); } } #[doc(alias = "accel-closure")] fn accel_closure(&self) -> Option { ObjectExt::property(self.as_ref(), "accel-closure") } #[doc(alias = "accel-closure")] fn connect_accel_closure_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_accel_closure_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::GtkAccelLabel, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(AccelLabel::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::accel-closure\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_accel_closure_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "accel-widget")] fn connect_accel_widget_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_accel_widget_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::GtkAccelLabel, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(AccelLabel::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::accel-widget\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_accel_widget_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl> AccelLabelExt for O {} impl fmt::Display for AccelLabel { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("AccelLabel") } } rust-gtk-0.18-0.18.1/src/auto/action_bar.rs000066400000000000000000000241551467506176400202020ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{Align, Bin, Buildable, Container, PackType, ResizeMode, Widget}; use glib::{prelude::*, translate::*}; use std::fmt; glib::wrapper! { #[doc(alias = "GtkActionBar")] pub struct ActionBar(Object) @extends Bin, Container, Widget, @implements Buildable; match fn { type_ => || ffi::gtk_action_bar_get_type(), } } impl ActionBar { pub const NONE: Option<&'static ActionBar> = None; #[doc(alias = "gtk_action_bar_new")] pub fn new() -> ActionBar { assert_initialized_main_thread!(); unsafe { Widget::from_glib_none(ffi::gtk_action_bar_new()).unsafe_cast() } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`ActionBar`] objects. /// /// This method returns an instance of [`ActionBarBuilder`](crate::builders::ActionBarBuilder) which can be used to create [`ActionBar`] objects. pub fn builder() -> ActionBarBuilder { ActionBarBuilder::new() } } impl Default for ActionBar { fn default() -> Self { Self::new() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`ActionBar`] 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 ActionBarBuilder { builder: glib::object::ObjectBuilder<'static, ActionBar>, } impl ActionBarBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } 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: 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: 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 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: 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 [`ActionBar`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> ActionBar { self.builder.build() } } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait ActionBarExt: IsA + sealed::Sealed + 'static { #[doc(alias = "gtk_action_bar_get_center_widget")] #[doc(alias = "get_center_widget")] fn center_widget(&self) -> Option { unsafe { from_glib_none(ffi::gtk_action_bar_get_center_widget( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_action_bar_pack_end")] fn pack_end(&self, child: &impl IsA) { unsafe { ffi::gtk_action_bar_pack_end( self.as_ref().to_glib_none().0, child.as_ref().to_glib_none().0, ); } } #[doc(alias = "gtk_action_bar_pack_start")] fn pack_start(&self, child: &impl IsA) { unsafe { ffi::gtk_action_bar_pack_start( self.as_ref().to_glib_none().0, child.as_ref().to_glib_none().0, ); } } #[doc(alias = "gtk_action_bar_set_center_widget")] fn set_center_widget(&self, center_widget: Option<&impl IsA>) { unsafe { ffi::gtk_action_bar_set_center_widget( self.as_ref().to_glib_none().0, center_widget.map(|p| p.as_ref()).to_glib_none().0, ); } } #[doc(alias = "child.pack-type")] fn child_pack_type>(&self, item: &T) -> PackType { crate::prelude::ContainerExtManual::child_property( self.as_ref(), &item.clone().upcast(), "pack-type", ) } #[doc(alias = "child.pack-type")] fn set_child_pack_type>(&self, item: &T, pack_type: PackType) { crate::prelude::ContainerExtManual::child_set_property( self.as_ref(), &item.clone().upcast(), "pack-type", &pack_type, ) } fn child_position>(&self, item: &T) -> i32 { crate::prelude::ContainerExtManual::child_property( self.as_ref(), &item.clone().upcast(), "position", ) } fn set_child_position>(&self, item: &T, position: i32) { crate::prelude::ContainerExtManual::child_set_property( self.as_ref(), &item.clone().upcast(), "position", &position, ) } } impl> ActionBarExt for O {} impl fmt::Display for ActionBar { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("ActionBar") } } rust-gtk-0.18-0.18.1/src/auto/actionable.rs000066400000000000000000000112101467506176400201660ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{Buildable, Widget}; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "GtkActionable")] pub struct Actionable(Interface) @requires Widget, Buildable; match fn { type_ => || ffi::gtk_actionable_get_type(), } } impl Actionable { pub const NONE: Option<&'static Actionable> = None; } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait ActionableExt: IsA + sealed::Sealed + 'static { #[doc(alias = "gtk_actionable_get_action_name")] #[doc(alias = "get_action_name")] fn action_name(&self) -> Option { unsafe { from_glib_none(ffi::gtk_actionable_get_action_name( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_actionable_get_action_target_value")] #[doc(alias = "get_action_target_value")] fn action_target_value(&self) -> Option { unsafe { from_glib_none(ffi::gtk_actionable_get_action_target_value( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_actionable_set_action_name")] fn set_action_name(&self, action_name: Option<&str>) { unsafe { ffi::gtk_actionable_set_action_name( self.as_ref().to_glib_none().0, action_name.to_glib_none().0, ); } } //#[doc(alias = "gtk_actionable_set_action_target")] //fn set_action_target(&self, format_string: &str, : /*Unknown conversion*//*Unimplemented*/Basic: VarArgs) { // unsafe { TODO: call ffi:gtk_actionable_set_action_target() } //} #[doc(alias = "gtk_actionable_set_action_target_value")] fn set_action_target_value(&self, target_value: Option<&glib::Variant>) { unsafe { ffi::gtk_actionable_set_action_target_value( self.as_ref().to_glib_none().0, target_value.to_glib_none().0, ); } } #[doc(alias = "gtk_actionable_set_detailed_action_name")] fn set_detailed_action_name(&self, detailed_action_name: &str) { unsafe { ffi::gtk_actionable_set_detailed_action_name( self.as_ref().to_glib_none().0, detailed_action_name.to_glib_none().0, ); } } #[doc(alias = "action-name")] fn connect_action_name_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_action_name_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::GtkActionable, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Actionable::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::action-name\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_action_name_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "action-target")] fn connect_action_target_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_action_target_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::GtkActionable, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Actionable::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::action-target\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_action_target_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl> ActionableExt for O {} impl fmt::Display for Actionable { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Actionable") } } rust-gtk-0.18-0.18.1/src/auto/adjustment.rs000066400000000000000000000335711467506176400202610ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "GtkAdjustment")] pub struct Adjustment(Object); match fn { type_ => || ffi::gtk_adjustment_get_type(), } } impl Adjustment { pub const NONE: Option<&'static Adjustment> = None; #[doc(alias = "gtk_adjustment_new")] pub fn new( value: f64, lower: f64, upper: f64, step_increment: f64, page_increment: f64, page_size: f64, ) -> Adjustment { assert_initialized_main_thread!(); unsafe { from_glib_none(ffi::gtk_adjustment_new( value, lower, upper, step_increment, page_increment, page_size, )) } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`Adjustment`] objects. /// /// This method returns an instance of [`AdjustmentBuilder`](crate::builders::AdjustmentBuilder) which can be used to create [`Adjustment`] objects. pub fn builder() -> AdjustmentBuilder { AdjustmentBuilder::new() } } impl Default for Adjustment { fn default() -> Self { glib::object::Object::new::() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`Adjustment`] 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 AdjustmentBuilder { builder: glib::object::ObjectBuilder<'static, Adjustment>, } impl AdjustmentBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } pub fn lower(self, lower: f64) -> Self { Self { builder: self.builder.property("lower", lower), } } pub fn page_increment(self, page_increment: f64) -> Self { Self { builder: self.builder.property("page-increment", page_increment), } } pub fn page_size(self, page_size: f64) -> Self { Self { builder: self.builder.property("page-size", page_size), } } pub fn step_increment(self, step_increment: f64) -> Self { Self { builder: self.builder.property("step-increment", step_increment), } } pub fn upper(self, upper: f64) -> Self { Self { builder: self.builder.property("upper", upper), } } pub fn value(self, value: f64) -> Self { Self { builder: self.builder.property("value", value), } } // rustdoc-stripper-ignore-next /// Build the [`Adjustment`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> Adjustment { self.builder.build() } } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait AdjustmentExt: IsA + sealed::Sealed + 'static { #[doc(alias = "gtk_adjustment_clamp_page")] fn clamp_page(&self, lower: f64, upper: f64) { unsafe { ffi::gtk_adjustment_clamp_page(self.as_ref().to_glib_none().0, lower, upper); } } #[doc(alias = "gtk_adjustment_configure")] fn configure( &self, value: f64, lower: f64, upper: f64, step_increment: f64, page_increment: f64, page_size: f64, ) { unsafe { ffi::gtk_adjustment_configure( self.as_ref().to_glib_none().0, value, lower, upper, step_increment, page_increment, page_size, ); } } #[doc(alias = "gtk_adjustment_get_lower")] #[doc(alias = "get_lower")] fn lower(&self) -> f64 { unsafe { ffi::gtk_adjustment_get_lower(self.as_ref().to_glib_none().0) } } #[doc(alias = "gtk_adjustment_get_minimum_increment")] #[doc(alias = "get_minimum_increment")] fn minimum_increment(&self) -> f64 { unsafe { ffi::gtk_adjustment_get_minimum_increment(self.as_ref().to_glib_none().0) } } #[doc(alias = "gtk_adjustment_get_page_increment")] #[doc(alias = "get_page_increment")] fn page_increment(&self) -> f64 { unsafe { ffi::gtk_adjustment_get_page_increment(self.as_ref().to_glib_none().0) } } #[doc(alias = "gtk_adjustment_get_page_size")] #[doc(alias = "get_page_size")] fn page_size(&self) -> f64 { unsafe { ffi::gtk_adjustment_get_page_size(self.as_ref().to_glib_none().0) } } #[doc(alias = "gtk_adjustment_get_step_increment")] #[doc(alias = "get_step_increment")] fn step_increment(&self) -> f64 { unsafe { ffi::gtk_adjustment_get_step_increment(self.as_ref().to_glib_none().0) } } #[doc(alias = "gtk_adjustment_get_upper")] #[doc(alias = "get_upper")] fn upper(&self) -> f64 { unsafe { ffi::gtk_adjustment_get_upper(self.as_ref().to_glib_none().0) } } #[doc(alias = "gtk_adjustment_get_value")] #[doc(alias = "get_value")] fn value(&self) -> f64 { unsafe { ffi::gtk_adjustment_get_value(self.as_ref().to_glib_none().0) } } #[doc(alias = "gtk_adjustment_set_lower")] fn set_lower(&self, lower: f64) { unsafe { ffi::gtk_adjustment_set_lower(self.as_ref().to_glib_none().0, lower); } } #[doc(alias = "gtk_adjustment_set_page_increment")] fn set_page_increment(&self, page_increment: f64) { unsafe { ffi::gtk_adjustment_set_page_increment(self.as_ref().to_glib_none().0, page_increment); } } #[doc(alias = "gtk_adjustment_set_page_size")] fn set_page_size(&self, page_size: f64) { unsafe { ffi::gtk_adjustment_set_page_size(self.as_ref().to_glib_none().0, page_size); } } #[doc(alias = "gtk_adjustment_set_step_increment")] fn set_step_increment(&self, step_increment: f64) { unsafe { ffi::gtk_adjustment_set_step_increment(self.as_ref().to_glib_none().0, step_increment); } } #[doc(alias = "gtk_adjustment_set_upper")] fn set_upper(&self, upper: f64) { unsafe { ffi::gtk_adjustment_set_upper(self.as_ref().to_glib_none().0, upper); } } #[doc(alias = "gtk_adjustment_set_value")] fn set_value(&self, value: f64) { unsafe { ffi::gtk_adjustment_set_value(self.as_ref().to_glib_none().0, value); } } #[doc(alias = "changed")] fn connect_changed(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn changed_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::GtkAdjustment, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Adjustment::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"changed\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( changed_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "value-changed")] fn connect_value_changed(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn value_changed_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::GtkAdjustment, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Adjustment::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"value-changed\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( value_changed_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "lower")] fn connect_lower_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_lower_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::GtkAdjustment, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Adjustment::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::lower\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_lower_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "page-increment")] fn connect_page_increment_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_page_increment_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::GtkAdjustment, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Adjustment::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::page-increment\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_page_increment_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "page-size")] fn connect_page_size_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_page_size_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::GtkAdjustment, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Adjustment::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::page-size\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_page_size_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "step-increment")] fn connect_step_increment_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_step_increment_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::GtkAdjustment, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Adjustment::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::step-increment\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_step_increment_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "upper")] fn connect_upper_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_upper_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::GtkAdjustment, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Adjustment::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::upper\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_upper_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "value")] fn connect_value_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_value_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::GtkAdjustment, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Adjustment::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::value\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_value_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl> AdjustmentExt for O {} impl fmt::Display for Adjustment { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Adjustment") } } rust-gtk-0.18-0.18.1/src/auto/app_chooser_button.rs000066400000000000000000000451571467506176400220030ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ Align, AppChooser, Bin, Buildable, CellArea, CellEditable, CellLayout, ComboBox, Container, ResizeMode, SensitivityType, TreeModel, Widget, }; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "GtkAppChooserButton")] pub struct AppChooserButton(Object) @extends ComboBox, Bin, Container, Widget, @implements Buildable, CellEditable, CellLayout, AppChooser; match fn { type_ => || ffi::gtk_app_chooser_button_get_type(), } } impl AppChooserButton { pub const NONE: Option<&'static AppChooserButton> = None; #[doc(alias = "gtk_app_chooser_button_new")] pub fn new(content_type: &str) -> AppChooserButton { assert_initialized_main_thread!(); unsafe { Widget::from_glib_none(ffi::gtk_app_chooser_button_new( content_type.to_glib_none().0, )) .unsafe_cast() } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`AppChooserButton`] objects. /// /// This method returns an instance of [`AppChooserButtonBuilder`](crate::builders::AppChooserButtonBuilder) which can be used to create [`AppChooserButton`] objects. pub fn builder() -> AppChooserButtonBuilder { AppChooserButtonBuilder::new() } } impl Default for AppChooserButton { fn default() -> Self { glib::object::Object::new::() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`AppChooserButton`] 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 AppChooserButtonBuilder { builder: glib::object::ObjectBuilder<'static, AppChooserButton>, } impl AppChooserButtonBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } pub fn heading(self, heading: impl Into) -> Self { Self { builder: self.builder.property("heading", heading.into()), } } pub fn show_default_item(self, show_default_item: bool) -> Self { Self { builder: self .builder .property("show-default-item", show_default_item), } } pub fn show_dialog_item(self, show_dialog_item: bool) -> Self { Self { builder: self.builder.property("show-dialog-item", show_dialog_item), } } pub fn active(self, active: i32) -> Self { Self { builder: self.builder.property("active", active), } } pub fn active_id(self, active_id: impl Into) -> Self { Self { builder: self.builder.property("active-id", active_id.into()), } } pub fn button_sensitivity(self, button_sensitivity: SensitivityType) -> Self { Self { builder: self .builder .property("button-sensitivity", button_sensitivity), } } pub fn cell_area(self, cell_area: &impl IsA) -> Self { Self { builder: self .builder .property("cell-area", cell_area.clone().upcast()), } } pub fn column_span_column(self, column_span_column: i32) -> Self { Self { builder: self .builder .property("column-span-column", column_span_column), } } pub fn entry_text_column(self, entry_text_column: i32) -> Self { Self { builder: self .builder .property("entry-text-column", entry_text_column), } } pub fn has_entry(self, has_entry: bool) -> Self { Self { builder: self.builder.property("has-entry", has_entry), } } pub fn has_frame(self, has_frame: bool) -> Self { Self { builder: self.builder.property("has-frame", has_frame), } } pub fn id_column(self, id_column: i32) -> Self { Self { builder: self.builder.property("id-column", id_column), } } pub fn model(self, model: &impl IsA) -> Self { Self { builder: self.builder.property("model", model.clone().upcast()), } } pub fn popup_fixed_width(self, popup_fixed_width: bool) -> Self { Self { builder: self .builder .property("popup-fixed-width", popup_fixed_width), } } pub fn row_span_column(self, row_span_column: i32) -> Self { Self { builder: self.builder.property("row-span-column", row_span_column), } } pub fn wrap_width(self, wrap_width: i32) -> Self { Self { builder: self.builder.property("wrap-width", wrap_width), } } 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: 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: 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 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: 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 editing_canceled(self, editing_canceled: bool) -> Self { Self { builder: self.builder.property("editing-canceled", editing_canceled), } } pub fn content_type(self, content_type: impl Into) -> Self { Self { builder: self.builder.property("content-type", content_type.into()), } } // rustdoc-stripper-ignore-next /// Build the [`AppChooserButton`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> AppChooserButton { self.builder.build() } } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait AppChooserButtonExt: IsA + sealed::Sealed + 'static { #[doc(alias = "gtk_app_chooser_button_append_custom_item")] fn append_custom_item(&self, name: &str, label: &str, icon: &impl IsA) { unsafe { ffi::gtk_app_chooser_button_append_custom_item( self.as_ref().to_glib_none().0, name.to_glib_none().0, label.to_glib_none().0, icon.as_ref().to_glib_none().0, ); } } #[doc(alias = "gtk_app_chooser_button_append_separator")] fn append_separator(&self) { unsafe { ffi::gtk_app_chooser_button_append_separator(self.as_ref().to_glib_none().0); } } #[doc(alias = "gtk_app_chooser_button_get_heading")] #[doc(alias = "get_heading")] fn heading(&self) -> Option { unsafe { from_glib_none(ffi::gtk_app_chooser_button_get_heading( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_app_chooser_button_get_show_default_item")] #[doc(alias = "get_show_default_item")] fn shows_default_item(&self) -> bool { unsafe { from_glib(ffi::gtk_app_chooser_button_get_show_default_item( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_app_chooser_button_get_show_dialog_item")] #[doc(alias = "get_show_dialog_item")] fn shows_dialog_item(&self) -> bool { unsafe { from_glib(ffi::gtk_app_chooser_button_get_show_dialog_item( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_app_chooser_button_set_active_custom_item")] fn set_active_custom_item(&self, name: &str) { unsafe { ffi::gtk_app_chooser_button_set_active_custom_item( self.as_ref().to_glib_none().0, name.to_glib_none().0, ); } } #[doc(alias = "gtk_app_chooser_button_set_heading")] fn set_heading(&self, heading: &str) { unsafe { ffi::gtk_app_chooser_button_set_heading( self.as_ref().to_glib_none().0, heading.to_glib_none().0, ); } } #[doc(alias = "gtk_app_chooser_button_set_show_default_item")] fn set_show_default_item(&self, setting: bool) { unsafe { ffi::gtk_app_chooser_button_set_show_default_item( self.as_ref().to_glib_none().0, setting.into_glib(), ); } } #[doc(alias = "gtk_app_chooser_button_set_show_dialog_item")] fn set_show_dialog_item(&self, setting: bool) { unsafe { ffi::gtk_app_chooser_button_set_show_dialog_item( self.as_ref().to_glib_none().0, setting.into_glib(), ); } } #[doc(alias = "custom-item-activated")] fn connect_custom_item_activated( &self, detail: Option<&str>, f: F, ) -> SignalHandlerId { unsafe extern "C" fn custom_item_activated_trampoline< P: IsA, F: Fn(&P, &str) + 'static, >( this: *mut ffi::GtkAppChooserButton, item_name: *mut libc::c_char, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f( AppChooserButton::from_glib_borrow(this).unsafe_cast_ref(), &glib::GString::from_glib_borrow(item_name), ) } unsafe { let f: Box_ = Box_::new(f); let detailed_signal_name = detail.map(|name| format!("custom-item-activated::{name}\0")); let signal_name: &[u8] = detailed_signal_name .as_ref() .map_or(&b"custom-item-activated\0"[..], |n| n.as_bytes()); connect_raw( self.as_ptr() as *mut _, signal_name.as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( custom_item_activated_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "heading")] fn connect_heading_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_heading_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::GtkAppChooserButton, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(AppChooserButton::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::heading\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_heading_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "show-default-item")] fn connect_show_default_item_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_show_default_item_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::GtkAppChooserButton, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(AppChooserButton::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::show-default-item\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_show_default_item_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "show-dialog-item")] fn connect_show_dialog_item_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_show_dialog_item_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::GtkAppChooserButton, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(AppChooserButton::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::show-dialog-item\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_show_dialog_item_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl> AppChooserButtonExt for O {} impl fmt::Display for AppChooserButton { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("AppChooserButton") } } rust-gtk-0.18-0.18.1/src/auto/app_chooser_dialog.rs000066400000000000000000000412451467506176400217210ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ Align, AppChooser, Application, Bin, Buildable, Container, Dialog, DialogFlags, ResizeMode, Widget, Window, WindowPosition, WindowType, }; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "GtkAppChooserDialog")] pub struct AppChooserDialog(Object) @extends Dialog, Window, Bin, Container, Widget, @implements Buildable, AppChooser; match fn { type_ => || ffi::gtk_app_chooser_dialog_get_type(), } } impl AppChooserDialog { pub const NONE: Option<&'static AppChooserDialog> = None; #[doc(alias = "gtk_app_chooser_dialog_new")] pub fn new( parent: Option<&impl IsA>, flags: DialogFlags, file: &impl IsA, ) -> AppChooserDialog { assert_initialized_main_thread!(); unsafe { Widget::from_glib_none(ffi::gtk_app_chooser_dialog_new( parent.map(|p| p.as_ref()).to_glib_none().0, flags.into_glib(), file.as_ref().to_glib_none().0, )) .unsafe_cast() } } #[doc(alias = "gtk_app_chooser_dialog_new_for_content_type")] #[doc(alias = "new_for_content_type")] pub fn for_content_type( parent: Option<&impl IsA>, flags: DialogFlags, content_type: &str, ) -> AppChooserDialog { assert_initialized_main_thread!(); unsafe { Widget::from_glib_none(ffi::gtk_app_chooser_dialog_new_for_content_type( parent.map(|p| p.as_ref()).to_glib_none().0, flags.into_glib(), content_type.to_glib_none().0, )) .unsafe_cast() } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`AppChooserDialog`] objects. /// /// This method returns an instance of [`AppChooserDialogBuilder`](crate::builders::AppChooserDialogBuilder) which can be used to create [`AppChooserDialog`] objects. pub fn builder() -> AppChooserDialogBuilder { AppChooserDialogBuilder::new() } } impl Default for AppChooserDialog { fn default() -> Self { glib::object::Object::new::() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`AppChooserDialog`] 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 AppChooserDialogBuilder { builder: glib::object::ObjectBuilder<'static, AppChooserDialog>, } impl AppChooserDialogBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } pub fn gfile(self, gfile: &impl IsA) -> Self { Self { builder: self.builder.property("gfile", gfile.clone().upcast()), } } pub fn heading(self, heading: impl Into) -> Self { Self { builder: self.builder.property("heading", heading.into()), } } pub fn use_header_bar(self, use_header_bar: i32) -> Self { Self { builder: self.builder.property("use-header-bar", use_header_bar), } } 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: 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: &gdk::Screen) -> Self { Self { builder: self.builder.property("screen", screen.clone()), } } 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_: WindowType) -> Self { Self { builder: self.builder.property("type", type_), } } pub fn type_hint(self, type_hint: 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: 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: 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: 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 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: 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 content_type(self, content_type: impl Into) -> Self { Self { builder: self.builder.property("content-type", content_type.into()), } } // rustdoc-stripper-ignore-next /// Build the [`AppChooserDialog`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> AppChooserDialog { self.builder.build() } } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait AppChooserDialogExt: IsA + sealed::Sealed + 'static { #[doc(alias = "gtk_app_chooser_dialog_get_heading")] #[doc(alias = "get_heading")] fn heading(&self) -> Option { unsafe { from_glib_none(ffi::gtk_app_chooser_dialog_get_heading( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_app_chooser_dialog_get_widget")] #[doc(alias = "get_widget")] fn widget(&self) -> Widget { unsafe { from_glib_none(ffi::gtk_app_chooser_dialog_get_widget( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_app_chooser_dialog_set_heading")] fn set_heading(&self, heading: &str) { unsafe { ffi::gtk_app_chooser_dialog_set_heading( self.as_ref().to_glib_none().0, heading.to_glib_none().0, ); } } fn gfile(&self) -> Option { ObjectExt::property(self.as_ref(), "gfile") } #[doc(alias = "heading")] fn connect_heading_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_heading_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::GtkAppChooserDialog, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(AppChooserDialog::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::heading\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_heading_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl> AppChooserDialogExt for O {} impl fmt::Display for AppChooserDialog { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("AppChooserDialog") } } rust-gtk-0.18-0.18.1/src/auto/app_chooser_widget.rs000066400000000000000000000552331467506176400217470ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ Align, AppChooser, BaselinePosition, Box, Buildable, Container, Menu, Orientable, Orientation, ResizeMode, Widget, }; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "GtkAppChooserWidget")] pub struct AppChooserWidget(Object) @extends Box, Container, Widget, @implements Buildable, Orientable, AppChooser; match fn { type_ => || ffi::gtk_app_chooser_widget_get_type(), } } impl AppChooserWidget { pub const NONE: Option<&'static AppChooserWidget> = None; #[doc(alias = "gtk_app_chooser_widget_new")] pub fn new(content_type: &str) -> AppChooserWidget { assert_initialized_main_thread!(); unsafe { Widget::from_glib_none(ffi::gtk_app_chooser_widget_new( content_type.to_glib_none().0, )) .unsafe_cast() } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`AppChooserWidget`] objects. /// /// This method returns an instance of [`AppChooserWidgetBuilder`](crate::builders::AppChooserWidgetBuilder) which can be used to create [`AppChooserWidget`] objects. pub fn builder() -> AppChooserWidgetBuilder { AppChooserWidgetBuilder::new() } } impl Default for AppChooserWidget { fn default() -> Self { glib::object::Object::new::() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`AppChooserWidget`] 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 AppChooserWidgetBuilder { builder: glib::object::ObjectBuilder<'static, AppChooserWidget>, } impl AppChooserWidgetBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } pub fn default_text(self, default_text: impl Into) -> Self { Self { builder: self.builder.property("default-text", default_text.into()), } } pub fn show_all(self, show_all: bool) -> Self { Self { builder: self.builder.property("show-all", show_all), } } pub fn show_default(self, show_default: bool) -> Self { Self { builder: self.builder.property("show-default", show_default), } } pub fn show_fallback(self, show_fallback: bool) -> Self { Self { builder: self.builder.property("show-fallback", show_fallback), } } pub fn show_other(self, show_other: bool) -> Self { Self { builder: self.builder.property("show-other", show_other), } } pub fn show_recommended(self, show_recommended: bool) -> Self { Self { builder: self.builder.property("show-recommended", show_recommended), } } pub fn baseline_position(self, baseline_position: BaselinePosition) -> Self { Self { builder: self .builder .property("baseline-position", baseline_position), } } pub fn homogeneous(self, homogeneous: bool) -> Self { Self { builder: self.builder.property("homogeneous", homogeneous), } } pub fn spacing(self, spacing: i32) -> Self { Self { builder: self.builder.property("spacing", spacing), } } 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: 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: 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 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: 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: Orientation) -> Self { Self { builder: self.builder.property("orientation", orientation), } } pub fn content_type(self, content_type: impl Into) -> Self { Self { builder: self.builder.property("content-type", content_type.into()), } } // rustdoc-stripper-ignore-next /// Build the [`AppChooserWidget`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> AppChooserWidget { self.builder.build() } } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait AppChooserWidgetExt: IsA + sealed::Sealed + 'static { #[doc(alias = "gtk_app_chooser_widget_get_default_text")] #[doc(alias = "get_default_text")] fn default_text(&self) -> Option { unsafe { from_glib_none(ffi::gtk_app_chooser_widget_get_default_text( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_app_chooser_widget_get_show_all")] #[doc(alias = "get_show_all")] fn shows_all(&self) -> bool { unsafe { from_glib(ffi::gtk_app_chooser_widget_get_show_all( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_app_chooser_widget_get_show_default")] #[doc(alias = "get_show_default")] fn shows_default(&self) -> bool { unsafe { from_glib(ffi::gtk_app_chooser_widget_get_show_default( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_app_chooser_widget_get_show_fallback")] #[doc(alias = "get_show_fallback")] fn shows_fallback(&self) -> bool { unsafe { from_glib(ffi::gtk_app_chooser_widget_get_show_fallback( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_app_chooser_widget_get_show_other")] #[doc(alias = "get_show_other")] fn shows_other(&self) -> bool { unsafe { from_glib(ffi::gtk_app_chooser_widget_get_show_other( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_app_chooser_widget_get_show_recommended")] #[doc(alias = "get_show_recommended")] fn shows_recommended(&self) -> bool { unsafe { from_glib(ffi::gtk_app_chooser_widget_get_show_recommended( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_app_chooser_widget_set_default_text")] fn set_default_text(&self, text: &str) { unsafe { ffi::gtk_app_chooser_widget_set_default_text( self.as_ref().to_glib_none().0, text.to_glib_none().0, ); } } #[doc(alias = "gtk_app_chooser_widget_set_show_all")] fn set_show_all(&self, setting: bool) { unsafe { ffi::gtk_app_chooser_widget_set_show_all( self.as_ref().to_glib_none().0, setting.into_glib(), ); } } #[doc(alias = "gtk_app_chooser_widget_set_show_default")] fn set_show_default(&self, setting: bool) { unsafe { ffi::gtk_app_chooser_widget_set_show_default( self.as_ref().to_glib_none().0, setting.into_glib(), ); } } #[doc(alias = "gtk_app_chooser_widget_set_show_fallback")] fn set_show_fallback(&self, setting: bool) { unsafe { ffi::gtk_app_chooser_widget_set_show_fallback( self.as_ref().to_glib_none().0, setting.into_glib(), ); } } #[doc(alias = "gtk_app_chooser_widget_set_show_other")] fn set_show_other(&self, setting: bool) { unsafe { ffi::gtk_app_chooser_widget_set_show_other( self.as_ref().to_glib_none().0, setting.into_glib(), ); } } #[doc(alias = "gtk_app_chooser_widget_set_show_recommended")] fn set_show_recommended(&self, setting: bool) { unsafe { ffi::gtk_app_chooser_widget_set_show_recommended( self.as_ref().to_glib_none().0, setting.into_glib(), ); } } #[doc(alias = "application-activated")] fn connect_application_activated( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn application_activated_trampoline< P: IsA, F: Fn(&P, &gio::AppInfo) + 'static, >( this: *mut ffi::GtkAppChooserWidget, application: *mut gio::ffi::GAppInfo, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f( AppChooserWidget::from_glib_borrow(this).unsafe_cast_ref(), &from_glib_borrow(application), ) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"application-activated\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( application_activated_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "application-selected")] fn connect_application_selected( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn application_selected_trampoline< P: IsA, F: Fn(&P, &gio::AppInfo) + 'static, >( this: *mut ffi::GtkAppChooserWidget, application: *mut gio::ffi::GAppInfo, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f( AppChooserWidget::from_glib_borrow(this).unsafe_cast_ref(), &from_glib_borrow(application), ) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"application-selected\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( application_selected_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "populate-popup")] fn connect_populate_popup( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn populate_popup_trampoline< P: IsA, F: Fn(&P, &Menu, &gio::AppInfo) + 'static, >( this: *mut ffi::GtkAppChooserWidget, menu: *mut ffi::GtkMenu, application: *mut gio::ffi::GAppInfo, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f( AppChooserWidget::from_glib_borrow(this).unsafe_cast_ref(), &from_glib_borrow(menu), &from_glib_borrow(application), ) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"populate-popup\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( populate_popup_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "default-text")] fn connect_default_text_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_default_text_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::GtkAppChooserWidget, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(AppChooserWidget::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::default-text\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_default_text_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "show-all")] fn connect_show_all_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_show_all_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::GtkAppChooserWidget, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(AppChooserWidget::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::show-all\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_show_all_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "show-default")] fn connect_show_default_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_show_default_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::GtkAppChooserWidget, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(AppChooserWidget::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::show-default\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_show_default_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "show-fallback")] fn connect_show_fallback_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_show_fallback_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::GtkAppChooserWidget, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(AppChooserWidget::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::show-fallback\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_show_fallback_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "show-other")] fn connect_show_other_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_show_other_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::GtkAppChooserWidget, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(AppChooserWidget::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::show-other\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_show_other_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "show-recommended")] fn connect_show_recommended_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_show_recommended_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::GtkAppChooserWidget, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(AppChooserWidget::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::show-recommended\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_show_recommended_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl> AppChooserWidgetExt for O {} impl fmt::Display for AppChooserWidget { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("AppChooserWidget") } } rust-gtk-0.18-0.18.1/src/auto/application.rs000066400000000000000000000433051467506176400204020ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ApplicationInhibitFlags, Window}; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "GtkApplication")] pub struct Application(Object) @extends gio::Application, @implements gio::ActionGroup, gio::ActionMap; match fn { type_ => || ffi::gtk_application_get_type(), } } impl Application { pub const NONE: Option<&'static Application> = None; // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`Application`] objects. /// /// This method returns an instance of [`ApplicationBuilder`](crate::builders::ApplicationBuilder) which can be used to create [`Application`] objects. pub fn builder() -> ApplicationBuilder { ApplicationBuilder::new() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`Application`] 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 ApplicationBuilder { builder: glib::object::ObjectBuilder<'static, Application>, } impl ApplicationBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } pub fn app_menu(self, app_menu: &impl IsA) -> Self { Self { builder: self.builder.property("app-menu", app_menu.clone().upcast()), } } pub fn menubar(self, menubar: &impl IsA) -> Self { Self { builder: self.builder.property("menubar", menubar.clone().upcast()), } } pub fn register_session(self, register_session: bool) -> Self { Self { builder: self.builder.property("register-session", register_session), } } pub fn action_group(self, action_group: &impl IsA) -> Self { Self { builder: self .builder .property("action-group", action_group.clone().upcast()), } } pub fn application_id(self, application_id: impl Into) -> Self { Self { builder: self .builder .property("application-id", application_id.into()), } } pub fn flags(self, flags: gio::ApplicationFlags) -> Self { Self { builder: self.builder.property("flags", flags), } } pub fn inactivity_timeout(self, inactivity_timeout: u32) -> Self { Self { builder: self .builder .property("inactivity-timeout", inactivity_timeout), } } pub fn resource_base_path(self, resource_base_path: impl Into) -> Self { Self { builder: self .builder .property("resource-base-path", resource_base_path.into()), } } // rustdoc-stripper-ignore-next /// Build the [`Application`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> Application { let ret = self.builder.build(); { Application::register_startup_hook(&ret); } ret } } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait GtkApplicationExt: IsA + sealed::Sealed + 'static { #[doc(alias = "gtk_application_add_window")] fn add_window(&self, window: &impl IsA) { unsafe { ffi::gtk_application_add_window( self.as_ref().to_glib_none().0, window.as_ref().to_glib_none().0, ); } } #[doc(alias = "gtk_application_get_accels_for_action")] #[doc(alias = "get_accels_for_action")] fn accels_for_action(&self, detailed_action_name: &str) -> Vec { unsafe { FromGlibPtrContainer::from_glib_full(ffi::gtk_application_get_accels_for_action( self.as_ref().to_glib_none().0, detailed_action_name.to_glib_none().0, )) } } #[doc(alias = "gtk_application_get_actions_for_accel")] #[doc(alias = "get_actions_for_accel")] fn actions_for_accel(&self, accel: &str) -> Vec { unsafe { FromGlibPtrContainer::from_glib_full(ffi::gtk_application_get_actions_for_accel( self.as_ref().to_glib_none().0, accel.to_glib_none().0, )) } } #[doc(alias = "gtk_application_get_active_window")] #[doc(alias = "get_active_window")] fn active_window(&self) -> Option { unsafe { from_glib_none(ffi::gtk_application_get_active_window( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_application_get_app_menu")] #[doc(alias = "get_app_menu")] fn app_menu(&self) -> Option { unsafe { from_glib_none(ffi::gtk_application_get_app_menu( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_application_get_menu_by_id")] #[doc(alias = "get_menu_by_id")] fn menu_by_id(&self, id: &str) -> Option { unsafe { from_glib_none(ffi::gtk_application_get_menu_by_id( self.as_ref().to_glib_none().0, id.to_glib_none().0, )) } } #[doc(alias = "gtk_application_get_menubar")] #[doc(alias = "get_menubar")] fn menubar(&self) -> Option { unsafe { from_glib_none(ffi::gtk_application_get_menubar( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_application_get_window_by_id")] #[doc(alias = "get_window_by_id")] fn window_by_id(&self, id: u32) -> Option { unsafe { from_glib_none(ffi::gtk_application_get_window_by_id( self.as_ref().to_glib_none().0, id, )) } } #[doc(alias = "gtk_application_get_windows")] #[doc(alias = "get_windows")] fn windows(&self) -> Vec { unsafe { FromGlibPtrContainer::from_glib_none(ffi::gtk_application_get_windows( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_application_inhibit")] fn inhibit( &self, window: Option<&impl IsA>, flags: ApplicationInhibitFlags, reason: Option<&str>, ) -> u32 { unsafe { ffi::gtk_application_inhibit( self.as_ref().to_glib_none().0, window.map(|p| p.as_ref()).to_glib_none().0, flags.into_glib(), reason.to_glib_none().0, ) } } #[doc(alias = "gtk_application_is_inhibited")] fn is_inhibited(&self, flags: ApplicationInhibitFlags) -> bool { unsafe { from_glib(ffi::gtk_application_is_inhibited( self.as_ref().to_glib_none().0, flags.into_glib(), )) } } #[doc(alias = "gtk_application_list_action_descriptions")] fn list_action_descriptions(&self) -> Vec { unsafe { FromGlibPtrContainer::from_glib_full(ffi::gtk_application_list_action_descriptions( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_application_prefers_app_menu")] fn prefers_app_menu(&self) -> bool { unsafe { from_glib(ffi::gtk_application_prefers_app_menu( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_application_remove_window")] fn remove_window(&self, window: &impl IsA) { unsafe { ffi::gtk_application_remove_window( self.as_ref().to_glib_none().0, window.as_ref().to_glib_none().0, ); } } #[doc(alias = "gtk_application_set_accels_for_action")] fn set_accels_for_action(&self, detailed_action_name: &str, accels: &[&str]) { unsafe { ffi::gtk_application_set_accels_for_action( self.as_ref().to_glib_none().0, detailed_action_name.to_glib_none().0, accels.to_glib_none().0, ); } } #[doc(alias = "gtk_application_set_app_menu")] fn set_app_menu(&self, app_menu: Option<&impl IsA>) { unsafe { ffi::gtk_application_set_app_menu( self.as_ref().to_glib_none().0, app_menu.map(|p| p.as_ref()).to_glib_none().0, ); } } #[doc(alias = "gtk_application_set_menubar")] fn set_menubar(&self, menubar: Option<&impl IsA>) { unsafe { ffi::gtk_application_set_menubar( self.as_ref().to_glib_none().0, menubar.map(|p| p.as_ref()).to_glib_none().0, ); } } #[doc(alias = "gtk_application_uninhibit")] fn uninhibit(&self, cookie: u32) { unsafe { ffi::gtk_application_uninhibit(self.as_ref().to_glib_none().0, cookie); } } #[doc(alias = "register-session")] fn is_register_session(&self) -> bool { ObjectExt::property(self.as_ref(), "register-session") } #[doc(alias = "register-session")] fn set_register_session(&self, register_session: bool) { ObjectExt::set_property(self.as_ref(), "register-session", register_session) } #[cfg(feature = "v3_24")] #[cfg_attr(docsrs, doc(cfg(feature = "v3_24")))] #[doc(alias = "screensaver-active")] fn is_screensaver_active(&self) -> bool { ObjectExt::property(self.as_ref(), "screensaver-active") } #[cfg(feature = "v3_24_8")] #[cfg_attr(docsrs, doc(cfg(feature = "v3_24_8")))] #[doc(alias = "query-end")] fn connect_query_end(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn query_end_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::GtkApplication, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Application::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"query-end\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( query_end_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "window-added")] fn connect_window_added(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn window_added_trampoline< P: IsA, F: Fn(&P, &Window) + 'static, >( this: *mut ffi::GtkApplication, window: *mut ffi::GtkWindow, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f( Application::from_glib_borrow(this).unsafe_cast_ref(), &from_glib_borrow(window), ) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"window-added\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( window_added_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "window-removed")] fn connect_window_removed(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn window_removed_trampoline< P: IsA, F: Fn(&P, &Window) + 'static, >( this: *mut ffi::GtkApplication, window: *mut ffi::GtkWindow, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f( Application::from_glib_borrow(this).unsafe_cast_ref(), &from_glib_borrow(window), ) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"window-removed\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( window_removed_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "active-window")] fn connect_active_window_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_active_window_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::GtkApplication, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Application::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::active-window\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_active_window_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "app-menu")] fn connect_app_menu_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_app_menu_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::GtkApplication, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Application::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::app-menu\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_app_menu_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "menubar")] fn connect_menubar_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_menubar_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::GtkApplication, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Application::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::menubar\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_menubar_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "register-session")] fn connect_register_session_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_register_session_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::GtkApplication, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Application::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::register-session\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_register_session_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v3_24")] #[cfg_attr(docsrs, doc(cfg(feature = "v3_24")))] #[doc(alias = "screensaver-active")] fn connect_screensaver_active_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_screensaver_active_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::GtkApplication, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Application::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::screensaver-active\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_screensaver_active_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl> GtkApplicationExt for O {} impl fmt::Display for Application { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Application") } } rust-gtk-0.18-0.18.1/src/auto/application_window.rs000066400000000000000000000367321467506176400217770ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ Align, Application, Bin, Buildable, Container, ResizeMode, ShortcutsWindow, Widget, Window, WindowPosition, WindowType, }; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "GtkApplicationWindow")] pub struct ApplicationWindow(Object) @extends Window, Bin, Container, Widget, @implements Buildable, gio::ActionGroup, gio::ActionMap; match fn { type_ => || ffi::gtk_application_window_get_type(), } } impl ApplicationWindow { pub const NONE: Option<&'static ApplicationWindow> = None; // 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() } } // 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: 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: &gdk::Screen) -> Self { Self { builder: self.builder.property("screen", screen.clone()), } } 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_: WindowType) -> Self { Self { builder: self.builder.property("type", type_), } } pub fn type_hint(self, type_hint: 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: 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: 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: 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 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: 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() } } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait ApplicationWindowExt: IsA + sealed::Sealed + 'static { #[doc(alias = "gtk_application_window_get_help_overlay")] #[doc(alias = "get_help_overlay")] fn help_overlay(&self) -> Option { unsafe { from_glib_none(ffi::gtk_application_window_get_help_overlay( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_application_window_get_id")] #[doc(alias = "get_id")] fn id(&self) -> u32 { unsafe { ffi::gtk_application_window_get_id(self.as_ref().to_glib_none().0) } } #[doc(alias = "gtk_application_window_get_show_menubar")] #[doc(alias = "get_show_menubar")] fn shows_menubar(&self) -> bool { unsafe { from_glib(ffi::gtk_application_window_get_show_menubar( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_application_window_set_help_overlay")] fn set_help_overlay(&self, help_overlay: Option<&impl IsA>) { unsafe { ffi::gtk_application_window_set_help_overlay( self.as_ref().to_glib_none().0, help_overlay.map(|p| p.as_ref()).to_glib_none().0, ); } } #[doc(alias = "gtk_application_window_set_show_menubar")] fn set_show_menubar(&self, show_menubar: bool) { unsafe { ffi::gtk_application_window_set_show_menubar( self.as_ref().to_glib_none().0, show_menubar.into_glib(), ); } } #[doc(alias = "show-menubar")] fn connect_show_menubar_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_show_menubar_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::GtkApplicationWindow, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(ApplicationWindow::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::show-menubar\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_show_menubar_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl> ApplicationWindowExt for O {} impl fmt::Display for ApplicationWindow { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("ApplicationWindow") } } rust-gtk-0.18-0.18.1/src/auto/aspect_frame.rs000066400000000000000000000347211467506176400205320ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{Align, Bin, Buildable, Container, Frame, ResizeMode, ShadowType, Widget}; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "GtkAspectFrame")] pub struct AspectFrame(Object) @extends Frame, Bin, Container, Widget, @implements Buildable; match fn { type_ => || ffi::gtk_aspect_frame_get_type(), } } impl AspectFrame { pub const NONE: Option<&'static AspectFrame> = None; #[doc(alias = "gtk_aspect_frame_new")] pub fn new( label: Option<&str>, xalign: f32, yalign: f32, ratio: f32, obey_child: bool, ) -> AspectFrame { assert_initialized_main_thread!(); unsafe { Widget::from_glib_none(ffi::gtk_aspect_frame_new( label.to_glib_none().0, xalign, yalign, ratio, obey_child.into_glib(), )) .unsafe_cast() } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`AspectFrame`] objects. /// /// This method returns an instance of [`AspectFrameBuilder`](crate::builders::AspectFrameBuilder) which can be used to create [`AspectFrame`] objects. pub fn builder() -> AspectFrameBuilder { AspectFrameBuilder::new() } } impl Default for AspectFrame { fn default() -> Self { glib::object::Object::new::() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`AspectFrame`] 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 AspectFrameBuilder { builder: glib::object::ObjectBuilder<'static, AspectFrame>, } impl AspectFrameBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } pub fn obey_child(self, obey_child: bool) -> Self { Self { builder: self.builder.property("obey-child", obey_child), } } pub fn ratio(self, ratio: f32) -> Self { Self { builder: self.builder.property("ratio", ratio), } } 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 label(self, label: impl Into) -> Self { Self { builder: self.builder.property("label", label.into()), } } pub fn label_widget(self, label_widget: &impl IsA) -> Self { Self { builder: self .builder .property("label-widget", label_widget.clone().upcast()), } } pub fn label_xalign(self, label_xalign: f32) -> Self { Self { builder: self.builder.property("label-xalign", label_xalign), } } pub fn label_yalign(self, label_yalign: f32) -> Self { Self { builder: self.builder.property("label-yalign", label_yalign), } } pub fn shadow_type(self, shadow_type: ShadowType) -> Self { Self { builder: self.builder.property("shadow-type", shadow_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: 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: 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 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: 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 [`AspectFrame`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> AspectFrame { self.builder.build() } } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait AspectFrameExt: IsA + sealed::Sealed + 'static { #[doc(alias = "gtk_aspect_frame_set")] fn set(&self, xalign: f32, yalign: f32, ratio: f32, obey_child: bool) { unsafe { ffi::gtk_aspect_frame_set( self.as_ref().to_glib_none().0, xalign, yalign, ratio, obey_child.into_glib(), ); } } #[doc(alias = "obey-child")] fn is_obey_child(&self) -> bool { ObjectExt::property(self.as_ref(), "obey-child") } #[doc(alias = "obey-child")] fn set_obey_child(&self, obey_child: bool) { ObjectExt::set_property(self.as_ref(), "obey-child", obey_child) } fn ratio(&self) -> f32 { ObjectExt::property(self.as_ref(), "ratio") } fn set_ratio(&self, ratio: f32) { ObjectExt::set_property(self.as_ref(), "ratio", ratio) } fn xalign(&self) -> f32 { ObjectExt::property(self.as_ref(), "xalign") } fn set_xalign(&self, xalign: f32) { ObjectExt::set_property(self.as_ref(), "xalign", xalign) } fn yalign(&self) -> f32 { ObjectExt::property(self.as_ref(), "yalign") } fn set_yalign(&self, yalign: f32) { ObjectExt::set_property(self.as_ref(), "yalign", yalign) } #[doc(alias = "obey-child")] fn connect_obey_child_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_obey_child_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::GtkAspectFrame, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(AspectFrame::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::obey-child\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_obey_child_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "ratio")] fn connect_ratio_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_ratio_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::GtkAspectFrame, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(AspectFrame::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::ratio\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_ratio_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "xalign")] fn connect_xalign_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_xalign_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::GtkAspectFrame, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(AspectFrame::from_glib_borrow(this).unsafe_cast_ref()) } 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")] fn connect_yalign_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_yalign_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::GtkAspectFrame, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(AspectFrame::from_glib_borrow(this).unsafe_cast_ref()) } 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> AspectFrameExt for O {} impl fmt::Display for AspectFrame { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("AspectFrame") } } rust-gtk-0.18-0.18.1/src/auto/assistant.rs000066400000000000000000000663211467506176400201130ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ Align, Application, AssistantPageType, Bin, Buildable, Container, ResizeMode, Widget, Window, WindowPosition, WindowType, }; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "GtkAssistant")] pub struct Assistant(Object) @extends Window, Bin, Container, Widget, @implements Buildable; match fn { type_ => || ffi::gtk_assistant_get_type(), } } impl Assistant { pub const NONE: Option<&'static Assistant> = None; #[doc(alias = "gtk_assistant_new")] pub fn new() -> Assistant { assert_initialized_main_thread!(); unsafe { Widget::from_glib_none(ffi::gtk_assistant_new()).unsafe_cast() } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`Assistant`] objects. /// /// This method returns an instance of [`AssistantBuilder`](crate::builders::AssistantBuilder) which can be used to create [`Assistant`] objects. pub fn builder() -> AssistantBuilder { AssistantBuilder::new() } } impl Default for Assistant { fn default() -> Self { Self::new() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`Assistant`] 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 AssistantBuilder { builder: glib::object::ObjectBuilder<'static, Assistant>, } impl AssistantBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } pub fn use_header_bar(self, use_header_bar: i32) -> Self { Self { builder: self.builder.property("use-header-bar", use_header_bar), } } 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: 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: &gdk::Screen) -> Self { Self { builder: self.builder.property("screen", screen.clone()), } } 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_: WindowType) -> Self { Self { builder: self.builder.property("type", type_), } } pub fn type_hint(self, type_hint: 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: 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: 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: 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 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: 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 [`Assistant`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> Assistant { self.builder.build() } } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait AssistantExt: IsA + sealed::Sealed + 'static { #[doc(alias = "gtk_assistant_add_action_widget")] fn add_action_widget(&self, child: &impl IsA) { unsafe { ffi::gtk_assistant_add_action_widget( self.as_ref().to_glib_none().0, child.as_ref().to_glib_none().0, ); } } #[doc(alias = "gtk_assistant_append_page")] fn append_page(&self, page: &impl IsA) -> i32 { unsafe { ffi::gtk_assistant_append_page( self.as_ref().to_glib_none().0, page.as_ref().to_glib_none().0, ) } } #[doc(alias = "gtk_assistant_commit")] fn commit(&self) { unsafe { ffi::gtk_assistant_commit(self.as_ref().to_glib_none().0); } } #[doc(alias = "gtk_assistant_get_current_page")] #[doc(alias = "get_current_page")] fn current_page(&self) -> i32 { unsafe { ffi::gtk_assistant_get_current_page(self.as_ref().to_glib_none().0) } } #[doc(alias = "gtk_assistant_get_n_pages")] #[doc(alias = "get_n_pages")] fn n_pages(&self) -> i32 { unsafe { ffi::gtk_assistant_get_n_pages(self.as_ref().to_glib_none().0) } } #[doc(alias = "gtk_assistant_get_nth_page")] #[doc(alias = "get_nth_page")] fn nth_page(&self, page_num: i32) -> Option { unsafe { from_glib_none(ffi::gtk_assistant_get_nth_page( self.as_ref().to_glib_none().0, page_num, )) } } #[doc(alias = "gtk_assistant_get_page_complete")] #[doc(alias = "get_page_complete")] fn page_is_complete(&self, page: &impl IsA) -> bool { unsafe { from_glib(ffi::gtk_assistant_get_page_complete( self.as_ref().to_glib_none().0, page.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_assistant_get_page_has_padding")] #[doc(alias = "get_page_has_padding")] fn page_has_padding(&self, page: &impl IsA) -> bool { unsafe { from_glib(ffi::gtk_assistant_get_page_has_padding( self.as_ref().to_glib_none().0, page.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_assistant_get_page_title")] #[doc(alias = "get_page_title")] fn page_title(&self, page: &impl IsA) -> Option { unsafe { from_glib_none(ffi::gtk_assistant_get_page_title( self.as_ref().to_glib_none().0, page.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_assistant_get_page_type")] #[doc(alias = "get_page_type")] fn page_type(&self, page: &impl IsA) -> AssistantPageType { unsafe { from_glib(ffi::gtk_assistant_get_page_type( self.as_ref().to_glib_none().0, page.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_assistant_insert_page")] fn insert_page(&self, page: &impl IsA, position: i32) -> i32 { unsafe { ffi::gtk_assistant_insert_page( self.as_ref().to_glib_none().0, page.as_ref().to_glib_none().0, position, ) } } #[doc(alias = "gtk_assistant_next_page")] fn next_page(&self) { unsafe { ffi::gtk_assistant_next_page(self.as_ref().to_glib_none().0); } } #[doc(alias = "gtk_assistant_prepend_page")] fn prepend_page(&self, page: &impl IsA) -> i32 { unsafe { ffi::gtk_assistant_prepend_page( self.as_ref().to_glib_none().0, page.as_ref().to_glib_none().0, ) } } #[doc(alias = "gtk_assistant_previous_page")] fn previous_page(&self) { unsafe { ffi::gtk_assistant_previous_page(self.as_ref().to_glib_none().0); } } #[doc(alias = "gtk_assistant_remove_action_widget")] fn remove_action_widget(&self, child: &impl IsA) { unsafe { ffi::gtk_assistant_remove_action_widget( self.as_ref().to_glib_none().0, child.as_ref().to_glib_none().0, ); } } #[doc(alias = "gtk_assistant_remove_page")] fn remove_page(&self, page_num: i32) { unsafe { ffi::gtk_assistant_remove_page(self.as_ref().to_glib_none().0, page_num); } } #[doc(alias = "gtk_assistant_set_current_page")] fn set_current_page(&self, page_num: i32) { unsafe { ffi::gtk_assistant_set_current_page(self.as_ref().to_glib_none().0, page_num); } } #[doc(alias = "gtk_assistant_set_forward_page_func")] fn set_forward_page_func(&self, page_func: Option i32 + 'static>>) { let page_func_data: Box_ i32 + 'static>>> = Box_::new(page_func); unsafe extern "C" fn page_func_func( current_page: libc::c_int, data: glib::ffi::gpointer, ) -> libc::c_int { let callback: &Option i32 + 'static>> = &*(data as *mut _); if let Some(ref callback) = *callback { callback(current_page) } else { panic!("cannot get closure...") } } let page_func = if page_func_data.is_some() { Some(page_func_func as _) } else { None }; unsafe extern "C" fn destroy_func(data: glib::ffi::gpointer) { let _callback: Box_ i32 + 'static>>> = Box_::from_raw(data as *mut _); } let destroy_call3 = Some(destroy_func as _); let super_callback0: Box_ i32 + 'static>>> = page_func_data; unsafe { ffi::gtk_assistant_set_forward_page_func( self.as_ref().to_glib_none().0, page_func, Box_::into_raw(super_callback0) as *mut _, destroy_call3, ); } } #[doc(alias = "gtk_assistant_set_page_complete")] fn set_page_complete(&self, page: &impl IsA, complete: bool) { unsafe { ffi::gtk_assistant_set_page_complete( self.as_ref().to_glib_none().0, page.as_ref().to_glib_none().0, complete.into_glib(), ); } } #[doc(alias = "gtk_assistant_set_page_has_padding")] fn set_page_has_padding(&self, page: &impl IsA, has_padding: bool) { unsafe { ffi::gtk_assistant_set_page_has_padding( self.as_ref().to_glib_none().0, page.as_ref().to_glib_none().0, has_padding.into_glib(), ); } } #[doc(alias = "gtk_assistant_set_page_title")] fn set_page_title(&self, page: &impl IsA, title: &str) { unsafe { ffi::gtk_assistant_set_page_title( self.as_ref().to_glib_none().0, page.as_ref().to_glib_none().0, title.to_glib_none().0, ); } } #[doc(alias = "gtk_assistant_set_page_type")] fn set_page_type(&self, page: &impl IsA, type_: AssistantPageType) { unsafe { ffi::gtk_assistant_set_page_type( self.as_ref().to_glib_none().0, page.as_ref().to_glib_none().0, type_.into_glib(), ); } } #[doc(alias = "gtk_assistant_update_buttons_state")] fn update_buttons_state(&self) { unsafe { ffi::gtk_assistant_update_buttons_state(self.as_ref().to_glib_none().0); } } #[doc(alias = "use-header-bar")] fn use_header_bar(&self) -> i32 { ObjectExt::property(self.as_ref(), "use-header-bar") } fn child_is_complete>(&self, item: &T) -> bool { crate::prelude::ContainerExtManual::child_property( self.as_ref(), &item.clone().upcast(), "complete", ) } fn set_child_complete>(&self, item: &T, complete: bool) { crate::prelude::ContainerExtManual::child_set_property( self.as_ref(), &item.clone().upcast(), "complete", &complete, ) } #[doc(alias = "child.has-padding")] fn child_has_padding>(&self, item: &T) -> bool { crate::prelude::ContainerExtManual::child_property( self.as_ref(), &item.clone().upcast(), "has-padding", ) } #[doc(alias = "child.has-padding")] fn set_child_has_padding>(&self, item: &T, has_padding: bool) { crate::prelude::ContainerExtManual::child_set_property( self.as_ref(), &item.clone().upcast(), "has-padding", &has_padding, ) } #[doc(alias = "child.page-type")] fn child_page_type>(&self, item: &T) -> AssistantPageType { crate::prelude::ContainerExtManual::child_property( self.as_ref(), &item.clone().upcast(), "page-type", ) } #[doc(alias = "child.page-type")] fn set_child_page_type>(&self, item: &T, page_type: AssistantPageType) { crate::prelude::ContainerExtManual::child_set_property( self.as_ref(), &item.clone().upcast(), "page-type", &page_type, ) } fn child_title>(&self, item: &T) -> Option { crate::prelude::ContainerExtManual::child_property( self.as_ref(), &item.clone().upcast(), "title", ) } fn set_child_title>(&self, item: &T, title: Option<&str>) { crate::prelude::ContainerExtManual::child_set_property( self.as_ref(), &item.clone().upcast(), "title", &title, ) } #[doc(alias = "apply")] fn connect_apply(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn apply_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::GtkAssistant, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Assistant::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"apply\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( apply_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "cancel")] fn connect_cancel(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn cancel_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::GtkAssistant, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Assistant::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"cancel\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( cancel_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "close")] fn connect_close(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn close_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::GtkAssistant, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Assistant::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"close\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( close_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "escape")] fn connect_escape(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn escape_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::GtkAssistant, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Assistant::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"escape\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( escape_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn emit_escape(&self) { self.emit_by_name::<()>("escape", &[]); } #[doc(alias = "prepare")] fn connect_prepare(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn prepare_trampoline, F: Fn(&P, &Widget) + 'static>( this: *mut ffi::GtkAssistant, page: *mut ffi::GtkWidget, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f( Assistant::from_glib_borrow(this).unsafe_cast_ref(), &from_glib_borrow(page), ) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"prepare\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( prepare_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl> AssistantExt for O {} impl fmt::Display for Assistant { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Assistant") } } rust-gtk-0.18-0.18.1/src/auto/bin.rs000066400000000000000000000020161467506176400166410ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{Buildable, Container, Widget}; use glib::{prelude::*, translate::*}; use std::fmt; glib::wrapper! { #[doc(alias = "GtkBin")] pub struct Bin(Object) @extends Container, Widget, @implements Buildable; match fn { type_ => || ffi::gtk_bin_get_type(), } } impl Bin { pub const NONE: Option<&'static Bin> = None; } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait BinExt: IsA + sealed::Sealed + 'static { #[doc(alias = "gtk_bin_get_child")] #[doc(alias = "get_child")] fn child(&self) -> Option { unsafe { from_glib_none(ffi::gtk_bin_get_child(self.as_ref().to_glib_none().0)) } } } impl> BinExt for O {} impl fmt::Display for Bin { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Bin") } } rust-gtk-0.18-0.18.1/src/auto/box_.rs000066400000000000000000000445001467506176400170240ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ Align, BaselinePosition, Buildable, Container, Orientable, Orientation, PackType, ResizeMode, Widget, }; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem, mem::transmute}; glib::wrapper! { #[doc(alias = "GtkBox")] pub struct Box(Object) @extends Container, Widget, @implements Buildable, Orientable; match fn { type_ => || ffi::gtk_box_get_type(), } } impl Box { pub const NONE: Option<&'static Box> = None; #[doc(alias = "gtk_box_new")] pub fn new(orientation: Orientation, spacing: i32) -> Box { assert_initialized_main_thread!(); unsafe { Widget::from_glib_none(ffi::gtk_box_new(orientation.into_glib(), spacing)).unsafe_cast() } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`Box`] objects. /// /// This method returns an instance of [`BoxBuilder`](crate::builders::BoxBuilder) which can be used to create [`Box`] objects. pub fn builder() -> BoxBuilder { BoxBuilder::new() } } impl Default for Box { fn default() -> Self { glib::object::Object::new::() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`Box`] 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 BoxBuilder { builder: glib::object::ObjectBuilder<'static, Box>, } impl BoxBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } pub fn baseline_position(self, baseline_position: BaselinePosition) -> Self { Self { builder: self .builder .property("baseline-position", baseline_position), } } pub fn homogeneous(self, homogeneous: bool) -> Self { Self { builder: self.builder.property("homogeneous", homogeneous), } } pub fn spacing(self, spacing: i32) -> Self { Self { builder: self.builder.property("spacing", spacing), } } 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: 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: 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 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: 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: Orientation) -> Self { Self { builder: self.builder.property("orientation", orientation), } } // rustdoc-stripper-ignore-next /// Build the [`Box`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> Box { self.builder.build() } } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait BoxExt: IsA + sealed::Sealed + 'static { #[doc(alias = "gtk_box_get_baseline_position")] #[doc(alias = "get_baseline_position")] fn baseline_position(&self) -> BaselinePosition { unsafe { from_glib(ffi::gtk_box_get_baseline_position( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_box_get_center_widget")] #[doc(alias = "get_center_widget")] fn center_widget(&self) -> Option { unsafe { from_glib_none(ffi::gtk_box_get_center_widget( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_box_get_homogeneous")] #[doc(alias = "get_homogeneous")] fn is_homogeneous(&self) -> bool { unsafe { from_glib(ffi::gtk_box_get_homogeneous(self.as_ref().to_glib_none().0)) } } #[doc(alias = "gtk_box_get_spacing")] #[doc(alias = "get_spacing")] fn spacing(&self) -> i32 { unsafe { ffi::gtk_box_get_spacing(self.as_ref().to_glib_none().0) } } #[doc(alias = "gtk_box_pack_end")] fn pack_end(&self, child: &impl IsA, expand: bool, fill: bool, padding: u32) { unsafe { ffi::gtk_box_pack_end( self.as_ref().to_glib_none().0, child.as_ref().to_glib_none().0, expand.into_glib(), fill.into_glib(), padding, ); } } #[doc(alias = "gtk_box_pack_start")] fn pack_start(&self, child: &impl IsA, expand: bool, fill: bool, padding: u32) { unsafe { ffi::gtk_box_pack_start( self.as_ref().to_glib_none().0, child.as_ref().to_glib_none().0, expand.into_glib(), fill.into_glib(), padding, ); } } #[doc(alias = "gtk_box_query_child_packing")] fn query_child_packing(&self, child: &impl IsA) -> (bool, bool, u32, PackType) { unsafe { let mut expand = mem::MaybeUninit::uninit(); let mut fill = mem::MaybeUninit::uninit(); let mut padding = mem::MaybeUninit::uninit(); let mut pack_type = mem::MaybeUninit::uninit(); ffi::gtk_box_query_child_packing( self.as_ref().to_glib_none().0, child.as_ref().to_glib_none().0, expand.as_mut_ptr(), fill.as_mut_ptr(), padding.as_mut_ptr(), pack_type.as_mut_ptr(), ); ( from_glib(expand.assume_init()), from_glib(fill.assume_init()), padding.assume_init(), from_glib(pack_type.assume_init()), ) } } #[doc(alias = "gtk_box_reorder_child")] fn reorder_child(&self, child: &impl IsA, position: i32) { unsafe { ffi::gtk_box_reorder_child( self.as_ref().to_glib_none().0, child.as_ref().to_glib_none().0, position, ); } } #[doc(alias = "gtk_box_set_baseline_position")] fn set_baseline_position(&self, position: BaselinePosition) { unsafe { ffi::gtk_box_set_baseline_position( self.as_ref().to_glib_none().0, position.into_glib(), ); } } #[doc(alias = "gtk_box_set_center_widget")] fn set_center_widget(&self, widget: Option<&impl IsA>) { unsafe { ffi::gtk_box_set_center_widget( self.as_ref().to_glib_none().0, widget.map(|p| p.as_ref()).to_glib_none().0, ); } } #[doc(alias = "gtk_box_set_child_packing")] fn set_child_packing( &self, child: &impl IsA, expand: bool, fill: bool, padding: u32, pack_type: PackType, ) { unsafe { ffi::gtk_box_set_child_packing( self.as_ref().to_glib_none().0, child.as_ref().to_glib_none().0, expand.into_glib(), fill.into_glib(), padding, pack_type.into_glib(), ); } } #[doc(alias = "gtk_box_set_homogeneous")] fn set_homogeneous(&self, homogeneous: bool) { unsafe { ffi::gtk_box_set_homogeneous(self.as_ref().to_glib_none().0, homogeneous.into_glib()); } } #[doc(alias = "gtk_box_set_spacing")] fn set_spacing(&self, spacing: i32) { unsafe { ffi::gtk_box_set_spacing(self.as_ref().to_glib_none().0, spacing); } } fn child_expands>(&self, item: &T) -> bool { crate::prelude::ContainerExtManual::child_property( self.as_ref(), &item.clone().upcast(), "expand", ) } fn set_child_expand>(&self, item: &T, expand: bool) { crate::prelude::ContainerExtManual::child_set_property( self.as_ref(), &item.clone().upcast(), "expand", &expand, ) } fn child_fills>(&self, item: &T) -> bool { crate::prelude::ContainerExtManual::child_property( self.as_ref(), &item.clone().upcast(), "fill", ) } fn set_child_fill>(&self, item: &T, fill: bool) { crate::prelude::ContainerExtManual::child_set_property( self.as_ref(), &item.clone().upcast(), "fill", &fill, ) } #[doc(alias = "child.pack-type")] fn child_pack_type>(&self, item: &T) -> PackType { crate::prelude::ContainerExtManual::child_property( self.as_ref(), &item.clone().upcast(), "pack-type", ) } #[doc(alias = "child.pack-type")] fn set_child_pack_type>(&self, item: &T, pack_type: PackType) { crate::prelude::ContainerExtManual::child_set_property( self.as_ref(), &item.clone().upcast(), "pack-type", &pack_type, ) } fn child_padding>(&self, item: &T) -> u32 { crate::prelude::ContainerExtManual::child_property( self.as_ref(), &item.clone().upcast(), "padding", ) } fn set_child_padding>(&self, item: &T, padding: u32) { crate::prelude::ContainerExtManual::child_set_property( self.as_ref(), &item.clone().upcast(), "padding", &padding, ) } fn child_position>(&self, item: &T) -> i32 { crate::prelude::ContainerExtManual::child_property( self.as_ref(), &item.clone().upcast(), "position", ) } fn set_child_position>(&self, item: &T, position: i32) { crate::prelude::ContainerExtManual::child_set_property( self.as_ref(), &item.clone().upcast(), "position", &position, ) } #[doc(alias = "baseline-position")] fn connect_baseline_position_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_baseline_position_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::GtkBox, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Box::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::baseline-position\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_baseline_position_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "homogeneous")] fn connect_homogeneous_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_homogeneous_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::GtkBox, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Box::from_glib_borrow(this).unsafe_cast_ref()) } 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 = "spacing")] fn connect_spacing_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_spacing_trampoline, F: Fn(&P) + 'static>( this: *mut ffi::GtkBox, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Box::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), ) } } } impl> BoxExt for O {} impl fmt::Display for Box { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Box") } } rust-gtk-0.18-0.18.1/src/auto/buildable.rs000066400000000000000000000074241467506176400200240ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::Builder; use glib::{prelude::*, translate::*}; use std::fmt; glib::wrapper! { #[doc(alias = "GtkBuildable")] pub struct Buildable(Interface); match fn { type_ => || ffi::gtk_buildable_get_type(), } } impl Buildable { pub const NONE: Option<&'static Buildable> = None; } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait BuildableExt: IsA + sealed::Sealed + 'static { #[doc(alias = "gtk_buildable_add_child")] fn add_child( &self, builder: &impl IsA, child: &impl IsA, type_: Option<&str>, ) { unsafe { ffi::gtk_buildable_add_child( self.as_ref().to_glib_none().0, builder.as_ref().to_glib_none().0, child.as_ref().to_glib_none().0, type_.to_glib_none().0, ); } } #[doc(alias = "gtk_buildable_construct_child")] fn construct_child(&self, builder: &impl IsA, name: &str) -> Option { unsafe { from_glib_full(ffi::gtk_buildable_construct_child( self.as_ref().to_glib_none().0, builder.as_ref().to_glib_none().0, name.to_glib_none().0, )) } } //#[doc(alias = "gtk_buildable_custom_finished")] //fn custom_finished(&self, builder: &impl IsA, child: Option<&impl IsA>, tagname: &str, data: /*Unimplemented*/Option) { // unsafe { TODO: call ffi:gtk_buildable_custom_finished() } //} //#[doc(alias = "gtk_buildable_custom_tag_end")] //fn custom_tag_end(&self, builder: &impl IsA, child: Option<&impl IsA>, tagname: &str, data: /*Unimplemented*/Option) { // unsafe { TODO: call ffi:gtk_buildable_custom_tag_end() } //} //#[doc(alias = "gtk_buildable_custom_tag_start")] //fn custom_tag_start(&self, builder: &impl IsA, child: Option<&impl IsA>, tagname: &str, parser: /*Ignored*/glib::MarkupParser, data: /*Unimplemented*/&mut Option) -> bool { // unsafe { TODO: call ffi:gtk_buildable_custom_tag_start() } //} #[doc(alias = "gtk_buildable_get_internal_child")] #[doc(alias = "get_internal_child")] fn internal_child(&self, builder: &impl IsA, childname: &str) -> Option { unsafe { from_glib_none(ffi::gtk_buildable_get_internal_child( self.as_ref().to_glib_none().0, builder.as_ref().to_glib_none().0, childname.to_glib_none().0, )) } } #[doc(alias = "gtk_buildable_parser_finished")] fn parser_finished(&self, builder: &impl IsA) { unsafe { ffi::gtk_buildable_parser_finished( self.as_ref().to_glib_none().0, builder.as_ref().to_glib_none().0, ); } } #[doc(alias = "gtk_buildable_set_buildable_property")] fn set_buildable_property(&self, builder: &impl IsA, name: &str, value: &glib::Value) { unsafe { ffi::gtk_buildable_set_buildable_property( self.as_ref().to_glib_none().0, builder.as_ref().to_glib_none().0, name.to_glib_none().0, value.to_glib_none().0, ); } } } impl> BuildableExt for O {} impl fmt::Display for Buildable { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Buildable") } } rust-gtk-0.18-0.18.1/src/auto/builder.rs000066400000000000000000000172111467506176400175220ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::Application; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute, ptr}; glib::wrapper! { #[doc(alias = "GtkBuilder")] pub struct Builder(Object); match fn { type_ => || ffi::gtk_builder_get_type(), } } impl Builder { pub const NONE: Option<&'static Builder> = None; #[doc(alias = "gtk_builder_new")] pub fn new() -> Builder { assert_initialized_main_thread!(); unsafe { from_glib_full(ffi::gtk_builder_new()) } } #[doc(alias = "gtk_builder_new_from_resource")] #[doc(alias = "new_from_resource")] pub fn from_resource(resource_path: &str) -> Builder { assert_initialized_main_thread!(); unsafe { from_glib_full(ffi::gtk_builder_new_from_resource( resource_path.to_glib_none().0, )) } } #[doc(alias = "gtk_builder_new_from_string")] #[doc(alias = "new_from_string")] pub fn from_string(string: &str) -> Builder { assert_initialized_main_thread!(); let length = string.len() as _; unsafe { from_glib_full(ffi::gtk_builder_new_from_string( string.to_glib_none().0, length, )) } } } impl Default for Builder { fn default() -> Self { Self::new() } } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait BuilderExt: IsA + sealed::Sealed + 'static { //#[doc(alias = "gtk_builder_add_callback_symbol")] //fn add_callback_symbol(&self, callback_name: &str, callback_symbol: P) { // unsafe { TODO: call ffi:gtk_builder_add_callback_symbol() } //} //#[doc(alias = "gtk_builder_add_callback_symbols")] //fn add_callback_symbols(&self, first_callback_name: &str, first_callback_symbol: P, : /*Unknown conversion*//*Unimplemented*/Basic: VarArgs) { // unsafe { TODO: call ffi:gtk_builder_add_callback_symbols() } //} //#[doc(alias = "gtk_builder_connect_signals")] //fn connect_signals(&self, user_data: /*Unimplemented*/Option) { // unsafe { TODO: call ffi:gtk_builder_connect_signals() } //} #[doc(alias = "gtk_builder_expose_object")] fn expose_object(&self, name: &str, object: &impl IsA) { unsafe { ffi::gtk_builder_expose_object( self.as_ref().to_glib_none().0, name.to_glib_none().0, object.as_ref().to_glib_none().0, ); } } #[doc(alias = "gtk_builder_get_application")] #[doc(alias = "get_application")] fn application(&self) -> Option { unsafe { from_glib_none(ffi::gtk_builder_get_application( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_builder_get_objects")] #[doc(alias = "get_objects")] fn objects(&self) -> Vec { unsafe { FromGlibPtrContainer::from_glib_container(ffi::gtk_builder_get_objects( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_builder_get_translation_domain")] #[doc(alias = "get_translation_domain")] fn translation_domain(&self) -> Option { unsafe { from_glib_none(ffi::gtk_builder_get_translation_domain( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gtk_builder_get_type_from_name")] #[doc(alias = "get_type_from_name")] fn type_from_name(&self, type_name: &str) -> glib::types::Type { unsafe { from_glib(ffi::gtk_builder_get_type_from_name( self.as_ref().to_glib_none().0, type_name.to_glib_none().0, )) } } //#[doc(alias = "gtk_builder_lookup_callback_symbol")] //fn lookup_callback_symbol(&self, callback_name: &str) -> Option> { // unsafe { TODO: call ffi:gtk_builder_lookup_callback_symbol() } //} #[doc(alias = "gtk_builder_set_application")] fn set_application(&self, application: &impl IsA) { unsafe { ffi::gtk_builder_set_application( self.as_ref().to_glib_none().0, application.as_ref().to_glib_none().0, ); } } #[doc(alias = "gtk_builder_set_translation_domain")] fn set_translation_domain(&self, domain: Option<&str>) { unsafe { ffi::gtk_builder_set_translation_domain( self.as_ref().to_glib_none().0, domain.to_glib_none().0, ); } } #[doc(alias = "gtk_builder_value_from_string")] fn value_from_string( &self, pspec: impl AsRef, string: &str, ) -> Result { unsafe { let mut value = glib::Value::uninitialized(); let mut error = ptr::null_mut(); let is_ok = ffi::gtk_builder_value_from_string( self.as_ref().to_glib_none().0, pspec.as_ref().to_glib_none().0, string.to_glib_none().0, value.to_glib_none_mut().0, &mut error, ); debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(value) } else { Err(from_glib_full(error)) } } } #[doc(alias = "gtk_builder_value_from_string_type")] fn value_from_string_type( &self, type_: glib::types::Type, string: &str, ) -> Result { unsafe { let mut value = glib::Value::uninitialized(); let mut error = ptr::null_mut(); let is_ok = ffi::gtk_builder_value_from_string_type( self.as_ref().to_glib_none().0, type_.into_glib(), string.to_glib_none().0, value.to_glib_none_mut().0, &mut error, ); debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(value) } else { Err(from_glib_full(error)) } } } #[doc(alias = "translation-domain")] fn connect_translation_domain_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_translation_domain_trampoline< P: IsA, F: Fn(&P) + 'static, >( this: *mut ffi::GtkBuilder, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(Builder::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::translation-domain\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_translation_domain_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl> BuilderExt for O {} impl fmt::Display for Builder { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("Builder") } } rust-gtk-0.18-0.18.1/src/auto/button.rs000066400000000000000000000516271467506176400174200ustar00rootroot00000000000000// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use crate::{ Actionable, Align, Bin, Buildable, Container, IconSize, PositionType, ReliefStyle, ResizeMode, Widget, }; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::{boxed::Box as Box_, fmt, mem::transmute}; glib::wrapper! { #[doc(alias = "GtkButton")] pub struct Button(Object) @extends Bin, Container, Widget, @implements Buildable, Actionable; match fn { type_ => || ffi::gtk_button_get_type(), } } impl Button { pub const NONE: Option<&'static Button> = None; #[doc(alias = "gtk_button_new")] pub fn new() -> Button { assert_initialized_main_thread!(); unsafe { Widget::from_glib_none(ffi::gtk_button_new()).unsafe_cast() } } #[doc(alias = "gtk_button_new_from_icon_name")] #[doc(alias = "new_from_icon_name")] pub fn from_icon_name(icon_name: Option<&str>, size: IconSize) -> Button { assert_initialized_main_thread!(); unsafe { Widget::from_glib_none(ffi::gtk_button_new_from_icon_name( icon_name.to_glib_none().0, size.into_glib(), )) .unsafe_cast() } } #[doc(alias = "gtk_button_new_with_label")] #[doc(alias = "new_with_label")] pub fn with_label(label: &str) -> Button { assert_initialized_main_thread!(); unsafe { Widget::from_glib_none(ffi::gtk_button_new_with_label(label.to_glib_none().0)) .unsafe_cast() } } #[doc(alias = "gtk_button_new_with_mnemonic")] #[doc(alias = "new_with_mnemonic")] pub fn with_mnemonic(label: &str) -> Button { assert_initialized_main_thread!(); unsafe { Widget::from_glib_none(ffi::gtk_button_new_with_mnemonic(label.to_glib_none().0)) .unsafe_cast() } } // rustdoc-stripper-ignore-next /// Creates a new builder-pattern struct instance to construct [`Button`] objects. /// /// This method returns an instance of [`ButtonBuilder`](crate::builders::ButtonBuilder) which can be used to create [`Button`] objects. pub fn builder() -> ButtonBuilder { ButtonBuilder::new() } } impl Default for Button { fn default() -> Self { Self::new() } } // rustdoc-stripper-ignore-next /// A [builder-pattern] type to construct [`Button`] 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 ButtonBuilder { builder: glib::object::ObjectBuilder<'static, Button>, } impl ButtonBuilder { fn new() -> Self { Self { builder: glib::object::Object::builder(), } } pub fn always_show_image(self, always_show_image: bool) -> Self { Self { builder: self .builder .property("always-show-image", always_show_image), } } pub fn image(self, image: &impl IsA) -> Self { Self { builder: self.builder.property("image", image.clone().upcast()), } } pub fn image_position(self, image_position: PositionType) -> Self { Self { builder: self.builder.property("image-position", image_position), } } pub fn label(self, label: impl Into) -> Self { Self { builder: self.builder.property("label", label.into()), } } pub fn relief(self, relief: ReliefStyle) -> Self { Self { builder: self.builder.property("relief", relief), } } pub fn use_underline(self, use_underline: bool) -> Self { Self { builder: self.builder.property("use-underline", use_underline), } } 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: 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: 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 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: 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 [`Button`]. #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"] pub fn build(self) -> Button { self.builder.build() } } mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait ButtonExt: IsA