Merge branch 'master' into blender2.8

This commit is contained in:
Campbell Barton 2018-02-23 13:10:39 +11:00
commit 171c756f20
12 changed files with 34 additions and 22 deletions

View File

@ -272,8 +272,8 @@ typedef struct ModifierTypeInfo {
* This function is optional.
*/
void (*updateDepsgraph)(struct ModifierData *md,
const ModifierUpdateDepsgraphContext* ctx);
const ModifierUpdateDepsgraphContext *ctx);
/* Should return true if the modifier needs to be recalculated on time
* changes.
*

View File

@ -18,8 +18,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
#ifndef __BLI_POLYFILL2D_BEAUTIFY_H__
#define __BLI_POLYFILL2D_BEAUTIFY_H__
#ifndef __BLI_POLYFILL_2D_BEAUTIFY_H__
#define __BLI_POLYFILL_2D_BEAUTIFY_H__
struct Heap;
struct MemArena;
@ -42,4 +42,4 @@ float BLI_polyfill_beautify_quad_rotate_calc_ex(
/* avoid realloc's when creating new structures for polyfill ngons */
#define BLI_POLYFILL_ALLOC_NGON_RESERVE 64
#endif /* __BLI_POLYFILL2D_BEAUTIFY_H__ */
#endif /* __BLI_POLYFILL_2D_BEAUTIFY_H__ */

View File

@ -23,8 +23,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
#ifndef __BLI_VORONOI_H__
#define __BLI_VORONOI_H__
#ifndef __BLI_VORONOI_2D_H__
#define __BLI_VORONOI_2D_H__
struct ListBase;
@ -67,4 +67,4 @@ void BLI_voronoi_triangulate(const VoronoiSite *sites, int sites_total, struct L
VoronoiTriangulationPoint **triangulated_points_r, int *triangulated_points_total_r,
int (**triangles_r)[3], int *triangles_total_r);
#endif /* __BLI_VORONOI_H__ */
#endif /* __BLI_VORONOI_2D_H__ */

View File

@ -20,7 +20,7 @@
* ***** END GPL LICENSE BLOCK *****
*/
/** \file blender/blenlib/intern/boxpack2d.c
/** \file blender/blenlib/intern/boxpack_2d.c
* \ingroup bli
*/

View File

@ -25,7 +25,7 @@
* ***** END GPL LICENSE BLOCK *****
*/
/** \file blender/blenlib/intern/jitter.c
/** \file blender/blenlib/intern/jitter_2d.c
* \ingroup bli
* \brief Jitter offset table
*/

View File

@ -18,7 +18,7 @@
* ***** END GPL LICENSE BLOCK *****
*/
/** \file blender/blenlib/intern/polyfill2d_beautify.c
/** \file blender/blenlib/intern/polyfill_2d_beautify.c
* \ingroup bli
*
* This function is to improve the tessellation resulting from polyfill2d,

View File

@ -24,7 +24,7 @@
* ***** END GPL LICENSE BLOCK *****
*/
/** \file blender/depsgraph/intern/builder/deg_builder.cc
/** \file blender/depsgraph/intern/builder/deg_builder_map.cc
* \ingroup depsgraph
*/

View File

@ -24,7 +24,7 @@
* ***** END GPL LICENSE BLOCK *****
*/
/** \file blender/depsgraph/intern/builder/deg_builder.h
/** \file blender/depsgraph/intern/builder/deg_builder_map.h
* \ingroup depsgraph
*/

View File

@ -317,8 +317,10 @@ typedef struct wmKeyMap {
short kmi_id; /* last kmi id */
/* runtime */
int (*poll)(struct bContext *); /* verify if enabled in the current context */
const void *modal_items; /* for modal, EnumPropertyItem for now */
/** Verify if enabled in the current context, use #WM_keymap_poll instead of direct calls. */
int (*poll)(struct bContext *);
/** For modal, #EnumPropertyItem for now. */
const void *modal_items;
} wmKeyMap;
/* wmKeyMap.flag */

View File

