58EditorView::EditorView(
PopUps* popUps)
62 engine = Engine::getInstance();
76 for (
auto& event: Engine::getInstance()->getGUI()->getKeyboardEvents()) {
78 if (event.isProcessed() ==
true)
return;
81 switch (event.getKeyCode()) {
82 case (GUIKeyboardEvent::KEYCODE_F11):
84 if (event.getType() == GUIKeyboardEvent::KEYBOARDEVENT_KEY_PRESSED) {
87 event.setProcessed(
true);
99 if (tabView !=
nullptr) {
102 int left, top, width, height;
103 getViewPort(tabView->getFrameBufferNode(), left, top, width, height);
104 auto offsetX = tabView->getFrameBufferNode()->computeParentChildrenRenderOffsetXTotal();
105 auto offsetY = tabView->getFrameBufferNode()->computeParentChildrenRenderOffsetYTotal();
109 tabView->getTabView()->activate();
112 for (
auto event: Engine::getInstance()->getGUI()->getMouseEvents()) {
113 auto eventX = (
event.getXUnscaled() - left + offsetX) / xScale;
114 auto eventY = (
event.getYUnscaled() - top + offsetY) / yScale;
115 if (eventX < 0 || eventX >= width || eventY < 0 || eventY >= height)
continue;
118 event.setXUnscaled(eventX);
119 event.setYUnscaled(eventY);
120 tabView->getTabView()->getEngine()->getGUI()->getMouseEvents().push_back(event);
122 for (
auto& event: Engine::getInstance()->getGUI()->getKeyboardEvents()) {
123 tabView->getTabView()->getEngine()->getGUI()->getKeyboardEvents().push_back(event);
125 tabView->getTabView()->handleInputEvents();
126 tabView->getTabView()->getEngine()->getGUI()->getMouseEvents().clear();
127 tabView->getTabView()->getEngine()->getGUI()->getKeyboardEvents().clear();
139 if (tabView !=
nullptr) {
142 int left, top, width, height;
143 getViewPort(tabView->getFrameBufferNode()->getParentNode(), left, top, width, height);
146 auto reshaped =
false;
147 if (tabView->getTabView()->hasFixedSize() ==
false &&
148 (tabView->getTabView()->getEngine()->getWidth() != width || tabView->getTabView()->getEngine()->getHeight() != height)) {
149 tabView->getTabView()->getEngine()->reshape(width, height);
152 tabView->getFrameBufferNode()->setFrameBuffer(tabView->getTabView()->getEngine()->getFrameBuffer());
153 tabView->getTabView()->display();
154 if (reshaped ==
true) {
159 Audio::getInstance()->update();
174 Console::print(
string(
"EditorView::initialize(): An error occurred: "));
175 Console::println(
string(exception.what()));
201 Engine::getInstance()->reset();
225 auto tabViewIt = tabViews.find(selectedTabId);
226 if (tabViewIt != tabViews.end()){
227 auto& tab = tabViewIt->second;
228 TabView::OutlinerState outlinerState;
230 tab.getTabView()->reloadOutliner();
231 if (newSelectionValue.empty() ==
false) outlinerState.value = newSelectionValue;
241 left =
static_cast<int>(
static_cast<float>(left) * xScale);
242 top =
static_cast<int>(
static_cast<float>(top) * yScale);
243 width =
static_cast<int>(
static_cast<float>(width) * xScale);
244 height =
static_cast<int>(
static_cast<float>(height) * yScale);
Interface to audio module.
void setPartition(Partition *partition)
Set partition.
void reset()
Removes all entities and caches.
Bogus/Simple partition implementation.
void addRenderScreen(const string &screenId)
Add render screen.
void addScreen(const string &id, GUIScreenNode *screen)
Add screen.
void resetRenderScreens()
Reset render screens.
GUI screen node that represents a screen that can be rendered via GUI system.
void setInputEventHandler(GUIInputEventHandler *inputEventHandler)
Set input event handler.
void invalidateLayout(GUINode *node)
Mark a node to be invalidated regarding layout.
GUINode * getNodeById(const string &nodeId)
Get GUI node by id.
void delegateValueChanged(GUIElementNode *node)
Delegate value changed.
std::exception Exception
Exception base class.