The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

698 lines
28KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE 6 technical preview.
  4. Copyright (c) 2017 - ROLI Ltd.
  5. You may use this code under the terms of the GPL v3
  6. (see www.gnu.org/licenses).
  7. For this technical preview, this file is not subject to commercial licensing.
  8. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  9. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  10. DISCLAIMED.
  11. ==============================================================================
  12. */
  13. #pragma once
  14. //==============================================================================
  15. class ModuleItem : public ProjectTreeItemBase
  16. {
  17. public:
  18. ModuleItem (Project& p, const String& modID)
  19. : project (p), moduleID (modID)
  20. {
  21. missingDependencies = project.getEnabledModules().getExtraDependenciesNeeded (moduleID).size() > 0;
  22. cppStandardHigherThanProject = project.getEnabledModules().doesModuleHaveHigherCppStandardThanProject (moduleID);
  23. moduleInfo = project.getEnabledModules().getModuleInfo (moduleID);
  24. }
  25. bool canBeSelected() const override { return true; }
  26. bool mightContainSubItems() override { return false; }
  27. String getUniqueName() const override { return "module_" + moduleID; }
  28. String getDisplayName() const override { return moduleID; }
  29. String getRenamingName() const override { return getDisplayName(); }
  30. void setName (const String&) override {}
  31. bool isMissing() const override { return missingDependencies; }
  32. bool hasWarnings() const override { return cppStandardHigherThanProject; }
  33. void showDocument() override
  34. {
  35. showSettingsPage (new ModuleSettingsPanel (project, moduleID, getOwnerView()));
  36. }
  37. void deleteItem() override
  38. {
  39. closeSettingsPage();
  40. project.getEnabledModules().removeModule (moduleID);
  41. }
  42. Icon getIcon() const override
  43. {
  44. auto iconColour = getOwnerView()->findColour (isSelected() ? defaultHighlightedTextColourId
  45. : treeIconColourId);
  46. if (! isSelected())
  47. {
  48. if (moduleInfo.isValid() && moduleInfo.getVendor() == "juce")
  49. {
  50. if (moduleInfo.getLicense() == "ISC")
  51. iconColour = Colours::lightblue;
  52. else if (moduleInfo.getLicense() == "GPL/Commercial")
  53. iconColour = Colours::orange;
  54. }
  55. }
  56. return Icon (getIcons().singleModule, iconColour);
  57. }
  58. void showAddMenu() override
  59. {
  60. if (auto* parent = dynamic_cast<EnabledModulesItem*> (getParentItem()))
  61. parent->showPopupMenu();
  62. }
  63. void showPopupMenu() override
  64. {
  65. PopupMenu menu;
  66. menu.addItem (1, "Remove this module");
  67. launchPopupMenu (menu);
  68. }
  69. void handlePopupMenuResult (int resultCode) override
  70. {
  71. if (resultCode == 1)
  72. deleteItem();
  73. }
  74. bool checkCppStandard()
  75. {
  76. auto oldVal = cppStandardHigherThanProject;
  77. cppStandardHigherThanProject = project.getEnabledModules().doesModuleHaveHigherCppStandardThanProject (moduleID);
  78. if (oldVal != cppStandardHigherThanProject)
  79. return true;
  80. return false;
  81. }
  82. Project& project;
  83. String moduleID;
  84. private:
  85. ModuleDescription moduleInfo;
  86. bool missingDependencies = false;
  87. bool cppStandardHigherThanProject = false;
  88. //==============================================================================
  89. class ModuleSettingsPanel : public Component,
  90. private Value::Listener,
  91. private Timer
  92. {
  93. public:
  94. ModuleSettingsPanel (Project& p, const String& modID, TreeView* tree)
  95. : group (p.getEnabledModules().getModuleInfo (modID).getID(),
  96. Icon (getIcons().singleModule, Colours::transparentBlack)),
  97. project (p),
  98. modulesTree (tree),
  99. moduleID (modID)
  100. {
  101. addAndMakeVisible (group);
  102. refresh();
  103. }
  104. void refresh()
  105. {
  106. auto& modules = project.getEnabledModules();
  107. setEnabled (modules.isModuleEnabled (moduleID));
  108. PropertyListBuilder props;
  109. props.add (new ModuleInfoComponent (project, moduleID));
  110. if (modules.getExtraDependenciesNeeded (moduleID).size() > 0)
  111. props.add (new MissingDependenciesComponent (project, moduleID));
  112. if (modules.doesModuleHaveHigherCppStandardThanProject (moduleID))
  113. props.add (new CppStandardWarningComponent());
  114. group.properties.clear();
  115. exporterModulePathDefaultValues.clear();
  116. exporterModulePathValues.clear();
  117. globalPathValues.clear();
  118. for (Project::ExporterIterator exporter (project); exporter.next();)
  119. {
  120. if (exporter->isCLion())
  121. continue;
  122. exporterModulePathDefaultValues.add (exporter->getPathForModuleValue (moduleID));
  123. auto& defaultValue = exporterModulePathDefaultValues.getReference (exporterModulePathDefaultValues.size() - 1);
  124. exporterModulePathValues.add (defaultValue.getPropertyAsValue());
  125. auto pathComponent = std::make_unique<FilePathPropertyComponent> (defaultValue,
  126. "Path for " + exporter->getName().quoted(),
  127. true,
  128. exporter->getTargetOSForExporter() == TargetOS::getThisOS(),
  129. "*",
  130. project.getProjectFolder());
  131. pathComponent->setEnabled (! modules.shouldUseGlobalPath (moduleID));
  132. props.add (pathComponent.release(),
  133. "A path to the folder that contains the " + moduleID + " module when compiling the "
  134. + exporter->getName().quoted() + " target. "
  135. "This can be an absolute path, or relative to the jucer project folder, but it "
  136. "must be valid on the filesystem of the target machine that will be performing this build. If this "
  137. "is empty then the global path will be used.");
  138. globalPathValues.add (getAppSettings().getStoredPath (isJUCEModule (moduleID) ? Ids::defaultJuceModulePath : Ids::defaultUserModulePath,
  139. exporter->getTargetOSForExporter()).getPropertyAsValue());
  140. }
  141. for (int i = 0; i < exporterModulePathDefaultValues.size(); ++i)
  142. {
  143. exporterModulePathDefaultValues.getReference (i).onDefaultChange = [this] { startTimer (50); };
  144. exporterModulePathValues.getReference (i).addListener (this);
  145. globalPathValues.getReference (i).addListener (this);
  146. }
  147. useGlobalPathValue.removeListener (this);
  148. useGlobalPathValue.referTo (modules.shouldUseGlobalPathValue (moduleID));
  149. useGlobalPathValue.addListener (this);
  150. auto menuItemString = (TargetOS::getThisOS() == TargetOS::osx ? "\"Projucer->Global Paths...\""
  151. : "\"File->Global Paths...\"");
  152. props.add (new BooleanPropertyComponent (useGlobalPathValue,
  153. "Use global path", "Use global path for this module"),
  154. String ("If this is enabled, then the locally-stored global path (set in the ") + menuItemString + " menu item) "
  155. "will be used as the path to this module. "
  156. "This means that if this Projucer project is opened on another machine it will use that machine's global path as the path to this module.");
  157. props.add (new BooleanPropertyComponent (modules.shouldCopyModuleFilesLocallyValue (moduleID),
  158. "Create local copy", "Copy the module into the project folder"),
  159. "If this is enabled, then a local copy of the entire module will be made inside your project (in the auto-generated JuceLibraryFiles folder), "
  160. "so that your project will be self-contained, and won't need to contain any references to files in other folders. "
  161. "This also means that you can check the module into your source-control system to make sure it is always in sync with your own code.");
  162. props.add (new BooleanPropertyComponent (modules.shouldShowAllModuleFilesInProjectValue (moduleID),
  163. "Add source to project", "Make module files browsable in projects"),
  164. "If this is enabled, then the entire source tree from this module will be shown inside your project, "
  165. "making it easy to browse/edit the module's classes. If disabled, then only the minimum number of files "
  166. "required to compile it will appear inside your project.");
  167. auto info = modules.getModuleInfo (moduleID);
  168. if (info.isValid())
  169. {
  170. configFlags.clear();
  171. LibraryModule (info).getConfigFlags (project, configFlags);
  172. for (auto* flag : configFlags)
  173. {
  174. auto* c = new ChoicePropertyComponent (flag->value, flag->symbol);
  175. c->setTooltip (flag->description);
  176. props.add (c);
  177. }
  178. }
  179. group.setProperties (props);
  180. parentSizeChanged();
  181. }
  182. void parentSizeChanged() override { updateSize (*this, group); }
  183. void resized() override { group.setBounds (getLocalBounds().withTrimmedLeft (12)); }
  184. String getModuleID() const noexcept { return moduleID; }
  185. private:
  186. void valueChanged (Value& v) override
  187. {
  188. auto isExporterPathValue = [&]
  189. {
  190. for (auto& exporterValue : exporterModulePathValues)
  191. if (exporterValue.refersToSameSourceAs (v))
  192. return true;
  193. return false;
  194. }();
  195. if (isExporterPathValue)
  196. project.rescanExporterPathModules();
  197. startTimer (50);
  198. }
  199. void timerCallback() override
  200. {
  201. stopTimer();
  202. refresh();
  203. }
  204. //==============================================================================
  205. Array<ValueWithDefault> exporterModulePathDefaultValues;
  206. Array<Value> exporterModulePathValues, globalPathValues;
  207. Value useGlobalPathValue;
  208. OwnedArray <Project::ConfigFlag> configFlags;
  209. PropertyGroupComponent group;
  210. Project& project;
  211. SafePointer<TreeView> modulesTree;
  212. String moduleID;
  213. //==============================================================================
  214. class ModuleInfoComponent : public PropertyComponent,
  215. private Value::Listener
  216. {
  217. public:
  218. ModuleInfoComponent (Project& p, const String& modID)
  219. : PropertyComponent ("Module", 150), project (p), moduleID (modID)
  220. {
  221. for (Project::ExporterIterator exporter (project); exporter.next();)
  222. listeningValues.add (new Value (exporter->getPathForModuleValue (moduleID).getPropertyAsValue()))->addListener (this);
  223. refresh();
  224. }
  225. void refresh() override
  226. {
  227. info = project.getEnabledModules().getModuleInfo (moduleID);
  228. repaint();
  229. }
  230. private:
  231. void paint (Graphics& g) override
  232. {
  233. auto bounds = getLocalBounds().reduced (10);
  234. bounds.removeFromTop (5);
  235. if (info.isValid())
  236. {
  237. auto topSlice = bounds.removeFromTop (bounds.getHeight() / 2);
  238. bounds.removeFromTop (bounds.getHeight() / 6);
  239. auto bottomSlice = bounds;
  240. g.setColour (findColour (defaultTextColourId));
  241. g.drawFittedText (info.getName(), topSlice.removeFromTop (topSlice.getHeight() / 4), Justification::centredLeft, 1);
  242. g.drawFittedText ("Version: " + info.getVersion(), topSlice.removeFromTop (topSlice.getHeight() / 3), Justification::centredLeft, 1);
  243. g.drawFittedText ("License: " + info.getLicense(), topSlice.removeFromTop (topSlice.getHeight() / 2), Justification::centredLeft, 1);
  244. g.drawFittedText ("Location: " + info.getFolder().getParentDirectory().getFullPathName(),
  245. topSlice.removeFromTop (topSlice.getHeight()), Justification::centredLeft, 1);
  246. g.drawFittedText (info.getDescription(), bottomSlice, Justification::topLeft, 3, 1.0f);
  247. }
  248. else
  249. {
  250. g.setColour (Colours::red);
  251. g.drawFittedText ("Cannot find this module at the specified path!", bounds, Justification::centred, 1);
  252. }
  253. }
  254. void valueChanged (Value&) override
  255. {
  256. refresh();
  257. }
  258. Project& project;
  259. String moduleID;
  260. OwnedArray<Value> listeningValues;
  261. ModuleDescription info;
  262. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ModuleInfoComponent)
  263. };
  264. //==============================================================================
  265. class MissingDependenciesComponent : public PropertyComponent
  266. {
  267. public:
  268. MissingDependenciesComponent (Project& p, const String& modID)
  269. : PropertyComponent ("Dependencies", 100),
  270. project (p), moduleID (modID),
  271. missingDependencies (project.getEnabledModules().getExtraDependenciesNeeded (modID))
  272. {
  273. addAndMakeVisible (fixButton);
  274. fixButton.setColour (TextButton::buttonColourId, Colours::red);
  275. fixButton.setColour (TextButton::textColourOffId, Colours::white);
  276. fixButton.onClick = [this] { fixDependencies(); };
  277. }
  278. void refresh() override {}
  279. void paint (Graphics& g) override
  280. {
  281. String text ("This module has missing dependencies!\n\n"
  282. "To build correctly, it requires the following modules to be added:\n");
  283. text << missingDependencies.joinIntoString (", ");
  284. g.setColour (Colours::red);
  285. g.drawFittedText (text, getLocalBounds().reduced (10), Justification::topLeft, 3);
  286. }
  287. void fixDependencies()
  288. {
  289. if (! tryToFix())
  290. {
  291. AlertWindow::showMessageBoxAsync (AlertWindow::WarningIcon,
  292. "Adding Missing Dependencies",
  293. "Couldn't locate some of these modules - you'll need to find their "
  294. "folders manually and add them to the list.");
  295. return;
  296. }
  297. refreshAndReselectItem();
  298. }
  299. void resized() override
  300. {
  301. fixButton.setBounds (getWidth() - 168, getHeight() - 26, 160, 22);
  302. }
  303. private:
  304. Project& project;
  305. String moduleID;
  306. StringArray missingDependencies;
  307. TextButton fixButton { "Add Required Modules" };
  308. bool tryToFix()
  309. {
  310. auto& enabledModules = project.getEnabledModules();
  311. auto copyLocally = enabledModules.areMostModulesCopiedLocally();
  312. auto useGlobalPath = enabledModules.areMostModulesUsingGlobalPath();
  313. StringArray missing;
  314. for (auto missingModule : missingDependencies)
  315. {
  316. auto mod = project.getModuleWithID (missingModule);
  317. if (mod.second != File())
  318. enabledModules.addModule (mod.second, copyLocally, useGlobalPath);
  319. else
  320. missing.add (missingModule);
  321. }
  322. missingDependencies.swapWith (missing);
  323. return (missingDependencies.size() == 0);
  324. }
  325. void refreshAndReselectItem()
  326. {
  327. if (auto* settingsPanel = findParentComponentOfClass<ModuleSettingsPanel>())
  328. {
  329. if (settingsPanel->modulesTree == nullptr)
  330. return;
  331. auto* rootItem = settingsPanel->modulesTree->getRootItem();
  332. if (rootItem == nullptr)
  333. return;
  334. for (int i = 0; i < rootItem->getNumSubItems(); ++i)
  335. {
  336. if (auto* subItem = dynamic_cast<ProjectTreeItemBase*> (rootItem->getSubItem (i)))
  337. {
  338. if (subItem->getDisplayName() == moduleID)
  339. {
  340. subItem->setSelected (true, true);
  341. return;
  342. }
  343. }
  344. }
  345. }
  346. }
  347. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MissingDependenciesComponent)
  348. };
  349. //==============================================================================
  350. struct CppStandardWarningComponent : public PropertyComponent
  351. {
  352. CppStandardWarningComponent()
  353. : PropertyComponent ("CppStandard", 100)
  354. {
  355. }
  356. void refresh() override {}
  357. void paint (Graphics& g) override
  358. {
  359. auto text = String ("This module has a higher C++ language standard requirement than your project!\n\n"
  360. "To use this module you need to increase the C++ standard of the project.\n");
  361. g.setColour (findColour (defaultHighlightColourId));
  362. g.drawFittedText (text, getLocalBounds().reduced (10), Justification::topLeft, 3);
  363. }
  364. StringArray configsToWarnAbout;
  365. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (CppStandardWarningComponent)
  366. };
  367. };
  368. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ModuleItem)
  369. };
  370. //==============================================================================
  371. class EnabledModulesItem : public ProjectTreeItemBase,
  372. private Value::Listener,
  373. private AvailableModuleList::Listener
  374. {
  375. public:
  376. EnabledModulesItem (Project& p)
  377. : project (p),
  378. moduleListTree (project.getEnabledModules().getState())
  379. {
  380. moduleListTree.addListener (this);
  381. projectCppStandardValue.referTo (project.getProjectValue (Ids::cppLanguageStandard));
  382. projectCppStandardValue.addListener (this);
  383. ProjucerApplication::getApp().getJUCEPathModuleList().addListener (this);
  384. ProjucerApplication::getApp().getUserPathsModuleList().addListener (this);
  385. project.getExporterPathsModuleList().addListener (this);
  386. }
  387. ~EnabledModulesItem() override
  388. {
  389. ProjucerApplication::getApp().getJUCEPathModuleList().removeListener (this);
  390. ProjucerApplication::getApp().getUserPathsModuleList().removeListener (this);
  391. project.getExporterPathsModuleList().removeListener (this);
  392. }
  393. int getItemHeight() const override { return 22; }
  394. bool isModulesList() const override { return true; }
  395. bool canBeSelected() const override { return true; }
  396. bool mightContainSubItems() override { return true; }
  397. String getUniqueName() const override { return "modules"; }
  398. String getRenamingName() const override { return getDisplayName(); }
  399. String getDisplayName() const override { return "Modules"; }
  400. void setName (const String&) override {}
  401. bool isMissing() const override { return false; }
  402. Icon getIcon() const override { return Icon (getIcons().graph, getContentColour (true)); }
  403. void showDocument() override
  404. {
  405. if (auto* pcc = getProjectContentComponent())
  406. pcc->setEditorComponent (new ModulesInformationComponent (project), nullptr);
  407. }
  408. static File getModuleFolder (const File& draggedFile)
  409. {
  410. if (draggedFile.hasFileExtension (headerFileExtensions))
  411. return draggedFile.getParentDirectory();
  412. return draggedFile;
  413. }
  414. bool isInterestedInFileDrag (const StringArray& files) override
  415. {
  416. for (auto i = files.size(); --i >= 0;)
  417. if (ModuleDescription (getModuleFolder (files[i])).isValid())
  418. return true;
  419. return false;
  420. }
  421. void filesDropped (const StringArray& files, int /*insertIndex*/) override
  422. {
  423. Array<ModuleDescription> modules;
  424. for (auto f : files)
  425. {
  426. ModuleDescription m (getModuleFolder (f));
  427. if (m.isValid())
  428. modules.add (m);
  429. }
  430. for (int i = 0; i < modules.size(); ++i)
  431. project.getEnabledModules().addModule (modules.getReference(i).moduleFolder,
  432. project.getEnabledModules().areMostModulesCopiedLocally(),
  433. project.getEnabledModules().areMostModulesUsingGlobalPath());
  434. }
  435. void addSubItems() override
  436. {
  437. for (int i = 0; i < project.getEnabledModules().getNumModules(); ++i)
  438. addSubItem (new ModuleItem (project, project.getEnabledModules().getModuleID (i)));
  439. }
  440. void showPopupMenu() override
  441. {
  442. auto& enabledModules = project.getEnabledModules();
  443. PopupMenu allModules;
  444. int index = 100;
  445. // JUCE path
  446. PopupMenu jucePathModules;
  447. for (auto& mod : ProjucerApplication::getApp().getJUCEPathModuleList().getAllModules())
  448. jucePathModules.addItem (index++, mod.first, ! enabledModules.isModuleEnabled (mod.first));
  449. jucePathModules.addSeparator();
  450. jucePathModules.addItem (-1, "Re-scan path");
  451. allModules.addSubMenu ("Global JUCE modules path", jucePathModules);
  452. // User path
  453. index = 200;
  454. PopupMenu userPathModules;
  455. for (auto& mod : ProjucerApplication::getApp().getUserPathsModuleList().getAllModules())
  456. userPathModules.addItem (index++, mod.first, ! enabledModules.isModuleEnabled (mod.first));
  457. userPathModules.addSeparator();
  458. userPathModules.addItem (-2, "Re-scan path");
  459. allModules.addSubMenu ("Global user modules path", userPathModules);
  460. // Exporter path
  461. index = 300;
  462. PopupMenu exporterPathModules;
  463. for (auto& mod : project.getExporterPathsModuleList().getAllModules())
  464. exporterPathModules.addItem (index++, mod.first, ! enabledModules.isModuleEnabled (mod.first));
  465. exporterPathModules.addSeparator();
  466. exporterPathModules.addItem (-3, "Re-scan path");
  467. allModules.addSubMenu ("Exporter paths", exporterPathModules);
  468. PopupMenu menu;
  469. menu.addSubMenu ("Add a module", allModules);
  470. menu.addSeparator();
  471. menu.addItem (1001, "Add a module from a specified folder...");
  472. launchPopupMenu (menu);
  473. }
  474. void handlePopupMenuResult (int resultCode) override
  475. {
  476. if (resultCode == 1001)
  477. {
  478. project.getEnabledModules().addModuleFromUserSelectedFile();
  479. }
  480. else if (resultCode < 0)
  481. {
  482. if (resultCode == -1) ProjucerApplication::getApp().rescanJUCEPathModules();
  483. else if (resultCode == -2) ProjucerApplication::getApp().rescanUserPathModules();
  484. else if (resultCode == -3) project.rescanExporterPathModules();
  485. }
  486. else if (resultCode > 0)
  487. {
  488. std::vector<AvailableModuleList::ModuleIDAndFolder> list;
  489. int offset = -1;
  490. if (resultCode < 200)
  491. {
  492. list = ProjucerApplication::getApp().getJUCEPathModuleList().getAllModules();
  493. offset = 100;
  494. }
  495. else if (resultCode < 300)
  496. {
  497. list = ProjucerApplication::getApp().getUserPathsModuleList().getAllModules();
  498. offset = 200;
  499. }
  500. else if (resultCode < 400)
  501. {
  502. list = project.getExporterPathsModuleList().getAllModules();
  503. offset = 300;
  504. }
  505. if (offset != -1)
  506. project.getEnabledModules().addModuleInteractive (list[(size_t) (resultCode - offset)].first);
  507. }
  508. }
  509. //==============================================================================
  510. void valueTreeChildAdded (ValueTree& parentTree, ValueTree&) override { refreshIfNeeded (parentTree); }
  511. void valueTreeChildRemoved (ValueTree& parentTree, ValueTree&, int) override { refreshIfNeeded (parentTree); }
  512. void valueTreeChildOrderChanged (ValueTree& parentTree, int, int) override { refreshIfNeeded (parentTree); }
  513. void refreshIfNeeded (ValueTree& changedTree)
  514. {
  515. if (changedTree == moduleListTree)
  516. refreshSubItems();
  517. }
  518. private:
  519. Project& project;
  520. ValueTree moduleListTree;
  521. Value projectCppStandardValue;
  522. //==============================================================================
  523. void valueChanged (Value& v) override
  524. {
  525. if (v == projectCppStandardValue)
  526. {
  527. for (int i = 0; i < getNumSubItems(); ++i)
  528. {
  529. if (auto* moduleItem = dynamic_cast<ModuleItem*> (getSubItem (i)))
  530. {
  531. if (moduleItem->checkCppStandard())
  532. {
  533. refreshSubItems();
  534. return;
  535. }
  536. }
  537. }
  538. }
  539. }
  540. void removeDuplicateModules()
  541. {
  542. auto jucePathModuleList = ProjucerApplication::getApp().getJUCEPathModuleList().getAllModules();
  543. auto& userPathModules = ProjucerApplication::getApp().getUserPathsModuleList();
  544. userPathModules.removeDuplicates (jucePathModuleList);
  545. auto& exporterPathModules = project.getExporterPathsModuleList();
  546. exporterPathModules.removeDuplicates (jucePathModuleList);
  547. exporterPathModules.removeDuplicates (userPathModules.getAllModules());
  548. }
  549. void availableModulesChanged() override
  550. {
  551. removeDuplicateModules();
  552. refreshSubItems();
  553. }
  554. //==============================================================================
  555. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (EnabledModulesItem)
  556. };