-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathState.h
More file actions
68 lines (49 loc) · 1.28 KB
/
Copy pathState.h
File metadata and controls
68 lines (49 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/** $VER: State.h (2026.08.14) P. Stuer **/
#pragma once
#pragma warning(push)
#pragma warning(disable: 4868) // compiler may not enforce left-to-right evaluation order in braced initializer list
#include <nlohmann/json.hpp>
using json = nlohmann::ordered_json;
#pragma warning(pop)
enum ItemImage : int
{
Folder = 0,
Playlist = 1,
PlaylistPlaying = 2,
PlaylistLocked = 3,
FolderLocked = 4,
AutoPlaylist = 5,
AutoPlaylistPlaying = 6,
FolderFrozen = 7,
Count,
};
struct image_t
{
std::string _FilePath;
uint32_t _IconIndex;
};
/// <summary>
/// Represents the state of the component.
/// </summary>
class state_t
{
public:
state_t() noexcept;
state_t & operator=(const state_t & other) noexcept;
virtual ~state_t() noexcept { }
void Reset() noexcept;
void FromJSON(const char * data, size_t size) noexcept;
json ToJSON() const noexcept;
public:
std::string _TextFormat;
std::string _ToolTipFormat;
uint32_t _ImageSize;
bool _UseQuickSearch;
bool _UseHorizontalScrollbar;
bool _ExpandDropTarget;
std::vector<image_t> _Images;
const uint32_t _SchemaVersion = 1; // v0.1.0.0
/* Not serialized */
json _Object;
};
extern state_t _State;