[KLF Application]
[KLF Tools]
[KLF Backend]
[KLF Home]
KLatexFormula Project
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
src
klfbackend
klfdefs.h
Go to the documentation of this file.
1
/***************************************************************************
2
* file klfdefs.h
3
* This file is part of the KLatexFormula Project.
4
* Copyright (C) 2011 by Philippe Faist
5
* philippe.faist at bluewin.ch
6
* *
7
* This program is free software; you can redistribute it and/or modify *
8
* it under the terms of the GNU General Public License as published by *
9
* the Free Software Foundation; either version 2 of the License, or *
10
* (at your option) any later version. *
11
* *
12
* This program is distributed in the hope that it will be useful, *
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15
* GNU General Public License for more details. *
16
* *
17
* You should have received a copy of the GNU General Public License *
18
* along with this program; if not, write to the *
19
* Free Software Foundation, Inc., *
20
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
21
***************************************************************************/
22
/* $Id: klfdefs.h 603 2011-02-26 23:14:55Z phfaist $ */
23
24
#ifndef KLFDEFS_H_
25
#define KLFDEFS_H_
26
27
#include <qobject.h>
28
29
// first, detect a missing KLFBACKEND_QT4 definition
30
#if defined(QT_VERSION) && QT_VERSION >= 0x040000
31
# ifndef KLFBACKEND_QT4
32
# define KLFBACKEND_QT4
33
# endif
34
#endif
35
36
37
#include <qstring.h>
38
#include <qvariant.h>
39
40
41
// EXPORTING SYMBOLS TO E.G. PLUGINS ...
42
#ifndef KLF_EXPORT
43
# if defined(Q_OS_WIN)
44
# if defined(KLF_SRC_BUILD)
45
# define KLF_EXPORT __declspec(dllexport)
46
# else
47
# define KLF_EXPORT __declspec(dllimport)
48
# endif
49
# else
50
# define KLF_EXPORT __attribute__((visibility("default")))
51
# endif
52
#endif
53
54
55
// VERSION INFORMATION
56
57
KLF_EXPORT
const
char
* klfVersion();
58
59
KLF_EXPORT
int
klfVersionMaj();
60
KLF_EXPORT
int
klfVersionMin();
61
KLF_EXPORT
int
klfVersionRelease();
62
63
64
KLF_EXPORT
QByteArray
klfFmt(
const
char
* fmt, ...)
65
#if defined(Q_CC_GNU) && !defined(__INSURE__)
66
__attribute__ ((format (printf, 1, 2)))
67
#endif
68
;
69
70
#define klfFmtCC (const char*)klfFmt
71
72
KLF_EXPORT
QByteArray
klfFmt(
const
char
* fmt, va_list pp) ;
73
74
75
#define KLF_FUNC_SINGLE_RUN \
76
{ static bool first_run = true; if ( ! first_run ) return; first_run = false; }
77
78
79
80
// utility functions
81
82
83
namespace
KLFSysInfo
84
{
85
enum
Os
{
Linux
,
Win32
,
MacOsX
,
OtherOs
};
86
87
inline
int
sizeofVoidStar
() {
return
sizeof
(
void
*); }
88
89
KLF_EXPORT
QString
arch
();
90
91
KLF_EXPORT
KLFSysInfo::Os
os
();
92
93
KLF_EXPORT
QString
osString
(
KLFSysInfo::Os
sysos =
os
());
94
};
95
96
97
98
99
KLF_EXPORT
int
klfVersionCompare(
const
QString
& v1,
const
QString
& v2);
100
101
KLF_EXPORT
bool
klfVersionCompareLessThan(
const
QString
& v1,
const
QString
& v2);
102
103
104
#if defined(Q_OS_WIN32) || defined(Q_OS_WIN64)
105
# define KLF_PATH_SEP ';'
106
#else
107
# define KLF_PATH_SEP ':'
108
#endif
109
110
KLF_EXPORT
QStringList
klfSearchFind(
const
QString
& wildcard_expression,
int
limit = -1);
111
KLF_EXPORT
QString
klfSearchPath(
const
QString
& prog,
const
QString
& extra_path =
""
);
112
113
114
115
// Import debugging utilities
116
117
#include <
klfdebug.h
>
118
119
120
121
#endif
Generated by
doxygen
1.8.2