@ -76,7 +76,8 @@ wmKeyMap *WM_keymap_find_all(const struct bContext *C, const char *idname, int s
wmKeyMap *WM_keymap_active(struct wmWindowManager *wm, struct wmKeyMap *keymap);
wmKeyMap *WM_keymap_guess_opname(const struct bContext *C, const char *opname);
bool WM_keymap_remove(struct wmKeyConfig *keyconfig, struct wmKeyMap *keymap);
bool WM_keymap_poll(struct bContext *C, struct wmKeyMap *keymap);
wmKeyMapItem *WM_keymap_item_find_id(struct wmKeyMap *keymap, int id);
int WM_keymap_item_compare(struct wmKeyMapItem *k1, struct wmKeyMapItem *k2);

View File

@ -2180,7 +2180,7 @@ static int wm_handlers_do_intern(bContext *C, wmEvent *event, ListBase *handlers
PRINT("%s: checking '%s' ...", __func__, keymap->idname);
if (!keymap->poll || keymap->poll(C)) {
if (WM_keymap_poll(C, keymap)) {
PRINT("pass\n");

View File

@ -398,6 +398,15 @@ bool WM_keymap_remove(wmKeyConfig *keyconf, wmKeyMap *keymap)
}
}
bool WM_keymap_poll(bContext *C, wmKeyMap *keymap)
{
if (keymap->poll != NULL) {
return keymap->poll(C);
}
return true;
}
static void keymap_event_set(wmKeyMapItem *kmi, short type, short val, int modifier, short keymodifier)
{
kmi->type = type;
@ -1087,7 +1096,7 @@ static wmKeyMapItem *wm_keymap_item_find_handlers(
for (handler = handlers->first; handler; handler = handler->next) {
keymap = WM_keymap_active(wm, handler->keymap);
if (keymap && (!keymap->poll || keymap->poll((bContext *)C))) {
if (keymap && WM_keymap_poll((bContext *)C, keymap)) {
for (kmi = keymap->items.first; kmi; kmi = kmi->next) {
/* skip disabled keymap items [T38447] */
if (kmi->flag & KMI_INACTIVE)
@ -1719,7 +1728,7 @@ wmKeyMap *WM_keymap_guess_opname(const bContext *C, const char *opname)
km = WM_keymap_find_all(C, "Mesh", 0, 0);
/* some mesh operators are active in object mode too, like add-prim */
if (km && km->poll && km->poll((bContext *)C) == 0) {
if (km && !WM_keymap_poll((bContext *)C, km)) {
km = WM_keymap_find_all(C, "Object Mode", 0, 0);
}
}
@ -1729,7 +1738,7 @@ wmKeyMap *WM_keymap_guess_opname(const bContext *C, const char *opname)
km = WM_keymap_find_all(C, "Curve", 0, 0);
/* some curve operators are active in object mode too, like add-prim */
if (km && km->poll && km->poll((bContext *)C) == 0) {
if (km && !WM_keymap_poll((bContext *)C, km)) {
km = WM_keymap_find_all(C, "Object Mode", 0, 0);
}
}
@ -1757,7 +1766,7 @@ wmKeyMap *WM_keymap_guess_opname(const bContext *C, const char *opname)
km = WM_keymap_find_all(C, "Metaball", 0, 0);
/* some mball operators are active in object mode too, like add-prim */
if (km && km->poll && km->poll((bContext *)C) == 0) {
if (km && !WM_keymap_poll((bContext *)C, km)) {
km = WM_keymap_find_all(C, "Object Mode", 0, 0);
}
}
@ -1809,7 +1818,7 @@ wmKeyMap *WM_keymap_guess_opname(const bContext *C, const char *opname)
* Mesh keymap is probably not ideal, but best place I could find to put those. */
if (sl->spacetype == SPACE_VIEW3D) {
km = WM_keymap_find_all(C, "Mesh", 0, 0);
if (km && km->poll && !km->poll((bContext *)C)) {
if (km && !WM_keymap_poll((bContext *)C, km)) {
km = NULL;
}
}