29#define G_LOG_DOMAIN "Widgets.Icon"
56 G_GNUC_UNUSED
const int width) {
61 int iconh = cairo_image_surface_get_height(b->
icon);
62 int iconw = cairo_image_surface_get_width(b->
icon);
63 int icons = MAX(iconh, iconw);
64 double scale = (double)b->
size / icons;
65 height = iconh * scale;
72 G_GNUC_UNUSED
const int height) {
77 int iconh = cairo_image_surface_get_height(b->
icon);
78 int iconw = cairo_image_surface_get_width(b->
icon);
79 int icons = MAX(iconh, iconw);
80 double scale = (double)b->
size / icons;
81 width = iconw * scale;
94 cairo_surface_reference(b->
icon);
97 if (b->
icon == NULL) {
100 int iconh = cairo_image_surface_get_height(b->
icon);
101 int iconw = cairo_image_surface_get_width(b->
icon);
102 int icons = MAX(iconh, iconw);
103 double scale = (double)b->
size / icons;
113 draw, lpad + (b->
widget.
w - iconw * scale - lpad - rpad) * b->
xalign,
114 tpad + (b->
widget.
h - iconh * scale - tpad - bpad) * b->
yalign);
115 cairo_scale(draw, scale, scale);
116 cairo_set_source_surface(draw, b->
icon, 0, 0);
125 cairo_surface_destroy(b->
icon);
147 cairo_surface_reference(surf);
cairo_surface_t * rofi_icon_fetcher_get(const uint32_t uid)
uint32_t rofi_icon_fetcher_query(const char *name, const int size)
void icon_set_surface(icon *icon, cairo_surface_t *surf)
icon * icon_create(widget *parent, const char *name)
static int icon_get_desired_height(widget *widget, G_GNUC_UNUSED const int width)
static void icon_free(widget *wid)
static void icon_resize(widget *widget, short w, short h)
static void icon_draw(widget *wid, cairo_t *draw)
static int icon_get_desired_width(widget *widget, G_GNUC_UNUSED const int height)
@ ROFI_ORIENTATION_VERTICAL
const char * rofi_theme_get_string(const widget *widget, const char *property, const char *def)
RofiDistance rofi_theme_get_distance(const widget *widget, const char *property, int def)
int rofi_theme_get_boolean(const widget *widget, const char *property, int def)
int distance_get_pixel(RofiDistance d, RofiOrientation ori)
double rofi_theme_get_double(const widget *widget, const char *property, double def)