1 --- qt-copy/tools/tools.pro.orig 2005-05-13 16:39:18.000000000 +0200
2 +++ qt-copy/tools/tools.pro 2005-05-13 20:02:31.761482520 +0200
9 !contains(QT_EDITION, Console):SUBDIRS += designer
10 unix:!embedded:SUBDIRS += qtconfig
11 win32:!contains(QT_EDITION, OpenSource|Console):SUBDIRS += activeqt
12 --- qt-x11-opensource-src-4.1.4/tools/qvfb/qvfbhdr.h.orig 1970-01-01 01:00:00.000000000 +0100
13 +++ qt-x11-opensource-src-4.1.4/tools/qvfb/qvfbhdr.h 2006-07-02 11:34:33.753478750 +0200
15 +/****************************************************************************
17 +** Copyright (C) 1992-2006 Trolltech AS. All rights reserved.
19 +** This file is part of the QtGui module of the Qt Toolkit.
21 +** This file may be used under the terms of the GNU General Public
22 +** License version 2.0 as published by the Free Software Foundation
23 +** and appearing in the file LICENSE.GPL included in the packaging of
24 +** this file. Please review the following information to ensure GNU
25 +** General Public Licensing requirements will be met:
26 +** http://www.trolltech.com/products/qt/opensource.html
28 +** If you are unsure which license is appropriate for your use, please
29 +** review the following information:
30 +** http://www.trolltech.com/products/qt/licensing.html or contact the
31 +** sales department at sales@trolltech.com.
33 +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
34 +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
36 +****************************************************************************/
41 +#include <QtGui/qcolor.h>
42 +#include <QtCore/qrect.h>
48 +#define QT_VFB_MOUSE_PIPE "/tmp/.qtvfb_mouse-%1"
49 +#define QT_VFB_KEYBOARD_PIPE "/tmp/.qtvfb_keyboard-%1"
68 + unsigned int keycode;
69 + Qt::KeyboardModifiers modifiers;
70 + unsigned short int unicode;
78 diff -Nur qt-x11-opensource-src-4.1.4/src/gui/embedded.orig/qlock.cpp qt-x11-opensource-src-4.1.4/src/gui/embedded/qlock.cpp
79 --- qt-x11-opensource-src-4.1.4/src/gui/embedded.orig/qlock.cpp 1970-01-01 01:00:00.000000000 +0100
80 +++ qt-x11-opensource-src-4.1.4/src/gui/embedded/qlock.cpp 2006-07-02 11:35:54.386518000 +0200
82 +/****************************************************************************
84 +** Copyright (C) 1992-2006 Trolltech AS. All rights reserved.
86 +** This file is part of the QtGui module of the Qt Toolkit.
88 +** This file may be used under the terms of the GNU General Public
89 +** License version 2.0 as published by the Free Software Foundation
90 +** and appearing in the file LICENSE.GPL included in the packaging of
91 +** this file. Please review the following information to ensure GNU
92 +** General Public Licensing requirements will be met:
93 +** http://www.trolltech.com/products/qt/opensource.html
95 +** If you are unsure which license is appropriate for your use, please
96 +** review the following information:
97 +** http://www.trolltech.com/products/qt/licensing.html or contact the
98 +** sales department at sales@trolltech.com.
100 +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
101 +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
103 +****************************************************************************/
105 +#include "qlock_p.h"
107 +#ifndef QT_NO_QWS_MULTIPROCESS
110 +#include <sys/types.h>
111 +#if defined(Q_OS_DARWIN)
112 +#define Q_NO_SEMAPHORE
113 +#include <sys/stat.h>
114 +#include <sys/file.h>
116 +#include <sys/sem.h>
117 +#if defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED) \
118 + || defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD) || defined(Q_OS_NETBSD) || defined(Q_OS_BSDI)
119 +/* union semun is defined by including <sys/sem.h> */
121 +/* according to X/OPEN we have to define it ourselves */
123 + int val; /* value for SETVAL */
124 + struct semid_ds *buf; /* buffer for IPC_STAT, IPC_SET */
125 + unsigned short *array; /* array for GETALL, SETALL */
129 +#include <sys/ipc.h>
134 +#define MAX_LOCKS 200 // maximum simultaneous read locks
139 +#ifdef Q_NO_SEMAPHORE
150 + \class QLock qlock_p.h
151 + \brief The QLock class is a wrapper for a System V shared semaphore.
158 + It is used by \l {Qtopia Core} for synchronizing access to the graphics
159 + card and shared memory region between processes.
170 + \fn QLock::QLock(const QString &filename, char id, bool create)
172 + Creates a lock. \a filename is the file path of the Unix-domain
173 + socket the \l {Qtopia Core} client is using. \a id is the name of the
174 + particular lock to be created on that socket. If \a create is true
175 + the lock is to be created (as the \l {Qtopia Core} server does); if \a
176 + create is false the lock should exist already (as the \l {Qtopia Core}
180 +QLock::QLock(const QString &filename, char id, bool create)
182 +#ifdef QT_NO_QWS_MULTIPROCESS
183 + Q_UNUSED(filename);
187 + data = new QLockData;
189 +#ifdef Q_NO_SEMAPHORE
190 + data->file = QString(filename+id).toLocal8Bit().constData();
191 + for(int x = 0; x < 2; x++) {
192 + data->id = open(data->file, O_RDWR | (x ? O_CREAT : 0), S_IRWXU);
193 + if(data->id != -1 || !create) {
199 + key_t semkey = ftok(filename.toLocal8Bit().constData(), id);
200 + data->id = semget(semkey,0,0);
201 + data->owned = create;
203 + semun arg; arg.val = 0;
204 + if (data->id != -1)
205 + semctl(data->id,0,IPC_RMID,arg);
206 + data->id = semget(semkey,1,IPC_CREAT|0600);
207 + arg.val = MAX_LOCKS;
208 + semctl(data->id,0,SETVAL,arg);
211 + if (data->id == -1) {
212 + qWarning("Cannot %s semaphore %s '%c'", (create ? "create" : "get"),
213 + qPrintable(filename), id);
214 + qDebug() << "Error" << errno << strerror(errno);
220 + \fn QLock::~QLock()
227 +#ifndef QT_NO_QWS_MULTIPROCESS
230 +#ifdef Q_NO_SEMAPHORE
234 + unlink(data->file);
238 + semun arg; arg.val = 0;
239 + semctl(data->id, 0, IPC_RMID, arg);
247 + \fn bool QLock::isValid() const
249 + Returns true if the lock constructor was successful; returns false if
250 + the lock could not be created or was not available to connect to.
253 +bool QLock::isValid() const
255 +#ifndef QT_NO_QWS_MULTIPROCESS
256 + return (data->id != -1);
263 + Locks the semaphore with a lock of type \a t. Locks can either be
264 + \c Read or \c Write. If a lock is \c Read, attempts by other
265 + processes to obtain \c Read locks will succeed, and \c Write
266 + attempts will block until the lock is unlocked. If locked as \c
267 + Write, all attempts to lock by other processes will block until
268 + the lock is unlocked. Locks are stacked: i.e. a given QLock can be
269 + locked multiple times by the same process without blocking, and
270 + will only be unlocked after a corresponding number of unlock()
274 +void QLock::lock(Type t)
276 +#ifdef QT_NO_QWS_MULTIPROCESS
279 + if (!data->count) {
280 +#ifdef Q_NO_SEMAPHORE
284 + for(int rv=1; rv;) {
285 + rv = flock(data->id, op);
286 + if (rv == -1 && errno != EINTR)
287 + qDebug("Semop lock failure %s",strerror(errno));
292 + sops.sem_flg = SEM_UNDO;
295 + sops.sem_op = -MAX_LOCKS;
304 + rv = semop(data->id,&sops,1);
305 + if (rv == -1 && errno != EINTR)
306 + qDebug("Semop lock failure %s",strerror(errno));
307 + } while (rv == -1 && errno == EINTR);
315 + \fn void QLock::unlock()
317 + Unlocks the semaphore. If other processes were blocking waiting to
318 + lock() the semaphore, one of them will wake up and succeed in
322 +void QLock::unlock()
324 +#ifndef QT_NO_QWS_MULTIPROCESS
328 +#ifdef Q_NO_SEMAPHORE
329 + for(int rv=1; rv;) {
330 + rv = flock(data->id, LOCK_UN);
331 + if (rv == -1 && errno != EINTR)
332 + qDebug("Semop lock failure %s",strerror(errno));
338 + sops.sem_flg = SEM_UNDO;
340 + sops.sem_op = MAX_LOCKS;
344 + rv = semop(data->id,&sops,1);
345 + if (rv == -1 && errno != EINTR)
346 + qDebug("Semop unlock failure %s",strerror(errno));
347 + } while (rv == -1 && errno == EINTR);
351 + qDebug("Unlock without corresponding lock");
357 + \fn bool QLock::locked() const
359 + Returns true if the lock is currently held by the current process;
360 + otherwise returns false.
363 +bool QLock::locked() const
365 +#ifndef QT_NO_QWS_MULTIPROCESS
366 + return (data->count > 0);
371 diff -Nur qt-x11-opensource-src-4.1.4/src/gui/embedded.orig/qlock_p.h qt-x11-opensource-src-4.1.4/src/gui/embedded/qlock_p.h
372 --- qt-x11-opensource-src-4.1.4/src/gui/embedded.orig/qlock_p.h 1970-01-01 01:00:00.000000000 +0100
373 +++ qt-x11-opensource-src-4.1.4/src/gui/embedded/qlock_p.h 2006-07-02 11:36:23.952365750 +0200
375 +/****************************************************************************
377 +** Copyright (C) 1992-2006 Trolltech AS. All rights reserved.
379 +** This file is part of the QtGui module of the Qt Toolkit.
381 +** This file may be used under the terms of the GNU General Public
382 +** License version 2.0 as published by the Free Software Foundation
383 +** and appearing in the file LICENSE.GPL included in the packaging of
384 +** this file. Please review the following information to ensure GNU
385 +** General Public Licensing requirements will be met:
386 +** http://www.trolltech.com/products/qt/opensource.html
388 +** If you are unsure which license is appropriate for your use, please
389 +** review the following information:
390 +** http://www.trolltech.com/products/qt/licensing.html or contact the
391 +** sales department at sales@trolltech.com.
393 +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
394 +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
396 +****************************************************************************/
405 +// This file is not part of the Qt API. This header file may
406 +// change from version to version without notice, or even be
412 +#include "QtCore/qstring.h"
416 +class Q_GUI_EXPORT QLock
419 + QLock(const QString &filename, char id, bool create = false);
422 + enum Type { Read, Write };
424 + bool isValid() const;
425 + void lock(Type type);
427 + bool locked() const;
435 +// Nice class for ensuring the lock is released.
436 +// Just create one on the stack and the lock is automatically released
437 +// when QLockHandle is destructed.
438 +class Q_GUI_EXPORT QLockHandle
441 + QLockHandle(QLock *l, QLock::Type type) : qlock(l) { qlock->lock(type); }
442 + ~QLockHandle() { if (locked()) qlock->unlock(); }
444 + void lock(QLock::Type type) { qlock->lock(type); }
445 + void unlock() { qlock->unlock(); }
446 + bool locked() const { return qlock->locked(); }