godot
godot copied to clipboard
Use forward-declarations in big editor classes
Follow up of #60684
Reduce the number of includes in some editor classes that are included a lot.
Add forward declarations in touched headers. Remove some unused includes.
I noticed you added some new includes in some .h files (editor node, canvas item editor, script text editor etc.). I assume you plan to handle them in follow-up PR(s)?
Not really. They need non-trivial refactoring (and in some cases you can't e.g., with subclasses), which I don't plan to do. What I'll do in follow-up PRs is to further forward declare stuff.
But includes are only needed when you inherit the class or define a method inside header. I checked these files and it doesn't seem to be the case there.
I checked these files and it doesn't seem to be the case there.
EditorData doesn't agree with you 😀
But includes are only needed when you inherit the class or define a method inside header
Another thing that can't be included are enums defined in classes. This is why, e.g., EditorNode needs editor_plugin.h
.
This is what I gather from a quick search. If there is some ~~obscure~~ C++ syntax for it, then I'm happy to use that and remove the includes.
Thanks!