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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4070 - (hide annotations) (download) (as text)
Wed Jan 3 15:38:52 2024 UTC (3 months, 3 weeks ago) by capela
File MIME type: text/x-c++hdr
File size: 3051 byte(s)
- Updated copyright headers into the New Year (2024).
1 capela 3494 // qsampler.h
2     //
3     /****************************************************************************
4 capela 4070 Copyright (C) 2003-2024, rncbc aka Rui Nuno Capela. All rights reserved.
5 capela 3681 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 capela 4067 protected:
96     // Local server/shmem setup/cleanup.
97     bool setupServer();
98     void clearServer();
99 capela 3496 #endif // CONFIG_XUNIQUE
100     #endif
101 capela 3494
102     private:
103    
104     // Translation support.
105     QTranslator *m_pQtTranslator;
106     QTranslator *m_pMyTranslator;
107    
108     // Instance variables.
109     QWidget *m_pWidget;
110    
111 capela 4067 #ifdef CONFIG_XUNIQUE
112 capela 3520 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
113 capela 3494 #ifdef CONFIG_X11
114     Display *m_pDisplay;
115     Atom m_aUnique;
116     Window m_wOwner;
117 capela 3496 #endif // CONFIG_X11
118     #else
119     QString m_sUnique;
120     QSharedMemory *m_pMemory;
121     QLocalServer *m_pServer;
122 capela 4067 #endif
123 capela 3496 #endif // CONFIG_XUNIQUE
124 capela 3494 };
125    
126    
127     #endif // __qsampler_h
128    
129     // end of qsampler.h

  ViewVC Help
Powered by ViewVC