Hi folks,
i have an idea....
I currently working on the DirectX Header translations.
Now there are many codes like this one:
STDMETHOD_(void, GetOutput)(
_Outptr_ ID2D1Image **outputImage
) CONST PURE;
COM_DECLSPEC_NOTHROW
void
SetInputEffect(
UINT32 index,
_In_opt_ ID2D1Effect *inputEffect,
BOOL invalidate = TRUE
)
{
ID2D1Image *output = NULL;
if (inputEffect != NULL)
{
inputEffect->GetOutput(&output);
}
SetInput(index, output, invalidate);
if (output != NULL)
{
output->Release();
}
}
well, the first function (GetOutput) is no problem, a normal definition of a interface function.
but the seconde ( SetInputEffect) is terrible to translate to pascal, no idea how...
if calling this function, in C++ simple the code provided is executed....
So the idea is to add the INLINE function to the interface definition in fpc.
The above could look as:
procedure GetOutput(
out outputImage :ID2D1Image
); stdcall;
procedure SetInputEffect( index:UINT32;
inputEffect:ID2D1Effect = nil;
invalidate: boolean = TRUE
) ; inline;
so with the INLINE directive the compiler replaces the call with the provided code (which has to be coded in the implementation section).
is this possible ? since the directive do the same for "normal" functions this should be possible for interfaces too I think, even i'm not a compiler-programer
would be a nice feature
PS: sorry for my bad english