Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface.c
| Show First 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | |||||
| #include "RNA_access.h" | #include "RNA_access.h" | ||||
| #include "BPY_extern.h" | #include "BPY_extern.h" | ||||
| #include "ED_screen.h" | #include "ED_screen.h" | ||||
| #include "ED_numinput.h" | #include "ED_numinput.h" | ||||
| #include "IMB_imbuf.h" | |||||
| #include "IMB_imbuf_types.h" | |||||
| #include "IMB_colormanagement.h" | #include "IMB_colormanagement.h" | ||||
| #include "DEG_depsgraph_query.h" | #include "DEG_depsgraph_query.h" | ||||
| #include "interface_intern.h" | #include "interface_intern.h" | ||||
| /* prototypes. */ | /* prototypes. */ | ||||
| static void ui_but_to_pixelrect(struct rcti *rect, | static void ui_but_to_pixelrect(struct rcti *rect, | ||||
| ▲ Show 20 Lines • Show All 184 Lines • ▼ Show 20 Lines | |||||
| uiBut *but = ui_def_but( | uiBut *but = ui_def_but( | ||||
| block, type, retval, str, x, y, width, height, poin, min, max, a1, a2, tip); | block, type, retval, str, x, y, width, height, poin, min, max, a1, a2, tip); | ||||
| ui_but_update(but); | ui_but_update(but); | ||||
| return but; | return but; | ||||
| } | } | ||||
| uiBut *uiDefButImage( | |||||
| uiBlock *block, void *imbuf, int x, int y, short width, short height, uchar color[4]) | |||||
| { | |||||
| uiBut *but = ui_def_but( | |||||
| block, UI_BTYPE_IMAGE, 0, "", x, y, width, height, imbuf, 0, 0, 0, 0, ""); | |||||
| if (color) { | |||||
| copy_v4_v4_uchar(but->col, color); | |||||
| } | |||||
| else { | |||||
| but->col[0] = 255; | |||||
| but->col[1] = 255; | |||||
| but->col[2] = 255; | |||||
| but->col[3] = 255; | |||||
| } | |||||
| ui_but_update(but); | |||||
| return but; | |||||
| } | |||||
| /** | /** | ||||
| * if \a _x_ is a power of two (only one bit) return the power, | * if \a _x_ is a power of two (only one bit) return the power, | ||||
| * otherwise return -1. | * otherwise return -1. | ||||
| * | * | ||||
| * for powers of two: | * for powers of two: | ||||
| * \code{.c} | * \code{.c} | ||||
| * ((1 << findBitIndex(x)) == x); | * ((1 << findBitIndex(x)) == x); | ||||
| * \endcode | * \endcode | ||||
| ▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines | |||||