]> git.lyx.org Git - lyx.git/blob - src/main.cpp
Avoid full metrics computation with Update:FitCursor
[lyx.git] / src / main.cpp
1 /**
2  * \file main.cpp
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Lars Gullik Bjønnes
7  * \author Jean Marc Lasgouttes
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #include <config.h>
13
14 #include "LyX.h"
15
16 #include "support/debug.h"
17 #include "support/os.h"
18
19 #include <iostream>
20 #ifdef HAVE_IOS
21 #include <ios>
22 #endif
23
24 #ifdef WIN32
25 #include <Windows.h>
26 #endif
27
28
29 using namespace std;
30
31
32 int main(int argc, char * argv[])
33 {
34 #ifdef HAVE_IOS
35         ios_base::sync_with_stdio(false);
36 #endif
37
38 #ifdef WIN32
39         if (AttachConsole(ATTACH_PARENT_PROCESS)) {
40                 freopen("CONOUT$", "w", stdout);
41                 freopen("CONOUT$", "w", stderr);
42         }
43         SetConsoleOutputCP(CP_UTF8);
44 #endif
45
46         // To avoid ordering of global object problems with some
47         // stdlibs we do the initialization here, but still as
48         // early as possible.
49         lyx::lyxerr.setStream(cerr);
50
51         lyx::support::os::init(argc, &argv);
52
53         lyx::LyX the_lyx_instance;
54
55         return the_lyx_instance.exec(argc, argv);
56 }