Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_icons.c
| Show First 20 Lines • Show All 171 Lines • ▼ Show 20 Lines | |||||
| # define DEF_ICON_FOLDER(name) {ICON_TYPE_MONO_TEXTURE, TH_ICON_FOLDER}, | # define DEF_ICON_FOLDER(name) {ICON_TYPE_MONO_TEXTURE, TH_ICON_FOLDER}, | ||||
| # define DEF_ICON_FUND(name) {ICON_TYPE_MONO_TEXTURE, TH_ICON_FUND}, | # define DEF_ICON_FUND(name) {ICON_TYPE_MONO_TEXTURE, TH_ICON_FUND}, | ||||
| # define DEF_ICON_VECTOR(name) {ICON_TYPE_VECTOR, 0}, | # define DEF_ICON_VECTOR(name) {ICON_TYPE_VECTOR, 0}, | ||||
| # define DEF_ICON_COLOR(name) {ICON_TYPE_COLOR_TEXTURE, 0}, | # define DEF_ICON_COLOR(name) {ICON_TYPE_COLOR_TEXTURE, 0}, | ||||
| # define DEF_ICON_BLANK(name) {ICON_TYPE_BLANK, 0}, | # define DEF_ICON_BLANK(name) {ICON_TYPE_BLANK, 0}, | ||||
| # include "UI_icons.h" | # include "UI_icons.h" | ||||
| }; | }; | ||||
| /* ********** Alert Icons ********** */ | |||||
| # define ALERT_IMG_SIZE 256 | |||||
| ImBuf *UI_alert_image(eAlertIcon icon) | |||||
| { | |||||
| # ifdef WITH_HEADLESS | |||||
| return NULL | |||||
| # else | |||||
| ImBuf *ibuf; | |||||
| icon = MIN2(icon, ALERT_ICON_MAX - 1); | |||||
| const int left = icon * ALERT_IMG_SIZE; | |||||
| const rcti crop = {left, left + ALERT_IMG_SIZE - 1, 0, ALERT_IMG_SIZE - 1}; | |||||
| ibuf = IMB_ibImageFromMemory((const uchar *)datatoc_alert_icons_png, | |||||
| datatoc_alert_icons_png_size, | |||||
| IB_rect, | |||||
| NULL, | |||||
| "alert_icon"); | |||||
| IMB_rect_crop(ibuf, &crop); | |||||
| IMB_premultiply_alpha(ibuf); | |||||
| return ibuf; | |||||
| #endif | |||||
| } | |||||
| /* **************************************************** */ | /* **************************************************** */ | ||||
| static DrawInfo *def_internal_icon( | static DrawInfo *def_internal_icon( | ||||
| ImBuf *bbuf, int icon_id, int xofs, int yofs, int size, int type, int theme_color) | ImBuf *bbuf, int icon_id, int xofs, int yofs, int size, int type, int theme_color) | ||||
| { | { | ||||
| Icon *new_icon = NULL; | Icon *new_icon = NULL; | ||||
| IconImage *iimg = NULL; | IconImage *iimg = NULL; | ||||
| DrawInfo *di; | DrawInfo *di; | ||||
| ▲ Show 20 Lines • Show All 2,177 Lines • Show Last 20 Lines | |||||