mirror of
https://github.com/microsoft/terminal.git
synced 2025-12-12 18:41:01 -06:00
format
This commit is contained in:
parent
2b1ffd4d47
commit
ccfb4bdf1d
@ -89,23 +89,23 @@ struct InitListPlaceholder
|
|||||||
&&(otherAsUs->_##name == _##name)
|
&&(otherAsUs->_##name == _##name)
|
||||||
|
|
||||||
#define X_MACRO_INDEX_BASE() \
|
#define X_MACRO_INDEX_BASE() \
|
||||||
constexpr auto X_MACRO_INDEXED_BASE__ = __COUNTER__ - 1
|
constexpr auto X_MACRO_INDEXED_BASE__ = __COUNTER__ - 1
|
||||||
|
|
||||||
#define X_MACRO_INDEX() \
|
#define X_MACRO_INDEX() \
|
||||||
(__COUNTER__ - X_MACRO_INDEXED_BASE__)
|
(__COUNTER__ - X_MACRO_INDEXED_BASE__)
|
||||||
|
|
||||||
// getter and setter for each property by index
|
// getter and setter for each property by index
|
||||||
#define GET_ARG_BY_INDEX(type, name, jsonKey, required, typeHint, ...) \
|
#define GET_ARG_BY_INDEX(type, name, jsonKey, required, typeHint, ...) \
|
||||||
if (index == X_MACRO_INDEX()) \
|
if (index == X_MACRO_INDEX()) \
|
||||||
{ \
|
{ \
|
||||||
if (_##name.has_value()) \
|
if (_##name.has_value()) \
|
||||||
{ \
|
{ \
|
||||||
return winrt::box_value(_##name.value()); \
|
return winrt::box_value(_##name.value()); \
|
||||||
} \
|
} \
|
||||||
else \
|
else \
|
||||||
{ \
|
{ \
|
||||||
return winrt::box_value(static_cast<type>(__VA_ARGS__)); \
|
return winrt::box_value(static_cast<type>(__VA_ARGS__)); \
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define SET_ARG_BY_INDEX(type, name, jsonKey, required, typeHint, ...) \
|
#define SET_ARG_BY_INDEX(type, name, jsonKey, required, typeHint, ...) \
|
||||||
@ -219,12 +219,12 @@ public:
|
|||||||
} \
|
} \
|
||||||
uint32_t GetArgCount() \
|
uint32_t GetArgCount() \
|
||||||
{ \
|
{ \
|
||||||
return gsl::narrow<uint32_t>(GetArgDescriptors().Size()); \
|
return gsl::narrow<uint32_t>(GetArgDescriptors().Size()); \
|
||||||
} \
|
} \
|
||||||
winrt::Windows::Foundation::Collections::IVectorView<ArgDescriptor> GetArgDescriptors() \
|
winrt::Windows::Foundation::Collections::IVectorView<ArgDescriptor> GetArgDescriptors() \
|
||||||
{ \
|
{ \
|
||||||
static const auto descriptors = INIT_ARG_DESCRIPTORS(argsMacro); \
|
static const auto descriptors = INIT_ARG_DESCRIPTORS(argsMacro); \
|
||||||
return descriptors; \
|
return descriptors; \
|
||||||
} \
|
} \
|
||||||
IInspectable GetArgAt(uint32_t index) const \
|
IInspectable GetArgAt(uint32_t index) const \
|
||||||
{ \
|
{ \
|
||||||
@ -237,34 +237,34 @@ public:
|
|||||||
argsMacro(SET_ARG_BY_INDEX) \
|
argsMacro(SET_ARG_BY_INDEX) \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define PARTIAL_ACTION_ARG_BODY(className, argsMacro) \
|
#define PARTIAL_ACTION_ARG_BODY(className, argsMacro) \
|
||||||
className() = default; \
|
className() = default; \
|
||||||
className( \
|
className( \
|
||||||
argsMacro(CTOR_PARAMS) InitListPlaceholder = {}) : \
|
argsMacro(CTOR_PARAMS) InitListPlaceholder = {}) : \
|
||||||
argsMacro(CTOR_INIT) \
|
argsMacro(CTOR_INIT) \
|
||||||
_placeholder{} {}; \
|
_placeholder{} {}; \
|
||||||
argsMacro(DECLARE_ARGS); \
|
argsMacro(DECLARE_ARGS); \
|
||||||
\
|
\
|
||||||
private: \
|
private: \
|
||||||
InitListPlaceholder _placeholder; \
|
InitListPlaceholder _placeholder; \
|
||||||
\
|
\
|
||||||
public: \
|
public: \
|
||||||
uint32_t GetArgCount() \
|
uint32_t GetArgCount() \
|
||||||
{ \
|
{ \
|
||||||
return gsl::narrow<uint32_t>(GetArgDescriptors().Size()); \
|
return gsl::narrow<uint32_t>(GetArgDescriptors().Size()); \
|
||||||
} \
|
} \
|
||||||
winrt::Windows::Foundation::Collections::IVectorView<ArgDescriptor> GetArgDescriptors() \
|
winrt::Windows::Foundation::Collections::IVectorView<ArgDescriptor> GetArgDescriptors() \
|
||||||
{ \
|
{ \
|
||||||
static const auto descriptors = INIT_ARG_DESCRIPTORS(argsMacro); \
|
static const auto descriptors = INIT_ARG_DESCRIPTORS(argsMacro); \
|
||||||
return descriptors; \
|
return descriptors; \
|
||||||
} \
|
} \
|
||||||
IInspectable GetArgAt(uint32_t index) const \
|
IInspectable GetArgAt(uint32_t index) const \
|
||||||
{ \
|
{ \
|
||||||
X_MACRO_INDEX_BASE(); \
|
X_MACRO_INDEX_BASE(); \
|
||||||
argsMacro(GET_ARG_BY_INDEX) return nullptr; \
|
argsMacro(GET_ARG_BY_INDEX) return nullptr; \
|
||||||
} \
|
} \
|
||||||
void SetArgAt(uint32_t index, IInspectable value) \
|
void SetArgAt(uint32_t index, IInspectable value) \
|
||||||
{ \
|
{ \
|
||||||
X_MACRO_INDEX_BASE(); \
|
X_MACRO_INDEX_BASE(); \
|
||||||
argsMacro(SET_ARG_BY_INDEX) \
|
argsMacro(SET_ARG_BY_INDEX) \
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user