From 1bcadda46b96e3e557aad1b0d2d53a0b4743b413 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 31 Oct 2012 20:29:32 +0000 Subject: fix [#30910] Problems: Add Shortcut(s) for "Ctrl Tab" menu comparing keymaps was too sloppy or too strict, now sloppy keymap comparison works by setting all the operator properties to their default values if they are not already set, then compare this with the keymap item (ignoring values missing from either one). ... this way any non default keymap setting wont match with an operator menu item which doesnt set this operator at all (a problem sighted in this bug report). developer notes: - IDP_EqualsProperties_ex() function adds an argument to treat missing members of either group to act as if there is a match. - WM_operator_properties_default() function to reset RNA values to their defaults. - add IDP_spit(), debug only function to print out ID properties. --- source/blender/blenkernel/BKE_idprop.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source/blender/blenkernel/BKE_idprop.h') diff --git a/source/blender/blenkernel/BKE_idprop.h b/source/blender/blenkernel/BKE_idprop.h index 027f06ef84f..2dd1bfc2a51 100644 --- a/source/blender/blenkernel/BKE_idprop.h +++ b/source/blender/blenkernel/BKE_idprop.h @@ -266,6 +266,12 @@ __attribute__((nonnull)) #endif ; +int IDP_EqualsProperties_ex(IDProperty *prop1, IDProperty *prop2, const int is_strict) +#ifdef __GNUC__ +__attribute__((warn_unused_result)) +#endif +; + int IDP_EqualsProperties(struct IDProperty *prop1, struct IDProperty *prop2) #ifdef __GNUC__ __attribute__((warn_unused_result)) @@ -319,4 +325,9 @@ void IDP_UnlinkProperty(struct IDProperty *prop); #define IDP_IDPArray(prop) ((IDProperty *)(prop)->data.pointer) #define IDP_Double(prop) (*(double *)&(prop)->data.val) +#ifdef DEBUG +/* for printout only */ +void IDP_spit(IDProperty *prop); +#endif + #endif /* __BKE_IDPROP_H__ */ -- cgit v1.2.3