Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/windowing/StarRegisteredPaneManager.hpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2023-07-04 22:36:27 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2023-07-04 22:36:27 +1000
commitc923f4f13b1cade968bb6fec585a242b62d35715 (patch)
tree94bc9f9098c007070d3644f077e6f544c4fd43a4 /source/windowing/StarRegisteredPaneManager.hpp
parent5df9adcd0ecbf09ae2ba426b3eeab78296d370c4 (diff)
pane lua stuff
Diffstat (limited to 'source/windowing/StarRegisteredPaneManager.hpp')
-rw-r--r--source/windowing/StarRegisteredPaneManager.hpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/windowing/StarRegisteredPaneManager.hpp b/source/windowing/StarRegisteredPaneManager.hpp
index 4038525..ebb158d 100644
--- a/source/windowing/StarRegisteredPaneManager.hpp
+++ b/source/windowing/StarRegisteredPaneManager.hpp
@@ -19,6 +19,8 @@ public:
template <typename T = Pane>
shared_ptr<T> registeredPane(KeyT const& paneId) const;
+ template <typename T = Pane>
+ shared_ptr<T> maybeRegisteredPane(KeyT const& paneId) const;
// Displays a registred pane if it is not already displayed. Returns true
// if it is newly displayed.
@@ -54,6 +56,14 @@ shared_ptr<T> RegisteredPaneManager<KeyT>::registeredPane(KeyT const& paneId) co
}
template <typename KeyT>
+template <typename T>
+shared_ptr<T> RegisteredPaneManager<KeyT>::maybeRegisteredPane(KeyT const& paneId) const {
+ if (auto v = m_registeredPanes.ptr(paneId))
+ return convert<T>(v->pane);
+ return {};
+}
+
+template <typename KeyT>
void RegisteredPaneManager<KeyT>::registerPane(
KeyT paneId, PaneLayer paneLayer, PanePtr pane, DismissCallback onDismiss) {
if (!m_registeredPanes.insert(move(paneId), {move(paneLayer), move(pane), move(onDismiss)}).second)