Files
oak-editor/src/render/transition/config/config.h
T
Mike-Solar edbd3913af refactor(render): de-Qt oakrender and wrap it in a pure C ABI
- copy engine/render to src/render/src (sunk param types excluded),
  de-Qt in five parallel groups: core machinery (tickets/worker pool/
  jobs), caches, color/texture, preview/IPC, GPU backends
- replace Qt GL/Vulkan wrappers with native context abstractions
  (CGL/EGL/WGL, raw vulkan.h), QProcess with POSIX WorkerProcess,
  QJsonObject with a minimal NDJSON-compatible workerjson (wire
  protocol unchanged), QDataStream disk state with a byte-compatible
  BinaryStream
- signals become single std::function callbacks or facade-triggered
  calls per the documented signal/slot strategy
- pure C ABI in include/render + src/render/c_api (renderer/cache/
  color/manager families, OAKRENDER_E_* codes), 37 gtest cases
- bridge src/node/transition/render/* stubs to the real oakrender
  headers, closing the node<->render cycle: liboaknode links
  liboakrender, zero dangling symbols
- docs: M7 implementation status + oakrender semantic-change notes
2026-08-06 03:21:26 +08:00

44 lines
1.4 KiB
C++

#pragma once
// Transitional stub for engine/config/config.h (still Qt-based, config 未拆分).
// Union of the src/node/transition stub and the render-facing surface:
// keeps the OAK_CONFIG* call shape; values are inert defaults until the
// config milestone wires the real store. operator[] returns a stored
// reference so writes (lutlibrary) compile; nothing is persisted. 只增不删。
#include <map>
#include <string>
#include "variant.h"
#ifndef QStringLiteral
#define QStringLiteral(x) x
#endif
namespace olive {
class ConfigValue : public olive::Variant {
public:
ConfigValue() = default;
ConfigValue(const std::string &s) : olive::Variant(s) {}
ConfigValue &operator=(const std::string &s)
{
olive::Variant::operator=(olive::Variant(s));
return *this;
}
bool toBool() const { return to_bool(); }
int toInt() const { return to_int(); }
uint64_t toULongLong() const { return to_u_long_long(); }
// rendermanager reads the graphics backend name through this
std::string toString() const { return to_string(); }
std::vector<std::string> toStringList() const { return to_string_list(); }
};
class Config {
public:
static Config &current() { static Config c; return c; }
ConfigValue &operator[](const std::string &key) { return values_[key]; }
private:
std::map<std::string, ConfigValue> values_;
};
}
#ifndef OAK_CONFIG
#define OAK_CONFIG(x) Config::current()[x]
#endif
#ifndef OAK_CONFIG_STR
#define OAK_CONFIG_STR(x) Config::current()[x]
#endif