--- qsampler/trunk/src/qsampler.h 2019/03/09 21:49:29 3494 +++ qsampler/trunk/src/qsampler.h 2020/01/02 14:39:02 3681 @@ -1,7 +1,8 @@ // qsampler.h // /**************************************************************************** - Copyright (C) 2003-2019, rncbc aka Rui Nuno Capela. All rights reserved. + Copyright (C) 2003-2020, rncbc aka Rui Nuno Capela. All rights reserved. + Copyright (C) 2007,2008,2015,2019 Christian Schoenebeck This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -26,7 +27,7 @@ #include -#if QT_VERSION < 0x050000 +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) #if defined(Q_WS_X11) #define CONFIG_X11 #endif @@ -41,19 +42,19 @@ class QWidget; class QTranslator; -#ifdef CONFIG_X11 +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) #ifdef CONFIG_XUNIQUE - +#ifdef CONFIG_X11 #include - typedef unsigned long Window; typedef unsigned long Atom; - -#if QT_VERSION >= 0x050100 -class qsamplerXcbEventFilter; -#endif - -#endif +#endif // CONFIG_X11 +#endif // CONFIG_XUNIQUE +#else +#ifdef CONFIG_XUNIQUE +class QSharedMemory; +class QLocalServer; +#endif // CONFIG_XUNIQUE #endif @@ -63,6 +64,8 @@ class qsamplerApplication : public QApplication { + Q_OBJECT + public: // Constructor. @@ -80,11 +83,21 @@ // and raise its proper main widget... bool setup(); -#ifdef CONFIG_X11 +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) #ifdef CONFIG_XUNIQUE +#ifdef CONFIG_X11 void x11PropertyNotify(Window w); -#endif // CONFIG_XUNIQUE + bool x11EventFilter(XEvent *pEv) #endif // CONFIG_X11 +#endif // CONFIG_XUNIQUE +#else +#ifdef CONFIG_XUNIQUE +protected slots: + // Local server slots. + void newConnectionSlot(); + void readyReadSlot(); +#endif // CONFIG_XUNIQUE +#endif private: @@ -95,16 +108,21 @@ // Instance variables. QWidget *m_pWidget; -#ifdef CONFIG_X11 +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) #ifdef CONFIG_XUNIQUE +#ifdef CONFIG_X11 Display *m_pDisplay; Atom m_aUnique; Window m_wOwner; -#if QT_VERSION >= 0x050100 - qsamplerXcbEventFilter *m_pXcbEventFilter; -#endif -#endif // CONFIG_XUNIQUE #endif // CONFIG_X11 +#endif // CONFIG_XUNIQUE +#else +#ifdef CONFIG_XUNIQUE + QString m_sUnique; + QSharedMemory *m_pMemory; + QLocalServer *m_pServer; +#endif // CONFIG_XUNIQUE +#endif };