diff options
author | Campbell Barton <campbell@blender.org> | 2022-03-26 10:39:42 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-03-26 10:42:33 +0300 |
commit | 9c41767d57cd911edaa0c021f7709ea87967a155 (patch) | |
tree | 1dd538b69aeacc3364b065b05efe9bbaeae001e2 /source | |
parent | 4d5e8e54774c22426a78bdd8aeaf55e601d22f8d (diff) |
Cleanup: move eFileSel_Action from DNA to WM_api.h
This isn't stored in blend files so it can be moved out of DNA.
Also use an enum for `WM_FILESEL_*` members.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/makesdna/DNA_space_types.h | 6 | ||||
-rw-r--r-- | source/blender/windowmanager/WM_api.h | 33 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_operator_props.c | 12 |
3 files changed, 27 insertions, 24 deletions
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index f538917143b..6d7952cb799 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -989,12 +989,6 @@ typedef enum eFileSelectType { FILE_SPECIAL = 9, } eFileSelectType; -/** File-selector op property -> action. */ -typedef enum eFileSel_Action { - FILE_OPENFILE = 0, - FILE_SAVE = 1, -} eFileSel_Action; - /** * #FileSelectParams.flag / `sfile->params->flag`. * \note short flag, also used as 16 lower bits of flags in link/append code diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index 7959c3d6f0b..0864627ebe3 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -740,14 +740,33 @@ bool WM_operator_last_properties_store(struct wmOperator *op); /* wm_operator_props.c */ void WM_operator_properties_confirm_or_exec(struct wmOperatorType *ot); + +/** Flags for #WM_operator_properties_filesel. */ +typedef enum eFileSel_Flag { + WM_FILESEL_RELPATH = 1 << 0, + WM_FILESEL_DIRECTORY = 1 << 1, + WM_FILESEL_FILENAME = 1 << 2, + WM_FILESEL_FILEPATH = 1 << 3, + WM_FILESEL_FILES = 1 << 4, + /** Show the properties sidebar by default. */ + WM_FILESEL_SHOW_PROPS = 1 << 5, +} eFileSel_Flag; +ENUM_OPERATORS(eFileSel_Flag, WM_FILESEL_SHOW_PROPS) + +/** Action for #WM_operator_properties_filesel. */ +typedef enum eFileSel_Action { + FILE_OPENFILE = 0, + FILE_SAVE = 1, +} eFileSel_Action; + /** * Default properties for file-select. */ void WM_operator_properties_filesel(struct wmOperatorType *ot, int filter, short type, - short action, - short flag, + eFileSel_Action action, + eFileSel_Flag flag, short display, short sort); /** @@ -841,16 +860,6 @@ void WM_operator_properties_checker_interval_from_op(struct wmOperator *op, bool WM_operator_properties_checker_interval_test(const struct CheckerIntervalParams *op_params, int depth); -/* flags for WM_operator_properties_filesel */ -#define WM_FILESEL_RELPATH (1 << 0) - -#define WM_FILESEL_DIRECTORY (1 << 1) -#define WM_FILESEL_FILENAME (1 << 2) -#define WM_FILESEL_FILEPATH (1 << 3) -#define WM_FILESEL_FILES (1 << 4) -/* Show the properties sidebar by default. */ -#define WM_FILESEL_SHOW_PROPS (1 << 5) - /** * Operator as a Python command (resulting string must be freed). * diff --git a/source/blender/windowmanager/intern/wm_operator_props.c b/source/blender/windowmanager/intern/wm_operator_props.c index dacc17c2c1e..c048b64426a 100644 --- a/source/blender/windowmanager/intern/wm_operator_props.c +++ b/source/blender/windowmanager/intern/wm_operator_props.c @@ -58,12 +58,12 @@ static const EnumPropertyItem *wm_operator_properties_filesel_sort_items_itemf( } void WM_operator_properties_filesel(wmOperatorType *ot, - int filter, - short type, - short action, - short flag, - short display, - short sort) + const int filter, + const short type, + const eFileSel_Action action, + const eFileSel_Flag flag, + const short display, + const short sort) { PropertyRNA *prop; |