/****************************************************************
 *
 * 作   者：王建军
 * 时   间：2020/08/24
 * 开发语言：C++
 * 开发工具：QtCreator(Qt)
 * 文   件：frameless_define.h
 * 版   权：武汉创景可视技术有限公司
 *
 ***************************************************************/

#ifndef FRAMELESS_DEFINE_H
#define FRAMELESS_DEFINE_H

#include <QtCore/qglobal.h>

#ifndef Q_NULLPTR
#define Q_NULLPTR 0
#endif

#ifndef Q_DECL_OVERRIDE
#define Q_DECL_OVERRIDE override
#endif

#define QCP_VERSION_JOIN2(major, minor, patch) major##.##minor##.##patch
#define QCP_VERSION_JOIN(major, minor, patch) QCP_VERSION_JOIN2(major, minor, patch)

#define QCP_DECLARE_PRIVATE(Class) \
    Class##Private *d_ptr; \
    Q_DECLARE_PRIVATE(Class)

#define QCP_DECLARE_PUBLIC(Class) \
    Class *q_ptr; \
    inline void setPublic(Class *ptr) { q_ptr = ptr; } \
    Q_DECLARE_PUBLIC(Class)

#define QCP_INIT_PRIVATE(Class) \
    d_ptr = new Class##Private(); \
    d_ptr->setPublic(this);

#define QCP_SET_PRIVATE(Dptr) \
    d_ptr = Dptr; \
    d_ptr->setPublic(this);

#define QCP_FINI_PRIVATE() \
    delete d_ptr; d_ptr = Q_NULLPTR;


#if !defined(FRAMELESS_LIBRARY_DISABLE)
#if defined(FRAMELESS_LIBRARY)
#  define FRAMELESS_SHARED_EXPORT Q_DECL_EXPORT
#else
#  define FRAMELESS_SHARED_EXPORT Q_DECL_IMPORT
#endif
#else
#  define FRAMELESS_SHARED_EXPORT
#endif

#define FRAMELESS_VERSION_MAJOR 2
#define FRAMELESS_VERSION_MINOR 0
#define FRAMELESS_VERSION_PATCH 1
/*
   FRAMELESS_VERSION is (major << 16) + (minor << 8) + patch.
   can be used like #if (FRAMELESS_VERSION >= QT_VERSION_CHECK(0, 5, 3))
*/
#define FRAMELESS_VERSION \
QT_VERSION_CHECK(FRAMELESS_VERSION_MAJOR, FRAMELESS_VERSION_MINOR, FRAMELESS_VERSION_PATCH)

#define FRAMELESS_VERSION_STR \
QT_STRINGIFY(FRAMELESS_VERSION_JOIN(FRAMELESS_VERSION_MAJOR, FRAMELESS_VERSION_MINOR, FRAMELESS_VERSION_PATCH))


#ifndef FRAMELESS_DISABLE_DEPRECATED_BEFORE
    #define FRAMELESS_DISABLE_DEPRECATED_BEFORE QT_VERSION_CHECK(2, 0, 0)
#endif

/*
 FRAMELESS_DEPRECATED_SINCE(major, minor) evaluates as true if the qcanpool version is greater than
 the deprecation point specified.

Use it to specify from which version of qcanpool a function or class has been deprecated

Example:
  #if FRAMELESS_DEPRECATED_SINCE(2, 0)
      QT_DEPRECATED void deprecatedFunction(); // function deprecated since qcanpool 2.0
  #endif

 */
#ifdef QT_DEPRECATED
#define FRAMELESS_DEPRECATED_SINCE(major, minor) \
    (QT_VERSION_CHECK(major, minor, 0) > FRAMELESS_DISABLE_DEPRECATED_BEFORE)
#else
#define FRAMELESS_DEPRECATED_SINCE(major, minor) 0
#endif

#endif // FRAMELESS_DEFINE_H
