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.

ovdCApplication.h 5.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. #pragma once
  2. #include <visualization-toolkit/ovvizIVisualizationManager.h>
  3. #include "ovd_base.h"
  4. #include "archway/ovdCArchwayHandler.h"
  5. #include "archway/ovdCArchwayHandlerGUI.h"
  6. #define OVD_ScenarioImportContext_OpenScenario OpenViBE::CIdentifier(0xA180DB91, 0x19235AEE)
  7. #define OVD_ScenarioExportContext_SaveScenario OpenViBE::CIdentifier(0xC98C47AD, 0xCBD952B2)
  8. #define OVD_ScenarioExportContext_SaveMetabox OpenViBE::CIdentifier(0x529494F1, 0x6C2527D9)
  9. #include <vector>
  10. namespace OpenViBE {
  11. namespace Designer {
  12. class CInterfacedScenario;
  13. class CLogListenerDesigner;
  14. class CApplication
  15. {
  16. public:
  17. explicit CApplication(const Kernel::IKernelContext& ctx);
  18. ~CApplication();
  19. void initialize(ECommandLineFlag cmdLineFlags);
  20. bool openScenario(const char* filename);
  21. /** \name Drag and drop management */
  22. //@{
  23. void dragDataGetCB(GtkWidget* widget, GdkDragContext* dragCtx, GtkSelectionData* selectionData, guint info, guint time) const;
  24. //@}
  25. /** \name Selection management */
  26. //@{
  27. void undoCB();
  28. void redoCB();
  29. void copySelectionCB();
  30. void cutSelectionCB();
  31. void pasteSelectionCB();
  32. void deleteSelectionCB();
  33. void preferencesCB() const;
  34. //@}
  35. /** \name Scenario management */
  36. //@{
  37. CString getWorkingDirectory();
  38. bool hasRunningScenario();
  39. bool hasUnsavedScenario();
  40. CInterfacedScenario* getCurrentInterfacedScenario();
  41. void saveOpenedScenarios();
  42. void testCB() const;
  43. void newScenarioCB();
  44. void openScenarioCB();
  45. void saveScenarioCB(CInterfacedScenario* scenario = nullptr); // defaults to current scenario if nullptr
  46. void saveScenarioAsCB(CInterfacedScenario* scenario = nullptr); // defaults to current scenario if nullptr
  47. void closeScenarioCB(CInterfacedScenario* scenario);
  48. void restoreDefaultScenariosCB() const;
  49. void stopScenarioCB();
  50. void pauseScenarioCB();
  51. void nextScenarioCB();
  52. void playScenarioCB();
  53. void forwardScenarioCB();
  54. void configureScenarioSettingsCB(CInterfacedScenario* scenario) const;
  55. void addCommentCB(CInterfacedScenario* scenario) const;
  56. void changeCurrentScenario(int pageIdx);
  57. void reorderCurrentScenario(size_t newPageIdx);
  58. void addRecentScenario(const std::string& scenarioPath);
  59. static void cannotSaveScenarioBeforeUpdate();
  60. //@}
  61. /** \name Designer visualization management */
  62. //@{
  63. void deleteDesignerVisualizationCB();
  64. void toggleDesignerVisualizationCB();
  65. //@}
  66. /** \name Player management */
  67. //@{
  68. Kernel::IPlayer* getPlayer();
  69. bool createPlayer();
  70. void stopInterfacedScenarioAndReleasePlayer(CInterfacedScenario* scenario);
  71. //@}
  72. /** \name Application management */
  73. //@{
  74. bool quitApplicationCB();
  75. void aboutOpenViBECB() const;
  76. void aboutScenarioCB(CInterfacedScenario* scenario) const;
  77. void aboutLinkClickedCB(const gchar* url) const;
  78. void browseDocumentationCB() const;
  79. static void registerLicenseCB();
  80. void reportIssueCB() const;
  81. void windowStateChangedCB(bool isMaximized);
  82. bool displayChangelogWhenAvailable();
  83. //@}
  84. void logLevelCB() const;
  85. //void logLevelMessagesCB();
  86. void cpuUsageCB();
  87. void zoomInCB(); //Call when a zoom in is required
  88. void zoomOutCB(); //Call when a zoom out is required
  89. void spinnerZoomChangedCB(const size_t scaleDelta);
  90. const Kernel::IKernelContext& m_kernelCtx;
  91. Kernel::IPluginManager* m_PluginMgr = nullptr;
  92. Kernel::IScenarioManager* m_ScenarioMgr = nullptr;
  93. VisualizationToolkit::IVisualizationManager* m_VisualizationMgr = nullptr;
  94. Kernel::IScenario* m_ClipboardScenario = nullptr;
  95. ECommandLineFlag m_CmdLineFlags = CommandLineFlag_None;
  96. GtkBuilder* m_Builder = nullptr;
  97. GtkWidget* m_MainWindow = nullptr;
  98. GtkTreeStore* m_BoxAlgorithmTreeModel = nullptr;
  99. GtkTreeModel* m_BoxAlgorithmTreeModelFilter = nullptr;
  100. GtkTreeModel* m_BoxAlgorithmTreeModelFilter2 = nullptr;
  101. GtkTreeModel* m_BoxAlgorithmTreeModelFilter3 = nullptr;
  102. GtkTreeModel* m_BoxAlgorithmTreeModelFilter4 = nullptr;
  103. GtkTreeView* m_BoxAlgorithmTreeView = nullptr;
  104. GtkTreeStore* m_AlgorithmTreeModel = nullptr;
  105. GtkSpinButton* m_FastForwardFactor = nullptr;
  106. // UI for adding inputs and outputs to a scenario
  107. GtkWidget* m_Inputs = nullptr;
  108. GtkWidget* m_Outputs = nullptr;
  109. gint m_FilterTimeout = 0;
  110. const gchar* m_SearchTerm = nullptr;
  111. uint64_t m_LastTimeRefresh = 0;
  112. bool m_IsQuitting = false;
  113. bool m_IsNewVersion = false;
  114. std::vector<CInterfacedScenario*> m_Scenarios;
  115. std::vector<const Plugins::IPluginObjectDesc*> m_NewBoxes;
  116. std::vector<const Plugins::IPluginObjectDesc*> m_UpdatedBoxes;
  117. #ifdef MENSIA_DISTRIBUTION
  118. CArchwayHandler* m_ArchwayHandler = nullptr;
  119. CArchwayHandlerGUI* m_ArchwayHandlerGUI = nullptr;
  120. #endif
  121. protected:
  122. VisualizationToolkit::IVisualizationContext* m_visualizationCtx = nullptr;
  123. CLogListenerDesigner* m_logListener = nullptr;
  124. GtkWidget* m_splashScreen = nullptr;
  125. GtkNotebook* m_scenarioNotebook = nullptr;
  126. GtkNotebook* m_resourceNotebook = nullptr;
  127. GtkTreeView* m_algorithmTreeView = nullptr;
  128. GtkWidget* m_configureSettingsAddSettingButton = nullptr;
  129. GtkContainer* m_menuOpenRecent = nullptr;
  130. std::vector<const GtkWidget*> m_recentScenarios;
  131. bool m_isMaximized = false;
  132. size_t m_currentScenarioIdx = 0;
  133. std::vector<std::string> m_documentedBoxes;
  134. };
  135. } //namespace Designer
  136. } //namespace OpenViBE