ObsidianDragon - DragonX ImGui Wallet
Full-node GUI wallet for DragonX cryptocurrency. Built with Dear ImGui, SDL3, and OpenGL3/DX11. Features: - Send/receive shielded and transparent transactions - Autoshield with merged transaction display - Built-in CPU mining (xmrig) - Peer management and network monitoring - Wallet encryption with PIN lock - QR code generation for receive addresses - Transaction history with pagination - Console for direct RPC commands - Cross-platform (Linux, Windows)
This commit is contained in:
65
src/embedded/resources.h
Normal file
65
src/embedded/resources.h
Normal file
@@ -0,0 +1,65 @@
|
||||
// DragonX Wallet - ImGui Edition
|
||||
// Copyright 2024-2026 The Hush Developers
|
||||
// Released under the GPLv3
|
||||
|
||||
// Embedded Resources Header
|
||||
// This provides access to resources embedded in the binary
|
||||
|
||||
#pragma once
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
|
||||
namespace dragonx {
|
||||
namespace embedded {
|
||||
|
||||
// Forward declarations for embedded data (generated at build time)
|
||||
struct EmbeddedResource {
|
||||
const unsigned char* data;
|
||||
size_t size;
|
||||
};
|
||||
|
||||
// Resource registry
|
||||
class Resources {
|
||||
public:
|
||||
static Resources& instance() {
|
||||
static Resources inst;
|
||||
return inst;
|
||||
}
|
||||
|
||||
// Get embedded resource by name
|
||||
// Returns nullptr if not found
|
||||
const EmbeddedResource* get(const std::string& name) const {
|
||||
auto it = resources_.find(name);
|
||||
if (it != resources_.end()) {
|
||||
return &it->second;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Check if resource exists
|
||||
bool has(const std::string& name) const {
|
||||
return resources_.find(name) != resources_.end();
|
||||
}
|
||||
|
||||
// Register a resource (called during static init)
|
||||
void registerResource(const std::string& name, const unsigned char* data, size_t size) {
|
||||
resources_[name] = {data, size};
|
||||
}
|
||||
|
||||
private:
|
||||
Resources() = default;
|
||||
std::unordered_map<std::string, EmbeddedResource> resources_;
|
||||
};
|
||||
|
||||
// Helper macro for registering resources
|
||||
#define REGISTER_EMBEDDED_RESOURCE(name, data, size) \
|
||||
static struct _EmbeddedResourceRegister_##name { \
|
||||
_EmbeddedResourceRegister_##name() { \
|
||||
dragonx::embedded::Resources::instance().registerResource(#name, data, size); \
|
||||
} \
|
||||
} _embedded_resource_register_##name
|
||||
|
||||
} // namespace embedded
|
||||
} // namespace dragonx
|
||||
Reference in New Issue
Block a user