forked from Hexagenic/wanikaniwallpaper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
37 lines (31 loc) · 1.1 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
#include <iostream>
#include "order.hpp"
#include "api.hpp"
#include "renderer.hpp"
#include "options.hpp"
int main(int argc, char **argv)
{
wanikani::Options options(argc, argv);
if(!options.helpRequested() && options.apikey())
{
wanikani::Renderer renderer(options.width(), options.height(), options.fontFileName());
wanikani::Order order;
order.update(wanikani::API::get(options.apikey().get()));
renderer.setMargins(options.marginLeft(), options.marginRight(), options.marginTop(), options.marginBottom());
renderer.setBackground(options.colorBackground());
renderer.setUnseen(options.colorUnseen());
renderer.setApprentice(options.colorApprentice());
renderer.setGuru(options.colorGuru());
renderer.setMaster(options.colorMaster());
renderer.setEnlightened(options.colorEnlightened());
renderer.setBurned(options.colorBurned());
renderer.setError(options.colorError());
renderer.render(order);
renderer.save(options.outFileName());
}
else if (!options.apikey() && !options.helpRequested())
{
std::cout << "Please provide an apikey. More info with --help.\n";
}
return 0;
}