Merge branch 'master' into blender2.8
authorCampbell Barton <ideasman42@gmail.com>
Fri, 23 Feb 2018 02:10:39 +0000 (13:10 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 23 Feb 2018 02:10:39 +0000 (13:10 +1100)
12 files changed:
source/blender/blenkernel/BKE_modifier.h
source/blender/blenlib/BLI_polyfill_2d_beautify.h
source/blender/blenlib/BLI_voronoi_2d.h
source/blender/blenlib/intern/boxpack_2d.c
source/blender/blenlib/intern/jitter_2d.c
source/blender/blenlib/intern/polyfill_2d_beautify.c
source/blender/depsgraph/intern/builder/deg_builder_map.cc
source/blender/depsgraph/intern/builder/deg_builder_map.h
source/blender/makesdna/DNA_windowmanager_types.h
source/blender/windowmanager/WM_keymap.h
source/blender/windowmanager/intern/wm_event_system.c
source/blender/windowmanager/intern/wm_keymap.c

index ac9c2c50df2f72d63fc63773ff54a18c2ed27d89..e1ce58ba69ba94d358b1d7cc442e16d08843615c 100644 (file)
@@ -272,8 +272,8 @@ typedef struct ModifierTypeInfo {
         * This function is optional.
         */
        void (*updateDepsgraph)(struct ModifierData *md,
-                               const ModifierUpdateDepsgraphContextctx);
-
+                               const ModifierUpdateDepsgraphContext *ctx);
        /* Should return true if the modifier needs to be recalculated on time
         * changes.
         *
index 278771e9611193dd976cc44f89ddde21d2946543..73b52125904a85354679186c8896c6d8439de3fe 100644 (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__ */
index 51d1d5aa88e396d88738ed3d0edbc27fd7d5d802..8d1ff2d4c2b2c0a4eb82d79bd3ed97d7af68b021 100644 (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__ */
index b3beff0b78b22cfa5a02284f3b626621353c9e3b..cf9e29209fbc7f7e7bebc7a1df49218b8dd0ca96 100644 (file)
@@ -20,7 +20,7 @@
  * ***** END GPL LICENSE BLOCK *****
  */
 
-/** \file blender/blenlib/intern/boxpack2d.c
+/** \file blender/blenlib/intern/boxpack_2d.c
  *  \ingroup bli
  */
 
index 6c51eeb36d93bf2c0c8847cdf348effc0d50080c..26351f52c7f207cbb2eaddb2dfec902b9cfdb012 100644 (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
  */
index 93bfb02bce449fe69e3bce768e887174315563d4..9eb2ebc0bab59d595b77c0462c3251cbe7457188 100644 (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,
index 8c8446c1686aa44860994bc06dc1b4dec520f931..67cb04d1b98a62fed0394b2ba12b14fb50cf247b 100644 (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
  */
 
index 0e6d7c813960c2d3f714c827e50ce104d65f6fcc..5ad22a9aa77d3aa14d6de0f5feb471f696b7645e 100644 (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
  */
 
index 9e1d5e4ec93db1ae5bb12a7ecf5e276c65324c16..56c3c8ab976fa8c709a8330940e3f19bec33ad35 100644 (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 */
index 8a94472aaf52af3fc0e3b75946d58ea5f8bdec5c..b4d4d55479df24a474514c580577f1c8f1af6ac0 100644 (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);
 
index 38f9a2bccae1d5a2f170f088d03b307f4e668388..b6a9115cca45797a5ce8faaa6bfe6a9ff429c5b6 100644 (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");
 
index 910b7eadf4c7f2fdf053f3d27bfeaff347519a5e..45ed44d83d6b88ae7f328f05827eb05e864b8b43 100644 (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;
                        }
                }