载入中...
搜索中...
未找到
DatabasePanel.h
浏览该文件的文档.
1#pragma once
2
3#include "common/Export.h"
4#include "common/Runtime.h"
5#include "ui/ObjectRegistry.h"
6#include "ui/Widget.h"
7
8#include <simplesquirrel/simplesquirrel.hpp>
9
10#include <cstdint>
11#include <string>
12#include <vector>
13
14namespace eve::ui {
15
16class UIHost;
17
30public:
31 DatabasePanel() = default;
33 DatabasePanel(const DatabasePanel&) = delete;
35
37 void open();
39 void close();
41 bool isOpen() const;
43 UIHost* host() const { return host_; }
44
46 void refresh();
48 bool selectClass(const std::string& name);
50 const std::string& selectedClass() const { return selectedClass_; }
52 uint64_t createInstance();
54 uint64_t registerObject(const ssq::Object& object, const std::string& label = {});
56 bool unregister(uint64_t id);
57
59 void sync();
61 WidgetDesc build();
62
63private:
64 void rebuildHost();
65 void rebuildCache();
66 WidgetDesc cellWidget(const ObjectEntry& entry, const ReflectedMember& member,
67 const ReflectedValue& value);
68
69 UIHost* host_ = nullptr;
70 std::vector<std::string> classNames_;
71 std::string selectedClass_;
72 std::vector<ObjectEntry> entries_;
73 std::vector<ReflectedMember> members_;
74 // Row-major cell cache: [row][col] -> last value pushed to the view.
75 std::vector<std::vector<ReflectedValue>> cached_;
76};
77
78} // namespace eve::ui
std::string value
#define EVENGINE_API
宿主(eve / libmain)导出宏;插件从进程导入同一批符号。
Definition Export.h:16
const char * name
Definition RockMesh.cpp:21
Reflection-driven database panel (DevTools, MVVM).
UIHost * host() const
The mounted host (nullptr until open()); for embedding/tests.
const std::string & selectedClass() const
Name of the currently selected class ("" when none).
DatabasePanel(const DatabasePanel &)=delete
DatabasePanel & operator=(const DatabasePanel &)=delete
ECS mount point for one UI panel/screen. Subclass to attach UI to game entities, e....
Definition UIHost.h:130
Typed snapshot of one live instance property.
Definition Runtime.h:119