Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2022-05-12 16:53:12 +0300
committerJulian Eisel <julian@blender.org>2022-05-12 17:56:14 +0300
commit3693e1d8e80501c6efcb8f732107742f80acf773 (patch)
tree2fc6177061859beff71ffd3413fad4131724be82
parentc31f519954f2b21fecc86b1b3b9386685226dbdc (diff)
Revert commits to increase button flag bitfield size
This reverts the commits 8d9d5da13706b668b9bd0d631e00c9b00b73f3ea, 59cd616534b46ab85b4324a0886bd9eb8876a48b and 98a04ed4524234b1840dc039c2f356db5ac57f26. The commits are causing issues with MSVC, see D14926. I'm working on a different solution, but that will need some work.
-rw-r--r--source/blender/editors/include/UI_interface.h60
-rw-r--r--source/blender/editors/interface/interface.cc12
-rw-r--r--source/blender/editors/interface/interface_anim.c4
-rw-r--r--source/blender/editors/interface/interface_intern.h16
-rw-r--r--source/blender/editors/interface/interface_layout.c2
-rw-r--r--source/blender/editors/interface/interface_query.cc4
-rw-r--r--source/blender/editors/interface/interface_region_search.cc12
-rw-r--r--source/blender/editors/interface/interface_template_search_menu.cc2
-rw-r--r--source/blender/editors/interface/interface_utils.cc2
-rw-r--r--source/blender/editors/interface/interface_widgets.c133
-rw-r--r--source/blender/editors/interface/view2d.cc4
11 files changed, 109 insertions, 142 deletions
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index a996d1e0e76..301171a284d 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -184,50 +184,50 @@ enum {
/** #uiBut.flag general state flags. */
enum {
- /* WARNING: the first 10 flags are internal (see #UI_SELECT definition). */
- UI_BUT_ICON_SUBMENU = 1 << 10,
- UI_BUT_ICON_PREVIEW = 1 << 11,
+ /* WARNING: the first 7 flags are internal (see #UI_SELECT definition). */
+ UI_BUT_ICON_SUBMENU = 1 << 7,
+ UI_BUT_ICON_PREVIEW = 1 << 8,
- UI_BUT_NODE_LINK = 1 << 12,
- UI_BUT_NODE_ACTIVE = 1 << 13,
- UI_BUT_DRAG_LOCK = 1 << 14,
+ UI_BUT_NODE_LINK = 1 << 9,
+ UI_BUT_NODE_ACTIVE = 1 << 10,
+ UI_BUT_DRAG_LOCK = 1 << 11,
/** Grayed out and un-editable. */
- UI_BUT_DISABLED = 1 << 15,
+ UI_BUT_DISABLED = 1 << 12,
- UI_BUT_ANIMATED = 1 << 16,
- UI_BUT_ANIMATED_KEY = 1 << 17,
- UI_BUT_DRIVEN = 1 << 18,
- UI_BUT_REDALERT = 1 << 19,
+ UI_BUT_ANIMATED = 1 << 13,
+ UI_BUT_ANIMATED_KEY = 1 << 14,
+ UI_BUT_DRIVEN = 1 << 15,
+ UI_BUT_REDALERT = 1 << 16,
/** Grayed out but still editable. */
- UI_BUT_INACTIVE = 1 << 20,
- UI_BUT_LAST_ACTIVE = 1 << 21,
- UI_BUT_UNDO = 1 << 22,
- UI_BUT_IMMEDIATE = 1 << 23,
- UI_BUT_NO_UTF8 = 1 << 24,
+ UI_BUT_INACTIVE = 1 << 17,
+ UI_BUT_LAST_ACTIVE = 1 << 18,
+ UI_BUT_UNDO = 1 << 19,
+ UI_BUT_IMMEDIATE = 1 << 20,
+ UI_BUT_NO_UTF8 = 1 << 21,
/** For popups, pressing return activates this button, overriding the highlighted button.
* For non-popups this is just used as a display hint for the user to let them
* know the action which is activated when pressing return (file selector for eg). */
- UI_BUT_ACTIVE_DEFAULT = 1 << 25,
+ UI_BUT_ACTIVE_DEFAULT = 1 << 23,
/** This but is "inside" a list item (currently used to change theme colors). */
- UI_BUT_LIST_ITEM = 1 << 26,
+ UI_BUT_LIST_ITEM = 1 << 24,
/** edit this button as well as the active button (not just dragging) */
- UI_BUT_DRAG_MULTI = 1 << 27,
+ UI_BUT_DRAG_MULTI = 1 << 25,
/** Use for popups to start editing the button on initialization. */
- UI_BUT_ACTIVATE_ON_INIT = 1 << 28,
+ UI_BUT_ACTIVATE_ON_INIT = 1 << 26,
/** #uiBut.str contains #UI_SEP_CHAR, used for key shortcuts */
- UI_BUT_HAS_SEP_CHAR = 1 << 29,
+ UI_BUT_HAS_SEP_CHAR = 1 << 27,
/** Don't run updates while dragging (needed in rare cases). */
- UI_BUT_UPDATE_DELAY = 1u << 30,
+ UI_BUT_UPDATE_DELAY = 1 << 28,
/** When widget is in text-edit mode, update value on each char stroke. */
- UI_BUT_TEXTEDIT_UPDATE = 1ul << 31,
+ UI_BUT_TEXTEDIT_UPDATE = 1 << 29,
/** Show 'x' icon to clear/unlink value of text or search button. */
- UI_BUT_VALUE_CLEAR = 1ul << 32,
+ UI_BUT_VALUE_CLEAR = 1 << 30,
/** RNA property of the button is overridden from linked reference data. */
- UI_BUT_OVERRIDDEN = 1ul << 33,
+ UI_BUT_OVERRIDDEN = 1u << 31u,
};
/* Default font size for normal text. */
@@ -462,7 +462,7 @@ enum {
void UI_draw_widget_scroll(struct uiWidgetColors *wcol,
const struct rcti *rect,
const struct rcti *slider,
- uint64_t state);
+ int 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, 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_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_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,
- uint64_t state,
+ int state,
uint8_t name_prefix_offset);
/**
diff --git a/source/blender/editors/interface/interface.cc b/source/blender/editors/interface/interface.cc
index effd3a64fcd..b7098c26bcd 100644
--- a/source/blender/editors/interface/interface.cc
+++ b/source/blender/editors/interface/interface.cc
@@ -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 uint64_t flag_copy = UI_BUT_REDALERT | UI_HAS_ICON | UI_SELECT_DRAW;
+ const int 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 {
- uint64_t flag_copy = UI_BUT_DRAG_MULTI;
+ int 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 uint64_t flag)
+void ui_def_but_icon(uiBut *but, const int icon, const int 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, uint64_t flag)
+void UI_but_flag_enable(uiBut *but, int flag)
{
but->flag |= flag;
}
-void UI_but_flag_disable(uiBut *but, uint64_t flag)
+void UI_but_flag_disable(uiBut *but, int flag)
{
but->flag &= ~flag;
}
-bool UI_but_flag_is_set(uiBut *but, uint64_t flag)
+bool UI_but_flag_is_set(uiBut *but, int flag)
{
return (but->flag & flag) != 0;
}
diff --git a/source/blender/editors/interface/interface_anim.c b/source/blender/editors/interface/interface_anim.c
index b77d48552c7..e838ce37d8e 100644
--- a/source/blender/editors/interface/interface_anim.c
+++ b/source/blender/editors/interface/interface_anim.c
@@ -144,7 +144,7 @@ void ui_but_anim_decorate_update_from_flag(uiButDecorator *decorator_but)
return;
}
- const uint64_t flag = but_anim->flag;
+ const int 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 uint64_t flag_copy = (UI_BUT_DISABLED | UI_BUT_INACTIVE);
+ const int flag_copy = (UI_BUT_DISABLED | UI_BUT_INACTIVE);
but->flag = (but->flag & ~flag_copy) | (flag & flag_copy);
}
diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h
index e8c5f2bb322..c09ff68bbca 100644
--- a/source/blender/editors/interface/interface_intern.h
+++ b/source/blender/editors/interface/interface_intern.h
@@ -74,8 +74,7 @@ enum {
UI_SELECT_DRAW = (1 << 5),
/** Property search filter is active and the button does not match. */
UI_SEARCH_FILTER_NO_MATCH = (1 << 6),
-
- /* WARNING: rest of #uiBut.flag in UI_interface.h (starting at `1 << 10`). */
+ /* WARNING: rest of #uiBut.flag in UI_interface.h */
};
/** #uiBut.dragflag */
@@ -148,8 +147,7 @@ struct uiBut {
/** Pointer back to the layout item holding this button. */
uiLayout *layout;
- uint64_t flag;
- int drawflag;
+ int flag, drawflag;
eButType type;
eButPointerType pointype;
short bit, bitnr, retval, strwidth, alignnr;
@@ -711,7 +709,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, uint64_t flag);
+void ui_def_but_icon(uiBut *but, int icon, int flag);
/**
* Avoid using this where possible since it's better not to ask for an icon in the first place.
*/
@@ -1218,14 +1216,14 @@ void ui_draw_menu_item(const struct uiFontStyle *fstyle,
rcti *rect,
const char *name,
int iconid,
- uint64_t state,
+ int state,
uiMenuItemSeparatorType separator_type,
int *r_xmax);
void ui_draw_preview_item(const struct uiFontStyle *fstyle,
rcti *rect,
const char *name,
int iconid,
- uint64_t state,
+ int state,
eFontStyle_Align text_align);
/**
* Version of #ui_draw_preview_item() that does not draw the menu background and item text based on
@@ -1426,8 +1424,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,
- uint64_t flag_include,
- uint64_t flag_exclude);
+ int flag_include,
+ int 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;
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index 198195f1d9a..c1bb2ed6d18 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -5316,7 +5316,7 @@ static void ui_item_align(uiLayout *litem, short nr)
}
}
-static void ui_item_flag(uiLayout *litem, uint64_t flag)
+static void ui_item_flag(uiLayout *litem, int flag)
{
LISTBASE_FOREACH_BACKWARD (uiItem *, item, &litem->items) {
if (item->type == ITEM_BUTTON) {
diff --git a/source/blender/editors/interface/interface_query.cc b/source/blender/editors/interface/interface_query.cc
index b1619df7e4c..337b2852d57 100644
--- a/source/blender/editors/interface/interface_query.cc
+++ b/source/blender/editors/interface/interface_query.cc
@@ -699,9 +699,7 @@ uiBut *ui_region_find_active_but(ARegion *region)
return nullptr;
}
-uiBut *ui_region_find_first_but_test_flag(ARegion *region,
- uint64_t flag_include,
- uint64_t flag_exclude)
+uiBut *ui_region_find_first_but_test_flag(ARegion *region, int flag_include, int flag_exclude)
{
LISTBASE_FOREACH (uiBlock *, block, &region->uiblocks) {
LISTBASE_FOREACH (uiBut *, but, &block->buttons) {
diff --git a/source/blender/editors/interface/interface_region_search.cc b/source/blender/editors/interface/interface_region_search.cc
index 016abb2f021..bc497e2647c 100644
--- a/source/blender/editors/interface/interface_region_search.cc
+++ b/source/blender/editors/interface/interface_region_search.cc
@@ -58,7 +58,7 @@ struct uiSearchItems {
char **names;
void **pointers;
int *icons;
- uint64_t *states;
+ int *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,
- uint64_t state,
+ int 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 uint64_t state = ((a == data->active) ? UI_ACTIVE : 0) | data->items.states[a];
+ const int 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 uint64_t state = ((a == data->active) ? UI_ACTIVE : 0) | data->items.states[a];
+ const int 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 = (uint64_t *)MEM_callocN(data->items.maxitem * sizeof(uint64_t), __func__);
+ data->items.states = (int *)MEM_callocN(data->items.maxitem * sizeof(int), __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 uint64_t state = ((a == data->active) ? UI_ACTIVE : 0) | data->items.states[a];
+ const int state = ((a == data->active) ? UI_ACTIVE : 0) | data->items.states[a];
wmOperatorType *ot = static_cast<wmOperatorType *>(data->items.pointers[a]);
char text_pre[128];
diff --git a/source/blender/editors/interface/interface_template_search_menu.cc b/source/blender/editors/interface/interface_template_search_menu.cc
index 854e3dace3b..c3021028b97 100644
--- a/source/blender/editors/interface/interface_template_search_menu.cc
+++ b/source/blender/editors/interface/interface_template_search_menu.cc
@@ -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;
- uint64_t state;
+ int state;
MenuSearch_Parent *menu_parent;
MenuType *mt;
diff --git a/source/blender/editors/interface/interface_utils.cc b/source/blender/editors/interface/interface_utils.cc
index e68d8f12a1f..993ccdf92f7 100644
--- a/source/blender/editors/interface/interface_utils.cc
+++ b/source/blender/editors/interface/interface_utils.cc
@@ -494,7 +494,7 @@ static bool add_collection_search_item(CollItemSearch *cis,
cis->name,
cis->data,
cis->iconid,
- cis->has_sep_char ? (uint64_t)UI_BUT_HAS_SEP_CHAR : 0,
+ cis->has_sep_char ? (int)UI_BUT_HAS_SEP_CHAR : 0,
name_prefix_offset);
}
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index 2801930ff1d..98ecf91adbc 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -256,10 +256,10 @@ typedef struct uiWidgetType {
/* converted colors for state */
uiWidgetColors wcol;
- void (*state)(struct uiWidgetType *, uint64_t state, int drawflag, eUIEmbossType emboss);
- void (*draw)(uiWidgetColors *, rcti *, uint64_t state, int roundboxalign, const float zoom);
+ void (*state)(struct uiWidgetType *, int state, int drawflag, eUIEmbossType emboss);
+ void (*draw)(uiWidgetColors *, rcti *, int state, int roundboxalign, const float zoom);
void (*custom)(
- uiBut *, uiWidgetColors *, rcti *, uint64_t state, int roundboxalign, const float zoom);
+ uiBut *, uiWidgetColors *, rcti *, int 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 uint64_t state)
+static float widget_alpha_factor(const int 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 uint64_t state)
+static void ui_widget_color_disabled(uiWidgetType *wt, const int 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,
- uint64_t state,
+ int 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, uint64_t state, int drawflag, eUIEmbossType emboss)
+static void widget_state(uiWidgetType *wt, int state, int drawflag, eUIEmbossType emboss)
{
uiWidgetStateColors *wcol_state = wt->wcol_state;
@@ -2600,10 +2600,7 @@ 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,
- uint64_t state,
- int drawflag,
- eUIEmbossType emboss)
+static void widget_state_numslider(uiWidgetType *wt, int state, int drawflag, eUIEmbossType emboss)
{
uiWidgetStateColors *wcol_state = wt->wcol_state;
@@ -2627,7 +2624,7 @@ static void widget_state_numslider(uiWidgetType *wt,
/* labels use theme colors for text */
static void widget_state_option_menu(uiWidgetType *wt,
- uint64_t state,
+ int state,
int drawflag,
eUIEmbossType emboss)
{
@@ -2647,7 +2644,7 @@ static void widget_state_option_menu(uiWidgetType *wt,
}
static void widget_state_nothing(uiWidgetType *wt,
- uint64_t UNUSED(state),
+ int UNUSED(state),
int UNUSED(drawflag),
eUIEmbossType UNUSED(emboss))
{
@@ -2656,7 +2653,7 @@ static void widget_state_nothing(uiWidgetType *wt,
/* special case, button that calls pulldown */
static void widget_state_pulldown(uiWidgetType *wt,
- uint64_t UNUSED(state),
+ int UNUSED(state),
int UNUSED(drawflag),
eUIEmbossType UNUSED(emboss))
{
@@ -2665,7 +2662,7 @@ static void widget_state_pulldown(uiWidgetType *wt,
/* special case, pie menu items */
static void widget_state_pie_menu_item(uiWidgetType *wt,
- uint64_t state,
+ int state,
int UNUSED(drawflag),
eUIEmbossType UNUSED(emboss))
{
@@ -2700,7 +2697,7 @@ static void widget_state_pie_menu_item(uiWidgetType *wt,
/* special case, menu items */
static void widget_state_menu_item(uiWidgetType *wt,
- uint64_t state,
+ int state,
int UNUSED(drawflag),
eUIEmbossType UNUSED(emboss))
{
@@ -2790,7 +2787,7 @@ static void widget_softshadow(const rcti *rect, int roundboxalign, const float r
}
static void widget_menu_back(
- uiWidgetColors *wcol, rcti *rect, uint64_t flag, int direction, const float zoom)
+ uiWidgetColors *wcol, rcti *rect, int flag, int direction, const float zoom)
{
uiWidgetBase wtb;
int roundboxalign = UI_CNR_ALL;
@@ -3324,12 +3321,8 @@ 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,
- uint64_t state,
- int roundboxalign,
- bool emboss)
+static void widget_numbut_draw(
+ uiWidgetColors *wcol, rcti *rect, const float zoom, int 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);
@@ -3430,13 +3423,13 @@ static void widget_numbut_draw(uiWidgetColors *wcol,
}
static void widget_numbut(
- uiWidgetColors *wcol, rcti *rect, uint64_t state, int roundboxalign, const float zoom)
+ uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign, const float zoom)
{
widget_numbut_draw(wcol, rect, zoom, state, roundboxalign, false);
}
static void widget_menubut(
- uiWidgetColors *wcol, rcti *rect, uint64_t UNUSED(state), int roundboxalign, const float zoom)
+ uiWidgetColors *wcol, rcti *rect, int UNUSED(state), int roundboxalign, const float zoom)
{
uiWidgetBase wtb;
widget_init(&wtb);
@@ -3461,7 +3454,7 @@ static void widget_menubut(
static void widget_menubut_embossn(const uiBut *UNUSED(but),
uiWidgetColors *wcol,
rcti *rect,
- uint64_t UNUSED(state),
+ int UNUSED(state),
int UNUSED(roundboxalign))
{
uiWidgetBase wtb;
@@ -3483,17 +3476,14 @@ static void widget_menubut_embossn(const uiBut *UNUSED(but),
static void widget_numbut_embossn(const uiBut *UNUSED(but),
uiWidgetColors *wcol,
rcti *rect,
- uint64_t state,
+ int 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,
- uint64_t state)
+void UI_draw_widget_scroll(uiWidgetColors *wcol, const rcti *rect, const rcti *slider, int state)
{
uiWidgetBase wtb;
bool outline = false;
@@ -3583,7 +3573,7 @@ void UI_draw_widget_scroll(uiWidgetColors *wcol,
static void widget_scroll(uiBut *but,
uiWidgetColors *wcol,
rcti *rect,
- uint64_t state,
+ int state,
int UNUSED(roundboxalign),
const float UNUSED(zoom))
{
@@ -3645,7 +3635,7 @@ static void widget_scroll(uiBut *but,
static void widget_progressbar(uiBut *but,
uiWidgetColors *wcol,
rcti *rect,
- uint64_t UNUSED(state),
+ int UNUSED(state),
int roundboxalign,
const float zoom)
{
@@ -3679,7 +3669,7 @@ static void widget_progressbar(uiBut *but,
static void widget_treerow_exec(uiWidgetColors *wcol,
rcti *rect,
- uint64_t state,
+ int state,
int UNUSED(roundboxalign),
int indentation,
const float zoom)
@@ -3700,12 +3690,8 @@ 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,
- uint64_t state,
- int roundboxalign,
- const float zoom)
+static void widget_treerow(
+ uiBut *but, uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign, const float zoom)
{
uiButTreeRow *tree_row = (uiButTreeRow *)but;
BLI_assert(but->type == UI_BTYPE_TREEROW);
@@ -3715,7 +3701,7 @@ static void widget_treerow(uiBut *but,
static void widget_nodesocket(uiBut *but,
uiWidgetColors *wcol,
rcti *rect,
- uint64_t UNUSED(state),
+ int UNUSED(state),
int UNUSED(roundboxalign),
const float UNUSED(zoom))
{
@@ -3751,12 +3737,8 @@ static void widget_nodesocket(uiBut *but,
copy_v3_v3_uchar(wcol->outline, old_outline);
}
-static void widget_numslider(uiBut *but,
- uiWidgetColors *wcol,
- rcti *rect,
- uint64_t state,
- int roundboxalign,
- const float zoom)
+static void widget_numslider(
+ uiBut *but, uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign, const float zoom)
{
uiWidgetBase wtb, wtb1;
widget_init(&wtb);
@@ -3868,12 +3850,8 @@ static void widget_numslider(uiBut *but,
/* 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,
- uint64_t state,
- int roundboxalign,
- const float zoom)
+static void widget_swatch(
+ uiBut *but, uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign, const float zoom)
{
BLI_assert(but->type == UI_BTYPE_COLOR);
uiButColor *color_but = (uiButColor *)but;
@@ -3960,7 +3938,7 @@ static void widget_swatch(uiBut *but,
static void widget_unitvec(uiBut *but,
uiWidgetColors *wcol,
rcti *rect,
- uint64_t UNUSED(state),
+ int UNUSED(state),
int UNUSED(roundboxalign),
const float zoom)
{
@@ -3968,12 +3946,8 @@ 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,
- uint64_t state,
- int roundboxalign,
- const float zoom)
+static void widget_icon_has_anim(
+ uiBut *but, uiWidgetColors *wcol, rcti *rect, int 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) {
@@ -3997,7 +3971,7 @@ static void widget_icon_has_anim(uiBut *but,
}
static void widget_textbut(
- uiWidgetColors *wcol, rcti *rect, uint64_t state, int roundboxalign, const float zoom)
+ uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign, const float zoom)
{
if (state & UI_SELECT) {
SWAP(short, wcol->shadetop, wcol->shadedown);
@@ -4015,7 +3989,7 @@ static void widget_textbut(
static void widget_preview_tile(uiBut *but,
uiWidgetColors *wcol,
rcti *rect,
- uint64_t UNUSED(state),
+ int UNUSED(state),
int UNUSED(roundboxalign),
const float UNUSED(zoom))
{
@@ -4025,7 +3999,7 @@ static void widget_preview_tile(uiBut *but,
}
static void widget_menuiconbut(
- uiWidgetColors *wcol, rcti *rect, uint64_t UNUSED(state), int roundboxalign, const float zoom)
+ uiWidgetColors *wcol, rcti *rect, int UNUSED(state), int roundboxalign, const float zoom)
{
uiWidgetBase wtb;
widget_init(&wtb);
@@ -4038,7 +4012,7 @@ static void widget_menuiconbut(
}
static void widget_pulldownbut(
- uiWidgetColors *wcol, rcti *rect, uint64_t state, int roundboxalign, const float zoom)
+ uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign, const float zoom)
{
float back[4];
UI_GetThemeColor4fv(TH_BACK, back);
@@ -4068,7 +4042,7 @@ static void widget_pulldownbut(
static void widget_menu_itembut(uiWidgetColors *wcol,
rcti *rect,
- uint64_t UNUSED(state),
+ int UNUSED(state),
int UNUSED(roundboxalign),
const float zoom)
{
@@ -4092,7 +4066,7 @@ static void widget_menu_itembut(uiWidgetColors *wcol,
static void widget_menu_itembut_unpadded(uiWidgetColors *wcol,
rcti *rect,
- uint64_t UNUSED(state),
+ int UNUSED(state),
int UNUSED(roundboxalign),
const float zoom)
{
@@ -4114,7 +4088,7 @@ static void widget_menu_itembut_unpadded(uiWidgetColors *wcol,
static void widget_menu_radial_itembut(uiBut *but,
uiWidgetColors *wcol,
rcti *rect,
- uint64_t UNUSED(state),
+ int UNUSED(state),
int UNUSED(roundboxalign),
const float zoom)
{
@@ -4140,7 +4114,7 @@ static void widget_menu_radial_itembut(uiBut *but,
static void widget_list_itembut(uiWidgetColors *wcol,
rcti *rect,
- uint64_t UNUSED(state),
+ int UNUSED(state),
int UNUSED(roundboxalign),
const float zoom)
{
@@ -4157,7 +4131,7 @@ static void widget_list_itembut(uiWidgetColors *wcol,
static void widget_optionbut(uiWidgetColors *wcol,
rcti *rect,
- uint64_t state,
+ int state,
int UNUSED(roundboxalign),
const float UNUSED(zoom))
{
@@ -4203,10 +4177,7 @@ static void widget_optionbut(uiWidgetColors *wcol,
}
/* labels use Editor theme colors for text */
-static void widget_state_label(uiWidgetType *wt,
- uint64_t state,
- int drawflag,
- eUIEmbossType emboss)
+static void widget_state_label(uiWidgetType *wt, int state, int drawflag, eUIEmbossType emboss)
{
if (state & UI_BUT_LIST_ITEM) {
/* Override default label theme's colors. */
@@ -4233,7 +4204,7 @@ static void widget_state_label(uiWidgetType *wt,
}
static void widget_radiobut(
- uiWidgetColors *wcol, rcti *rect, uint64_t UNUSED(state), int roundboxalign, const float zoom)
+ uiWidgetColors *wcol, rcti *rect, int UNUSED(state), int roundboxalign, const float zoom)
{
uiWidgetBase wtb;
widget_init(&wtb);
@@ -4247,7 +4218,7 @@ static void widget_radiobut(
static void widget_box(uiBut *but,
uiWidgetColors *wcol,
rcti *rect,
- uint64_t UNUSED(state),
+ int UNUSED(state),
int roundboxalign,
const float zoom)
{
@@ -4274,7 +4245,7 @@ static void widget_box(uiBut *but,
}
static void widget_but(
- uiWidgetColors *wcol, rcti *rect, uint64_t UNUSED(state), int roundboxalign, const float zoom)
+ uiWidgetColors *wcol, rcti *rect, int UNUSED(state), int roundboxalign, const float zoom)
{
uiWidgetBase wtb;
widget_init(&wtb);
@@ -4301,7 +4272,7 @@ static void widget_roundbut(uiWidgetColors *wcol, rcti *rect, int UNUSED(state),
#endif
static void widget_roundbut_exec(
- uiWidgetColors *wcol, rcti *rect, uint64_t state, int roundboxalign, const float zoom)
+ uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign, const float zoom)
{
uiWidgetBase wtb;
widget_init(&wtb);
@@ -4320,7 +4291,7 @@ static void widget_roundbut_exec(
}
static void widget_tab(
- uiWidgetColors *wcol, rcti *rect, uint64_t state, int roundboxalign, const float zoom)
+ uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign, const float zoom)
{
const float rad = widget_radius_from_zoom(zoom, wcol);
const bool is_active = (state & UI_SELECT);
@@ -4951,7 +4922,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. */
- uint64_t state = but->flag & ~UI_STATE_FLAGS_ALL;
+ int state = but->flag & ~UI_STATE_FLAGS_ALL;
const int drawflag = but->drawflag;
if (state & UI_SELECT_DRAW) {
@@ -5364,7 +5335,7 @@ void ui_draw_menu_item(const uiFontStyle *fstyle,
rcti *rect,
const char *name,
int iconid,
- uint64_t state,
+ int state,
uiMenuItemSeparatorType separator_type,
int *r_xmax)
{
@@ -5557,7 +5528,7 @@ void ui_draw_preview_item(const uiFontStyle *fstyle,
rcti *rect,
const char *name,
int iconid,
- uint64_t state,
+ int state,
eFontStyle_Align text_align)
{
uiWidgetType *wt = widget_type(UI_WTYPE_MENU_ITEM_UNPADDED);
diff --git a/source/blender/editors/interface/view2d.cc b/source/blender/editors/interface/view2d.cc
index 94190c0a39d..66171dc13e4 100644
--- a/source/blender/editors/interface/view2d.cc
+++ b/source/blender/editors/interface/view2d.cc
@@ -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;
- uint64_t state;
+ int 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;
- uint64_t state;
+ int state;
slider.xmin = vert.xmin;
slider.xmax = vert.xmax;