TachyonUI 0.1.0
High-performance UI for building tools.
Loading...
Searching...
No Matches
gui_file_icons.h
Go to the documentation of this file.
1#pragma once
2
3// The icons the OS shows for files and folders, as picture icons for a file view.
4
6
7#include <cstdint>
8#include <string>
9#include <string_view>
10#include <unordered_map>
11#include <vector>
12
13namespace tachyon
14{
15 class ITextSystem;
16
19
26 {
27 public:
28 explicit FileIcons(ITextSystem& textSystem, uint32_t pixels = 48);
29
30 IconID Get(std::string_view name, bool isFolder);
33
36 static std::string Extension(std::string_view name);
37
38 private:
39 IconID Read(const std::string& key, bool isFolder, bool open);
40
41 ITextSystem& m_textSystem;
42 uint32_t m_pixels;
43 std::unordered_map<std::string, IconID> m_icons;
44 };
45
46#ifdef _WIN32
47 namespace detail
48 {
51 bool IconPixels(void* icon, uint32_t& width, uint32_t& height, std::vector<uint8_t>& rgba);
52 }
53#endif
54
56}
static std::string Extension(std::string_view name)
The extension Get goes by: from the last '.
IconID Get(std::string_view name, bool isFolder)
IconID OpenFolder()
A folder's icon while it's open, or while something is dragged over it.
FileIcons(ITextSystem &textSystem, uint32_t pixels=48)
Text and icon registration, measurement, rendering and editing.
Definition gui_text_system.h:178
IconID
Handle for an icon registered with ITextSystem::RegisterIconFromSVG / RegisterIconFromSVGFile.
Definition gui_style_text.h:15
Definition gui_logging.h:24