1 /**************************************************************************** 2 ** $Id: qt/qeventloop_p.h 3.3.8 edited Jan 11 14:38 $ 3 ** 4 ** Definition of QEventLoop class 5 ** 6 ** Copyright (C) 1992-2007 Trolltech ASA. All rights reserved. 7 ** 8 ** This file is part of the kernel module of the Qt GUI Toolkit. 9 ** 10 ** This file may be distributed and/or modified under the terms of the 11 ** GNU General Public License version 2 as published by the Free Software 12 ** Foundation and appearing in the file LICENSE.GPL included in the 13 ** packaging of this file. 14 ** 15 ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 16 ** licenses for Qt/Embedded may use this file in accordance with the 17 ** Qt Embedded Commercial License Agreement provided with the Software. 18 ** 19 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 20 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 21 ** 22 ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 23 ** information about Qt Commercial License Agreements. 24 ** See http://www.trolltech.com/gpl/ for GPL licensing information. 25 ** 26 ** Contact info@trolltech.com if any conditions of this licensing are 27 ** not clear to you. 28 ** 29 **********************************************************************/ 30 31 #ifndef QEVENTLOOP_P_H 32 #define QEVENTLOOP_P_H 33 34 // 35 // W A R N I N G 36 // ------------- 37 // 38 // This file is not part of the Qt API. This header file may 39 // change from version to version without notice, or even be 40 // removed. 41 // 42 // We mean it. 43 // 44 // 45 46 #ifndef QT_H 47 #include "qplatformdefs.h" 48 #endif // QT_H 49 50 // SCO OpenServer redefines raise -> kill 51 #if defined(raise) 52 # undef raise 53 #endif 54 55 #include "qwindowdefs.h" 56 57 class QSocketNotifier; 58 #ifdef Q_OS_MAC 59 class QMacSockNotPrivate; 60 #endif 61 62 #if defined(Q_OS_UNIX) || defined (Q_WS_WIN) 63 #include "qptrlist.h" 64 #endif // Q_OS_UNIX || Q_WS_WIN 65 66 #if defined(Q_OS_UNIX) 67 struct QSockNot 68 { 69 QSocketNotifier *obj; 70 int fd; 71 fd_set *queue; 72 }; 73 74 class QSockNotType 75 { 76 public: 77 QSockNotType(); 78 ~QSockNotType(); 79 80 QPtrList<QSockNot> *list; 81 fd_set select_fds; 82 fd_set enabled_fds; 83 fd_set pending_fds; 84 85 }; 86 #endif // Q_OS_UNIX 87 88 #if defined(Q_WS_WIN) 89 struct QSockNot { 90 QSocketNotifier *obj; 91 int fd; 92 }; 93 #endif // Q_WS_WIN 94 95 class QEventLoopPrivate 96 { 97 public: QEventLoopPrivate()98 QEventLoopPrivate() 99 { 100 reset(); 101 } 102 reset()103 void reset() { 104 looplevel = 0; 105 quitcode = 0; 106 quitnow = FALSE; 107 exitloop = FALSE; 108 shortcut = FALSE; 109 } 110 111 int looplevel; 112 int quitcode; 113 unsigned int quitnow : 1; 114 unsigned int exitloop : 1; 115 unsigned int shortcut : 1; 116 117 #if defined(Q_WS_MAC) 118 uchar next_select_timer; 119 EventLoopTimerRef select_timer; 120 #endif 121 122 #if defined(Q_WS_X11) 123 int xfd; 124 #endif // Q_WS_X11 125 126 #if defined(Q_OS_UNIX) 127 int thread_pipe[2]; 128 129 // pending socket notifiers list 130 QPtrList<QSockNot> sn_pending_list; 131 // highest fd for all socket notifiers 132 int sn_highest; 133 // 3 socket notifier types - read, write and exception 134 QSockNotType sn_vec[3]; 135 #endif 136 137 #ifdef Q_WS_WIN 138 // pending socket notifiers list 139 QPtrList<QSockNot> sn_pending_list; 140 #endif // Q_WS_WIN 141 142 }; 143 144 #endif // QEVENTLOOP_P_H 145