-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDasherController.h
More file actions
52 lines (41 loc) · 1.5 KB
/
DasherController.h
File metadata and controls
52 lines (41 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#pragma once
#include <DashIntfScreenMsgs.h>
#include "DasherUIScreen.h"
#include "imgui.h"
#include "imgui_internal.h"
#include <memory>
#include "OSOutput.h"
#include "SocketInput.h"
class DasherController : public Dasher::CDashIntfScreenMsgs
{
public:
DasherController(Dasher::CSettingsStore* pSettingsStore);
void editOutput(const std::string& strText, Dasher::CDasherNode* pNode) override;
void editDelete(const std::string& strText, Dasher::CDasherNode* pNode) override;
unsigned ctrlMove(bool bForwards, Dasher::EditDistance dist) override;
unsigned ctrlDelete(bool bForwards, Dasher::EditDistance dist) override;
std::string GetContext(unsigned iStart, unsigned iLength) override;
std::string GetAllContext() override;
std::string GetTextAroundCursor(Dasher::EditDistance iDist) override;
int GetAllContextLenght() override;
void Initialize();
void Render(long deltaTime, ImVec2 canvasPos, ImVec2 canvasSize);
std::string* GetBufferRef() { return &Buffer; }
private:
void CreateModules() override;
public:
std::shared_ptr<DasherUIScreen> GetScreenModule() { return ScreenModule; }
bool SupportsClipboard() override { return true; }
void CopyToClipboard(const std::string& text) override;
private:
//Cursor position in the output buffer
unsigned int Cursor = 0;
//Output Buffer
std::string Buffer;
//Accumulated deltaTime
unsigned long Time;
//Modules
std::shared_ptr<DasherUIScreen> ScreenModule;
std::shared_ptr<SocketInput> SocketInputModule;
std::shared_ptr<OSOutput> OSOutputModule;
};