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

Annotation of /qsampler/trunk/src/qsampler.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3828 - (hide annotations) (download) (as text)
Wed Oct 7 07:35:51 2020 UTC (3 years, 6 months ago) by capela
File MIME type: text/x-c++hdr
File size: 3007 byte(s)
- Got rid of any remaining qtx11extras dependency.
1 capela 3494 // qsampler.h
2     //
3     /****************************************************************************
4 capela 3681 Copyright (C) 2003-2020, rncbc aka Rui Nuno Capela. All rights reserved.
5     Copyright (C) 2007,2008,2015,2019 Christian Schoenebeck
6 capela 3494
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 capela 3520 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
31 capela 3494 #if defined(Q_WS_X11)
32     #define CONFIG_X11
33     #endif
34     #endif
35    
36    
37     // Forward decls.
38     class QWidget;
39     class QTranslator;
40    
41 capela 3520 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
42 capela 3496 #ifdef CONFIG_XUNIQUE
43 capela 3494 #ifdef CONFIG_X11
44     #include <QX11Info>
45     typedef unsigned long Window;
46     typedef unsigned long Atom;
47 capela 3496 #endif // CONFIG_X11
48     #endif // CONFIG_XUNIQUE
49     #else
50     #ifdef CONFIG_XUNIQUE
51     class QSharedMemory;
52     class QLocalServer;
53     #endif // CONFIG_XUNIQUE
54 capela 3494 #endif
55    
56    
57     //-------------------------------------------------------------------------
58     // Singleton application instance stuff (Qt/X11 only atm.)
59     //
60    
61     class qsamplerApplication : public QApplication
62     {
63 capela 3496 Q_OBJECT
64    
65 capela 3494 public:
66    
67     // Constructor.
68     qsamplerApplication(int& argc, char **argv);
69    
70     // Destructor.
71     ~qsamplerApplication();
72    
73     // Main application widget accessors.
74     void setMainWidget(QWidget *pWidget);
75     QWidget *mainWidget() const
76     { return m_pWidget; }
77    
78     // Check if another instance is running,
79     // and raise its proper main widget...
80     bool setup();
81    
82 capela 3520 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
83 capela 3496 #ifdef CONFIG_XUNIQUE
84 capela 3494 #ifdef CONFIG_X11
85     void x11PropertyNotify(Window w);
86 capela 3496 bool x11EventFilter(XEvent *pEv)
87     #endif // CONFIG_X11
88 capela 3494 #endif // CONFIG_XUNIQUE
89 capela 3496 #else
90     #ifdef CONFIG_XUNIQUE
91     protected slots:
92     // Local server slots.
93     void newConnectionSlot();
94     void readyReadSlot();
95     #endif // CONFIG_XUNIQUE
96     #endif
97 capela 3494
98     private:
99    
100     // Translation support.
101     QTranslator *m_pQtTranslator;
102     QTranslator *m_pMyTranslator;
103    
104     // Instance variables.
105     QWidget *m_pWidget;
106    
107 capela 3520 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
108 capela 3496 #ifdef CONFIG_XUNIQUE
109 capela 3494 #ifdef CONFIG_X11
110     Display *m_pDisplay;
111     Atom m_aUnique;
112     Window m_wOwner;
113 capela 3496 #endif // CONFIG_X11
114     #endif // CONFIG_XUNIQUE
115     #else
116     #ifdef CONFIG_XUNIQUE
117     QString m_sUnique;
118     QSharedMemory *m_pMemory;
119     QLocalServer *m_pServer;
120     #endif // CONFIG_XUNIQUE
121 capela 3494 #endif
122     };
123    
124    
125     #endif // __qsampler_h
126    
127     // end of qsampler.h

  ViewVC Help
Powered by ViewVC