open-story-teller/story-editor/src/main_window.h
anthony@rabine.fr d58967710a
Some checks are pending
Build-StoryEditor / build_linux (push) Waiting to run
Build-StoryEditor / build_win32 (push) Waiting to run
Deploy-Documentation / deploy (push) Waiting to run
Added localization API and helpers
2025-10-02 21:52:28 +02:00

95 lines
2.5 KiB
C++

#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <functional>
#include <memory>
#include <string>
#include "gui.h"
#include "console_window.h"
#include "debugger_window.h"
#include "emulator_dock.h"
#include "resources_dock.h"
#include "error_list_dock.h"
#include "node_editor_window.h"
#include "properties_window.h"
#include "variables_window.h"
#include "library_window.h"
#include "cpu_window.h"
// Dialogs
#include "about_dialog.h"
#include "project_properties_dialog.h"
#include "event_bus.h"
#include "app_controller.h"
#include "i_logger.h"
#include "imgui_toast_notifier.h"
#include "node_widget_factory.h"
#include "Localization.h"
#include "LanguageSelector.h"
class MainWindow : public std::enable_shared_from_this<MainWindow>, public ILogSubject
{
public:
MainWindow(ILogger& logger, EventBus& eventBus, AppController& appController);
~MainWindow();
bool Initialize();
bool Loop();
private:
enum VmEventType { EvNoEvent, EvStep, EvRun, EvOkButton, EvPreviousButton, EvNextButton, EvAudioFinished, EvStop, EvHomeButton};
ILogger& m_logger;
EventBus& m_eventBus;
AppController &m_appController; // Controller for application logic
NodeWidgetFactory m_widgetFactory;
std::shared_ptr<StoryProject> m_story; // Current story
std::shared_ptr<StoryProject> m_module; // Current module
std::vector<std::string> m_recentProjects;
Gui m_gui;
EmulatorDock m_emulatorDock;
ErrorListDock m_errorListDock;
ConsoleWindow m_consoleWindow;
DebuggerWindow m_debuggerWindow;
CpuWindow m_cpuWindow;
ResourcesDock m_resourcesDock;
NodeEditorWindow m_nodeEditorWindow;
NodeEditorWindow m_moduleEditorWindow;
PropertiesWindow m_propertiesWindow;
LibraryWindow m_libraryWindow;
VariablesWindow m_variablesWindow;
// Dialogs
AboutDialog m_aboutDialog;
ProjectPropertiesDialog m_projectPropertiesDialog;
ImGuiToastNotifier m_toastNotifier;
LanguageSelector m_languageSelector;
// From IStoryManager (proxy to StoryProject class)
void OpenProject(const std::string &uuid);
void CloseProject();
void OpenFunction(const std::string &uuid, const std::string &name);
void OpenModule(const std::string &uuid);
void NewModule();
void SaveModule();
void CloseModule();
// From ILogSubject
virtual void LogEvent(const std::string &txt, bool critical) override;
void RefreshProjectInformation();
float DrawMainMenuBar();
bool ShowQuitConfirm();
void DrawToolBar(float topPadding);
void UpdateVmView();
};
#endif // MAINWINDOW_H