Cleanup: simplify enum typedefs

This commit is contained in:
Campbell Barton
2023-08-05 14:22:48 +10:00
parent a86ef5d3f6
commit bf2b1f7e01
10 changed files with 40 additions and 40 deletions

View File

@@ -735,14 +735,14 @@ bool ANIM_remove_empty_action_from_animdata(AnimData *adt);
* \{ */
/* flags for Current Frame Drawing */
typedef enum eAnimEditDraw_CurrentFrame {
enum eAnimEditDraw_CurrentFrame {
/** Plain time indicator with no special indicators. */
/* DRAWCFRA_PLAIN = 0, */ /* UNUSED */
/** Time indication in seconds or frames. */
DRAWCFRA_UNIT_SECONDS = (1 << 0),
/** Draw indicator extra wide (for timeline). */
DRAWCFRA_WIDE = (1 << 1),
} eAnimEditDraw_CurrentFrame;
};
/**
* General call for drawing current frame indicator in animation editor.

View File

@@ -252,18 +252,18 @@ struct KeyingSetInfo {
void ANIM_relative_keyingset_add_source(ListBase *dsources, ID *id, StructRNA *srna, void *data);
/* mode for modify_keyframes */
typedef enum eModifyKey_Modes {
enum eModifyKey_Modes {
MODIFYKEY_MODE_INSERT = 0,
MODIFYKEY_MODE_DELETE,
} eModifyKey_Modes;
};
/* return codes for errors (with Relative KeyingSets) */
typedef enum eModifyKey_Returns {
enum eModifyKey_Returns {
/** Context info was invalid for using the Keying Set. */
MODIFYKEY_INVALID_CONTEXT = -1,
/** There isn't any type-info for generating paths from context. */
MODIFYKEY_MISSING_TYPEINFO = -2,
} eModifyKey_Returns;
};
/**
* Given a #KeyingSet and context info, validate Keying Set's paths.
@@ -418,12 +418,12 @@ extern EnumPropertyItem prop_driver_create_mapping_types[];
/* -------- */
typedef enum eDriverFCurveCreationMode {
enum eDriverFCurveCreationMode {
DRIVER_FCURVE_LOOKUP_ONLY = 0, /* Don't add anything if not found. */
DRIVER_FCURVE_KEYFRAMES = 1, /* Add with keyframes, for visual tweaking. */
DRIVER_FCURVE_GENERATOR = 2, /* Add with generator, for script backwards compatibility. */
DRIVER_FCURVE_EMPTY = 3 /* Add without data, for pasting. */
} eDriverFCurveCreationMode;
};
/**
* Get (or add relevant data to be able to do so) F-Curve from the driver stack,

View File

@@ -445,25 +445,25 @@ BLI_INLINE void flip_qt(float quat[4], const ePaintSymmetryFlags symm)
}
/* stroke operator */
typedef enum BrushStrokeMode {
enum BrushStrokeMode {
BRUSH_STROKE_NORMAL,
BRUSH_STROKE_INVERT,
BRUSH_STROKE_SMOOTH,
} BrushStrokeMode;
};
/* paint_hide.cc */
typedef enum {
enum PartialVisAction {
PARTIALVIS_HIDE,
PARTIALVIS_SHOW,
} PartialVisAction;
};
typedef enum {
enum PartialVisArea {
PARTIALVIS_INSIDE,
PARTIALVIS_OUTSIDE,
PARTIALVIS_ALL,
PARTIALVIS_MASKED,
} PartialVisArea;
};
void PAINT_OT_hide_show(wmOperatorType *ot);
@@ -476,11 +476,11 @@ void PAINT_OT_hide_show(wmOperatorType *ot);
*
* Fixes #102349.
*/
typedef enum {
enum PaintMaskFloodMode {
PAINT_MASK_FLOOD_VALUE = SEL_OP_SUB,
PAINT_MASK_FLOOD_VALUE_INVERSE = SEL_OP_ADD,
PAINT_MASK_INVERT = SEL_OP_XOR,
} PaintMaskFloodMode;
};
void PAINT_OT_mask_flood_fill(wmOperatorType *ot);
void PAINT_OT_mask_lasso_gesture(wmOperatorType *ot);

View File

@@ -16,10 +16,10 @@
namespace blender::gpu {
typedef enum {
enum GPUIndexBufType {
GPU_INDEX_U16,
GPU_INDEX_U32,
} GPUIndexBufType;
};
static inline size_t to_bytesize(GPUIndexBufType type)
{

View File

@@ -14,9 +14,9 @@ namespace blender::gpu {
#define QUERY_MIN_LEN 16
typedef enum GPUQueryType {
enum GPUQueryType {
GPU_QUERY_OCCLUSION = 0,
} GPUQueryType;
};
class QueryPool {
public:

View File

@@ -40,7 +40,7 @@ typedef enum eGPUTextureFormatFlag {
ENUM_OPERATORS(eGPUTextureFormatFlag, GPU_FORMAT_SIGNED)
typedef enum eGPUTextureType {
enum eGPUTextureType {
GPU_TEXTURE_1D = (1 << 0),
GPU_TEXTURE_2D = (1 << 1),
GPU_TEXTURE_3D = (1 << 2),
@@ -51,20 +51,20 @@ typedef enum eGPUTextureType {
GPU_TEXTURE_1D_ARRAY = (GPU_TEXTURE_1D | GPU_TEXTURE_ARRAY),
GPU_TEXTURE_2D_ARRAY = (GPU_TEXTURE_2D | GPU_TEXTURE_ARRAY),
GPU_TEXTURE_CUBE_ARRAY = (GPU_TEXTURE_CUBE | GPU_TEXTURE_ARRAY),
} eGPUTextureType;
};
ENUM_OPERATORS(eGPUTextureType, GPU_TEXTURE_BUFFER)
/* Format types for samplers within the shader.
* This covers the sampler format type permutations within GLSL/MSL. */
typedef enum eGPUSamplerFormat {
enum eGPUSamplerFormat {
GPU_SAMPLER_TYPE_FLOAT = 0,
GPU_SAMPLER_TYPE_INT = 1,
GPU_SAMPLER_TYPE_UINT = 2,
/* Special case for depth, as these require differing dummy formats. */
GPU_SAMPLER_TYPE_DEPTH = 3,
GPU_SAMPLER_TYPE_MAX = 4
} eGPUSamplerFormat;
};
ENUM_OPERATORS(eGPUSamplerFormat, GPU_SAMPLER_TYPE_UINT)

View File

@@ -425,7 +425,7 @@ struct MTLSamplerArray {
}
};
typedef enum MTLPipelineStateDirtyFlag {
enum MTLPipelineStateDirtyFlag {
MTL_PIPELINE_STATE_NULL_FLAG = 0,
/* Whether we need to call setViewport. */
MTL_PIPELINE_STATE_VIEWPORT_FLAG = (1 << 0),
@@ -444,7 +444,7 @@ typedef enum MTLPipelineStateDirtyFlag {
(MTL_PIPELINE_STATE_VIEWPORT_FLAG | MTL_PIPELINE_STATE_SCISSOR_FLAG |
MTL_PIPELINE_STATE_DEPTHSTENCIL_FLAG | MTL_PIPELINE_STATE_PSO_FLAG |
MTL_PIPELINE_STATE_FRONT_FACING_FLAG | MTL_PIPELINE_STATE_CULLMODE_FLAG)
} MTLPipelineStateDirtyFlag;
};
/* Ignore full flag bit-mask `MTL_PIPELINE_STATE_ALL_FLAG`. */
ENUM_OPERATORS(MTLPipelineStateDirtyFlag, MTL_PIPELINE_STATE_CULLMODE_FLAG);

View File

@@ -64,11 +64,11 @@ struct TextureUpdateRoutineSpecialisation {
* 1 = 24 bit integer (0 - 2^24)
* 2 = 32 bit integer (0 - 2^32) */
typedef enum {
enum DepthTextureUpdateMode {
MTL_DEPTH_UPDATE_MODE_FLOAT = 0,
MTL_DEPTH_UPDATE_MODE_INT24 = 1,
MTL_DEPTH_UPDATE_MODE_INT32 = 2
} DepthTextureUpdateMode;
};
struct DepthTextureUpdateRoutineSpecialisation {
DepthTextureUpdateMode data_mode;

View File

@@ -189,18 +189,18 @@ enum {
};
/** For #WM_cursor_grab_enable wrap axis. */
typedef enum eWM_CursorWrapAxis {
enum eWM_CursorWrapAxis {
WM_CURSOR_WRAP_NONE = 0,
WM_CURSOR_WRAP_X,
WM_CURSOR_WRAP_Y,
WM_CURSOR_WRAP_XY,
} eWM_CursorWrapAxis;
};
/**
* Context to call operator in for #WM_operator_name_call.
* rna_ui.cc contains EnumPropertyItem's of these, keep in sync.
*/
typedef enum wmOperatorCallContext {
enum wmOperatorCallContext {
/* if there's invoke, call it, otherwise exec */
WM_OP_INVOKE_DEFAULT,
WM_OP_INVOKE_REGION_WIN,
@@ -215,7 +215,7 @@ typedef enum wmOperatorCallContext {
WM_OP_EXEC_REGION_PREVIEW,
WM_OP_EXEC_AREA,
WM_OP_EXEC_SCREEN,
} wmOperatorCallContext;
};
#define WM_OP_CONTEXT_HAS_AREA(type) \
(CHECK_TYPE_INLINE(type, wmOperatorCallContext), \
@@ -224,9 +224,9 @@ typedef enum wmOperatorCallContext {
(WM_OP_CONTEXT_HAS_AREA(type) && !ELEM(type, WM_OP_INVOKE_AREA, WM_OP_EXEC_AREA))
/* property tags for RNA_OperatorProperties */
typedef enum eOperatorPropTags {
enum eOperatorPropTags {
OP_PROP_TAG_ADVANCED = (1 << 0),
} eOperatorPropTags;
};
#define OP_PROP_TAG_ADVANCED ((eOperatorPropTags)OP_PROP_TAG_ADVANCED)
/* -------------------------------------------------------------------- */
@@ -607,7 +607,7 @@ struct wmGesture {
/* ************** wmEvent ************************ */
typedef enum eWM_EventFlag {
enum eWM_EventFlag {
/**
* True if the operating system inverted the delta x/y values and resulting
* `prev_xy` values, for natural scroll direction.
@@ -634,7 +634,7 @@ typedef enum eWM_EventFlag {
* even when the threshold has not been met.
*/
WM_EVENT_FORCE_DRAG_THRESHOLD = (1 << 3),
} eWM_EventFlag;
};
ENUM_OPERATORS(eWM_EventFlag, WM_EVENT_FORCE_DRAG_THRESHOLD);
struct wmTabletData {
@@ -871,7 +871,7 @@ struct wmXrActionData {
#endif
/** Timer flags. */
typedef enum {
enum wmTimerFlags {
/** Do not attempt to free custom-data pointer even if non-NULL. */
WM_TIMER_NO_FREE_CUSTOM_DATA = 1 << 0,
@@ -879,7 +879,7 @@ typedef enum {
/** This timer has been tagged for removal and deletion, handled by WM code to ensure timers are
* deleted in a safe context. */
WM_TIMER_TAGGED_FOR_REMOVAL = 1 << 16,
} wmTimerFlags;
};
ENUM_OPERATORS(wmTimerFlags, WM_TIMER_TAGGED_FOR_REMOVAL)
struct wmTimer {

View File

@@ -11,7 +11,7 @@
struct wmEvent;
struct wmWindow;
typedef enum WMCursorType {
enum WMCursorType {
WM_CURSOR_DEFAULT = 1,
WM_CURSOR_TEXT_EDIT,
WM_CURSOR_WAIT,
@@ -59,7 +59,7 @@ typedef enum WMCursorType {
/* --- ALWAYS LAST ----- */
WM_CURSOR_NUM,
} WMCursorType;
};
void wm_init_cursor_data();
bool wm_cursor_arrow_move(wmWindow *win, const wmEvent *event);