diff options
author | Julian Eisel <julian@blender.org> | 2021-04-21 16:01:18 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2021-04-21 16:18:05 +0300 |
commit | 0b458e832218d0c9309ffef9ac90c1539970e55b (patch) | |
tree | 41ae1e1ac618e8363c983a70ac4c6fcb78d8e772 /source/blender/windowmanager | |
parent | 2e3f072d5d8a99ccbd23a25766dfebf3067e6162 (diff) |
Cleanup: Create/use types for generic WM callbacks
Makes it less of a hassle to pass these callbacks around as function
arguments, and deduplicates their signature when doing so.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/WM_types.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index d54925272de..1d99b605205 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -132,17 +132,21 @@ struct wmWindowManager; extern "C" { #endif +typedef void (*wmGenericUserDataFreeFn)(void *data); + typedef struct wmGenericUserData { void *data; /** When NULL, use #MEM_freeN. */ - void (*free_fn)(void *data); + wmGenericUserDataFreeFn free_fn; bool use_free; } wmGenericUserData; +typedef void (*wmGenericCallbackFn)(struct bContext *C, void *user_data); + typedef struct wmGenericCallback { - void (*exec)(struct bContext *C, void *user_data); + wmGenericCallbackFn exec; void *user_data; - void (*free_user_data)(void *user_data); + wmGenericUserDataFreeFn free_user_data; } wmGenericCallback; /* ************** wmOperatorType ************************ */ |