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:
authorBastien Montagne <montagne29@wanadoo.fr>2017-11-06 18:08:23 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2017-11-06 18:08:23 +0300
commit0dce80ad4323822c95429d782c51c105b18a4e18 (patch)
tree42311bbb9058b9e2455e52456164190116882fb3 /source/blender/editors/interface/interface.c
parente47a2a8d754756d332b1cccdf3752b5c08691c59 (diff)
parentb28da9dbf81581454ecda8197f4b23574e495729 (diff)
Merge branch 'master' into id_override_static
Conflicts: source/blender/editors/interface/interface_handlers.c
Diffstat (limited to 'source/blender/editors/interface/interface.c')
-rw-r--r--source/blender/editors/interface/interface.c35
1 files changed, 27 insertions, 8 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 6fd30b332b2..892d60c2fbc 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -983,7 +983,9 @@ void ui_but_add_shortcut(uiBut *but, const char *shortcut_str, const bool do_str
}
}
-static bool ui_but_event_operator_string(const bContext *C, uiBut *but, char *buf, const size_t buf_len)
+static bool ui_but_event_operator_string(
+ const bContext *C, uiBut *but,
+ char *buf, const size_t buf_len)
{
MenuType *mt;
bool found = false;
@@ -991,7 +993,10 @@ static bool ui_but_event_operator_string(const bContext *C, uiBut *but, char *bu
if (but->optype) {
IDProperty *prop = (but->opptr) ? but->opptr->data : NULL;
- if (WM_key_event_operator_string(C, but->optype->idname, but->opcontext, prop, true, buf_len, buf)) {
+ if (WM_key_event_operator_string(
+ C, but->optype->idname, but->opcontext, prop, true,
+ buf, buf_len))
+ {
found = true;
}
}
@@ -1006,8 +1011,9 @@ static bool ui_but_event_operator_string(const bContext *C, uiBut *but, char *bu
IDP_AssignString(prop_menu_name, mt->idname, sizeof(mt->idname));
- if (WM_key_event_operator_string(C, "WM_OT_call_menu", WM_OP_INVOKE_REGION_WIN, prop_menu,
- true, buf_len, buf))
+ if (WM_key_event_operator_string(
+ C, "WM_OT_call_menu", WM_OP_INVOKE_REGION_WIN, prop_menu, true,
+ buf, buf_len))
{
found = true;
}
@@ -1019,8 +1025,10 @@ static bool ui_but_event_operator_string(const bContext *C, uiBut *but, char *bu
return found;
}
-static bool ui_but_event_property_operator_string(const bContext *C, uiBut *but, char *buf, const size_t buf_len)
-{
+static bool ui_but_event_property_operator_string(
+ const bContext *C, uiBut *but,
+ char *buf, const size_t buf_len)
+{
/* context toggle operator names to check... */
const char *ctx_toggle_opnames[] = {
"WM_OT_context_toggle",
@@ -1114,8 +1122,9 @@ static bool ui_but_event_property_operator_string(const bContext *C, uiBut *but,
/* check each until one works... */
for (i = 0; (i < num_ops) && (ctx_toggle_opnames[i]); i++) {
- if (WM_key_event_operator_string(C, ctx_toggle_opnames[i], WM_OP_INVOKE_REGION_WIN, prop_path, false,
- buf_len, buf))
+ if (WM_key_event_operator_string(
+ C, ctx_toggle_opnames[i], WM_OP_INVOKE_REGION_WIN, prop_path, false,
+ buf, buf_len))
{
found = true;
break;
@@ -2687,6 +2696,10 @@ static void ui_but_free(const bContext *C, uiBut *but)
MEM_freeN(but->tip_argN);
}
+ if (but->hold_argN) {
+ MEM_freeN(but->hold_argN);
+ }
+
if (but->active) {
/* XXX solve later, buttons should be free-able without context ideally,
* however they may have open tooltips or popup windows, which need to
@@ -4535,6 +4548,12 @@ void UI_but_focus_on_enter_event(wmWindow *win, uiBut *but)
wm_event_add(win, &event);
}
+void UI_but_func_hold_set(uiBut *but, uiButHandleHoldFunc func, void *argN)
+{
+ but->hold_func = func;
+ but->hold_argN = argN;
+}
+
void UI_but_string_info_get(bContext *C, uiBut *but, ...)
{
va_list args;