34#include <NDEVR/SoftwareService.h>
35#include <NDEVR/Buffer.h>
36#include <NDEVR/String.h>
37#include <NDEVR/File.h>
38#include <NDEVR/Dictionary.h>
39#include <NDEVR/RGBColor.h>
40#include <NDEVR/LABColor.h>
41#include <NDEVR/Resource.h>
42#include <NDEVR/UUID.h>
43#include <qiconengine.h>
88 [[nodiscard]]
UUID id()
const {
return m_id; }
101 virtual void paint(QPainter* painter,
const QRect& rect, QIcon::Mode mode, QIcon::State state)
override;
102 virtual QPixmap
pixmap(
const QSize& size, QIcon::Mode mode, QIcon::State state)
override;
103 virtual QIconEngine*
clone(
void)
const override;
104 QSize
actualSize(
const QSize& size, QIcon::Mode mode, QIcon::State state)
override;
135 static void GetIconResource(
const std::function<
void(
const String&,
const QIcon&)>& on_finished,
const String& icon, QIcon::Mode mode = QIcon::Mode::Normal);
137 static void GetPixmapResource(
const std::function<
void(
const String&,
const QPixmap&)>& on_finished,
const String& pixmap, QIcon::Mode mode = QIcon::Mode::Normal,
const QSize& requested_size = QSize());
141 static QPixmap
LocalPixmapResource(
const String& pixmap, QIcon::Mode mode = QIcon::Mode::Normal,
const QSize& requested_size = QSize());
147 static void ConvertColorTheme(
const Buffer<std::pair<RGBColor, RGBColor>>& colors,
const File& in_location,
const File& out_location,
bool preserve_brightness,
bool preserve_alpha,
Log* log =
nullptr);
148 static void ConvertColorTheme(
const Buffer<std::pair<LABColor, LABColor>>& color, QImage& image,
bool preserve_brightness,
bool preserve_alpha);
149 static QImage
AutoCrop(
const QImage& pixmap,
int margin = 0,
bool preserve_ratio =
false);
168 static QIcon
icon(
const String& icon, QIcon::Mode mode = QIcon::Mode::Normal);
170 static QPixmap
pixmap(
const String& pixmap, QIcon::Mode mode = QIcon::Mode::Normal,
const QSize& requested_size = QSize());
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
Used to render any icons when they are needed. Resources will not be consumed until draw is called.
Definition QTIconManager.h:96
QIcon::Mode m_override_mode
Definition QTIconManager.h:108
virtual QIconEngine * clone(void) const override
QSize actualSize(const QSize &size, QIcon::Mode mode, QIcon::State state) override
QSize m_default_size
Definition QTIconManager.h:109
void setIconTheme(const IconThemeSettings theme)
virtual void paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state) override
String m_icon
Definition QTIconManager.h:107
virtual QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state) override
DeferredImageIconEngine(const String &icon, QIcon::Mode mode=QIcon::Mode::Normal)
QPixmap m_cached_pixmap
Definition QTIconManager.h:106
~DeferredImageIconEngine()
A hash-based key-value store, useful for quick associative lookups. Key features include:
Definition Dictionary.h:61
Logic for reading or writing to a file as well as navigating filesystems.
Definition File.h:48
Serves as the primary program interface for processes to report issues and allows any number of LogSt...
Definition Log.h:48
Used to render any icons or fetch any pixmaps within the software. More rendering engines can be adde...
Definition QTIconManager.h:81
virtual QIcon createIcon(const String &icon, const IconThemeSettings &theme, QIcon::Mode mode=QIcon::Mode::Normal)=0
NDEVRIconEngine(const UUID &id)
Definition QTIconManager.h:83
UUID id() const
Definition QTIconManager.h:88
virtual bool canProcess(const String &icon, const IconThemeSettings &theme, QIcon::Mode mode) const =0
A QIconEngine used to render SVG icons.
Definition SVGIconManager.h:28
Base class for logic that can be used to resolve a Pixmap resource and turn it into a QPixmap for use...
Definition QTIconManager.h:116
virtual bool canPotentiallyResolve(const String &pixmap_resource)=0
virtual UUID id() const =0
virtual QPixmap resolve(const String &pixmap_resource, QIcon::Mode mode, const QSize &requested_size, Dictionary< String, QPixmap > &pixmaps)=0
Manages all Icons and Pixmaps used by the UI in the NDEVR Engine. Icons may be fetched remotely so ca...
Definition QTIconManager.h:127
static const Buffer< IconThemeSettings > & iconThemes()
static void GetIconResource(const std::function< void(const String &, const QIcon &)> &on_finished, const String &icon, QIcon::Mode mode=QIcon::Mode::Normal)
static void ConvertColorTheme(const Buffer< std::pair< RGBColor, RGBColor > > &colors, const Buffer< File > &in, const File &out_location, bool preserve_brightness, bool preserve_alpha, Log *log=nullptr)
static void PostIconResourceLoad(const String &id)
static String GetSVGPath(const String &icon, const IconThemeSettings &theme)
static QIcon GetIconResourceBlocking(const String &icon, QIcon::Mode mode=QIcon::Mode::Normal)
static String ImageCacheLocation(const String &icon)
static QImage CleanupImageForIcon(const QImage &image)
static void AddResolver(PixmapResolver *resolver)
static QIcon icon(const String &icon, QIcon::Mode mode=QIcon::Mode::Normal)
static IconThemeSettings OutlineIconTheme()
static void SetWindowIcon(const String &s, QWidget *widget)
static void addIconTheme(const IconThemeSettings &theme)
static QPixmap LocalPixmapResource(const String &pixmap, QIcon::Mode mode=QIcon::Mode::Normal, const QSize &requested_size=QSize())
static QImage AutoCrop(const QImage &pixmap, int margin=0, bool preserve_ratio=false)
static void ConvertColorTheme(const Buffer< std::pair< LABColor, LABColor > > &color, QImage &image, bool preserve_brightness, bool preserve_alpha)
static const IconThemeSettings & EffectiveIconTheme()
static Buffer< std::pair< LABColor, LABColor > > ConvertColorPalette(const Buffer< std::pair< RGBColor, RGBColor > > &palette)
static void ClearWindowIcon(QWidget *widget)
static File GetImagePath(const String &icon)
static Resource< IconThemeSettings * > s_overide_icon_theme
Definition QTIconManager.h:156
static void SetOverrideTheme(IconThemeSettings *theme)
static Resource< IconThemeSettings > s_icon_theme
Definition QTIconManager.h:157
static String IconCacheLocation(const String &icon, const IconThemeSettings &theme)
static void ConvertColorTheme(const Buffer< std::pair< RGBColor, RGBColor > > &colors, const File &in_location, const File &out_location, bool preserve_brightness, bool preserve_alpha, Log *log=nullptr)
static void AddIconEngine(NDEVRIconEngine *engine)
static QIcon GetIconResourceBlocking(const String &icon, const IconThemeSettings &theme, QIcon::Mode mode=QIcon::Mode::Normal)
static IconThemeSettings NDEVRIconTheme()
static const QPixmap & disabledPixmap(const String &icon_name)
static QIcon icon(const String &icon, const IconThemeSettings &theme, QIcon::Mode mode=QIcon::Mode::Normal)
static QPixmap pixmap(const String &pixmap, QIcon::Mode mode=QIcon::Mode::Normal, const QSize &requested_size=QSize())
static void GetIconResource(const std::function< void(const String &, const QIcon &)> &on_finished, const String &icon, const IconThemeSettings &theme, QIcon::Mode mode=QIcon::Mode::Normal)
static constexpr const char * NDEVRThemeLocation()
Definition QTIconManager.h:160
static void GetPixmapResource(const std::function< void(const String &, const QPixmap &)> &on_finished, const String &pixmap, QIcon::Mode mode=QIcon::Mode::Normal, const QSize &requested_size=QSize())
static void SetLightingTheme(const IconThemeSettings &theme)
static QImage FillBackground(const QImage &pixmap, RGBColor color)
Represents a color in the RGB space with optional alpha transparency.
Definition RGBColor.h:54
A core part of the engine, stores variables that can be listened to with ResourceListener which will ...
Definition Toggle.h:41
Software Services provide an interface for adding to or changing the software behavior via functional...
Definition SoftwareService.h:9
Software Service Managers take a Software service to modify the behavior of the software.
Definition SoftwareService.h:15
The core String class for the NDEVR API.
Definition String.h:69
Logic for reading or writing to a string or a user friendly, TranslatedString.
Definition StringStream.h:230
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
Definition UUID.h:60
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:149
Stores information for how to draw icons, when supported.
Definition QTIconManager.h:59
RGBColor secondary_color
Definition QTIconManager.h:66
bool operator!=(const IconThemeSettings &settings) const
String theme_name
Definition QTIconManager.h:62
bool blend_color
Definition QTIconManager.h:71
fltp08 pixel_size
Definition QTIconManager.h:69
String theme_icon_location
Definition QTIconManager.h:63
String theme_icon
Definition QTIconManager.h:61
RGBColor primary_color
Definition QTIconManager.h:65
RGBColor highlight_color
Definition QTIconManager.h:64
bool colorize_svgs
Definition QTIconManager.h:70
bool operator==(const IconThemeSettings &settings) const
RGBColor accent_color
Definition QTIconManager.h:67
RGBColor outline_color
Definition QTIconManager.h:68