UI: Update rest of UI code for increased button flag bitfield
Needed after 98a04ed452
.
This commit is contained in:
parent
8d528241a9
commit
59cd616534
Notes:
blender-bot
2023-02-14 06:42:54 +01:00
Referenced by commit 3693e1d8e8
, Revert commits to increase button flag bitfield size
|
@ -462,7 +462,7 @@ enum {
|
|||
void UI_draw_widget_scroll(struct uiWidgetColors *wcol,
|
||||
const struct rcti *rect,
|
||||
const struct rcti *slider,
|
||||
int state);
|
||||
uint64_t state);
|
||||
|
||||
/**
|
||||
* Shortening string helper.
|
||||
|
@ -887,9 +887,9 @@ uiBut *UI_but_active_drop_name_button(const struct bContext *C);
|
|||
bool UI_but_active_drop_name(const struct bContext *C);
|
||||
bool UI_but_active_drop_color(struct bContext *C);
|
||||
|
||||
void UI_but_flag_enable(uiBut *but, int flag);
|
||||
void UI_but_flag_disable(uiBut *but, int flag);
|
||||
bool UI_but_flag_is_set(uiBut *but, int flag);
|
||||
void UI_but_flag_enable(uiBut *but, uint64_t flag);
|
||||
void UI_but_flag_disable(uiBut *but, uint64_t flag);
|
||||
bool UI_but_flag_is_set(uiBut *but, uint64_t flag);
|
||||
|
||||
void UI_but_drawflag_enable(uiBut *but, int flag);
|
||||
void UI_but_drawflag_disable(uiBut *but, int flag);
|
||||
|
@ -1682,7 +1682,7 @@ bool UI_search_item_add(uiSearchItems *items,
|
|||
const char *name,
|
||||
void *poin,
|
||||
int iconid,
|
||||
int state,
|
||||
uint64_t state,
|
||||
uint8_t name_prefix_offset);
|
||||
|
||||
/**
|
||||
|
|
|
@ -848,7 +848,7 @@ static void ui_but_update_old_active_from_new(uiBut *oldbut, uiBut *but)
|
|||
BLI_assert(oldbut->active);
|
||||
|
||||
/* flags from the buttons we want to refresh, may want to add more here... */
|
||||
const int flag_copy = UI_BUT_REDALERT | UI_HAS_ICON | UI_SELECT_DRAW;
|
||||
const uint64_t flag_copy = UI_BUT_REDALERT | UI_HAS_ICON | UI_SELECT_DRAW;
|
||||
const int drawflag_copy = 0; /* None currently. */
|
||||
|
||||
/* still stuff needs to be copied */
|
||||
|
@ -991,7 +991,7 @@ static bool ui_but_update_from_old_block(const bContext *C,
|
|||
found_active = true;
|
||||
}
|
||||
else {
|
||||
int flag_copy = UI_BUT_DRAG_MULTI;
|
||||
uint64_t flag_copy = UI_BUT_DRAG_MULTI;
|
||||
|
||||
/* Stupid special case: The active button may be inside (as in, overlapped on top) a tree-row
|
||||
* button which we also want to keep highlighted then. */
|
||||
|
@ -4219,7 +4219,7 @@ static uiBut *ui_def_but(uiBlock *block,
|
|||
return but;
|
||||
}
|
||||
|
||||
void ui_def_but_icon(uiBut *but, const int icon, const int flag)
|
||||
void ui_def_but_icon(uiBut *but, const int icon, const uint64_t flag)
|
||||
{
|
||||
if (icon) {
|
||||
ui_icon_ensure_deferred(static_cast<const bContext *>(but->block->evil_C),
|
||||
|
@ -5806,17 +5806,17 @@ void UI_block_flag_disable(uiBlock *block, int flag)
|
|||
block->flag &= ~flag;
|
||||
}
|
||||
|
||||
void UI_but_flag_enable(uiBut *but, int flag)
|
||||
void UI_but_flag_enable(uiBut *but, uint64_t flag)
|
||||
{
|
||||
but->flag |= flag;
|
||||
}
|
||||
|
||||
void UI_but_flag_disable(uiBut *but, int flag)
|
||||
void UI_but_flag_disable(uiBut *but, uint64_t flag)
|
||||
{
|
||||
but->flag &= ~flag;
|
||||
}
|
||||
|
||||
bool UI_but_flag_is_set(uiBut *but, int flag)
|
||||
bool UI_but_flag_is_set(uiBut *but, uint64_t flag)
|
||||
{
|
||||
return (but->flag & flag) != 0;
|
||||
}
|
||||
|
|
|
@ -144,7 +144,7 @@ void ui_but_anim_decorate_update_from_flag(uiButDecorator *decorator_but)
|
|||
return;
|
||||
}
|
||||
|
||||
const int flag = but_anim->flag;
|
||||
const uint64_t flag = but_anim->flag;
|
||||
|
||||
if (flag & UI_BUT_DRIVEN) {
|
||||
but->icon = ICON_DECORATE_DRIVER;
|
||||
|
@ -162,7 +162,7 @@ void ui_but_anim_decorate_update_from_flag(uiButDecorator *decorator_but)
|
|||
but->icon = ICON_DECORATE;
|
||||
}
|
||||
|
||||
const int flag_copy = (UI_BUT_DISABLED | UI_BUT_INACTIVE);
|
||||
const uint64_t flag_copy = (UI_BUT_DISABLED | UI_BUT_INACTIVE);
|
||||
but->flag = (but->flag & ~flag_copy) | (flag & flag_copy);
|
||||
}
|
||||
|
||||
|
|
|
@ -710,7 +710,7 @@ extern void ui_but_active_string_clear_and_exit(struct bContext *C, uiBut *but)
|
|||
extern void ui_but_set_string_interactive(struct bContext *C, uiBut *but, const char *value);
|
||||
extern uiBut *ui_but_drag_multi_edit_get(uiBut *but);
|
||||
|
||||
void ui_def_but_icon(uiBut *but, int icon, int flag);
|
||||
void ui_def_but_icon(uiBut *but, int icon, uint64_t flag);
|
||||
/**
|
||||
* Avoid using this where possible since it's better not to ask for an icon in the first place.
|
||||
*/
|
||||
|
@ -1217,14 +1217,14 @@ void ui_draw_menu_item(const struct uiFontStyle *fstyle,
|
|||
rcti *rect,
|
||||
const char *name,
|
||||
int iconid,
|
||||
int state,
|
||||
uint64_t state,
|
||||
uiMenuItemSeparatorType separator_type,
|
||||
int *r_xmax);
|
||||
void ui_draw_preview_item(const struct uiFontStyle *fstyle,
|
||||
rcti *rect,
|
||||
const char *name,
|
||||
int iconid,
|
||||
int state,
|
||||
uint64_t state,
|
||||
eFontStyle_Align text_align);
|
||||
/**
|
||||
* Version of #ui_draw_preview_item() that does not draw the menu background and item text based on
|
||||
|
@ -1425,8 +1425,8 @@ uiBlock *ui_block_find_mouse_over(const struct ARegion *region,
|
|||
bool only_clip);
|
||||
|
||||
uiBut *ui_region_find_first_but_test_flag(struct ARegion *region,
|
||||
int flag_include,
|
||||
int flag_exclude);
|
||||
uint64_t flag_include,
|
||||
uint64_t flag_exclude);
|
||||
uiBut *ui_region_find_active_but(struct ARegion *region) ATTR_WARN_UNUSED_RESULT;
|
||||
bool ui_region_contains_point_px(const struct ARegion *region, const int xy[2])
|
||||
ATTR_NONNULL(1, 2) ATTR_WARN_UNUSED_RESULT;
|
||||
|
|
|
@ -5316,7 +5316,7 @@ static void ui_item_align(uiLayout *litem, short nr)
|
|||
}
|
||||
}
|
||||
|
||||
static void ui_item_flag(uiLayout *litem, int flag)
|
||||
static void ui_item_flag(uiLayout *litem, uint64_t flag)
|
||||
{
|
||||
LISTBASE_FOREACH_BACKWARD (uiItem *, item, &litem->items) {
|
||||
if (item->type == ITEM_BUTTON) {
|
||||
|
|
|
@ -699,7 +699,9 @@ uiBut *ui_region_find_active_but(ARegion *region)
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
uiBut *ui_region_find_first_but_test_flag(ARegion *region, int flag_include, int flag_exclude)
|
||||
uiBut *ui_region_find_first_but_test_flag(ARegion *region,
|
||||
uint64_t flag_include,
|
||||
uint64_t flag_exclude)
|
||||
{
|
||||
LISTBASE_FOREACH (uiBlock *, block, ®ion->uiblocks) {
|
||||
LISTBASE_FOREACH (uiBut *, but, &block->buttons) {
|
||||
|
|
|
@ -58,7 +58,7 @@ struct uiSearchItems {
|
|||
char **names;
|
||||
void **pointers;
|
||||
int *icons;
|
||||
int *states;
|
||||
uint64_t *states;
|
||||
uint8_t *name_prefix_offsets;
|
||||
|
||||
/** Is there any item with an icon? */
|
||||
|
@ -94,7 +94,7 @@ bool UI_search_item_add(uiSearchItems *items,
|
|||
const char *name,
|
||||
void *poin,
|
||||
int iconid,
|
||||
int state,
|
||||
uint64_t state,
|
||||
const uint8_t name_prefix_offset)
|
||||
{
|
||||
/* hijack for autocomplete */
|
||||
|
@ -556,7 +556,7 @@ static void ui_searchbox_region_draw_fn(const bContext *C, ARegion *region)
|
|||
if (data->preview) {
|
||||
/* draw items */
|
||||
for (int a = 0; a < data->items.totitem; a++) {
|
||||
const int state = ((a == data->active) ? UI_ACTIVE : 0) | data->items.states[a];
|
||||
const uint64_t state = ((a == data->active) ? UI_ACTIVE : 0) | data->items.states[a];
|
||||
|
||||
/* ensure icon is up-to-date */
|
||||
ui_icon_ensure_deferred(C, data->items.icons[a], data->preview);
|
||||
|
@ -590,7 +590,7 @@ static void ui_searchbox_region_draw_fn(const bContext *C, ARegion *region)
|
|||
const int search_sep_len = data->sep_string ? strlen(data->sep_string) : 0;
|
||||
/* draw items */
|
||||
for (int a = 0; a < data->items.totitem; a++) {
|
||||
const int state = ((a == data->active) ? UI_ACTIVE : 0) | data->items.states[a];
|
||||
const uint64_t state = ((a == data->active) ? UI_ACTIVE : 0) | data->items.states[a];
|
||||
char *name = data->items.names[a];
|
||||
int icon = data->items.icons[a];
|
||||
char *name_sep_test = nullptr;
|
||||
|
@ -847,7 +847,7 @@ static ARegion *ui_searchbox_create_generic_ex(bContext *C,
|
|||
data->items.names = (char **)MEM_callocN(data->items.maxitem * sizeof(void *), __func__);
|
||||
data->items.pointers = (void **)MEM_callocN(data->items.maxitem * sizeof(void *), __func__);
|
||||
data->items.icons = (int *)MEM_callocN(data->items.maxitem * sizeof(int), __func__);
|
||||
data->items.states = (int *)MEM_callocN(data->items.maxitem * sizeof(int), __func__);
|
||||
data->items.states = (uint64_t *)MEM_callocN(data->items.maxitem * sizeof(uint64_t), __func__);
|
||||
data->items.name_prefix_offsets = nullptr; /* Lazy initialized as needed. */
|
||||
for (int i = 0; i < data->items.maxitem; i++) {
|
||||
data->items.names[i] = (char *)MEM_callocN(data->items.maxstrlen + 1, __func__);
|
||||
|
@ -913,7 +913,7 @@ static void ui_searchbox_region_draw_cb__operator(const bContext *UNUSED(C), ARe
|
|||
/* widget itself */
|
||||
/* NOTE: i18n messages extracting tool does the same, please keep it in sync. */
|
||||
{
|
||||
const int state = ((a == data->active) ? UI_ACTIVE : 0) | data->items.states[a];
|
||||
const uint64_t state = ((a == data->active) ? UI_ACTIVE : 0) | data->items.states[a];
|
||||
|
||||
wmOperatorType *ot = static_cast<wmOperatorType *>(data->items.pointers[a]);
|
||||
char text_pre[128];
|
||||
|
|
|
@ -87,7 +87,7 @@ struct MenuSearch_Item {
|
|||
/** Support a single level sub-menu nesting (for operator buttons that expand). */
|
||||
const char *drawstr_submenu;
|
||||
int icon;
|
||||
int state;
|
||||
uint64_t state;
|
||||
|
||||
MenuSearch_Parent *menu_parent;
|
||||
MenuType *mt;
|
||||
|
|
|
@ -494,7 +494,7 @@ static bool add_collection_search_item(CollItemSearch *cis,
|
|||
cis->name,
|
||||
cis->data,
|
||||
cis->iconid,
|
||||
cis->has_sep_char ? (int)UI_BUT_HAS_SEP_CHAR : 0,
|
||||
cis->has_sep_char ? UI_BUT_HAS_SEP_CHAR : 0,
|
||||
name_prefix_offset);
|
||||
}
|
||||
|
||||
|
|
|
@ -256,10 +256,10 @@ typedef struct uiWidgetType {
|
|||
/* converted colors for state */
|
||||
uiWidgetColors wcol;
|
||||
|
||||
void (*state)(struct uiWidgetType *, int state, int drawflag, eUIEmbossType emboss);
|
||||
void (*draw)(uiWidgetColors *, rcti *, int state, int roundboxalign, const float zoom);
|
||||
void (*state)(struct uiWidgetType *, uint64_t state, int drawflag, eUIEmbossType emboss);
|
||||
void (*draw)(uiWidgetColors *, rcti *, uint64_t state, int roundboxalign, const float zoom);
|
||||
void (*custom)(
|
||||
uiBut *, uiWidgetColors *, rcti *, int state, int roundboxalign, const float zoom);
|
||||
uiBut *, uiWidgetColors *, rcti *, uint64_t state, int roundboxalign, const float zoom);
|
||||
void (*text)(const uiFontStyle *, const uiWidgetColors *, uiBut *, rcti *);
|
||||
|
||||
} uiWidgetType;
|
||||
|
@ -1289,7 +1289,7 @@ static void widgetbase_draw(uiWidgetBase *wtb, const uiWidgetColors *wcol)
|
|||
|
||||
#define PREVIEW_PAD 4
|
||||
|
||||
static float widget_alpha_factor(const int state)
|
||||
static float widget_alpha_factor(const uint64_t state)
|
||||
{
|
||||
if (state & (UI_BUT_INACTIVE | UI_BUT_DISABLED)) {
|
||||
if (state & UI_SEARCH_FILTER_NO_MATCH) {
|
||||
|
@ -2446,7 +2446,7 @@ static void widget_draw_text_icon(const uiFontStyle *fstyle,
|
|||
* \{ */
|
||||
|
||||
/* put all widget colors on half alpha, use local storage */
|
||||
static void ui_widget_color_disabled(uiWidgetType *wt, const int state)
|
||||
static void ui_widget_color_disabled(uiWidgetType *wt, const uint64_t state)
|
||||
{
|
||||
static uiWidgetColors wcol_theme_s;
|
||||
|
||||
|
@ -2473,7 +2473,7 @@ static void widget_active_color(uiWidgetColors *wcol)
|
|||
}
|
||||
|
||||
static const uchar *widget_color_blend_from_flags(const uiWidgetStateColors *wcol_state,
|
||||
int state,
|
||||
uint64_t state,
|
||||
int drawflag,
|
||||
const eUIEmbossType emboss)
|
||||
{
|
||||
|
@ -2501,7 +2501,7 @@ static const uchar *widget_color_blend_from_flags(const uiWidgetStateColors *wco
|
|||
}
|
||||
|
||||
/* copy colors from theme, and set changes in it based on state */
|
||||
static void widget_state(uiWidgetType *wt, int state, int drawflag, eUIEmbossType emboss)
|
||||
static void widget_state(uiWidgetType *wt, uint64_t state, int drawflag, eUIEmbossType emboss)
|
||||
{
|
||||
uiWidgetStateColors *wcol_state = wt->wcol_state;
|
||||
|
||||
|
@ -2600,7 +2600,10 @@ static float widget_radius_from_rcti(const rcti *rect, const uiWidgetColors *wco
|
|||
* \{ */
|
||||
|
||||
/* sliders use special hack which sets 'item' as inner when drawing filling */
|
||||
static void widget_state_numslider(uiWidgetType *wt, int state, int drawflag, eUIEmbossType emboss)
|
||||
static void widget_state_numslider(uiWidgetType *wt,
|
||||
uint64_t state,
|
||||
int drawflag,
|
||||
eUIEmbossType emboss)
|
||||
{
|
||||
uiWidgetStateColors *wcol_state = wt->wcol_state;
|
||||
|
||||
|
@ -2624,7 +2627,7 @@ static void widget_state_numslider(uiWidgetType *wt, int state, int drawflag, eU
|
|||
|
||||
/* labels use theme colors for text */
|
||||
static void widget_state_option_menu(uiWidgetType *wt,
|
||||
int state,
|
||||
uint64_t state,
|
||||
int drawflag,
|
||||
eUIEmbossType emboss)
|
||||
{
|
||||
|
@ -2644,7 +2647,7 @@ static void widget_state_option_menu(uiWidgetType *wt,
|
|||
}
|
||||
|
||||
static void widget_state_nothing(uiWidgetType *wt,
|
||||
int UNUSED(state),
|
||||
uint64_t UNUSED(state),
|
||||
int UNUSED(drawflag),
|
||||
eUIEmbossType UNUSED(emboss))
|
||||
{
|
||||
|
@ -2653,7 +2656,7 @@ static void widget_state_nothing(uiWidgetType *wt,
|
|||
|
||||
/* special case, button that calls pulldown */
|
||||
static void widget_state_pulldown(uiWidgetType *wt,
|
||||
int UNUSED(state),
|
||||
uint64_t UNUSED(state),
|
||||
int UNUSED(drawflag),
|
||||
eUIEmbossType UNUSED(emboss))
|
||||
{
|
||||
|
@ -2662,7 +2665,7 @@ static void widget_state_pulldown(uiWidgetType *wt,
|
|||
|
||||
/* special case, pie menu items */
|
||||
static void widget_state_pie_menu_item(uiWidgetType *wt,
|
||||
int state,
|
||||
uint64_t state,
|
||||
int UNUSED(drawflag),
|
||||
eUIEmbossType UNUSED(emboss))
|
||||
{
|
||||
|
@ -2697,7 +2700,7 @@ static void widget_state_pie_menu_item(uiWidgetType *wt,
|
|||
|
||||
/* special case, menu items */
|
||||
static void widget_state_menu_item(uiWidgetType *wt,
|
||||
int state,
|
||||
uint64_t state,
|
||||
int UNUSED(drawflag),
|
||||
eUIEmbossType UNUSED(emboss))
|
||||
{
|
||||
|
@ -2787,7 +2790,7 @@ static void widget_softshadow(const rcti *rect, int roundboxalign, const float r
|
|||
}
|
||||
|
||||
static void widget_menu_back(
|
||||
uiWidgetColors *wcol, rcti *rect, int flag, int direction, const float zoom)
|
||||
uiWidgetColors *wcol, rcti *rect, uint64_t flag, int direction, const float zoom)
|
||||
{
|
||||
uiWidgetBase wtb;
|
||||
int roundboxalign = UI_CNR_ALL;
|
||||
|
@ -3321,8 +3324,12 @@ static void ui_draw_separator(const rcti *rect, const uiWidgetColors *wcol)
|
|||
|
||||
#define NUM_BUT_PADDING_FACTOR 0.425f
|
||||
|
||||
static void widget_numbut_draw(
|
||||
uiWidgetColors *wcol, rcti *rect, const float zoom, int state, int roundboxalign, bool emboss)
|
||||
static void widget_numbut_draw(uiWidgetColors *wcol,
|
||||
rcti *rect,
|
||||
const float zoom,
|
||||
uint64_t state,
|
||||
int roundboxalign,
|
||||
bool emboss)
|
||||
{
|
||||
const float rad = widget_radius_from_zoom(zoom, wcol);
|
||||
const int handle_width = min_ii(BLI_rcti_size_x(rect) / 3, BLI_rcti_size_y(rect) * 0.7f);
|
||||
|
@ -3423,13 +3430,13 @@ static void widget_numbut_draw(
|
|||
}
|
||||
|
||||
static void widget_numbut(
|
||||
uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign, const float zoom)
|
||||
uiWidgetColors *wcol, rcti *rect, uint64_t state, int roundboxalign, const float zoom)
|
||||
{
|
||||
widget_numbut_draw(wcol, rect, zoom, state, roundboxalign, false);
|
||||
}
|
||||
|
||||
static void widget_menubut(
|
||||
uiWidgetColors *wcol, rcti *rect, int UNUSED(state), int roundboxalign, const float zoom)
|
||||
uiWidgetColors *wcol, rcti *rect, uint64_t UNUSED(state), int roundboxalign, const float zoom)
|
||||
{
|
||||
uiWidgetBase wtb;
|
||||
widget_init(&wtb);
|
||||
|
@ -3454,7 +3461,7 @@ static void widget_menubut(
|
|||
static void widget_menubut_embossn(const uiBut *UNUSED(but),
|
||||
uiWidgetColors *wcol,
|
||||
rcti *rect,
|
||||
int UNUSED(state),
|
||||
uint64_t UNUSED(state),
|
||||
int UNUSED(roundboxalign))
|
||||
{
|
||||
uiWidgetBase wtb;
|
||||
|
@ -3476,14 +3483,17 @@ static void widget_menubut_embossn(const uiBut *UNUSED(but),
|
|||
static void widget_numbut_embossn(const uiBut *UNUSED(but),
|
||||
uiWidgetColors *wcol,
|
||||
rcti *rect,
|
||||
int state,
|
||||
uint64_t state,
|
||||
int roundboxalign,
|
||||
const float zoom)
|
||||
{
|
||||
widget_numbut_draw(wcol, rect, zoom, state, roundboxalign, true);
|
||||
}
|
||||
|
||||
void UI_draw_widget_scroll(uiWidgetColors *wcol, const rcti *rect, const rcti *slider, int state)
|
||||
void UI_draw_widget_scroll(uiWidgetColors *wcol,
|
||||
const rcti *rect,
|
||||
const rcti *slider,
|
||||
uint64_t state)
|
||||
{
|
||||
uiWidgetBase wtb;
|
||||
bool outline = false;
|
||||
|
@ -3573,7 +3583,7 @@ void UI_draw_widget_scroll(uiWidgetColors *wcol, const rcti *rect, const rcti *s
|
|||
static void widget_scroll(uiBut *but,
|
||||
uiWidgetColors *wcol,
|
||||
rcti *rect,
|
||||
int state,
|
||||
uint64_t state,
|
||||
int UNUSED(roundboxalign),
|
||||
const float UNUSED(zoom))
|
||||
{
|
||||
|
@ -3635,7 +3645,7 @@ static void widget_scroll(uiBut *but,
|
|||
static void widget_progressbar(uiBut *but,
|
||||
uiWidgetColors *wcol,
|
||||
rcti *rect,
|
||||
int UNUSED(state),
|
||||
uint64_t UNUSED(state),
|
||||
int roundboxalign,
|
||||
const float zoom)
|
||||
{
|
||||
|
@ -3669,7 +3679,7 @@ static void widget_progressbar(uiBut *but,
|
|||
|
||||
static void widget_treerow_exec(uiWidgetColors *wcol,
|
||||
rcti *rect,
|
||||
int state,
|
||||
uint64_t state,
|
||||
int UNUSED(roundboxalign),
|
||||
int indentation,
|
||||
const float zoom)
|
||||
|
@ -3690,8 +3700,12 @@ static void widget_treerow_exec(uiWidgetColors *wcol,
|
|||
BLI_rcti_translate(rect, 0.5f * UI_UNIT_X * indentation, 0);
|
||||
}
|
||||
|
||||
static void widget_treerow(
|
||||
uiBut *but, uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign, const float zoom)
|
||||
static void widget_treerow(uiBut *but,
|
||||
uiWidgetColors *wcol,
|
||||
rcti *rect,
|
||||
uint64_t state,
|
||||
int roundboxalign,
|
||||
const float zoom)
|
||||
{
|
||||
uiButTreeRow *tree_row = (uiButTreeRow *)but;
|
||||
BLI_assert(but->type == UI_BTYPE_TREEROW);
|
||||
|
@ -3701,7 +3715,7 @@ static void widget_treerow(
|
|||
static void widget_nodesocket(uiBut *but,
|
||||
uiWidgetColors *wcol,
|
||||
rcti *rect,
|
||||
int UNUSED(state),
|
||||
uint64_t UNUSED(state),
|
||||
int UNUSED(roundboxalign),
|
||||
const float UNUSED(zoom))
|
||||
{
|
||||
|
@ -3737,8 +3751,12 @@ static void widget_nodesocket(uiBut *but,
|
|||
copy_v3_v3_uchar(wcol->outline, old_outline);
|
||||
}
|
||||
|
||||
static void widget_numslider(
|
||||
uiBut *but, uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign, const float zoom)
|
||||
static void widget_numslider(uiBut *but,
|
||||
uiWidgetColors *wcol,
|
||||
rcti *rect,
|
||||
uint64_t state,
|
||||
int roundboxalign,
|
||||
const float zoom)
|
||||
{
|
||||
uiWidgetBase wtb, wtb1;
|
||||
widget_init(&wtb);
|
||||
|
@ -3850,8 +3868,12 @@ static void widget_numslider(
|
|||
/* I think 3 is sufficient border to indicate keyed status */
|
||||
#define SWATCH_KEYED_BORDER 3
|
||||
|
||||
static void widget_swatch(
|
||||
uiBut *but, uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign, const float zoom)
|
||||
static void widget_swatch(uiBut *but,
|
||||
uiWidgetColors *wcol,
|
||||
rcti *rect,
|
||||
uint64_t state,
|
||||
int roundboxalign,
|
||||
const float zoom)
|
||||
{
|
||||
BLI_assert(but->type == UI_BTYPE_COLOR);
|
||||
uiButColor *color_but = (uiButColor *)but;
|
||||
|
@ -3938,7 +3960,7 @@ static void widget_swatch(
|
|||
static void widget_unitvec(uiBut *but,
|
||||
uiWidgetColors *wcol,
|
||||
rcti *rect,
|
||||
int UNUSED(state),
|
||||
uint64_t UNUSED(state),
|
||||
int UNUSED(roundboxalign),
|
||||
const float zoom)
|
||||
{
|
||||
|
@ -3946,8 +3968,12 @@ static void widget_unitvec(uiBut *but,
|
|||
ui_draw_but_UNITVEC(but, wcol, rect, rad);
|
||||
}
|
||||
|
||||
static void widget_icon_has_anim(
|
||||
uiBut *but, uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign, const float zoom)
|
||||
static void widget_icon_has_anim(uiBut *but,
|
||||
uiWidgetColors *wcol,
|
||||
rcti *rect,
|
||||
uint64_t state,
|
||||
int roundboxalign,
|
||||
const float zoom)
|
||||
{
|
||||
if (state & (UI_BUT_ANIMATED | UI_BUT_ANIMATED_KEY | UI_BUT_DRIVEN | UI_BUT_REDALERT) &&
|
||||
but->emboss != UI_EMBOSS_NONE) {
|
||||
|
@ -3971,7 +3997,7 @@ static void widget_icon_has_anim(
|
|||
}
|
||||
|
||||
static void widget_textbut(
|
||||
uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign, const float zoom)
|
||||
uiWidgetColors *wcol, rcti *rect, uint64_t state, int roundboxalign, const float zoom)
|
||||
{
|
||||
if (state & UI_SELECT) {
|
||||
SWAP(short, wcol->shadetop, wcol->shadedown);
|
||||
|
@ -3989,7 +4015,7 @@ static void widget_textbut(
|
|||
static void widget_preview_tile(uiBut *but,
|
||||
uiWidgetColors *wcol,
|
||||
rcti *rect,
|
||||
int UNUSED(state),
|
||||
uint64_t UNUSED(state),
|
||||
int UNUSED(roundboxalign),
|
||||
const float UNUSED(zoom))
|
||||
{
|
||||
|
@ -3999,7 +4025,7 @@ static void widget_preview_tile(uiBut *but,
|
|||
}
|
||||
|
||||
static void widget_menuiconbut(
|
||||
uiWidgetColors *wcol, rcti *rect, int UNUSED(state), int roundboxalign, const float zoom)
|
||||
uiWidgetColors *wcol, rcti *rect, uint64_t UNUSED(state), int roundboxalign, const float zoom)
|
||||
{
|
||||
uiWidgetBase wtb;
|
||||
widget_init(&wtb);
|
||||
|
@ -4012,7 +4038,7 @@ static void widget_menuiconbut(
|
|||
}
|
||||
|
||||
static void widget_pulldownbut(
|
||||
uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign, const float zoom)
|
||||
uiWidgetColors *wcol, rcti *rect, uint64_t state, int roundboxalign, const float zoom)
|
||||
{
|
||||
float back[4];
|
||||
UI_GetThemeColor4fv(TH_BACK, back);
|
||||
|
@ -4042,7 +4068,7 @@ static void widget_pulldownbut(
|
|||
|
||||
static void widget_menu_itembut(uiWidgetColors *wcol,
|
||||
rcti *rect,
|
||||
int UNUSED(state),
|
||||
uint64_t UNUSED(state),
|
||||
int UNUSED(roundboxalign),
|
||||
const float zoom)
|
||||
{
|
||||
|
@ -4066,7 +4092,7 @@ static void widget_menu_itembut(uiWidgetColors *wcol,
|
|||
|
||||
static void widget_menu_itembut_unpadded(uiWidgetColors *wcol,
|
||||
rcti *rect,
|
||||
int UNUSED(state),
|
||||
uint64_t UNUSED(state),
|
||||
int UNUSED(roundboxalign),
|
||||
const float zoom)
|
||||
{
|
||||
|
@ -4088,7 +4114,7 @@ static void widget_menu_itembut_unpadded(uiWidgetColors *wcol,
|
|||
static void widget_menu_radial_itembut(uiBut *but,
|
||||
uiWidgetColors *wcol,
|
||||
rcti *rect,
|
||||
int UNUSED(state),
|
||||
uint64_t UNUSED(state),
|
||||
int UNUSED(roundboxalign),
|
||||
const float zoom)
|
||||
{
|
||||
|
@ -4114,7 +4140,7 @@ static void widget_menu_radial_itembut(uiBut *but,
|
|||
|
||||
static void widget_list_itembut(uiWidgetColors *wcol,
|
||||
rcti *rect,
|
||||
int UNUSED(state),
|
||||
uint64_t UNUSED(state),
|
||||
int UNUSED(roundboxalign),
|
||||
const float zoom)
|
||||
{
|
||||
|
@ -4131,7 +4157,7 @@ static void widget_list_itembut(uiWidgetColors *wcol,
|
|||
|
||||
static void widget_optionbut(uiWidgetColors *wcol,
|
||||
rcti *rect,
|
||||
int state,
|
||||
uint64_t state,
|
||||
int UNUSED(roundboxalign),
|
||||
const float UNUSED(zoom))
|
||||
{
|
||||
|
@ -4177,7 +4203,10 @@ static void widget_optionbut(uiWidgetColors *wcol,
|
|||
}
|
||||
|
||||
/* labels use Editor theme colors for text */
|
||||
static void widget_state_label(uiWidgetType *wt, int state, int drawflag, eUIEmbossType emboss)
|
||||
static void widget_state_label(uiWidgetType *wt,
|
||||
uint64_t state,
|
||||
int drawflag,
|
||||
eUIEmbossType emboss)
|
||||
{
|
||||
if (state & UI_BUT_LIST_ITEM) {
|
||||
/* Override default label theme's colors. */
|
||||
|
@ -4204,7 +4233,7 @@ static void widget_state_label(uiWidgetType *wt, int state, int drawflag, eUIEmb
|
|||
}
|
||||
|
||||
static void widget_radiobut(
|
||||
uiWidgetColors *wcol, rcti *rect, int UNUSED(state), int roundboxalign, const float zoom)
|
||||
uiWidgetColors *wcol, rcti *rect, uint64_t UNUSED(state), int roundboxalign, const float zoom)
|
||||
{
|
||||
uiWidgetBase wtb;
|
||||
widget_init(&wtb);
|
||||
|
@ -4218,7 +4247,7 @@ static void widget_radiobut(
|
|||
static void widget_box(uiBut *but,
|
||||
uiWidgetColors *wcol,
|
||||
rcti *rect,
|
||||
int UNUSED(state),
|
||||
uint64_t UNUSED(state),
|
||||
int roundboxalign,
|
||||
const float zoom)
|
||||
{
|
||||
|
@ -4245,7 +4274,7 @@ static void widget_box(uiBut *but,
|
|||
}
|
||||
|
||||
static void widget_but(
|
||||
uiWidgetColors *wcol, rcti *rect, int UNUSED(state), int roundboxalign, const float zoom)
|
||||
uiWidgetColors *wcol, rcti *rect, uint64_t UNUSED(state), int roundboxalign, const float zoom)
|
||||
{
|
||||
uiWidgetBase wtb;
|
||||
widget_init(&wtb);
|
||||
|
@ -4272,7 +4301,7 @@ static void widget_roundbut(uiWidgetColors *wcol, rcti *rect, int UNUSED(state),
|
|||
#endif
|
||||
|
||||
static void widget_roundbut_exec(
|
||||
uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign, const float zoom)
|
||||
uiWidgetColors *wcol, rcti *rect, uint64_t state, int roundboxalign, const float zoom)
|
||||
{
|
||||
uiWidgetBase wtb;
|
||||
widget_init(&wtb);
|
||||
|
@ -4291,7 +4320,7 @@ static void widget_roundbut_exec(
|
|||
}
|
||||
|
||||
static void widget_tab(
|
||||
uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign, const float zoom)
|
||||
uiWidgetColors *wcol, rcti *rect, uint64_t state, int roundboxalign, const float zoom)
|
||||
{
|
||||
const float rad = widget_radius_from_zoom(zoom, wcol);
|
||||
const bool is_active = (state & UI_SELECT);
|
||||
|
@ -4922,7 +4951,7 @@ void ui_draw_but(const bContext *C, struct ARegion *region, uiStyle *style, uiBu
|
|||
const int roundboxalign = widget_roundbox_set(but, rect);
|
||||
|
||||
/* Mask out flags re-used for local state. */
|
||||
int state = but->flag & ~UI_STATE_FLAGS_ALL;
|
||||
uint64_t state = but->flag & ~UI_STATE_FLAGS_ALL;
|
||||
const int drawflag = but->drawflag;
|
||||
|
||||
if (state & UI_SELECT_DRAW) {
|
||||
|
@ -5335,7 +5364,7 @@ void ui_draw_menu_item(const uiFontStyle *fstyle,
|
|||
rcti *rect,
|
||||
const char *name,
|
||||
int iconid,
|
||||
int state,
|
||||
uint64_t state,
|
||||
uiMenuItemSeparatorType separator_type,
|
||||
int *r_xmax)
|
||||
{
|
||||
|
@ -5528,7 +5557,7 @@ void ui_draw_preview_item(const uiFontStyle *fstyle,
|
|||
rcti *rect,
|
||||
const char *name,
|
||||
int iconid,
|
||||
int state,
|
||||
uint64_t state,
|
||||
eFontStyle_Align text_align)
|
||||
{
|
||||
uiWidgetType *wt = widget_type(UI_WTYPE_MENU_ITEM_UNPADDED);
|
||||
|
|
|
@ -1532,7 +1532,7 @@ void UI_view2d_scrollers_draw(View2D *v2d, const rcti *mask_custom)
|
|||
uiWidgetColors wcol = btheme->tui.wcol_scroll;
|
||||
const float alpha_fac = v2d->alpha_hor / 255.0f;
|
||||
rcti slider;
|
||||
int state;
|
||||
uint64_t state;
|
||||
|
||||
slider.xmin = scrollers.hor_min;
|
||||
slider.xmax = scrollers.hor_max;
|
||||
|
@ -1566,7 +1566,7 @@ void UI_view2d_scrollers_draw(View2D *v2d, const rcti *mask_custom)
|
|||
uiWidgetColors wcol = btheme->tui.wcol_scroll;
|
||||
rcti slider;
|
||||
const float alpha_fac = v2d->alpha_vert / 255.0f;
|
||||
int state;
|
||||
uint64_t state;
|
||||
|
||||
slider.xmin = vert.xmin;
|
||||
slider.xmax = vert.xmax;
|
||||
|
|
Loading…
Reference in New Issue