globals.h 1.48 KB
Newer Older
Tobias WEBER's avatar
Tobias WEBER committed
1
2
3
4
5
/**
 * globals
 * @author Tobias Weber <tweber@ill.fr>
 * @date 19-Jun-2018
 * @license see 'LICENSE' file
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 *
 * ----------------------------------------------------------------------------
 * mag-core (part of the Takin software suite)
 * Copyright (C) 2018-2021  Tobias WEBER (Institut Laue-Langevin (ILL),
 *                          Grenoble, France).
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, version 3 of the License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * ----------------------------------------------------------------------------
Tobias WEBER's avatar
Tobias WEBER committed
24
25
26
27
28
29
30
 */

#ifndef __GLOBALS_H__
#define __GLOBALS_H__

#include "command.h"

Tobias WEBER's avatar
Tobias WEBER committed
31
32
#define PROGRAM_VERSION "0.0.1"

Tobias WEBER's avatar
Tobias WEBER committed
33
34

// the GUI's command line widget
Tobias WEBER's avatar
Tobias WEBER committed
35
extern CommandLine *g_pCLI;
Tobias WEBER's avatar
Tobias WEBER committed
36
37
38
39
40
41
42


/**
 * print output
 */
template<typename ...T> void print_out(T&&... msgs)
{
Tobias WEBER's avatar
Tobias WEBER committed
43
44
	if(g_pCLI)
		g_pCLI->GetWidget()->PrintOutput(false, msgs...);
Tobias WEBER's avatar
Tobias WEBER committed
45
46
47
48
49
50
51
52
}


/**
 * print error messages
 */
template<typename ...T> void print_err(T&&... msgs)
{
Tobias WEBER's avatar
Tobias WEBER committed
53
54
	if(g_pCLI)
		g_pCLI->GetWidget()->PrintOutput(true, msgs...);
Tobias WEBER's avatar
Tobias WEBER committed
55
56
57
58
}


#endif