// This file Copyright © Mnemosyne LLC. // It may be used under GPLv2 (SPDX: GPL-2.0-only), GPLv3 (SPDX: GPL-3.0-only), // or any future license endorsed by Mnemosyne LLC. // License text can be found in the licenses/ folder. #pragma once #include "FilterBase.h" #if GTKMM_CHECK_VERSION(4, 0, 0) #include "Utils.h" #endif template bool FilterBase::matches_all() const { return false; } template bool FilterBase::matches_none() const { return false; } #if GTKMM_CHECK_VERSION(4, 0, 0) template bool FilterBase::match_vfunc(Glib::RefPtr const& object) { auto const concrete_object = gtr_ptr_dynamic_cast(object); g_return_val_if_fail(concrete_object != nullptr, false); return match(*concrete_object); } template typename FilterBase::Match FilterBase::get_strictness_vfunc() { if (matches_all()) { return Match::ALL; } if (matches_none()) { return Match::NONE; } return Match::SOME; } #else template sigc::signal::Change)>& FilterBase::signal_changed() { return signal_changed_; } template void FilterBase::changed(Change change) { signal_changed_.emit(change); } #endif