10 #ifndef _D2D1_EFFECT_HELPERS_H_ 11 #define _D2D1_EFFECT_HELPERS_H_ 32 template<
class C,
typename P,
typename I>
46 return (static_cast<C *>(effect)->*
callback)(*
reinterpret_cast<const P *
>(
data));
58 template<
typename T, T P,
typename I>
60 _In_ IUnknown *effect,
81 template<
class C,
typename P,
typename I>
87 _Out_opt_
UINT32 *actualSize
92 *actualSize =
sizeof(
P);
99 return E_NOT_SUFFICIENT_BUFFER;
102 *
reinterpret_cast<P *
>(
data) = (static_cast<const C *>(effect)->*
callback)();
117 template<
typename T, T P,
typename I>
119 _In_
const IUnknown *effect,
122 _Out_opt_
UINT32 *actualSize
141 template<
class C,
typename I>
161 template<
typename T, T P,
typename I>
163 _In_ IUnknown *effect,
184 template<
class C,
typename I>
187 _In_
const I *effect,
190 _Out_opt_
UINT32 *actualSize
205 template<
typename T, T P,
typename I>
207 _In_
const IUnknown *effect,
210 _Out_opt_
UINT32 *actualSize
229 template<
class C,
typename I>
239 return (static_cast<C *>(effect)->*
callback)(
reinterpret_cast<PCWSTR
>(
data));
251 template<
typename T, T P,
typename I>
253 _In_ IUnknown *effect,
274 template<
class C,
typename I>
277 _In_
const I *effect,
280 _Out_opt_
UINT32 *actualSize
287 if ((SUCCEEDED(hr) || hr == E_NOT_SUFFICIENT_BUFFER) && actualSize)
289 *actualSize = cchString *
sizeof(WCHAR);
304 template<
typename T, T P,
typename I>
306 _In_
const IUnknown *effect,
309 _Out_opt_
UINT32 *actualSize
320 #define D2D1_SIMPLE_BINDING_MACROS 323 #ifdef D2D1_SIMPLE_BINDING_MACROS 329 T GetType(
T t) {
return t; };
334 #define D2D1_VALUE_TYPE_BINDING(NAME, SETTER, GETTER) \ 335 { NAME, &ValueSetter<decltype(GetType(SETTER)), SETTER, ID2D1EffectImpl>, &ValueGetter<decltype(GetType(GETTER)), GETTER, ID2D1EffectImpl> } 337 #define D2D1_BLOB_TYPE_BINDING(NAME, SETTER, GETTER) \ 338 { NAME, &BlobSetter<decltype(GetType(SETTER)), SETTER, ID2D1EffectImpl>, &BlobGetter<decltype(GetType(GETTER)), GETTER, ID2D1EffectImpl> } 340 #define D2D1_STRING_TYPE_BINDING(NAME, SETTER, GETTER) \ 341 { NAME, &StringSetter<decltype(GetType(SETTER)), SETTER, ID2D1EffectImpl>, &StringGetter<decltype(GetType(GETTER)), GETTER, ID2D1EffectImpl> } 346 #define D2D1_READONLY_VALUE_TYPE_BINDING(NAME, GETTER) \ 347 { NAME, NULL, &ValueGetter<decltype(GetType(GETTER)), GETTER, ID2D1EffectImpl> } 349 #define D2D1_READONLY_BLOB_TYPE_BINDING(NAME, GETTER) \ 350 { NAME, NULL, &BlobGetter<decltype(GetType(GETTER)), GETTER, ID2D1EffectImpl> } 352 #define D2D1_READONLY_STRING_TYPE_BINDING(NAME, GETTER) \ 353 { NAME, NULL, &StringGetter<decltype(GetType(GETTER)), GETTER, ID2D1EffectImpl> } 355 #else // #ifdef D2D1_SIMPLE_BINDING_MACROS 360 #define D2D1_VALUE_TYPE_BINDING(NAME, TYPE, CLASS, SETTER, GETTER) \ 363 &ValueSetter<HRESULT (CLASS::*)(TYPE), SETTER, ID2D1EffectImpl>, \ 364 &ValueGetter<TYPE (CLASS::*)() const, GETTER, ID2D1EffectImpl> \ 367 #define D2D1_BLOB_TYPE_BINDING(NAME, CLASS, SETTER, GETTER) \ 370 &BlobSetter<HRESULT (CLASS::*)(const BYTE *, UINT32), SETTER, ID2D1EffectImpl>, \ 371 &BlobGetter<HRESULT (CLASS::*)(BYTE *, UINT32, UINT32*) const, GETTER, ID2D1EffectImpl> \ 374 #define D2D1_STRING_TYPE_BINDING(NAME, CLASS, SETTER, GETTER) \ 377 &StringSetter<HRESULT (CLASS::*)(PCWSTR string), SETTER, ID2D1EffectImpl>, \ 378 &StringGetter<HRESULT (CLASS::*)(PWSTR, UINT32, UINT32*) const, GETTER, ID2D1EffectImpl> \ 384 #define D2D1_READONLY_VALUE_TYPE_BINDING(NAME, TYPE, CLASS, GETTER) \ 388 &ValueGetter<TYPE (CLASS::*)() const, GETTER, ID2D1EffectImpl> \ 391 #define D2D1_READONLY_BLOB_TYPE_BINDING(NAME, CLASS, GETTER) \ 395 &BlobGetter<HRESULT (CLASS::*)(BYTE *, UINT32, UINT32*) const, GETTER, ID2D1EffectImpl> \ 398 #define D2D1_READONLY_STRING_TYPE_BINDING(NAME, CLASS, GETTER) \ 402 &StringGetter<HRESULT (CLASS::*)(PWSTR, UINT32, UINT32*) const, GETTER, ID2D1EffectImpl> \ 405 #endif // #ifdef D2D1_SIMPLE_BINDING_MACROS 410 #endif // #ifndef _D2D1_AUTHOR_H_ HRESULT CALLBACK ValueGetter(_In_ const IUnknown *effect, _Out_writes_opt_(dataSize) BYTE *data, UINT32 dataSize, _Out_opt_ UINT32 *actualSize)
Definition: d2d1effecthelpers.h:118
GLdouble GLdouble t
Definition: glext.h:6398
#define P(a, b, c, d, k, s, t)
typedef HRESULT(WINAPI *PFN_D3D12_SERIALIZE_ROOT_SIGNATURE)(_In_ const D3D12_ROOT_SIGNATURE_DESC *pRootSignature
HRESULT DeducingValueGetter(_In_ P(C::*callback)() const, _In_ const I *effect, _Out_writes_opt_(dataSize) BYTE *data, UINT32 dataSize, _Out_opt_ UINT32 *actualSize)
Definition: d2d1effecthelpers.h:82
GLsizei GLsizei GLenum GLenum const GLvoid * data
Definition: glext.h:6303
void callback(s32 result, dvdcmdblk *block)
Definition: dvd.c:2293
HRESULT CALLBACK BlobSetter(_In_ IUnknown *effect, _In_reads_(dataSize) const BYTE *data, UINT32 dataSize)
Definition: d2d1effecthelpers.h:162
HRESULT DeducingBlobSetter(_In_ HRESULT(C::*callback)(const BYTE *, UINT32), _In_ I *effect, _In_reads_(dataSize) const BYTE *data, UINT32 dataSize)
Definition: d2d1effecthelpers.h:142
HRESULT DeducingValueSetter(_In_ HRESULT(C::*callback)(P), _In_ I *effect, _In_reads_(dataSize) const BYTE *data, UINT32 dataSize)
Definition: d2d1effecthelpers.h:33
GLenum GLsizei dataSize
Definition: glext.h:12030
HRESULT CALLBACK BlobGetter(_In_ const IUnknown *effect, _Out_writes_opt_(dataSize) BYTE *data, UINT32 dataSize, _Out_opt_ UINT32 *actualSize)
Definition: d2d1effecthelpers.h:206
uint32_t UINT32
Definition: coretypes.h:10
HRESULT CALLBACK ValueSetter(_In_ IUnknown *effect, _In_reads_(dataSize) const BYTE *data, UINT32 dataSize)
Definition: d2d1effecthelpers.h:59
HRESULT CALLBACK StringSetter(_In_ IUnknown *effect, _In_reads_(dataSize) const BYTE *data, UINT32 dataSize)
Definition: d2d1effecthelpers.h:252
HRESULT CALLBACK StringGetter(_In_ const IUnknown *effect, _Out_writes_opt_(dataSize) BYTE *data, UINT32 dataSize, _Out_opt_ UINT32 *actualSize)
Definition: d2d1effecthelpers.h:305
HRESULT DeducingStringSetter(_In_ HRESULT(C::*callback)(PCWSTR string), _In_ I *effect, _In_reads_(dataSize) const BYTE *data, UINT32 dataSize)
Definition: d2d1effecthelpers.h:230
HRESULT DeducingStringGetter(_In_ HRESULT(C::*callback)(PWSTR, UINT32, UINT32 *) const, _In_ const I *effect, _Out_writes_opt_(dataSize) BYTE *data, UINT32 dataSize, _Out_opt_ UINT32 *actualSize)
Definition: d2d1effecthelpers.h:275
HRESULT DeducingBlobGetter(_In_ HRESULT(C::*callback)(BYTE *, UINT32, UINT32 *) const, _In_ const I *effect, _Out_writes_opt_(dataSize) BYTE *data, UINT32 dataSize, _Out_opt_ UINT32 *actualSize)
Definition: d2d1effecthelpers.h:185