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:
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/WM_api.h20
-rw-r--r--source/blender/windowmanager/WM_types.h6
-rw-r--r--source/blender/windowmanager/intern/wm_dragdrop.c5
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c4
-rw-r--r--source/blender/windowmanager/intern/wm_files.c2
-rw-r--r--source/blender/windowmanager/intern/wm_files_link.c2
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c11
-rw-r--r--source/blender/windowmanager/wm.h2
8 files changed, 28 insertions, 24 deletions
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h
index a96d9bec61a..3d1ee273108 100644
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@ -165,10 +165,11 @@ void WM_cursor_grab_enable(struct wmWindow *win, bool wrap, bool hide, int boun
void WM_cursor_grab_disable(struct wmWindow *win, const int mouse_ungrab_xy[2]);
void WM_cursor_time (struct wmWindow *win, int nr);
-void *WM_paint_cursor_activate(struct wmWindowManager *wm,
- int (*poll)(struct bContext *C),
- void (*draw)(struct bContext *C, int, int, void *customdata),
- void *customdata);
+void *WM_paint_cursor_activate(
+ struct wmWindowManager *wm,
+ bool (*poll)(struct bContext *C),
+ void (*draw)(struct bContext *C, int, int, void *customdata),
+ void *customdata);
void WM_paint_cursor_end(struct wmWindowManager *wm, void *handle);
void WM_paint_cursor_tag_redraw(struct wmWindow *win, struct ARegion *ar);
@@ -283,7 +284,7 @@ int WM_operator_confirm (struct bContext *C, struct wmOperator *op, const str
int WM_operator_filesel (struct bContext *C, struct wmOperator *op, const struct wmEvent *event);
bool WM_operator_filesel_ensure_ext_imtype(wmOperator *op, const struct ImageFormatData *im_format);
/* poll callback, context checks */
-int WM_operator_winactive (struct bContext *C);
+bool WM_operator_winactive (struct bContext *C);
/* invoke callback, exec + redo popup */
int WM_operator_props_popup_confirm(struct bContext *C, struct wmOperator *op, const struct wmEvent *event);
int WM_operator_props_popup_call(struct bContext *C, struct wmOperator *op, const struct wmEvent *event);
@@ -326,8 +327,8 @@ struct wmOperatorType *WM_operatortype_append_macro(const char *idname, const ch
struct wmOperatorTypeMacro *WM_operatortype_macro_define(struct wmOperatorType *ot, const char *idname);
-int WM_operator_poll (struct bContext *C, struct wmOperatorType *ot);
-int WM_operator_poll_context(struct bContext *C, struct wmOperatorType *ot, short context);
+bool WM_operator_poll (struct bContext *C, struct wmOperatorType *ot);
+bool WM_operator_poll_context(struct bContext *C, struct wmOperatorType *ot, short context);
int WM_operator_call_ex(struct bContext *C, struct wmOperator *op, const bool store);
int WM_operator_call (struct bContext *C, struct wmOperator *op);
int WM_operator_call_notest(struct bContext *C, struct wmOperator *op);
@@ -475,8 +476,9 @@ void WM_event_drag_image(struct wmDrag *, struct ImBuf *, float scale, int sx
void WM_drag_free(struct wmDrag *drag);
void WM_drag_free_list(struct ListBase *lb);
-struct wmDropBox *WM_dropbox_add(ListBase *lb, const char *idname, int (*poll)(struct bContext *, struct wmDrag *, const struct wmEvent *event),
- void (*copy)(struct wmDrag *, struct wmDropBox *));
+struct wmDropBox *WM_dropbox_add(
+ ListBase *lb, const char *idname, bool (*poll)(struct bContext *, struct wmDrag *, const struct wmEvent *event),
+ void (*copy)(struct wmDrag *, struct wmDropBox *));
ListBase *WM_dropboxmap_find(const char *idname, int spaceid, int regionid);
/* Set OpenGL viewport and scissor */
diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h
index 5abc0b2d48b..8e05822dd55 100644
--- a/source/blender/windowmanager/WM_types.h
+++ b/source/blender/windowmanager/WM_types.h
@@ -582,7 +582,7 @@ typedef struct wmOperatorType {
/* verify if the operator can be executed in the current context, note
* that the operator might still fail to execute even if this return true */
- int (*poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT;
+ bool (*poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT;
/* optional panel for redo and repeat, autogenerated if not set */
void (*ui)(struct bContext *, struct wmOperator *);
@@ -604,7 +604,7 @@ typedef struct wmOperatorType {
struct wmKeyMap *modalkeymap;
/* python needs the operator type as well */
- int (*pyop_poll)(struct bContext *, struct wmOperatorType *ot) ATTR_WARN_UNUSED_RESULT;
+ bool (*pyop_poll)(struct bContext *, struct wmOperatorType *ot) ATTR_WARN_UNUSED_RESULT;
/* RNA integration */
ExtensionRNA ext;
@@ -674,7 +674,7 @@ typedef struct wmDropBox {
struct wmDropBox *next, *prev;
/* test if the dropbox is active, then can print optype name */
- int (*poll)(struct bContext *, struct wmDrag *, const wmEvent *);
+ bool (*poll)(struct bContext *, struct wmDrag *, const wmEvent *);
/* before exec, this copies drag info to wmDrop properties */
void (*copy)(struct wmDrag *, struct wmDropBox *);
diff --git a/source/blender/windowmanager/intern/wm_dragdrop.c b/source/blender/windowmanager/intern/wm_dragdrop.c
index 16ed51cbd80..eca3a838c0f 100644
--- a/source/blender/windowmanager/intern/wm_dragdrop.c
+++ b/source/blender/windowmanager/intern/wm_dragdrop.c
@@ -97,8 +97,9 @@ ListBase *WM_dropboxmap_find(const char *idname, int spaceid, int regionid)
-wmDropBox *WM_dropbox_add(ListBase *lb, const char *idname, int (*poll)(bContext *, wmDrag *, const wmEvent *),
- void (*copy)(wmDrag *, wmDropBox *))
+wmDropBox *WM_dropbox_add(
+ ListBase *lb, const char *idname, bool (*poll)(bContext *, wmDrag *, const wmEvent *),
+ void (*copy)(wmDrag *, wmDropBox *))
{
wmDropBox *drop = MEM_callocN(sizeof(wmDropBox), "wmDropBox");
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index fcc297b308a..2a92eedf456 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -598,7 +598,7 @@ static void wm_handler_ui_cancel(bContext *C)
/* ********************* operators ******************* */
-int WM_operator_poll(bContext *C, wmOperatorType *ot)
+bool WM_operator_poll(bContext *C, wmOperatorType *ot)
{
wmOperatorTypeMacro *otmacro;
@@ -619,7 +619,7 @@ int WM_operator_poll(bContext *C, wmOperatorType *ot)
}
/* sets up the new context and calls 'wm_operator_invoke()' with poll_only */
-int WM_operator_poll_context(bContext *C, wmOperatorType *ot, short context)
+bool WM_operator_poll_context(bContext *C, wmOperatorType *ot, short context)
{
return wm_operator_call_internal(C, ot, NULL, NULL, context, true);
}
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index be805fa7b1f..f00ec500bc0 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -1930,7 +1930,7 @@ static int wm_revert_mainfile_exec(bContext *C, wmOperator *op)
}
}
-static int wm_revert_mainfile_poll(bContext *UNUSED(C))
+static bool wm_revert_mainfile_poll(bContext *UNUSED(C))
{
return G.relbase_valid;
}
diff --git a/source/blender/windowmanager/intern/wm_files_link.c b/source/blender/windowmanager/intern/wm_files_link.c
index c7d55b290f5..903795d6943 100644
--- a/source/blender/windowmanager/intern/wm_files_link.c
+++ b/source/blender/windowmanager/intern/wm_files_link.c
@@ -87,7 +87,7 @@
/* **************** link/append *************** */
-static int wm_link_append_poll(bContext *C)
+static bool wm_link_append_poll(bContext *C)
{
if (WM_operator_winactive(C)) {
/* linking changes active object which is pretty useful in general,
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 7a48d7e012c..fb4ff4ddb28 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -1359,7 +1359,7 @@ bool WM_operator_filesel_ensure_ext_imtype(wmOperator *op, const struct ImageFor
}
/* op->poll */
-int WM_operator_winactive(bContext *C)
+bool WM_operator_winactive(bContext *C)
{
if (CTX_wm_window(C) == NULL) return 0;
return 1;
@@ -2155,7 +2155,7 @@ static int wm_search_menu_invoke(bContext *C, wmOperator *UNUSED(op), const wmEv
}
/* op->poll */
-static int wm_search_menu_poll(bContext *C)
+static bool wm_search_menu_poll(bContext *C)
{
if (CTX_wm_window(C) == NULL) {
return 0;
@@ -2276,7 +2276,7 @@ static void WM_OT_call_panel(wmOperatorType *ot)
/* this poll functions is needed in place of WM_operator_winactive
* while it crashes on full screen */
-static int wm_operator_winactive_normal(bContext *C)
+static bool wm_operator_winactive_normal(bContext *C)
{
wmWindow *win = CTX_wm_window(C);
bScreen *screen;
@@ -2376,8 +2376,9 @@ static void WM_OT_console_toggle(wmOperatorType *ot)
* - draw(bContext): drawing callback for paint cursor
*/
-void *WM_paint_cursor_activate(wmWindowManager *wm, int (*poll)(bContext *C),
- wmPaintCursorDraw draw, void *customdata)
+void *WM_paint_cursor_activate(
+ wmWindowManager *wm, bool (*poll)(bContext *C),
+ wmPaintCursorDraw draw, void *customdata)
{
wmPaintCursor *pc = MEM_callocN(sizeof(wmPaintCursor), "paint cursor");
diff --git a/source/blender/windowmanager/wm.h b/source/blender/windowmanager/wm.h
index c92691eb65e..3605e57be36 100644
--- a/source/blender/windowmanager/wm.h
+++ b/source/blender/windowmanager/wm.h
@@ -42,7 +42,7 @@ typedef struct wmPaintCursor {
void *customdata;
- int (*poll)(struct bContext *C);
+ bool (*poll)(struct bContext *C);
void (*draw)(bContext *C, int, int, void *customdata);
} wmPaintCursor;