68 lines
1.8 KiB
C++
68 lines
1.8 KiB
C++
#pragma once
|
|
|
|
#include "config.hpp"
|
|
|
|
#include <array>
|
|
#include <cstddef>
|
|
#include <cstdint>
|
|
#include <string>
|
|
|
|
namespace settings {
|
|
|
|
inline constexpr std::size_t kSavedColorCount = 48;
|
|
|
|
enum class ScreenshotFormat : int {
|
|
Png = 0,
|
|
Jpeg = 1,
|
|
};
|
|
|
|
struct AppSettings {
|
|
bool notificationsEnabled = true;
|
|
bool startWithWindows = true;
|
|
bool silentAdmin = false;
|
|
|
|
bool copyUploadedUrl = true;
|
|
bool openUploadedUrl = false;
|
|
bool closeEditorAfterUpload = true;
|
|
|
|
std::wstring uploadUrl;
|
|
std::wstring uploadName = L"Screenshot1";
|
|
std::wstring multipartField = L"file";
|
|
|
|
// Files are saved automatically with non-destructive incrementing names:
|
|
// Screenshot_N.png/.jpg and GIFShot_N.gif.
|
|
std::wstring saveDirectory;
|
|
ScreenshotFormat screenshotFormat = ScreenshotFormat::Png;
|
|
int jpegQuality = 92;
|
|
|
|
int gifFps = 30;
|
|
int gifQuality = 8;
|
|
int gifMaxDurationSeconds = 30;
|
|
bool gifCaptureCursor = true;
|
|
|
|
// Drawing widths are physical pixels and intentionally persist immediately
|
|
// when the mouse wheel changes the active tool.
|
|
int penWidth = 3;
|
|
int lineWidth = 3;
|
|
int arrowWidth = 3;
|
|
int rectangleWidth = 3;
|
|
int markerWidth = 15;
|
|
|
|
// Last drawing color persists independently from the saved 8x6 palette.
|
|
std::uint32_t selectedColorArgb = 0xFF3B82F6u;
|
|
|
|
// ARGB values. Empty slots remain available for one-click saving from the
|
|
// in-editor 8x6 color picker.
|
|
std::array<std::uint32_t, kSavedColorCount> paletteArgb{};
|
|
std::array<bool, kSavedColorCount> paletteOccupied{};
|
|
};
|
|
|
|
[[nodiscard]] AppSettings load();
|
|
[[nodiscard]] bool save(const AppSettings& value);
|
|
[[nodiscard]] bool exists();
|
|
[[nodiscard]] std::wstring filePath();
|
|
[[nodiscard]] std::wstring defaultSaveDirectory();
|
|
[[nodiscard]] std::wstring normalizeEndpoint(std::wstring value);
|
|
|
|
} // namespace settings
|