29#define G_LOG_DOMAIN "Widgets.Icon"
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;
76 int iconh = cairo_image_surface_get_height(b->
icon);
77 int iconw = cairo_image_surface_get_width(b->
icon);
78 int icons = MAX(iconh, iconw);
79 double scale = (double)b->
size / icons;
80 width = iconw * scale;
93 cairo_surface_reference(b->
icon);
96 if (b->
icon == NULL) {
99 int iconh = cairo_image_surface_get_height(b->
icon);
100 int iconw = cairo_image_surface_get_width(b->
icon);
101 int icons = MAX(iconh, iconw);
102 double scale = (double)b->
size / icons;
112 draw, lpad + (b->
widget.
w - iconw * scale - lpad - rpad) * b->
xalign,
113 tpad + (b->
widget.
h - iconh * scale - tpad - bpad) * b->
yalign);
114 cairo_scale(draw, scale, scale);
115 cairo_set_source_surface(draw, b->
icon, 0, 0);
124 cairo_surface_destroy(b->
icon);
141 if (icon_widget->
icon) {
142 cairo_surface_destroy(icon_widget->
icon);
143 icon_widget->
icon = NULL;
146 cairo_surface_reference(surf);
147 icon_widget->
icon = 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_widget, cairo_surface_t *surf)
icon * icon_create(widget *parent, const char *name)
static int icon_get_desired_width(widget *wid, G_GNUC_UNUSED const int height)
static void icon_free(widget *wid)
static void icon_resize(widget *wid, short w, short h)
static int icon_get_desired_height(widget *wid, G_GNUC_UNUSED const int width)
static void icon_draw(widget *wid, cairo_t *draw)
@ ROFI_ORIENTATION_VERTICAL
int distance_get_pixel(RofiDistance d, RofiOrientation ori)
double rofi_theme_get_double(const widget *wid, const char *property, double def)
int rofi_theme_get_boolean(const widget *wid, const char *property, int def)
RofiDistance rofi_theme_get_distance(const widget *wid, const char *property, int def)
const char * rofi_theme_get_string(const widget *wid, const char *property, const char *def)