-
Notifications
You must be signed in to change notification settings - Fork 4
/
main.cpp
35 lines (27 loc) · 987 Bytes
/
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
#include <iostream>
#include "http/Http.h"
#include "dom/Parser.h"
#include "layout/LayoutEngine.h"
#include "render/render.h"
int startApp() {
Http http;
std::string doc = http.entryPoint("andreessen.jackfischer.me");
Parser parser;
parser.parseHTML(doc);
parser.root->print("","");
std::cout<<"\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
std::map< std::string, std::map<std::string, std::string> > css = parser.css;
for (auto iter : css) {
std::map<std::string, std::string> s = iter.second;
for (auto i : s) {
std::cout<<"F: "<<iter.first<<" S: "<<i.first<<" E: "<<i.second<<'\n';
}
}
std::cout<<"\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
LayoutEngine layout(parser.root, parser.css);
layout.startLayout();
// startBrowser(argc, argv, layout.toLayoutData());
loadLayoutData(layout.toLayoutData());
// std::cout << layout.toString();
return 0;
}