ODIN
odinconf.h
1 /***************************************************************************
2  odinconf.h - description
3  -------------------
4  begin : Fri Nov 11 21:30:11 CEST 2003
5  copyright : (C) 2000-2021 by Thies H. Jochimsen
6  email : thies@jochimsen.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef OdinConf_H
19 #define OdinConf_H
20 
21 #include <tjutils/tjprocess.h>
22 
23 #include <odinpara/ldrblock.h>
24 #include <odinpara/ldrtypes.h>
25 #include <odinpara/ldrarrays.h>
26 
28 
29 #define DEFAULT_METH_ROOT "odin-methods"
30 
32 
33 class QWidget; // forward declaration
34 
36 
37 struct OdinConf : public LDRblock {
38 
39  OdinConf(const STD_string& label="unnamedOdinConf", bool ignore_environment = false);
40 
41  LDRfileName sourcecode;
42  LDRfileName editor;
43  LDRfileName browser;
44  LDRfileName methroot;
45  LDRfileName smpfile;
46  LDRfileName protfile;
47  LDRfileName compiler; // Set once on startup, do not include in file
48  LDRfileName linker; // Set once on startup, do not include in file
49  LDRstring compiler_flags;
50  LDRstring extra_includes;
51  LDRstring extra_libs;
52  LDRstringArr selectedMethods;
53  LDRbool attachDebugger;
54 
55  bool init(QWidget* parent);
56 
57  svector get_method_compile_chain() const;
58 
59  // helper functions
60  static STD_string get_binprefix();
61  static STD_string get_homedir();
62  static STD_string get_seqexamplesdir();
63  static STD_string get_samplesdir();
64  static STD_string get_coilsdir();
65  static STD_string get_confdir();
66  static STD_string get_tmpdir();
67  static STD_string get_manual_location();
68 
69  bool display_html(const STD_string& location, STD_list<Process>& subprocs);
70  bool open_ascfile(const STD_string& filename, STD_list<Process>& subprocs);
71 
72  static STD_string get_installdir();
73 
74 #ifndef USING_WIN32
75  static bool start_proc(const STD_string& program, const STD_string& filename, STD_list<Process>& subprocs);
76 #endif
77 
78  private:
79  static STD_string get_registryvalue(const STD_string& keyname, const STD_string& valuename);
80 
81  static STD_string get_datadir();
82 
83  static bool ignore_env; // for clean start in IDEA
84 };
85 
86 #endif