Changeset View
Changeset View
Standalone View
Standalone View
effects.cpp
Show First 20 Lines • Show All 1891 Lines • ▼ Show 20 Line(s) | 1891 | { | |||
---|---|---|---|---|---|
1892 | if (AbstractClient* c = dynamic_cast< AbstractClient* >(toplevel)) { | 1892 | if (AbstractClient* c = dynamic_cast< AbstractClient* >(toplevel)) { | ||
1893 | if (AbstractClient* c2 = c->findModal()) | 1893 | if (AbstractClient* c2 = c->findModal()) | ||
1894 | return c2->effectWindow(); | 1894 | return c2->effectWindow(); | ||
1895 | } | 1895 | } | ||
1896 | return NULL; | 1896 | return NULL; | ||
1897 | } | 1897 | } | ||
1898 | 1898 | | |||
1899 | template <typename T> | 1899 | template <typename T> | ||
1900 | EffectWindowList getMainWindows(Toplevel *toplevel) | 1900 | EffectWindowList getMainWindows(T *c) | ||
1901 | { | 1901 | { | ||
1902 | T *c = static_cast<T*>(toplevel); | | |||
1903 | const auto mainclients = c->mainClients(); | 1902 | const auto mainclients = c->mainClients(); | ||
1904 | EffectWindowList ret; | 1903 | EffectWindowList ret; | ||
1905 | ret.reserve(mainclients.size()); | 1904 | ret.reserve(mainclients.size()); | ||
1906 | std::transform(std::cbegin(mainclients), std::cend(mainclients), | 1905 | std::transform(std::cbegin(mainclients), std::cend(mainclients), | ||
1907 | std::back_inserter(ret), | 1906 | std::back_inserter(ret), | ||
1908 | [](auto client) { return client->effectWindow(); }); | 1907 | [](auto client) { return client->effectWindow(); }); | ||
1909 | return ret; | 1908 | return ret; | ||
1910 | } | 1909 | } | ||
1911 | 1910 | | |||
1912 | EffectWindowList EffectWindowImpl::mainWindows() const | 1911 | EffectWindowList EffectWindowImpl::mainWindows() const | ||
1913 | { | 1912 | { | ||
1914 | if (dynamic_cast<AbstractClient*>(toplevel)) { | 1913 | if (auto client = qobject_cast<AbstractClient *>(toplevel)) { | ||
1915 | return getMainWindows<AbstractClient>(toplevel); | 1914 | return getMainWindows(client); | ||
1916 | } else if (toplevel->isDeleted()) { | | |||
1917 | return getMainWindows<Deleted>(toplevel); | | |||
1918 | } | 1915 | } | ||
1919 | return EffectWindowList(); | 1916 | if (auto deleted = qobject_cast<Deleted *>(toplevel)) { | ||
1917 | return getMainWindows(deleted); | ||||
1918 | } | ||||
1919 | return {}; | ||||
1920 | } | 1920 | } | ||
1921 | 1921 | | |||
1922 | WindowQuadList EffectWindowImpl::buildQuads(bool force) const | 1922 | WindowQuadList EffectWindowImpl::buildQuads(bool force) const | ||
1923 | { | 1923 | { | ||
1924 | return sceneWindow()->buildQuads(force); | 1924 | return sceneWindow()->buildQuads(force); | ||
1925 | } | 1925 | } | ||
1926 | 1926 | | |||
1927 | void EffectWindowImpl::setData(int role, const QVariant &data) | 1927 | void EffectWindowImpl::setData(int role, const QVariant &data) | ||
▲ Show 20 Lines • Show All 358 Lines • Show Last 20 Lines |