/** * @author Felix Morgner (felix.morgner@gmail.com) * @copyright Copyright (c) 2025 * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "adwaitamm/comborow.hpp" #include "adwaitamm/actionrow.hpp" #include "adwaitamm/private/comborow_p.hpp" #include #include #include #include #include #include #include #include #include #include #include #include namespace Adwaita { namespace { auto constinit _class = ComboRow_Class{}; namespace property_name { auto constexpr enable_search = "enable_search"; auto constexpr expression = "expression"; auto constexpr factory = "factory"; auto constexpr header_factory = "header-factory"; auto constexpr list_factory = "list-factory"; auto constexpr model = "model"; auto constexpr search_match_mode = "search-match-mode"; auto constexpr selected = "selected"; auto constexpr selected_item = "selected-item"; auto constexpr use_subtitle = "use-subtitle"; } // namespace property_name } // namespace ComboRow::ComboRow() : Glib::ObjectBase{nullptr} , ActionRow{Glib::ConstructParams{_class.init()}} { } auto ComboRow::get_type() -> GType { return _class.init().get_type(); } auto ComboRow::get_base_type() -> GType { return adw_combo_row_get_type(); } auto ComboRow::get_enable_search() const -> bool { return adw_combo_row_get_enable_search(const_cast(unwrap(this))); } auto ComboRow::get_expression() const -> Glib::RefPtr> { return Glib::wrap(adw_combo_row_get_expression(const_cast(unwrap(this))), true); } auto ComboRow::get_factory() const -> Glib::RefPtr { return Glib::wrap(adw_combo_row_get_factory(const_cast(unwrap(this))), true); } auto ComboRow::get_header_factory() const -> Glib::RefPtr { return Glib::wrap(adw_combo_row_get_header_factory(const_cast(unwrap(this))), true); } auto ComboRow::get_list_factory() const -> Glib::RefPtr { return Glib::wrap(adw_combo_row_get_list_factory(const_cast(unwrap(this))), true); } auto ComboRow::get_model() const -> Glib::RefPtr { return Glib::wrap(adw_combo_row_get_model(const_cast(unwrap(this))), true); } auto ComboRow::get_search_match_mode() const -> Gtk::StringFilter::MatchMode { return static_cast(adw_combo_row_get_search_match_mode(const_cast(unwrap(this)))); } auto ComboRow::get_selected() const -> unsigned int { return adw_combo_row_get_selected(const_cast(unwrap(this))); } auto ComboRow::get_selected_item() const -> Glib::RefPtr { return Glib::wrap(G_OBJECT(adw_combo_row_get_selected_item(const_cast(unwrap(this))))); } auto ComboRow::get_use_subtitle() const -> bool { return adw_combo_row_get_use_subtitle(const_cast(unwrap(this))); } auto ComboRow::set_enable_search(bool value) -> void { return adw_combo_row_set_enable_search(unwrap(this), value); } auto ComboRow::set_expression(Glib::RefPtr> const & value) -> void { return adw_combo_row_set_expression(unwrap(this), value ? value->gobj() : nullptr); } auto ComboRow::set_factory(Glib::RefPtr const & value) -> void { return adw_combo_row_set_factory(unwrap(this), value ? value->gobj() : nullptr); } auto ComboRow::set_header_factory(Glib::RefPtr const & value) -> void { return adw_combo_row_set_header_factory(unwrap(this), value ? value->gobj() : nullptr); } auto ComboRow::set_list_factory(Glib::RefPtr const & value) -> void { return adw_combo_row_set_list_factory(unwrap(this), value ? value->gobj() : nullptr); } auto ComboRow::set_model(Glib::RefPtr const & value) -> void { return adw_combo_row_set_model(unwrap(this), value ? value->gobj() : nullptr); } auto ComboRow::set_search_match_mode(Gtk::StringFilter::MatchMode value) -> void { return adw_combo_row_set_search_match_mode(unwrap(this), static_cast(value)); } auto ComboRow::set_selected(unsigned int value) -> void { return adw_combo_row_set_selected(unwrap(this), value); } auto ComboRow::set_use_subtitle(bool value) -> void { return adw_combo_row_set_use_subtitle(unwrap(this), value); } auto ComboRow::property_enable_search() -> Glib::PropertyProxy { return {this, property_name::enable_search}; } auto ComboRow::property_enable_search() const -> Glib::PropertyProxy_ReadOnly { return {this, property_name::enable_search}; } auto ComboRow::property_expression() -> Glib::PropertyProxy>> { return {this, property_name::expression}; } auto ComboRow::property_expression() const -> Glib::PropertyProxy_ReadOnly>> { return {this, property_name::expression}; } auto ComboRow::property_factory() -> Glib::PropertyProxy> { return {this, property_name::factory}; } auto ComboRow::property_factory() const -> Glib::PropertyProxy_ReadOnly> { return {this, property_name::factory}; } auto ComboRow::property_header_factory() -> Glib::PropertyProxy> { return {this, property_name::header_factory}; } auto ComboRow::property_header_factory() const -> Glib::PropertyProxy_ReadOnly> { return {this, property_name::header_factory}; } auto ComboRow::property_list_factory() -> Glib::PropertyProxy> { return {this, property_name::list_factory}; } auto ComboRow::property_list_factory() const -> Glib::PropertyProxy_ReadOnly> { return {this, property_name::list_factory}; } auto ComboRow::property_model() -> Glib::PropertyProxy> { return {this, property_name::model}; } auto ComboRow::property_model() const -> Glib::PropertyProxy_ReadOnly> { return {this, property_name::model}; } auto ComboRow::property_search_match_mode() -> Glib::PropertyProxy { return {this, property_name::search_match_mode}; } auto ComboRow::property_search_match_mode() const -> Glib::PropertyProxy_ReadOnly { return {this, property_name::search_match_mode}; } auto ComboRow::property_selected() -> Glib::PropertyProxy { return {this, property_name::selected}; } auto ComboRow::property_selected() const -> Glib::PropertyProxy_ReadOnly { return {this, property_name::selected}; } auto ComboRow::property_selected_item() -> Glib::PropertyProxy_ReadOnly> { return {this, property_name::selected_item}; } auto ComboRow::property_use_subtitle() -> Glib::PropertyProxy { return {this, property_name::use_subtitle}; } auto ComboRow::property_use_subtitle() const -> Glib::PropertyProxy_ReadOnly { return {this, property_name::use_subtitle}; } ComboRow::ComboRow(Glib::ConstructParams const & params) : ActionRow{params} { } ComboRow::ComboRow(BaseObjectType * gobj) : ActionRow(ADW_ACTION_ROW(gobj)) { } } // namespace Adwaita namespace Glib { auto wrap(AdwComboRow * object, bool copy) -> Adwaita::ComboRow * { return dynamic_cast(Glib::wrap_auto(G_OBJECT(object), copy)); } } // namespace Glib