Tulip 6.1.0
Large graphs analysis and drawing
Loading...
Searching...
No Matches
tulipconf.h
1/*
2 *
3 * This file is part of Tulip (https://tulip.labri.fr)
4 *
5 * Authors: David Auber and the Tulip development Team
6 * from LaBRI, University of Bordeaux
7 *
8 * Tulip is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License
10 * as published by the Free Software Foundation, either version 3
11 * of the License, or (at your option) any later version.
12 *
13 * Tulip is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16 * See the GNU General Public License for more details.
17 *
18 */
19///@cond DOXYGEN_HIDDEN
20
21#ifndef TULIPCONF_H
22#define TULIPCONF_H
23
24#include <cstddef>
25
26/**
27 * @brief this file contains various helper macros and functions to have a true cross-platform
28 * compilation.
29 *
30 */
31
32#define STRINGIFY(PARAM) STRINGIFY_INTERNAL(PARAM)
33#define STRINGIFY_INTERNAL(PARAM) #PARAM
34
35// some useful typedefs
36typedef unsigned int uint;
37typedef unsigned char uchar;
38
39#define _DEPRECATED __attribute__((deprecated))
40#define _DEPRECATED_TYPEDEF(type, deprecated_type) typedef type deprecated_type _DEPRECATED
41
42// WIN32 specific defines: dllimport and dllexport stuff
43#ifdef _WIN32
44#ifdef DLL_TULIP
45#define TLP_SCOPE __declspec(dllexport)
46#else
47#define TLP_SCOPE __declspec(dllimport)
48#endif
49#endif
50#ifndef TLP_SCOPE
51#define TLP_SCOPE
52#endif
53
54#ifdef _WIN32
55#ifdef DLL_TULIP_GL
56#define TLP_GL_SCOPE __declspec(dllexport)
57#else
58#define TLP_GL_SCOPE __declspec(dllimport)
59#endif
60#endif
61#ifndef TLP_GL_SCOPE
62#define TLP_GL_SCOPE
63#endif
64
65#ifdef _WIN32
66#ifdef DLL_TULIP_QT
67#define TLP_QT_SCOPE __declspec(dllexport)
68#else
69#define TLP_QT_SCOPE __declspec(dllimport)
70#endif
71#endif
72#ifndef TLP_QT_SCOPE
73#define TLP_QT_SCOPE
74#endif
75
76#ifdef _WIN32
77#ifdef DLL_TULIP_PYTHON
78#define TLP_PYTHON_SCOPE __declspec(dllexport)
79#else
80#define TLP_PYTHON_SCOPE __declspec(dllimport)
81#endif
82#endif
83#ifndef TLP_PYTHON_SCOPE
84#define TLP_PYTHON_SCOPE
85#endif
86
87#include <ostream>
88
89namespace tlp {
90/**
91 *
92 * @brief return the ostream used for the output of debug messages
93 */
94extern TLP_SCOPE std::ostream &debug();
95/**
96 *
97 * @brief set the ostream used for the output debug messages
98 */
99extern TLP_SCOPE void setDebugOutput(std::ostream &os);
100/**
101 *
102 * @brief return the ostream used for the output of warning messages
103 */
104extern TLP_SCOPE std::ostream &warning();
105/**
106 *
107 * @brief set the ostream used for the output of warning messages
108 */
109extern TLP_SCOPE void setWarningOutput(std::ostream &os);
110/**
111 *
112 * @brief allow to enable/disable the output of warning messages
113 */
114extern TLP_SCOPE void enableWarningOutput(bool);
115/**
116 *
117 * @brief indicate if the output of warning messages is enabled
118 */
119extern TLP_SCOPE bool isWarningOutputEnabled();
120/**
121 *
122 * @brief return the ostream used for the output of error messages
123 */
124extern TLP_SCOPE std::ostream &error();
125/**
126 *
127 * @brief set the ostream used for the output of error messages
128 */
129extern TLP_SCOPE void setErrorOutput(std::ostream &os);
130
131/**
132 *
133 * @brief return the TULIP_VERSION value
134 */
135extern TLP_SCOPE std::string getTulipVersion();
136} // namespace tlp
137
138#endif // TULIPCONF_H
139///@endcond