yaze
0.3.2
Link to the Past ROM Editor
Loading...
Searching...
No Matches
window_context.h
Go to the documentation of this file.
1
#ifndef YAZE_APP_EDITOR_REGISTRY_WINDOW_CONTEXT_H_
2
#define YAZE_APP_EDITOR_REGISTRY_WINDOW_CONTEXT_H_
3
4
#include <string>
5
6
#include "
app/editor/registry/content_registry.h
"
7
8
namespace
yaze::editor
{
9
10
template
<
typename
EditorT>
11
struct
TypedWindowContext
{
12
EditorT*
editor
=
nullptr
;
13
14
explicit
operator
bool()
const
{
return
editor
!=
nullptr
; }
15
EditorT*
operator->
()
const
{
return
editor
; }
16
};
17
18
template
<
typename
EditorT>
19
inline
TypedWindowContext<EditorT>
CurrentTypedWindowContext
(
20
const
std::string& category) {
21
return
{.
editor
=
static_cast<
EditorT*
>
(
22
ContentRegistry::Context::editor_window_context
(category))};
23
}
24
25
}
// namespace yaze::editor
26
27
#endif
// YAZE_APP_EDITOR_REGISTRY_WINDOW_CONTEXT_H_
yaze::editor::ContentRegistry::Context::editor_window_context
Editor * editor_window_context(const std::string &category)
Definition
content_registry.cc:123
yaze::editor
Editors are the view controllers for the application.
Definition
patch_export_usage.cc:9
yaze::editor::CurrentTypedWindowContext
TypedWindowContext< EditorT > CurrentTypedWindowContext(const std::string &category)
Definition
window_context.h:19
content_registry.h
yaze::editor::TypedWindowContext
Definition
window_context.h:11
yaze::editor::TypedWindowContext::editor
EditorT * editor
Definition
window_context.h:12
yaze::editor::TypedWindowContext::operator->
EditorT * operator->() const
Definition
window_context.h:15
src
app
editor
registry
window_context.h
Generated by
1.10.0