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:
86
src/resources/embedded_resources.h
Normal file
86
src/resources/embedded_resources.h
Normal file
@@ -0,0 +1,86 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <cstdint>
|
||||
|
||||
namespace dragonx {
|
||||
namespace resources {
|
||||
|
||||
// Embedded resource data (generated at build time)
|
||||
struct EmbeddedResource {
|
||||
const uint8_t* data;
|
||||
size_t size;
|
||||
const char* filename;
|
||||
};
|
||||
|
||||
// Check if embedded resources are available
|
||||
bool hasEmbeddedResources();
|
||||
|
||||
// Get embedded resource by name
|
||||
// Returns nullptr if not found or not embedded
|
||||
const EmbeddedResource* getEmbeddedResource(const std::string& name);
|
||||
|
||||
// Extract all embedded resources to appropriate locations
|
||||
// Returns true if all resources extracted successfully
|
||||
bool extractEmbeddedResources();
|
||||
|
||||
// Check if params need to be extracted (not already present)
|
||||
bool needsParamsExtraction();
|
||||
|
||||
// Get the params directory path
|
||||
std::string getParamsDirectory();
|
||||
|
||||
// Resource names
|
||||
constexpr const char* RESOURCE_SAPLING_SPEND = "sapling-spend.params";
|
||||
constexpr const char* RESOURCE_SAPLING_OUTPUT = "sapling-output.params";
|
||||
constexpr const char* RESOURCE_ASMAP = "asmap.dat";
|
||||
constexpr const char* RESOURCE_HUSHD = "hushd.exe";
|
||||
constexpr const char* RESOURCE_HUSH_CLI = "hush-cli.exe";
|
||||
constexpr const char* RESOURCE_HUSH_TX = "hush-tx.exe";
|
||||
constexpr const char* RESOURCE_DRAGONXD_BAT = "dragonxd.bat";
|
||||
constexpr const char* RESOURCE_DRAGONX_CLI_BAT = "dragonx-cli.bat";
|
||||
constexpr const char* RESOURCE_XMRIG = "xmrig.exe";
|
||||
constexpr const char* RESOURCE_DARK_GRADIENT = "dark_gradient.png";
|
||||
constexpr const char* RESOURCE_LOGO = "logo_ObsidianDragon_dark.png";
|
||||
|
||||
// Embedded theme overlay info (for iterating bundled themes)
|
||||
struct EmbeddedTheme {
|
||||
const uint8_t* data;
|
||||
size_t size;
|
||||
const char* filename; // e.g. "dark.toml"
|
||||
};
|
||||
|
||||
// Get array of embedded overlay themes (nullptr-terminated)
|
||||
const EmbeddedTheme* getEmbeddedThemes();
|
||||
|
||||
// Extract bundled overlay themes to the given directory
|
||||
// Returns number of themes extracted
|
||||
int extractBundledThemes(const std::string& destDir);
|
||||
|
||||
// Check if daemon needs to be extracted
|
||||
bool needsDaemonExtraction();
|
||||
|
||||
// Get daemon binary directory (<exe_dir>/hush3/)
|
||||
std::string getDaemonDirectory();
|
||||
|
||||
// Check if daemon is available (embedded or in app directory)
|
||||
bool hasDaemonAvailable();
|
||||
|
||||
// Get daemon executable path (extracts if needed)
|
||||
std::string getDaemonPath();
|
||||
|
||||
// Check if xmrig needs to be extracted
|
||||
bool needsXmrigExtraction();
|
||||
|
||||
// Check if xmrig is available (embedded or in app directory)
|
||||
bool hasXmrigAvailable();
|
||||
|
||||
// Force re-extract xmrig binary from embedded resources
|
||||
// (bypasses exists-check; use when Defender deletes the file)
|
||||
bool forceExtractXmrig();
|
||||
|
||||
// Get xmrig executable path (extracts if needed)
|
||||
std::string getXmrigPath();
|
||||
|
||||
} // namespace resources
|
||||
} // namespace dragonx
|
||||
Reference in New Issue
Block a user