X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Fmain.cpp;h=339ea8dea2fa0d015090104ca75a9913965f1639;hp=2a85c143c09bec12cf4f651bbd718c1fd7af5d46;hb=0d33eac5144178de754ad9f53e39463f79a31398;hpb=efdd8b2a07dcf770e325ec1fc9b4b7d908331e23 diff --git a/src/main.cpp b/src/main.cpp index 2a85c14..339ea8d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,27 +1,22 @@ -#include "common.h" - -#include "document.h" -#include "view.h" -#include "screen.h" - -using namespace std; -using namespace IPDF; - +#include "main.h" +#include // Because we can. int main(int argc, char ** argv) -{ +{ Document doc; srand(time(NULL)); - doc.Add(RECT_FILLED, Rect(Random(), Random(), Random(), Random())); - - View view(doc); - - Screen scr; - - while (scr.PumpEvents()) + if (argc > 1) { - view.Render(); - scr.Present(); + for (int i = 2; i < argc; ++i) + { + if (fork() == 0) doc.Load(argv[i]); + } + doc.Load(argv[1]); } - + else + { + Debug("Add random object"); + doc.Add(RECT_FILLED, Rect(Random()*0.5, Random()*0.5, Random()*0.5, Random()*0.5)); + } + MainLoop(doc); return 0; }