/[svn]/qsampler/trunk/src/qsampler.h
ViewVC logotype

Contents of /qsampler/trunk/src/qsampler.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3681 - (show annotations) (download) (as text)
Thu Jan 2 14:39:02 2020 UTC (4 years, 3 months ago) by capela
File MIME type: text/x-c++hdr
File size: 3069 byte(s)
- New year (2020) headers bumping...
1 // qsampler.h
2 //
3 /****************************************************************************
4 Copyright (C) 2003-2020, rncbc aka Rui Nuno Capela. All rights reserved.
5 Copyright (C) 2007,2008,2015,2019 Christian Schoenebeck
6
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation; either version 2
10 of the License, or (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 along
18 with this program; if not, write to the Free Software Foundation, Inc.,
19 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20
21 *****************************************************************************/
22
23 #ifndef __qsampler_h
24 #define __qsampler_h
25
26 #include "qsamplerAbout.h"
27
28 #include <QApplication>
29
30 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
31 #if defined(Q_WS_X11)
32 #define CONFIG_X11
33 #endif
34 #else
35 #if defined(QT_X11EXTRAS_LIB)
36 #define CONFIG_X11
37 #endif
38 #endif
39
40
41 // Forward decls.
42 class QWidget;
43 class QTranslator;
44
45 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
46 #ifdef CONFIG_XUNIQUE
47 #ifdef CONFIG_X11
48 #include <QX11Info>
49 typedef unsigned long Window;
50 typedef unsigned long Atom;
51 #endif // CONFIG_X11
52 #endif // CONFIG_XUNIQUE
53 #else
54 #ifdef CONFIG_XUNIQUE
55 class QSharedMemory;
56 class QLocalServer;
57 #endif // CONFIG_XUNIQUE
58 #endif
59
60
61 //-------------------------------------------------------------------------
62 // Singleton application instance stuff (Qt/X11 only atm.)
63 //
64
65 class qsamplerApplication : public QApplication
66 {
67 Q_OBJECT
68
69 public:
70
71 // Constructor.
72 qsamplerApplication(int& argc, char **argv);
73
74 // Destructor.
75 ~qsamplerApplication();
76
77 // Main application widget accessors.
78 void setMainWidget(QWidget *pWidget);
79 QWidget *mainWidget() const
80 { return m_pWidget; }
81
82 // Check if another instance is running,
83 // and raise its proper main widget...
84 bool setup();
85
86 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
87 #ifdef CONFIG_XUNIQUE
88 #ifdef CONFIG_X11
89 void x11PropertyNotify(Window w);
90 bool x11EventFilter(XEvent *pEv)
91 #endif // CONFIG_X11
92 #endif // CONFIG_XUNIQUE
93 #else
94 #ifdef CONFIG_XUNIQUE
95 protected slots:
96 // Local server slots.
97 void newConnectionSlot();
98 void readyReadSlot();
99 #endif // CONFIG_XUNIQUE
100 #endif
101
102 private:
103
104 // Translation support.
105 QTranslator *m_pQtTranslator;
106 QTranslator *m_pMyTranslator;
107
108 // Instance variables.
109 QWidget *m_pWidget;
110
111 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
112 #ifdef CONFIG_XUNIQUE
113 #ifdef CONFIG_X11
114 Display *m_pDisplay;
115 Atom m_aUnique;
116 Window m_wOwner;
117 #endif // CONFIG_X11
118 #endif // CONFIG_XUNIQUE
119 #else
120 #ifdef CONFIG_XUNIQUE
121 QString m_sUnique;
122 QSharedMemory *m_pMemory;
123 QLocalServer *m_pServer;
124 #endif // CONFIG_XUNIQUE
125 #endif
126 };
127
128
129 #endif // __qsampler_h
130
131 // end of qsampler.h

  ViewVC Help
Powered by ViewVC