mousetrap v0.2.0
|
object representing an icon. Note that this does not hodl any image data, instead it points to a file on disk or to an entry in an mousetrap::IconTheme More...
#include <icon.hpp>
Public Member Functions | |
Icon () | |
construct as empty icon | |
~Icon () | |
destructor | |
operator GIcon * () const | |
expose as GIcon \for_internal_use_only | |
operator GtkIconPaintable * () const | |
expose as GtkIconPaintable \for_internal_use_only | |
bool | create_from_file (const std::string &path, uint64_t square_resolution, uint64_t scale=1) |
create icon from file | |
bool | create_from_theme (const IconTheme &theme, const IconID &, uint64_t square_resolution, uint64_t scale=1) |
create icon from theme | |
IconID | get_name () const |
get the identifier of the icon | |
bool | operator== (const Icon &other) const |
check if two icons point to the same resource | |
bool | operator!= (const Icon &other) const |
check if two icons point to the same resource | |
uint64_t | get_scale () const |
get icon scale | |
Vector2ui | get_size () const |
get icon resolution, this is the resolution requested during create_from, not the resources native resolution | |
object representing an icon. Note that this does not hodl any image data, instead it points to a file on disk or to an entry in an mousetrap::IconTheme
bool mousetrap::Icon::create_from_file | ( | const std::string & | path, |
uint64_t | square_resolution, | ||
uint64_t | scale = 1 |
||
) |
create icon from file
path | |
square_resolution | target size of the icon, icons are always square. If the file is not a .svg file and the native resolution of the image is different from the requested resolution, performss linear scaling |
scale | scale of the icon, or 1 for no scaling |
References mousetrap::log::critical().
bool mousetrap::Icon::create_from_theme | ( | const IconTheme & | theme, |
const IconID & | id, | ||
uint64_t | square_resolution, | ||
uint64_t | scale = 1 |
||
) |
create icon from theme
theme | |
id | id of an icon |
square_resolution | target size of the icon, icons are always square. If the file is not a .svg file and the native resolution of the image is different from the requested resolution, performss linear scaling |
scale | scale of the icon, or 1 for no scaling |
References mousetrap::log::critical().
IconID mousetrap::Icon::get_name | ( | ) | const |
get the identifier of the icon
uint64_t mousetrap::Icon::get_scale | ( | ) | const |
Vector2ui mousetrap::Icon::get_size | ( | ) | const |
get icon resolution, this is the resolution requested during create_from, not the resources native resolution
Referenced by mousetrap::ImageDisplay::create_from_icon().
bool mousetrap::Icon::operator!= | ( | const Icon & | other | ) | const |
check if two icons point to the same resource
other |
bool mousetrap::Icon::operator== | ( | const Icon & | other | ) | const |
check if two icons point to the same resource
other |