TachyonUI
1.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);
31
~FileIcons
();
32
FileIcons
(
const
FileIcons
&) =
delete
;
33
FileIcons
&
operator=
(
const
FileIcons
&) =
delete
;
34
35
IconID
Get
(std::string_view name,
bool
isFolder);
37
IconID
OpenFolder
();
38
41
static
std::string
Extension
(std::string_view name);
42
43
private
:
44
IconID
Read(
const
std::string& key,
bool
isFolder,
bool
open);
45
46
ITextSystem
& m_textSystem;
47
[[maybe_unused]] uint32_t m_pixels;
48
std::unordered_map<std::string, IconID> m_icons;
49
};
50
51
#ifdef _WIN32
52
namespace
detail
53
{
56
bool
IconPixels(
void
* icon, uint32_t& width, uint32_t& height, std::vector<uint8_t>& rgba);
57
}
58
#endif
59
61
}
tachyon::FileIcons::FileIcons
FileIcons(const FileIcons &)=delete
tachyon::FileIcons::Extension
static std::string Extension(std::string_view name)
The extension Get goes by: from the last '.
tachyon::FileIcons::operator=
FileIcons & operator=(const FileIcons &)=delete
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()
Lets go of the icons it registered (ITextSystem::UnregisterIcon); another cache's registrations of th...
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:189
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