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:
authorCampbell Barton <ideasman42@gmail.com>2018-06-30 11:58:56 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-06-30 11:58:56 +0300
commit62ff53ff19e36da0203915d04fc0ce295002f173 (patch)
tree13872e2a1cf1f21b6ead83eb089c9d753fc253f2 /source/blender
parentb89307acfd71955000662232b5964edcdfef5ccf (diff)
UI: move queries into interface_query.c
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/include/UI_interface.h8
-rw-r--r--source/blender/editors/interface/interface_handlers.c25
-rw-r--r--source/blender/editors/interface/interface_query.c28
3 files changed, 32 insertions, 29 deletions
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index 7540e6ed602..b30ae67a3bd 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -404,6 +404,10 @@ typedef bool (*uiMenuStepFunc)(struct bContext *C, int direction, void *arg1);
/* interface_query.c */
+bool UI_but_is_tool(const uiBut *but);
+#define UI_but_is_decorator(but) \
+ ((but)->func == ui_but_anim_decorate_cb)
+
bool UI_block_is_empty(const uiBlock *block);
@@ -1265,8 +1269,4 @@ void UI_widgetbase_draw_cache_end(void);
/* Support click-drag motion which presses the button and closes a popover (like a menu). */
#define USE_UI_POPOVER_ONCE
-bool UI_but_is_tool(const uiBut *but);
-#define UI_but_is_decorator(but) \
- ((but)->func == ui_but_anim_decorate_cb)
-
#endif /* __UI_INTERFACE_H__ */
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 893700376b0..b60042b92a6 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -467,16 +467,6 @@ void ui_pan_to_scroll(const wmEvent *event, int *type, int *val)
}
}
-#ifdef USE_UI_POPOVER_ONCE
-bool ui_but_is_popover_once_compat(const uiBut *but)
-{
- return (
- (but->type == UI_BTYPE_BUT) ||
- ui_but_is_toggle(but)
- );
-}
-#endif
-
static uiBut *ui_but_prev(uiBut *but)
{
while (but->prev) {
@@ -9841,18 +9831,3 @@ void ui_but_clipboard_free(void)
{
curvemapping_free_data(&but_copypaste_curve);
}
-
-bool UI_but_is_tool(const uiBut *but)
-{
- /* very evil! */
- if (but->optype != NULL) {
- static wmOperatorType *ot = NULL;
- if (ot == NULL) {
- ot = WM_operatortype_find("WM_OT_tool_set_by_name", false);
- }
- if (but->optype == ot) {
- return true;
- }
- }
- return false;
-}
diff --git a/source/blender/editors/interface/interface_query.c b/source/blender/editors/interface/interface_query.c
index 5d6d03ece60..bdd2de05ab4 100644
--- a/source/blender/editors/interface/interface_query.c
+++ b/source/blender/editors/interface/interface_query.c
@@ -32,6 +32,9 @@
#include "interface_intern.h"
+#include "WM_api.h"
+#include "WM_types.h"
+
/* -------------------------------------------------------------------- */
/** \name Button (uiBut)
* \{ */
@@ -66,6 +69,31 @@ bool ui_but_is_toggle(const uiBut *but)
);
}
+#ifdef USE_UI_POPOVER_ONCE
+bool ui_but_is_popover_once_compat(const uiBut *but)
+{
+ return (
+ (but->type == UI_BTYPE_BUT) ||
+ ui_but_is_toggle(but)
+ );
+}
+#endif
+
+bool UI_but_is_tool(const uiBut *but)
+{
+ /* very evil! */
+ if (but->optype != NULL) {
+ static wmOperatorType *ot = NULL;
+ if (ot == NULL) {
+ ot = WM_operatortype_find("WM_OT_tool_set_by_name", false);
+ }
+ if (but->optype == ot) {
+ return true;
+ }
+ }
+ return false;
+}
+
/** \} */
/* -------------------------------------------------------------------- */