Commit 858c6ed5 authored by David Gobbi's avatar David Gobbi
Browse files

Expand typedefs for the Tcl and Java wrappers

Even though typedefs have been handled by the Python wrappers ever since
VTK 6.0, this feature was never enabled for the Java and Tcl wrappers.
This problem was noticed when the vtkMTimeType typedef was introduced,
since it caused MTime methods to disappear from the Java/Tcl wrappers.
parent 2fd1d443
...@@ -866,6 +866,9 @@ int main(int argc, char *argv[]) ...@@ -866,6 +866,9 @@ int main(int argc, char *argv[])
{ {
/* resolve using declarations within the header files */ /* resolve using declarations within the header files */
vtkWrap_ApplyUsingDeclarations(data, file_info, hierarchyInfo); vtkWrap_ApplyUsingDeclarations(data, file_info, hierarchyInfo);
/* expand typedefs */
vtkWrap_ExpandTypedefs(data, file_info, hierarchyInfo);
} }
} }
......
...@@ -832,11 +832,37 @@ void vtkWrap_ExpandTypedefs( ...@@ -832,11 +832,37 @@ void vtkWrap_ExpandTypedefs(
{ {
vtkParseHierarchy_ExpandTypedefsInValue( vtkParseHierarchy_ExpandTypedefsInValue(
hinfo, funcInfo->Parameters[j], finfo->Strings, data->Name); hinfo, funcInfo->Parameters[j], finfo->Strings, data->Name);
#ifndef VTK_PARSE_LEGACY_REMOVE
if (j < MAX_ARGS)
{
if (vtkWrap_IsFunction(funcInfo->Parameters[j]))
{
// legacy args only allow "void func(void *)" functions
if (vtkWrap_IsVoidFunction(funcInfo->Parameters[j]))
{
funcInfo->ArgTypes[j] = VTK_PARSE_FUNCTION;
funcInfo->ArgClasses[j] = funcInfo->Parameters[j]->Class;
}
}
else
{
funcInfo->ArgTypes[j] = funcInfo->Parameters[j]->Type;
funcInfo->ArgClasses[j] = funcInfo->Parameters[j]->Class;
}
}
#endif
} }
if (funcInfo->ReturnValue) if (funcInfo->ReturnValue)
{ {
vtkParseHierarchy_ExpandTypedefsInValue( vtkParseHierarchy_ExpandTypedefsInValue(
hinfo, funcInfo->ReturnValue, finfo->Strings, data->Name); hinfo, funcInfo->ReturnValue, finfo->Strings, data->Name);
#ifndef VTK_PARSE_LEGACY_REMOVE
if (!vtkWrap_IsFunction(funcInfo->ReturnValue))
{
funcInfo->ReturnType = funcInfo->ReturnValue->Type;
funcInfo->ReturnClass = funcInfo->ReturnValue->Class;
}
#endif
} }
} }
} }
......
...@@ -1281,6 +1281,9 @@ int main(int argc, char *argv[]) ...@@ -1281,6 +1281,9 @@ int main(int argc, char *argv[])
{ {
/* resolve using declarations within the header files */ /* resolve using declarations within the header files */
vtkWrap_ApplyUsingDeclarations(data, file_info, hierarchyInfo); vtkWrap_ApplyUsingDeclarations(data, file_info, hierarchyInfo);
/* expand typedefs */
vtkWrap_ExpandTypedefs(data, file_info, hierarchyInfo);
} }
} }
......
...@@ -1099,6 +1099,9 @@ int main(int argc, char *argv[]) ...@@ -1099,6 +1099,9 @@ int main(int argc, char *argv[])
{ {
/* resolve using declarations within the header files */ /* resolve using declarations within the header files */
vtkWrap_ApplyUsingDeclarations(data, file_info, hierarchyInfo); vtkWrap_ApplyUsingDeclarations(data, file_info, hierarchyInfo);
/* expand typedefs to get the real types */
vtkWrap_ExpandTypedefs(data, file_info, hierarchyInfo);
} }
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment