TachyonUI
0.1.0
High-performance UI for building tools.
Toggle main menu visibility
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
5
#include <
gui_core/style/gui_style_text.h
>
6
7
#include <cstdint>
8
#include <string>
9
#include <string_view>
10
#include <unordered_map>
11
#include <vector>
12
13
namespace
tachyon
14
{
15
class
ITextSystem
;
16
19
25
class
FileIcons
26
{
27
public
:
28
explicit
FileIcons
(
ITextSystem
& textSystem, uint32_t pixels = 48);
29
30
IconID
Get
(std::string_view name,
bool
isFolder);
32
IconID
OpenFolder
();
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
}
tachyon::FileIcons::Extension
static std::string Extension(std::string_view name)
The extension Get goes by: from the last '.
tachyon::FileIcons::Get
IconID Get(std::string_view name, bool isFolder)
tachyon::FileIcons::OpenFolder
IconID OpenFolder()
A folder's icon while it's open, or while something is dragged over it.
tachyon::FileIcons::FileIcons
FileIcons(ITextSystem &textSystem, uint32_t pixels=48)
tachyon::ITextSystem
Text and icon registration, measurement, rendering and editing.
Definition
gui_text_system.h:178
tachyon::IconID
IconID
Handle for an icon registered with ITextSystem::RegisterIconFromSVG / RegisterIconFromSVGFile.
Definition
gui_style_text.h:15
gui_style_text.h
tachyon
Definition
gui_logging.h:24
gui_controls
gui_file_icons.h
Generated by
1.18.0