[KLF Application][KLF Tools][KLF Backend][KLF Home]
KLatexFormula Project

src/klfbackend/klfdefs.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   file klfdefs.h
00003  *   This file is part of the KLatexFormula Project.
00004  *   Copyright (C) 2009 by Philippe Faist
00005  *   philippe.faist at bluewin.ch
00006  *                                                                         *
00007  *   This program is free software; you can redistribute it and/or modify  *
00008  *   it under the terms of the GNU General Public License as published by  *
00009  *   the Free Software Foundation; either version 2 of the License, or     *
00010  *   (at your option) any later version.                                   *
00011  *                                                                         *
00012  *   This program is distributed in the hope that it will be useful,       *
00013  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00014  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00015  *   GNU General Public License for more details.                          *
00016  *                                                                         *
00017  *   You should have received a copy of the GNU General Public License     *
00018  *   along with this program; if not, write to the                         *
00019  *   Free Software Foundation, Inc.,                                       *
00020  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00021  ***************************************************************************/
00022 /* $Id: klfdefs.h 495 2010-09-14 17:42:54Z philippe $ */
00023 
00024 #ifndef KLFDEFS_H_
00025 #define KLFDEFS_H_
00026 
00027 #include <qobject.h>
00028 
00029 // first, detect a missing KLFBACKEND_QT4 definition
00030 #if defined(QT_VERSION) && QT_VERSION >= 0x040000
00031 #  ifndef KLFBACKEND_QT4
00032 #    define KLFBACKEND_QT4
00033 #   endif
00034 #endif
00035 
00036 
00037 #include <qstring.h>
00038 #include <qvariant.h>
00039 
00040 
00041 // EXPORTING SYMBOLS TO E.G. PLUGINS ...
00042 #ifndef KLF_EXPORT
00043 #  if defined(Q_OS_WIN)
00044 #    if defined(KLF_SRC_BUILD)
00045 #      define KLF_EXPORT __declspec(dllexport)
00046 #    else
00047 #      define KLF_EXPORT __declspec(dllimport)
00048 #    endif
00049 #  else
00050 #    define KLF_EXPORT __attribute__((visibility("default")))
00051 #  endif
00052 #endif
00053 
00054 
00055 // VERSION INFORMATION
00056 
00057 KLF_EXPORT const char * klfVersion();
00058 
00059 KLF_EXPORT int klfVersionMaj();
00060 KLF_EXPORT int klfVersionMin();
00061 KLF_EXPORT int klfVersionRelease();
00062 
00063 
00064 KLF_EXPORT QByteArray klfFmt(const char * fmt, ...)
00065 #if defined(Q_CC_GNU) && !defined(__INSURE__)
00066     __attribute__ ((format (printf, 1, 2)))
00067 #endif
00068 ;
00069 
00070 #define klfFmtCC   (const char*)klfFmt
00071 
00072 KLF_EXPORT QByteArray klfFmt(const char * fmt, va_list pp) ;
00073 
00074 
00075 #define KLF_FUNC_SINGLE_RUN                                             \
00076   { static bool first_run = true;  if ( ! first_run )  return; first_run = false; }
00077 
00078 
00079 
00080 // utility functions
00081 
00082 
00083 namespace KLFSysInfo
00084 {
00085   enum Os { Linux, Win32, MacOsX, OtherOs };
00086 
00087   inline int sizeofVoidStar() { return sizeof(void*); }
00088 
00089   KLF_EXPORT QString arch();
00090 
00091   KLF_EXPORT KLFSysInfo::Os os();
00092 
00093   KLF_EXPORT QString osString(KLFSysInfo::Os sysos = os());
00094 };
00095 
00096 
00097 
00098 
00099 KLF_EXPORT int klfVersionCompare(const QString& v1, const QString& v2);
00100 
00101 KLF_EXPORT bool klfVersionCompareLessThan(const QString& v1, const QString& v2);
00102 
00103 
00104 #if defined(Q_OS_WIN32) || defined(Q_OS_WIN64)
00105 #  define KLF_PATH_SEP ';'
00106 #else
00107 #  define KLF_PATH_SEP ':'
00108 #endif
00109 
00110 KLF_EXPORT QStringList klfSearchFind(const QString& wildcard_expression, int limit = -1);
00111 KLF_EXPORT QString klfSearchPath(const QString& prog, const QString& extra_path = "");
00112 
00113 
00114 
00115 // Import debugging utilities
00116 
00117 #include <klfdebug.h>
00118 
00119 
00120 
00121 #endif

Generated by doxygen 1.7.3