1 /* This file is part of
2 * ======================================================
4 * LyX, The Document Processor
6 * Copyright 1995 Matthias Ettrich
7 * Copyright 1995-2000 The LyX Team.
9 * ====================================================== */
18 # include <gnome--/main.h>
19 # include "frontends/gnome/mainapp.h"
20 GLyxAppWin * mainAppWin;
23 #include FORMS_H_LOCATION
28 #include "support/filetools.h"
31 // I keep these here so that it will be processed as early in
32 // the compilation process as possible.
33 #if !defined(FL_REVISION) || FL_REVISION < 88 || FL_VERSION != 0
34 #error LyX will not compile with this version of XForms.\
35 Please get version 0.89.\
36 If you want to try to compile anyway, delete this test in src/main.C.
42 static int const xforms_include_version = FL_INCLUDE_VERSION;
44 int main(int argc, char * argv[])
46 // Check the XForms version in the forms.h header against
47 // the one in the libforms. If they don't match quit the
48 // execution of LyX. Better with a clean fast exit than
49 // a strange segfault later.
50 // I realize that this check have to be moved when we
51 // support several toolkits, but IMO all the toolkits
52 // should try to have the same kind of check. This could
53 // be done by having a CheckHeaderAndLib function in
54 // all the toolkit implementations, this function is
55 // responsible for notifing the user.
56 // if (!CheckHeaderAndLib()) {
57 // // header vs. lib version failed
60 int xforms_lib_version = fl_library_version(0, 0);
61 if (xforms_include_version != xforms_lib_version) {
62 cerr << "You are either running LyX with wrong "
63 "version of a dynamic XForms library\n"
64 "or you have build LyX with conflicting header "
65 "and library (different\n"
66 "versions of XForms. Sorry but there is no point "
67 "in continuing executing LyX!" << endl;
72 KApplication a( argc, argv );
75 string app_id(PACKAGE);
76 string app_version(VERSION);
77 Gnome::Main a(app_id, app_version, 1, argv); //argc, argv );
82 // lyx_localedir is used by gettext_init() is we have
83 // i18n support built-in
84 string lyx_localedir = GetEnvPath("LYX_LOCALEDIR");
85 if (lyx_localedir.empty())
86 lyx_localedir = LOCALEDIR;
88 // initialize for internationalized version *EK*
93 _wildcard(&argc, &argv);