GraphCanvasEditorModule.cpp 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include <GraphCanvasModule.h>
  9. #include <GraphCanvas.h>
  10. #include <Components/BookmarkAnchor/BookmarkAnchorComponent.h>
  11. #include <Components/BookmarkAnchor/BookmarkAnchorLayerControllerComponent.h>
  12. #include <Components/BookmarkAnchor/BookmarkAnchorVisualComponent.h>
  13. #include <Components/BookmarkManagerComponent.h>
  14. #include <Components/GeometryComponent.h>
  15. #include <Components/GridComponent.h>
  16. #include <Components/GridVisualComponent.h>
  17. #include <Components/PersistentIdComponent.h>
  18. #include <Components/SceneComponent.h>
  19. #include <Components/SceneMemberComponent.h>
  20. #include <Components/StylingComponent.h>
  21. #include <Components/Connections/ConnectionComponent.h>
  22. #include <Components/Connections/ConnectionLayerControllerComponent.h>
  23. #include <Components/Connections/ConnectionVisualComponent.h>
  24. #include <Components/Connections/DataConnections/DataConnectionComponent.h>
  25. #include <Components/Connections/DataConnections/DataConnectionVisualComponent.h>
  26. #include <Components/Nodes/NodeComponent.h>
  27. #include <Components/Nodes/NodeLayerControllerComponent.h>
  28. #include <Components/Nodes/Comment/CommentLayerControllerComponent.h>
  29. #include <Components/Nodes/Comment/CommentNodeFrameComponent.h>
  30. #include <Components/Nodes/Comment/CommentNodeLayoutComponent.h>
  31. #include <Components/Nodes/Comment/CommentNodeTextComponent.h>
  32. #include <Components/Nodes/General/GeneralNodeFrameComponent.h>
  33. #include <Components/Nodes/General/GeneralNodeLayoutComponent.h>
  34. #include <Components/Nodes/General/GeneralNodeTitleComponent.h>
  35. #include <Components/Nodes/General/GeneralSlotLayoutComponent.h>
  36. #include <Components/Nodes/Group/CollapsedNodeGroupComponent.h>
  37. #include <Components/Nodes/Group/NodeGroupLayoutComponent.h>
  38. #include <Components/Nodes/Group/NodeGroupLayerControllerComponent.h>
  39. #include <Components/Nodes/Group/NodeGroupFrameComponent.h>
  40. #include <Components/Nodes/Wrapper/WrapperNodeLayoutComponent.h>
  41. #include <Components/Slots/SlotComponent.h>
  42. #include <Components/Slots/SlotConnectionFilterComponent.h>
  43. #include <Components/Slots/Data/DataSlotComponent.h>
  44. #include <Components/Slots/Data/DataSlotLayoutComponent.h>
  45. #include <Components/Slots/Default/DefaultSlotLayoutComponent.h>
  46. #include <Components/Slots/Execution/ExecutionSlotComponent.h>
  47. #include <Components/Slots/Execution/ExecutionSlotLayoutComponent.h>
  48. #include <Components/Slots/Extender/ExtenderSlotComponent.h>
  49. #include <Components/Slots/Extender/ExtenderSlotLayoutComponent.h>
  50. #include <Components/Slots/Property/PropertySlotComponent.h>
  51. #include <Components/Slots/Property/PropertySlotLayoutComponent.h>
  52. #include <GraphCanvas/Components/ColorPaletteManager/ColorPaletteManagerComponent.h>
  53. #include <GraphCanvas/Components/GraphCanvasPropertyBus.h>
  54. #include <GraphCanvas/Styling/Style.h>
  55. #include <GraphCanvas/Styling/StyleManager.h>
  56. #include <GraphCanvas/Styling/PseudoElement.h>
  57. namespace GraphCanvas
  58. {
  59. //! Create ComponentDescriptors and add them to the list.
  60. //! The descriptors will be registered at the appropriate time.
  61. //! The descriptors will be destroyed (and thus unregistered) at the appropriate time.
  62. GraphCanvasModule::GraphCanvasModule()
  63. {
  64. m_descriptors.insert(m_descriptors.end(), {
  65. // Components
  66. BookmarkManagerComponent::CreateDescriptor(),
  67. GraphCanvasPropertyComponent::CreateDescriptor(),
  68. GraphCanvasSystemComponent::CreateDescriptor(),
  69. LayerControllerComponent::CreateDescriptor(),
  70. PersistentIdComponent::CreateDescriptor(),
  71. SceneComponent::CreateDescriptor(),
  72. SceneMemberComponent::CreateDescriptor(),
  73. // Background Grid
  74. GridComponent::CreateDescriptor(),
  75. GridVisualComponent::CreateDescriptor(),
  76. // BookmarkAnchor
  77. BookmarkAnchorComponent::CreateDescriptor(),
  78. BookmarkAnchorLayerControllerComponent::CreateDescriptor(),
  79. BookmarkAnchorVisualComponent::CreateDescriptor(),
  80. // General
  81. GeometryComponent::CreateDescriptor(),
  82. // Connections
  83. ConnectionComponent::CreateDescriptor(),
  84. ConnectionLayerControllerComponent::CreateDescriptor(),
  85. ConnectionVisualComponent::CreateDescriptor(),
  86. // Connections::DataConnections
  87. DataConnectionComponent::CreateDescriptor(),
  88. DataConnectionVisualComponent::CreateDescriptor(),
  89. // Nodes
  90. NodeComponent::CreateDescriptor(),
  91. NodeLayerControllerComponent::CreateDescriptor(),
  92. NodeLayoutComponent::CreateDescriptor(),
  93. // CommentNode
  94. CommentLayerControllerComponent::CreateDescriptor(),
  95. CommentNodeFrameComponent::CreateDescriptor(),
  96. CommentNodeLayoutComponent::CreateDescriptor(),
  97. CommentNodeTextComponent::CreateDescriptor(),
  98. // GeneralNode
  99. GeneralNodeTitleComponent::CreateDescriptor(),
  100. GeneralSlotLayoutComponent::CreateDescriptor(),
  101. GeneralNodeFrameComponent::CreateDescriptor(),
  102. GeneralNodeLayoutComponent::CreateDescriptor(),
  103. // NodeGroup
  104. CollapsedNodeGroupComponent::CreateDescriptor(),
  105. NodeGroupLayerControllerComponent::CreateDescriptor(),
  106. NodeGroupLayoutComponent::CreateDescriptor(),
  107. NodeGroupFrameComponent::CreateDescriptor(),
  108. // Wrapper Node
  109. WrapperNodeLayoutComponent::CreateDescriptor(),
  110. // Slots
  111. SlotComponent::CreateDescriptor(),
  112. SlotConnectionFilterComponent::CreateDescriptor(),
  113. DefaultSlotLayoutComponent::CreateDescriptor(),
  114. // Data Slots
  115. DataSlotComponent::CreateDescriptor(),
  116. DataSlotLayoutComponent::CreateDescriptor(),
  117. // Execution Slots
  118. ExecutionSlotComponent::CreateDescriptor(),
  119. ExecutionSlotLayoutComponent::CreateDescriptor(),
  120. // Extender Slots
  121. ExtenderSlotComponent::CreateDescriptor(),
  122. ExtenderSlotLayoutComponent::CreateDescriptor(),
  123. // Property Slots
  124. PropertySlotComponent::CreateDescriptor(),
  125. PropertySlotLayoutComponent::CreateDescriptor(),
  126. // Styling
  127. StylingComponent::CreateDescriptor(),
  128. Styling::ComputedStyle::CreateDescriptor(),
  129. Styling::VirtualChildElement::CreateDescriptor(),
  130. // Deprecated Components
  131. Deprecated::ColorPaletteManagerComponent::CreateDescriptor(),
  132. Deprecated::StyleSheetComponent::CreateDescriptor()
  133. });
  134. }
  135. //! Request system components on the system entity.
  136. //! These components' memory is owned by the system entity.
  137. AZ::ComponentTypeList GraphCanvasModule::GetRequiredSystemComponents() const
  138. {
  139. return{
  140. azrtti_typeid<GraphCanvasSystemComponent>(),
  141. };
  142. }
  143. }
  144. // Qt resources are defined in the GraphCanvas static library, so we must
  145. // initialize them manually
  146. extern int qInitResources_GraphCanvasEditorResources();
  147. extern int qCleanupResources_GraphCanvasEditorResources();
  148. namespace {
  149. struct initializer {
  150. initializer() { qInitResources_GraphCanvasEditorResources(); }
  151. ~initializer() { qCleanupResources_GraphCanvasEditorResources(); }
  152. } dummy;
  153. }
  154. #if defined(O3DE_GEM_NAME)
  155. AZ_DECLARE_MODULE_CLASS(AZ_JOIN(Gem_, O3DE_GEM_NAME, _Editor), GraphCanvas::GraphCanvasModule)
  156. #else
  157. AZ_DECLARE_MODULE_CLASS(Gem_GraphCanvas_Editor, GraphCanvas::GraphCanvasModule)
  158. #endif