| 1234567891011121314151617181920212223242526272829303132 |
- #pragma once
- #include "lumacs/editor_core.hpp" // For EditorEvent and other core types
- namespace lumacs {
- // Forward declaration to avoid circular dependency
- class EditorCore;
- /// Abstract interface for a Lumacs editor UI frontend.
- /// All editor UIs (ncurses, GTK, etc.) must implement this interface.
- class IEditorView {
- public:
- virtual ~IEditorView() = default;
- /// Initialize the UI system (e.g., ncurses init, GTK window setup).
- /// This should be called before run().
- virtual void init() = 0;
- /// Run the main UI loop. This method should block until the UI exits.
- virtual void run() = 0;
- /// Handle events emitted by the EditorCore.
- /// The EditorCore will register this view as a callback listener.
- virtual void handle_editor_event(EditorEvent event) = 0;
- /// Set the EditorCore instance for the view to interact with.
- /// This is typically called once during setup.
- virtual void set_core(EditorCore* core) = 0;
- };
- } // namespace lumacs
|