This repository was archived by the owner on Mar 2, 2021. It is now read-only.
forked from M4xi1m3/nw-atom
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathatom_controller.cpp
More file actions
64 lines (52 loc) · 1.31 KB
/
atom_controller.cpp
File metadata and controls
64 lines (52 loc) · 1.31 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
53
54
55
56
57
58
59
60
61
62
63
64
#include "atom_controller.h"
#include <apps/apps_container.h>
namespace Atom {
AtomController::AtomController() :
ViewController(nullptr),
m_atomView()
{
}
bool AtomController::handleEvent(Ion::Events::Event e) {
if (e == Ion::Events::Right) {
m_atomView.handleRight();
AppsContainer::sharedAppsContainer()->redrawWindow();
return true;
}
if (e == Ion::Events::Left){
m_atomView.handleLeft();
AppsContainer::sharedAppsContainer()->redrawWindow();
return true;
}
if (e == Ion::Events::Up){
m_atomView.handleUp();
AppsContainer::sharedAppsContainer()->redrawWindow();
return true;
}
if (e == Ion::Events::Down){
m_atomView.handleDown();
AppsContainer::sharedAppsContainer()->redrawWindow();
return true;
}
if (e == Ion::Events::Copy){
AppsContainer::sharedAppsContainer()->redrawWindow();
m_atomView.handleCopy();
return true;
}
if (e == Ion::Events::OK || e == Ion::Events::EXE){
if (m_atomView.handleOK()) {
AppsContainer::sharedAppsContainer()->redrawWindow();
return true;
}
}
if (e == Ion::Events::Back){
if (m_atomView.handleBack()) {
AppsContainer::sharedAppsContainer()->redrawWindow();
return true;
}
}
return false;
}
View * AtomController::view() {
return &m_atomView;
}
}