diff --git a/Sources/Core/View/Generated/ActionRow.swift b/Sources/Core/View/Generated/ActionRow.swift index 82fbb05..4af9ad2 100644 --- a/Sources/Core/View/Generated/ActionRow.swift +++ b/Sources/Core/View/Generated/ActionRow.swift @@ -2,7 +2,7 @@ // ActionRow.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Generated/AspectFrame.swift b/Sources/Core/View/Generated/AspectFrame.swift index 9428888..d32a24d 100644 --- a/Sources/Core/View/Generated/AspectFrame.swift +++ b/Sources/Core/View/Generated/AspectFrame.swift @@ -2,7 +2,7 @@ // AspectFrame.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Generated/Avatar.swift b/Sources/Core/View/Generated/Avatar.swift index 12826ca..fd9624e 100644 --- a/Sources/Core/View/Generated/Avatar.swift +++ b/Sources/Core/View/Generated/Avatar.swift @@ -2,7 +2,7 @@ // Avatar.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Generated/Banner.swift b/Sources/Core/View/Generated/Banner.swift index 652a6c6..d320eec 100644 --- a/Sources/Core/View/Generated/Banner.swift +++ b/Sources/Core/View/Generated/Banner.swift @@ -2,7 +2,7 @@ // Banner.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Generated/Bin.swift b/Sources/Core/View/Generated/Bin.swift index 42d60fd..4b399fa 100644 --- a/Sources/Core/View/Generated/Bin.swift +++ b/Sources/Core/View/Generated/Bin.swift @@ -2,7 +2,7 @@ // Bin.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Generated/Box.swift b/Sources/Core/View/Generated/Box.swift index 96c2083..3b96f77 100644 --- a/Sources/Core/View/Generated/Box.swift +++ b/Sources/Core/View/Generated/Box.swift @@ -2,7 +2,7 @@ // Box.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Generated/Button.swift b/Sources/Core/View/Generated/Button.swift index bc47cb5..98e6f97 100644 --- a/Sources/Core/View/Generated/Button.swift +++ b/Sources/Core/View/Generated/Button.swift @@ -2,7 +2,7 @@ // Button.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Generated/ButtonContent.swift b/Sources/Core/View/Generated/ButtonContent.swift index 6207f06..bd18fc3 100644 --- a/Sources/Core/View/Generated/ButtonContent.swift +++ b/Sources/Core/View/Generated/ButtonContent.swift @@ -2,7 +2,7 @@ // ButtonContent.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Generated/Carousel.swift b/Sources/Core/View/Generated/Carousel.swift index 1a0d9aa..af8a270 100644 --- a/Sources/Core/View/Generated/Carousel.swift +++ b/Sources/Core/View/Generated/Carousel.swift @@ -2,7 +2,7 @@ // Carousel.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Generated/CenterBox.swift b/Sources/Core/View/Generated/CenterBox.swift index dcbef37..98bbada 100644 --- a/Sources/Core/View/Generated/CenterBox.swift +++ b/Sources/Core/View/Generated/CenterBox.swift @@ -2,7 +2,7 @@ // CenterBox.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Generated/CheckButton.swift b/Sources/Core/View/Generated/CheckButton.swift index c67710d..bf81827 100644 --- a/Sources/Core/View/Generated/CheckButton.swift +++ b/Sources/Core/View/Generated/CheckButton.swift @@ -2,7 +2,7 @@ // CheckButton.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Generated/Clamp.swift b/Sources/Core/View/Generated/Clamp.swift index ef296fb..4767490 100644 --- a/Sources/Core/View/Generated/Clamp.swift +++ b/Sources/Core/View/Generated/Clamp.swift @@ -2,7 +2,7 @@ // Clamp.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Generated/ComboRow.swift b/Sources/Core/View/Generated/ComboRow.swift index 764fd94..3380b0e 100644 --- a/Sources/Core/View/Generated/ComboRow.swift +++ b/Sources/Core/View/Generated/ComboRow.swift @@ -2,7 +2,7 @@ // ComboRow.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Generated/DropDown.swift b/Sources/Core/View/Generated/DropDown.swift index acbe9e8..948c8f2 100644 --- a/Sources/Core/View/Generated/DropDown.swift +++ b/Sources/Core/View/Generated/DropDown.swift @@ -2,7 +2,7 @@ // DropDown.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Generated/Entry.swift b/Sources/Core/View/Generated/Entry.swift index 3aaf8fe..ea04492 100644 --- a/Sources/Core/View/Generated/Entry.swift +++ b/Sources/Core/View/Generated/Entry.swift @@ -2,7 +2,7 @@ // Entry.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Generated/EntryRow.swift b/Sources/Core/View/Generated/EntryRow.swift index bcbe67c..ac03ca7 100644 --- a/Sources/Core/View/Generated/EntryRow.swift +++ b/Sources/Core/View/Generated/EntryRow.swift @@ -2,7 +2,7 @@ // EntryRow.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Generated/ExpanderRow.swift b/Sources/Core/View/Generated/ExpanderRow.swift index bac82cc..5337c3a 100644 --- a/Sources/Core/View/Generated/ExpanderRow.swift +++ b/Sources/Core/View/Generated/ExpanderRow.swift @@ -2,7 +2,7 @@ // ExpanderRow.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Generated/Fixed.swift b/Sources/Core/View/Generated/Fixed.swift index 8a9b6e4..990a1e8 100644 --- a/Sources/Core/View/Generated/Fixed.swift +++ b/Sources/Core/View/Generated/Fixed.swift @@ -2,7 +2,7 @@ // Fixed.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Generated/FlowBox.swift b/Sources/Core/View/Generated/FlowBox.swift index 2d32614..e7d89e7 100644 --- a/Sources/Core/View/Generated/FlowBox.swift +++ b/Sources/Core/View/Generated/FlowBox.swift @@ -2,7 +2,7 @@ // FlowBox.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Generated/HeaderBar.swift b/Sources/Core/View/Generated/HeaderBar.swift index 95528c0..e2509d2 100644 --- a/Sources/Core/View/Generated/HeaderBar.swift +++ b/Sources/Core/View/Generated/HeaderBar.swift @@ -2,7 +2,7 @@ // HeaderBar.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Generated/Image.swift b/Sources/Core/View/Generated/Image.swift new file mode 100644 index 0000000..9997f9e --- /dev/null +++ b/Sources/Core/View/Generated/Image.swift @@ -0,0 +1,182 @@ +// +// Image.swift +// Adwaita +// +// Created by auto-generation on 23.10.25. +// + +import CAdw +import LevenshteinTransformations + +/// Displays an image. +/// +/// picture>An example GtkImage +/// +/// Various kinds of object can be displayed as an image; most typically, +/// you would load a `GdkTexture` from a file, using the convenience function +/// [ctor@Gtk.Image.new_from_file], for instance: +/// +/// ```c +/// GtkWidget *image = gtk_image_new_from_file ("myfile.png"); +/// ``` +/// +/// If the file isn’t loaded successfully, the image will contain a +/// “broken image” icon similar to that used in many web browsers. +/// +/// If you want to handle errors in loading the file yourself, +/// for example by displaying an error message, then load the image with +/// [ctor@Gdk.Texture.new_from_file], then create the `GtkImage` with +/// [ctor@Gtk.Image.new_from_paintable]. +/// +/// Sometimes an application will want to avoid depending on external data +/// files, such as image files. See the documentation of `GResource` inside +/// GIO, for details. In this case, [property@Gtk.Image:resource], +/// [ctor@Gtk.Image.new_from_resource], and [method@Gtk.Image.set_from_resource] +/// should be used. +/// +/// `GtkImage` displays its image as an icon, with a size that is determined +/// by the application. See [class@Gtk.Picture] if you want to show an image +/// at is actual size. +/// +/// ## CSS nodes +/// +/// `GtkImage` has a single CSS node with the name `image`. The style classes +/// `.normal-icons` or `.large-icons` may appear, depending on the +/// [property@Gtk.Image:icon-size] property. +/// +/// ## Accessibility +/// +/// `GtkImage` uses the [enum@Gtk.AccessibleRole.img] role. +public struct Image: AdwaitaWidget { + + /// Additional update functions for type extensions. + var updateFunctions: [(ViewStorage, WidgetData, Bool) -> Void] = [] + /// Additional appear functions for type extensions. + var appearFunctions: [(ViewStorage, WidgetData) -> Void] = [] + + /// The accessible role of the given `GtkAccessible` implementation. + /// + /// The accessible role cannot be changed once set. + var accessibleRole: String? + /// The name of the icon in the icon theme. + /// + /// If the icon theme is changed, the image will be updated automatically. + var iconName: String? + /// The size in pixels to display icons at. + /// + /// If set to a value != -1, this property overrides the + /// [property@Gtk.Image:icon-size] property for images of type + /// `GTK_IMAGE_ICON_NAME`. + var pixelSize: Int? + /// A path to a resource file to display. + var resource: String? + /// The representation being used for image data. + var storageType: String? + /// Whether the icon displayed in the `GtkImage` will use + /// standard icon names fallback. + /// + /// The value of this property is only relevant for images of type + /// %GTK_IMAGE_ICON_NAME and %GTK_IMAGE_GICON. + var useFallback: Bool? + + /// Initialize `Image`. + public init() { + } + + /// The view storage. + /// - Parameters: + /// - modifiers: Modify views before being updated. + /// - type: The view render data type. + /// - Returns: The view storage. + public func container(data: WidgetData, type: Data.Type) -> ViewStorage where Data: ViewRenderData { + let storage = ViewStorage(gtk_image_new()?.opaque()) + for function in appearFunctions { + function(storage, data) + } + update(storage, data: data, updateProperties: true, type: type) + + return storage + } + + /// Update the stored content. + /// - Parameters: + /// - storage: The storage to update. + /// - modifiers: Modify views before being updated + /// - updateProperties: Whether to update the view's properties. + /// - type: The view render data type. + public func update(_ storage: ViewStorage, data: WidgetData, updateProperties: Bool, type: Data.Type) where Data: ViewRenderData { + storage.modify { widget in + + if let iconName, updateProperties, (storage.previousState as? Self)?.iconName != iconName { + gtk_image_set_from_icon_name(widget, iconName) + } + if let pixelSize, updateProperties, (storage.previousState as? Self)?.pixelSize != pixelSize { + gtk_image_set_pixel_size(widget, pixelSize.cInt) + } + + + + } + for function in updateFunctions { + function(storage, data, updateProperties) + } + if updateProperties { + storage.previousState = self + } + } + + /// The accessible role of the given `GtkAccessible` implementation. + /// + /// The accessible role cannot be changed once set. + public func accessibleRole(_ accessibleRole: String?) -> Self { + var newSelf = self + newSelf.accessibleRole = accessibleRole + return newSelf + } + + /// The name of the icon in the icon theme. + /// + /// If the icon theme is changed, the image will be updated automatically. + public func iconName(_ iconName: String?) -> Self { + var newSelf = self + newSelf.iconName = iconName + return newSelf + } + + /// The size in pixels to display icons at. + /// + /// If set to a value != -1, this property overrides the + /// [property@Gtk.Image:icon-size] property for images of type + /// `GTK_IMAGE_ICON_NAME`. + public func pixelSize(_ pixelSize: Int?) -> Self { + var newSelf = self + newSelf.pixelSize = pixelSize + return newSelf + } + + /// A path to a resource file to display. + public func resource(_ resource: String?) -> Self { + var newSelf = self + newSelf.resource = resource + return newSelf + } + + /// The representation being used for image data. + public func storageType(_ storageType: String?) -> Self { + var newSelf = self + newSelf.storageType = storageType + return newSelf + } + + /// Whether the icon displayed in the `GtkImage` will use + /// standard icon names fallback. + /// + /// The value of this property is only relevant for images of type + /// %GTK_IMAGE_ICON_NAME and %GTK_IMAGE_GICON. + public func useFallback(_ useFallback: Bool? = true) -> Self { + var newSelf = self + newSelf.useFallback = useFallback + return newSelf + } + +} diff --git a/Sources/Core/View/Generated/Label.swift b/Sources/Core/View/Generated/Label.swift index fdc8489..fb285b2 100644 --- a/Sources/Core/View/Generated/Label.swift +++ b/Sources/Core/View/Generated/Label.swift @@ -2,7 +2,7 @@ // Label.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Generated/LevelBar.swift b/Sources/Core/View/Generated/LevelBar.swift index a1b236a..95523f7 100644 --- a/Sources/Core/View/Generated/LevelBar.swift +++ b/Sources/Core/View/Generated/LevelBar.swift @@ -2,7 +2,7 @@ // LevelBar.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Generated/LinkButton.swift b/Sources/Core/View/Generated/LinkButton.swift index c6abd59..368b0c6 100644 --- a/Sources/Core/View/Generated/LinkButton.swift +++ b/Sources/Core/View/Generated/LinkButton.swift @@ -2,7 +2,7 @@ // LinkButton.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Generated/ListBox.swift b/Sources/Core/View/Generated/ListBox.swift index 6dad367..4edff24 100644 --- a/Sources/Core/View/Generated/ListBox.swift +++ b/Sources/Core/View/Generated/ListBox.swift @@ -2,7 +2,7 @@ // ListBox.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Generated/Menu.swift b/Sources/Core/View/Generated/Menu.swift index 0ee27fd..fc7203e 100644 --- a/Sources/Core/View/Generated/Menu.swift +++ b/Sources/Core/View/Generated/Menu.swift @@ -2,7 +2,7 @@ // Menu.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Generated/NavigationView.swift b/Sources/Core/View/Generated/NavigationView.swift index ccb5a49..0a2ff1e 100644 --- a/Sources/Core/View/Generated/NavigationView.swift +++ b/Sources/Core/View/Generated/NavigationView.swift @@ -2,7 +2,7 @@ // NavigationView.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Generated/Overlay.swift b/Sources/Core/View/Generated/Overlay.swift index 16b1093..9544379 100644 --- a/Sources/Core/View/Generated/Overlay.swift +++ b/Sources/Core/View/Generated/Overlay.swift @@ -2,7 +2,7 @@ // Overlay.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Generated/OverlaySplitView.swift b/Sources/Core/View/Generated/OverlaySplitView.swift index cfb34b8..33d33ef 100644 --- a/Sources/Core/View/Generated/OverlaySplitView.swift +++ b/Sources/Core/View/Generated/OverlaySplitView.swift @@ -2,7 +2,7 @@ // OverlaySplitView.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Generated/PasswordEntryRow.swift b/Sources/Core/View/Generated/PasswordEntryRow.swift index 785d64c..b470923 100644 --- a/Sources/Core/View/Generated/PasswordEntryRow.swift +++ b/Sources/Core/View/Generated/PasswordEntryRow.swift @@ -2,7 +2,7 @@ // PasswordEntryRow.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Generated/Picture.swift b/Sources/Core/View/Generated/Picture.swift index e3d5403..b92b062 100644 --- a/Sources/Core/View/Generated/Picture.swift +++ b/Sources/Core/View/Generated/Picture.swift @@ -2,7 +2,7 @@ // Picture.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Generated/Popover.swift b/Sources/Core/View/Generated/Popover.swift index 45a4ee9..fb27c65 100644 --- a/Sources/Core/View/Generated/Popover.swift +++ b/Sources/Core/View/Generated/Popover.swift @@ -2,7 +2,7 @@ // Popover.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw @@ -13,12 +13,17 @@ import LevenshteinTransformations /// An example GtkPopover /// /// It is primarily meant to provide context-dependent information -/// or options. Popovers are attached to a parent widget. By default, -/// they point to the whole widget area, although this behavior can be -/// changed with [method@Gtk.Popover.set_pointing_to]. +/// or options. Popovers are attached to a parent widget. The parent widget +/// must support popover children, as [class@Gtk.MenuButton] and +/// [class@Gtk.PopoverMenuBar] do. If you want to make a custom widget that +/// has an attached popover, you need to call [method@Gtk.Popover.present] +/// in your [vfunc@Gtk.Widget.size_allocate] vfunc, in order to update the +/// positioning of the popover. /// /// The position of a popover relative to the widget it is attached to -/// can also be changed with [method@Gtk.Popover.set_position] +/// can also be changed with [method@Gtk.Popover.set_position]. By default, +/// it points to the whole widget area, but it can be made to point to +/// a specific area using [method@Gtk.Popover.set_pointing_to]. /// /// By default, `GtkPopover` performs a grab, in order to ensure input /// events get redirected to it while it is shown, and also so the popover diff --git a/Sources/Core/View/Generated/PreferencesGroup.swift b/Sources/Core/View/Generated/PreferencesGroup.swift index a822498..cf28740 100644 --- a/Sources/Core/View/Generated/PreferencesGroup.swift +++ b/Sources/Core/View/Generated/PreferencesGroup.swift @@ -2,7 +2,7 @@ // PreferencesGroup.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Generated/PreferencesPage.swift b/Sources/Core/View/Generated/PreferencesPage.swift index b904a16..24834b5 100644 --- a/Sources/Core/View/Generated/PreferencesPage.swift +++ b/Sources/Core/View/Generated/PreferencesPage.swift @@ -2,7 +2,7 @@ // PreferencesPage.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Generated/PreferencesRow.swift b/Sources/Core/View/Generated/PreferencesRow.swift index c358e0e..5f3a428 100644 --- a/Sources/Core/View/Generated/PreferencesRow.swift +++ b/Sources/Core/View/Generated/PreferencesRow.swift @@ -2,7 +2,7 @@ // PreferencesRow.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Generated/ProgressBar.swift b/Sources/Core/View/Generated/ProgressBar.swift index b9f8f84..0d79771 100644 --- a/Sources/Core/View/Generated/ProgressBar.swift +++ b/Sources/Core/View/Generated/ProgressBar.swift @@ -2,7 +2,7 @@ // ProgressBar.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Generated/ScrolledWindow.swift b/Sources/Core/View/Generated/ScrolledWindow.swift index 166a771..32edd01 100644 --- a/Sources/Core/View/Generated/ScrolledWindow.swift +++ b/Sources/Core/View/Generated/ScrolledWindow.swift @@ -2,7 +2,7 @@ // ScrolledWindow.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Generated/SearchBar.swift b/Sources/Core/View/Generated/SearchBar.swift index 075389d..2e94600 100644 --- a/Sources/Core/View/Generated/SearchBar.swift +++ b/Sources/Core/View/Generated/SearchBar.swift @@ -2,7 +2,7 @@ // SearchBar.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Generated/SearchEntry.swift b/Sources/Core/View/Generated/SearchEntry.swift index d7d7a15..6614eba 100644 --- a/Sources/Core/View/Generated/SearchEntry.swift +++ b/Sources/Core/View/Generated/SearchEntry.swift @@ -2,7 +2,7 @@ // SearchEntry.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Generated/Separator.swift b/Sources/Core/View/Generated/Separator.swift index 559882e..4af5308 100644 --- a/Sources/Core/View/Generated/Separator.swift +++ b/Sources/Core/View/Generated/Separator.swift @@ -2,7 +2,7 @@ // Separator.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Generated/SpinRow.swift b/Sources/Core/View/Generated/SpinRow.swift index 942ff36..ea689c4 100644 --- a/Sources/Core/View/Generated/SpinRow.swift +++ b/Sources/Core/View/Generated/SpinRow.swift @@ -2,7 +2,7 @@ // SpinRow.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Generated/Spinner.swift b/Sources/Core/View/Generated/Spinner.swift index 5bfccb8..c19ea49 100644 --- a/Sources/Core/View/Generated/Spinner.swift +++ b/Sources/Core/View/Generated/Spinner.swift @@ -2,7 +2,7 @@ // Spinner.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw @@ -32,6 +32,10 @@ import LevenshteinTransformations /// /// `AdwSpinner` has a single node with the name `image` and the style class /// `.spinner`. +/// +/// ## Accessibility +/// +/// `AdwSpinner` uses the [enum@Gtk.AccessibleRole.progress-bar] role. public struct Spinner: AdwaitaWidget { /// Additional update functions for type extensions. diff --git a/Sources/Core/View/Generated/SplitButton.swift b/Sources/Core/View/Generated/SplitButton.swift index 960083a..45d8c95 100644 --- a/Sources/Core/View/Generated/SplitButton.swift +++ b/Sources/Core/View/Generated/SplitButton.swift @@ -2,7 +2,7 @@ // SplitButton.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Generated/StatusPage.swift b/Sources/Core/View/Generated/StatusPage.swift index 93640a0..80962f8 100644 --- a/Sources/Core/View/Generated/StatusPage.swift +++ b/Sources/Core/View/Generated/StatusPage.swift @@ -2,7 +2,7 @@ // StatusPage.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Generated/SwitchRow.swift b/Sources/Core/View/Generated/SwitchRow.swift index a62d5b2..2fad162 100644 --- a/Sources/Core/View/Generated/SwitchRow.swift +++ b/Sources/Core/View/Generated/SwitchRow.swift @@ -2,7 +2,7 @@ // SwitchRow.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Generated/ToastOverlay.swift b/Sources/Core/View/Generated/ToastOverlay.swift index b2a1559..14f3522 100644 --- a/Sources/Core/View/Generated/ToastOverlay.swift +++ b/Sources/Core/View/Generated/ToastOverlay.swift @@ -2,7 +2,7 @@ // ToastOverlay.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Generated/ToggleButton.swift b/Sources/Core/View/Generated/ToggleButton.swift index e3645f2..8f7cf36 100644 --- a/Sources/Core/View/Generated/ToggleButton.swift +++ b/Sources/Core/View/Generated/ToggleButton.swift @@ -2,7 +2,7 @@ // ToggleButton.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Generated/ToolbarView.swift b/Sources/Core/View/Generated/ToolbarView.swift index 71f3317..92a7bc7 100644 --- a/Sources/Core/View/Generated/ToolbarView.swift +++ b/Sources/Core/View/Generated/ToolbarView.swift @@ -2,7 +2,7 @@ // ToolbarView.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Generated/WindowTitle.swift b/Sources/Core/View/Generated/WindowTitle.swift index f4dc878..3e837b6 100644 --- a/Sources/Core/View/Generated/WindowTitle.swift +++ b/Sources/Core/View/Generated/WindowTitle.swift @@ -2,7 +2,7 @@ // WindowTitle.swift // Adwaita // -// Created by auto-generation on 19.04.25. +// Created by auto-generation on 23.10.25. // import CAdw diff --git a/Sources/Core/View/Symbol.swift b/Sources/Core/View/Symbol.swift new file mode 100644 index 0000000..730647c --- /dev/null +++ b/Sources/Core/View/Symbol.swift @@ -0,0 +1,19 @@ +// +// Symbol.swift +// Adwaita +// +// Created by Marquis Kurt on 23.10.25. +// + +/// A view that display a symbolic image. +public typealias Symbol = Image + +extension Symbol { + + /// Initialize a symbolic image view. + /// - Parameter icon: The icon to display in the view. + public init(icon: Icon) { + self.init() + self.iconName = icon.string + } +} diff --git a/Sources/Demo/Page.swift b/Sources/Demo/Page.swift index 560da1f..df94fa7 100644 --- a/Sources/Demo/Page.swift +++ b/Sources/Demo/Page.swift @@ -34,6 +34,7 @@ enum Page: String, Identifiable, CaseIterable, Codable, CustomStringConvertible case fixed case textEditor case splitView + case symbol var id: Self { self @@ -115,6 +116,8 @@ enum Page: String, Identifiable, CaseIterable, Codable, CustomStringConvertible return "A simple text editor" case .splitView: return "A split view whose panes are ajustable in size" + case .symbol: + return "Display a symbolic image" } } @@ -166,6 +169,8 @@ enum Page: String, Identifiable, CaseIterable, Codable, CustomStringConvertible TextEditorDemo() case .splitView: SplitViewDemo() + case .symbol: + SymbolDemo() } } // swiftlint:enable cyclomatic_complexity diff --git a/Sources/Demo/SymbolDemo.swift b/Sources/Demo/SymbolDemo.swift new file mode 100644 index 0000000..3d9c809 --- /dev/null +++ b/Sources/Demo/SymbolDemo.swift @@ -0,0 +1,28 @@ +// +// SymbolDemo.swift +// Adwaita +// +// Created by Marquis Kurt on 23.10.25. +// + +// swiftlint:disable missing_docs + +import Adwaita + +struct SymbolDemo: View { + + var view: Body { + HStack { + Symbol(icon: .default(icon: .goNext)) + .pixelSize(64) + Symbol(icon: .default(icon: .goPrevious)) + .pixelSize(64) + Symbol(icon: .default(icon: .airplaneMode)) + .pixelSize(64) + } + .halign(.center) + .hexpand() + } +} + +// swiftlint:enable missing_docs diff --git a/Sources/Generation/GenerationConfiguration.swift b/Sources/Generation/GenerationConfiguration.swift index c347bfc..700cfa0 100644 --- a/Sources/Generation/GenerationConfiguration.swift +++ b/Sources/Generation/GenerationConfiguration.swift @@ -301,6 +301,7 @@ struct GenerationConfiguration { ), .init(class: "SearchBar"), .init(class: "Picture", excludeProperties: ["file", "paintable"]), + .init(class: "Image", excludeProperties: ["file", "paintable", "gicon", "icon-size"]), .init( class: "AspectFrame", initializer: "gtk_aspect_frame_new(0.5, 0.5, ratio, 0)",