TDME2  1.9.200
MarkdownTabView.cpp
Go to the documentation of this file.
2 
3 #include <memory>
4 #include <string>
5 #include <vector>
6 
7 #include <tdme/tdme.h>
8 #include <tdme/engine/Engine.h>
10 #include <tdme/gui/GUI.h>
15 #include <tdme/utilities/Console.h>
17 
18 using std::make_unique;
19 using std::string;
20 using std::unique_ptr;
21 using std::vector;
22 
24 
27 using tdme::gui::GUI;
33 
34 MarkdownTabView::MarkdownTabView(EditorView* editorView, const string& tabId, GUIScreenNode* screenNode, const vector<Markdown::TOCEntry>& toc)
35 {
36  this->editorView = editorView;
37  this->tabId = tabId;
38  this->screenNode = screenNode;
39  this->popUps = editorView->getPopUps();
40  this->toc = toc;
41  engine = unique_ptr<Engine>(Engine::createOffScreenInstance(512, 512, false, false, false));
42  engine->setSceneColor(Color4(39.0f / 255.0f, 39.0f / 255.0f, 39.0f / 255.0f, 1.0f));
43  engine->getGUI()->addScreen(screenNode->getId(), screenNode);
44  engine->getGUI()->addRenderScreen(screenNode->getId());
45 }
46 
48 }
49 
51 {
52  engine->getGUI()->handleEvents();
53 }
54 
56 {
57  engine->display();
58  engine->getGUI()->render();
59 }
60 
62 {
63  try {
64  markdownTabController = make_unique<MarkdownTabController>(this);
67  } catch (Exception& exception) {
68  Console::println("MarkdownTabView::initialize(): An error occurred: " + string(exception.what()));
69  }
70  // TODO: load settings
71 }
72 
74 {
75  engine->dispose();
76 }
77 
79 }
80 
82  return engine.get();
83 }
84 
86  markdownTabController->setOutlinerAddDropDownContent();
87  markdownTabController->setOutlinerContent();
90 }
91 
94 }
95 
97  markdownTabController->setOutlinerContent();
99 }
100 
Color 4 definition class.
Definition: Color4.h:18
Engine main class.
Definition: Engine.h:131
GUI module class.
Definition: GUI.h:64
const string & getId()
Definition: GUINode.h:339
GUI screen node that represents a screen that can be rendered via GUI system.
Definition: GUIScreenNode.h:72
void addTooltipRequestListener(GUITooltipRequestListener *listener)
Add tooltip request listener.
void restoreOutlinerState(const TabView::OutlinerState &outlinerState)
Restore outliner state.
void storeOutlinerState(TabView::OutlinerState &outlinerState)
Store outliner state.
void setDetailsContent(const string &xml)
Set details content.
void dispose() override
Disposes the view.
void display() override
Renders the view.
void reloadOutliner() override
Reload outliner.
unique_ptr< MarkdownTabController > markdownTabController
void initialize() override
Initiates the view.
void handleInputEvents() override
Handle input events that have not yet been processed.
void updateRendering() override
Update rendering.
EditorScreenController * getScreenController()
Definition: EditorView.h:69
Console class.
Definition: Console.h:29
std::exception Exception
Exception base class.
Definition: Exception.h:18