-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
57 lines (41 loc) · 1.14 KB
/
main.cpp
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
#include <iostream>
#include "TerminalBrowser.h"
#include <termios.h>
#include <unistd.h>
#include <stdlib.h>
#include <sstream>
//./RetroTerminalWebBrowser http://google.com 800 640 10 10
int main(int argc, char **argv)
{
std::string URL("http://google.com");
int panelW = 400;
int panelH = 320;
int consoleW = 400;
int consoleH = 320;
if(argc == 6)
{
std::stringstream ss;
for(int i = 1; i < 6; i++)
{
std::cout << argv[i] << std::endl;
ss << argv[i] << " ";
}
ss >> URL >> panelW >> panelH >> consoleW >> consoleH;
}
//std::cout << argc << " " << URL << " " << panelW << " " << panelH << " " << consoleW << " " << consoleH << std::endl;
TerminalBrowser *tb = new TerminalBrowser(panelW, panelH, consoleW, consoleH);
tb->LoadURL(URL);
//tb->Update();
//sleep(4); //Hopefully it's finished loading the webpage by then..
while(true)
{
tb->Update();
if(tb->IsDirty())
{
system("clear");
tb->Render();
}
//std::cout << "HI!\n" << std::endl;
}
return 0;
}