diff -uNr qt-x11-free-3.3.3/Makefile qt-x11-free-3.3.3-new/Makefile --- qt-x11-free-3.3.3/Makefile Mon Aug 11 10:37:25 2003 +++ qt-x11-free-3.3.3-new/Makefile Mon Oct 25 17:57:05 2004 @@ -11,7 +11,7 @@ install: FORCE @$(MAKE) qt.install -all: symlinks src-qmake src-moc sub-src sub-tools sub-tutorial sub-examples +all: symlinks src-qmake src-moc sub-src sub-tools @echo @echo "The Qt library is now built in ./lib" @echo "The Qt examples are built in the directories in ./examples" diff -uNr qt-x11-free-3.3.3/configure qt-x11-free-3.3.3-new/configure --- qt-x11-free-3.3.3/configure Mon Jun 14 05:18:55 2004 +++ qt-x11-free-3.3.3-new/configure Mon Oct 25 17:57:05 2004 @@ -1045,8 +1045,8 @@ [ -z "$QT_INSTALL_DATA" ] && QT_INSTALL_DATA=$QT_INSTALL_PREFIX # default PREFIX/translations [ -z "$QT_INSTALL_TRANSLATIONS" ] && QT_INSTALL_TRANSLATIONS=$QT_INSTALL_PREFIX/translations -# default PREFIX/etc/settings -[ -z "$QT_INSTALL_SYSCONF" ] && QT_INSTALL_SYSCONF=$QT_INSTALL_PREFIX/etc/settings +# default PREFIX/etc/qt +[ -z "$QT_INSTALL_SYSCONF" ] && QT_INSTALL_SYSCONF=$QT_INSTALL_PREFIX/etc/qt # generate qconfig.cpp [ -d $outpath/src/tools ] || mkdir -p $outpath/src/tools diff -uNr qt-x11-free-3.3.3/include/private/qtextlayout_p.h qt-x11-free-3.3.3-new/include/private/qtextlayout_p.h --- qt-x11-free-3.3.3/include/private/qtextlayout_p.h Thu Aug 5 10:42:10 2004 +++ qt-x11-free-3.3.3-new/include/private/qtextlayout_p.h Mon Oct 25 17:57:05 2004 @@ -153,7 +153,8 @@ bool validCursorPosition( int pos ) const; int nextCursorPosition( int oldPos, CursorMode mode = SkipCharacters ) const; int previousCursorPosition( int oldPos, CursorMode mode = SkipCharacters ) const; - +void setDirection(QChar::Direction); + private: QTextLayout( QTextEngine *e ) : d( e ) {} /* disable copy and assignment */ diff -uNr qt-x11-free-3.3.3/include/qdragobject.h qt-x11-free-3.3.3-new/include/qdragobject.h --- qt-x11-free-3.3.3/include/qdragobject.h Thu Aug 5 10:42:12 2004 +++ qt-x11-free-3.3.3-new/include/qdragobject.h Mon Oct 25 17:57:05 2004 @@ -245,10 +245,11 @@ void move( const QPoint & ); void drop(); void updatePixmap(); + void updatePixmap( const QPoint& cursorPos ); private: QDragObject * object; - void updateMode( ButtonState newstate ); + bool updateMode( ButtonState newstate ); void updateCursor(); QWidget * dragSource; diff -uNr qt-x11-free-3.3.3/include/qglobal.h qt-x11-free-3.3.3-new/include/qglobal.h --- qt-x11-free-3.3.3/include/qglobal.h Thu Aug 5 10:41:56 2004 +++ qt-x11-free-3.3.3-new/include/qglobal.h Mon Oct 25 17:57:05 2004 @@ -79,6 +79,10 @@ UNIX - Any UNIX BSD/SYSV system */ +#ifndef __DARWIN_X11__ +#define __DARWIN_X11__ +#endif + #if defined(__DARWIN_X11__) # define Q_OS_DARWIN #elif defined(__APPLE__) && (defined(__GNUC__) || defined(__xlC__)) @@ -545,6 +549,8 @@ #if defined(Q_OS_MAC9) # define Q_WS_MAC9 +#elif defined(__DARWIN_X11__) +# define Q_WS_X11 #elif defined(Q_OS_MSDOS) # define Q_WS_WIN16 # error "Qt requires Win32 and does not work with Windows 3.x" diff -uNr qt-x11-free-3.3.3/include/qiconview.h qt-x11-free-3.3.3-new/include/qiconview.h --- qt-x11-free-3.3.3/include/qiconview.h Thu Aug 5 10:42:00 2004 +++ qt-x11-free-3.3.3-new/include/qiconview.h Mon Oct 25 17:57:05 2004 @@ -496,6 +496,8 @@ const QPoint &relativeTo, const QIconViewItem *item ) const; QBitmap mask( QPixmap *pix ) const; + int visibleWidthSB() const; + int visibleHeightSB() const; QIconViewPrivate *d; diff -uNr qt-x11-free-3.3.3/include/qprogressbar.h qt-x11-free-3.3.3-new/include/qprogressbar.h --- qt-x11-free-3.3.3/include/qprogressbar.h Thu Aug 5 10:42:21 2004 +++ qt-x11-free-3.3.3-new/include/qprogressbar.h Mon Oct 25 17:57:05 2004 @@ -61,6 +61,7 @@ public: QProgressBar( QWidget* parent=0, const char* name=0, WFlags f=0 ); QProgressBar( int totalSteps, QWidget* parent=0, const char* name=0, WFlags f=0 ); + virtual ~QProgressBar(); int totalSteps() const; int progress() const; @@ -91,6 +92,7 @@ virtual bool setIndicator( QString & progress_str, int progress, int totalSteps ); void styleChange( QStyle& ); + bool requireRepaint( int newProgress ) const; private: int total_steps; diff -uNr qt-x11-free-3.3.3/include/qvaluelist.h qt-x11-free-3.3.3-new/include/qvaluelist.h --- qt-x11-free-3.3.3/include/qvaluelist.h Thu Aug 5 10:41:56 2004 +++ qt-x11-free-3.3.3-new/include/qvaluelist.h Mon Oct 25 17:57:05 2004 @@ -636,13 +636,11 @@ l.clear(); Q_UINT32 c; s >> c; - for( Q_UINT32 i = 0; i < c; ++i ) + for( Q_UINT32 i = 0; i < c && !s.atEnd(); ++i ) { T t; s >> t; l.append( t ); - if ( s.atEnd() ) - break; } return s; } diff -uNr qt-x11-free-3.3.3/mkspecs/darwin-g++/qmake.conf qt-x11-free-3.3.3-new/mkspecs/darwin-g++/qmake.conf --- qt-x11-free-3.3.3/mkspecs/darwin-g++/qmake.conf Thu Aug 5 10:42:57 2004 +++ qt-x11-free-3.3.3-new/mkspecs/darwin-g++/qmake.conf Mon Oct 25 17:59:08 2004 @@ -9,19 +9,19 @@ MAKEFILE_GENERATOR = UNIX TEMPLATE = app CONFIG += qt warn_on release native_precompiled_headers -CONFIG += qt warn_on release link_prl +CONFIG += qt warn_on release link_prl lib_version_first DEFINES += __DARWIN_X11__ -QMAKE_CC = cc +QMAKE_CC = gcc-3.3 QMAKE_LEX = flex QMAKE_LEXFLAGS = QMAKE_YACC = yacc QMAKE_YACCFLAGS = -d -QMAKE_CFLAGS = -pipe +QMAKE_CFLAGS = -pipe -fno-common -fPIC QMAKE_CFLAGS_DEPS = -M QMAKE_CFLAGS_WARN_ON = -Wall -W QMAKE_CFLAGS_WARN_OFF = -w -QMAKE_CFLAGS_RELEASE = -O2 +QMAKE_CFLAGS_RELEASE = -Os QMAKE_CFLAGS_DEBUG = -g QMAKE_CFLAGS_SHLIB = -fPIC QMAKE_EXTENSION_SHLIB = dylib @@ -29,7 +29,7 @@ QMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses QMAKE_CFLAGS_THREAD = -QMAKE_CXX = c++ +QMAKE_CXX = c++-3.3 QMAKE_CXXFLAGS = $$QMAKE_CFLAGS QMAKE_CXXFLAGS_DEPS = $$QMAKE_CFLAGS_DEPS QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON @@ -40,22 +40,22 @@ QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC QMAKE_CXXFLAGS_THREAD = -QMAKE_INCDIR = /usr/local/include -QMAKE_LIBDIR = +QMAKE_INCDIR = @PREFIX@/include/qt +QMAKE_LIBDIR = @PREFIX@/lib QMAKE_INCDIR_X11 = /usr/X11R6/include QMAKE_LIBDIR_X11 = /usr/X11R6/lib -QMAKE_INCDIR_QT = $(QTDIR)/include -QMAKE_LIBDIR_QT = $(QTDIR)/lib +QMAKE_INCDIR_QT = @PREFIX@/include/qt +QMAKE_LIBDIR_QT = @PREFIX@/lib QMAKE_INCDIR_OPENGL = /usr/X11R6/include QMAKE_LIBDIR_OPENGL = /usr/X11R6/lib -QMAKE_LINK = c++ -QMAKE_LINK_SHLIB = c++ +QMAKE_LINK = c++-3.3 +QMAKE_LINK_SHLIB = c++-3.3 QMAKE_LFLAGS = QMAKE_LFLAGS_RELEASE = QMAKE_LFLAGS_DEBUG = QMAKE_LFLAGS_APP = -prebind -QMAKE_LFLAGS_SHLIB = -prebind -dynamiclib -single_module -headerpad_max_install_names +QMAKE_LFLAGS_SHLIB = -prebind -dynamiclib -single_module -headerpad_max_install_names -install_name $$QMAKE_LIBDIR/$(TARGET1) QMAKE_LFLAGS_PLUGIN = -bundle QMAKE_LFLAGS_THREAD = @@ -64,7 +64,7 @@ QMAKE_RPATH = -QMAKE_LIBS_DYNLOAD = +QMAKE_LIBS_DYNLOAD = -ldl QMAKE_LIBS_X11 = -lXext -lX11 -lm QMAKE_LIBS_X11SM = -lSM -lICE QMAKE_LIBS_QT = -lqt @@ -73,20 +73,20 @@ QMAKE_LIBS_OPENGL_QT = -lGL -lXmu QMAKE_LIBS_THREAD = -QMAKE_MOC = $(QTDIR)/bin/moc -QMAKE_UIC = $(QTDIR)/bin/uic +QMAKE_MOC = @PREFIX@/bin/moc +QMAKE_UIC = @PREFIX@/bin/uic -QMAKE_AR = ar cq -QMAKE_RANLIB = ranlib -s +QMAKE_AR = /usr/bin/ar cq +QMAKE_RANLIB = /usr/bin/ranlib -s -QMAKE_TAR = tar -cf -QMAKE_GZIP = gzip -9f +QMAKE_TAR = @PREFIX@/bin/tar -cf +QMAKE_GZIP = @PREFIX@/bin/gzip -9f -QMAKE_COPY = cp -f +QMAKE_COPY = /bin/cp -f QMAKE_COPY_FILE = $$QMAKE_COPY QMAKE_COPY_DIR = $$QMAKE_COPY -r -QMAKE_MOVE = mv -f -QMAKE_DEL_FILE = rm -f -QMAKE_DEL_DIR = rmdir -QMAKE_CHK_DIR_EXISTS = test -d -QMAKE_MKDIR = mkdir -p +QMAKE_MOVE = /bin/mv -f +QMAKE_DEL_FILE = /bin/rm -f +QMAKE_DEL_DIR = /bin/rmdir +QMAKE_CHK_DIR_EXISTS = /bin/test -d +QMAKE_MKDIR = /bin/mkdir -p diff -uNr qt-x11-free-3.3.3/mkspecs/linux-g++/qplatformdefs.h qt-x11-free-3.3.3-new/mkspecs/linux-g++/qplatformdefs.h --- qt-x11-free-3.3.3/mkspecs/linux-g++/qplatformdefs.h Tue May 27 11:19:20 2003 +++ qt-x11-free-3.3.3-new/mkspecs/linux-g++/qplatformdefs.h Mon Oct 25 17:57:05 2004 @@ -102,5 +102,6 @@ #define QT_VSNPRINTF ::vsnprintf #endif +#define QT_MITSHM #endif // QPLATFORMDEFS_H diff -uNr qt-x11-free-3.3.3/qmake/Makefile.unix qt-x11-free-3.3.3-new/qmake/Makefile.unix --- qt-x11-free-3.3.3/qmake/Makefile.unix Wed Jun 2 18:24:30 2004 +++ qt-x11-free-3.3.3-new/qmake/Makefile.unix Mon Oct 25 17:57:05 2004 @@ -36,8 +36,8 @@ -I. -Igenerators -Igenerators/unix -Igenerators/win32 -Igenerators/mac \ -I@BUILD_PATH@/include/qmake -I@BUILD_PATH@/include -I@SOURCE_PATH@/include \ -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_STL \ - -DQT_NO_COMPRESS -I@QMAKESPEC@ -DHAVE_QCONFIG_CPP -LFLAGS=@QMAKE_LFLAGS@ + -DQT_NO_COMPRESS -I@QMAKESPEC@ -DHAVE_QCONFIG_CPP -mdynamic-no-pic +LFLAGS=@QMAKE_LFLAGS@ -mdynamic-no-pic qmake: $(OBJS) $(QOBJS) $(CXX) -o $@ $(OBJS) $(QOBJS) $(LFLAGS) diff -uNr qt-x11-free-3.3.3/qmake/main.cpp qt-x11-free-3.3.3-new/qmake/main.cpp --- qt-x11-free-3.3.3/qmake/main.cpp Thu Aug 5 10:42:29 2004 +++ qt-x11-free-3.3.3-new/qmake/main.cpp Mon Oct 25 17:57:05 2004 @@ -49,7 +49,7 @@ // for Borland, main is defined to qMain which breaks qmake #undef main -#ifdef Q_OS_MAC +#if defined(Q_OS_MAC) || defined(Q_OS_DARWIN) // for qurl bool qt_resolve_symlinks = FALSE; #endif diff -uNr qt-x11-free-3.3.3/src/iconview/qiconview.cpp qt-x11-free-3.3.3-new/src/iconview/qiconview.cpp --- qt-x11-free-3.3.3/src/iconview/qiconview.cpp Thu Aug 5 10:42:00 2004 +++ qt-x11-free-3.3.3-new/src/iconview/qiconview.cpp Mon Oct 25 17:57:05 2004 @@ -236,6 +236,7 @@ QPoint dragStartPos; QFontMetrics *fm; int minLeftBearing, minRightBearing; + int rubberStartX, rubberStartY; uint mousePressed :1; uint cleared :1; @@ -255,9 +256,11 @@ uint firstSizeHint : 1; uint showTips :1; uint pressedSelected :1; + uint canStartRubber :1; uint dragging :1; uint drawActiveSelection :1; uint inMenuMode :1; + uint controlPressed :1; QIconViewToolTip *toolTip; QPixmapCache maskCache; @@ -1060,7 +1063,7 @@ if ( view ) { if ( QRect( view->contentsX(), view->contentsY(), - view->visibleWidth(), view->visibleHeight() ). + view->visibleWidthSB(), view->visibleHeightSB() ). intersects( oR ) ) view->repaintContents( oR.x() - 1, oR.y() - 1, oR.width() + 2, oR.height() + 2, FALSE ); @@ -1104,7 +1107,7 @@ if ( view ) { if ( QRect( view->contentsX(), view->contentsY(), - view->visibleWidth(), view->visibleHeight() ). + view->visibleWidthSB(), view->visibleHeightSB() ). intersects( oR ) ) view->repaintContents( oR.x() - 1, oR.y() - 1, oR.width() + 2, oR.height() + 2, FALSE ); @@ -1140,7 +1143,7 @@ if ( view ) { if ( QRect( view->contentsX(), view->contentsY(), - view->visibleWidth(), view->visibleHeight() ). + view->visibleWidthSB(), view->visibleHeightSB() ). intersects( oR ) ) view->repaintContents( oR.x() - 1, oR.y() - 1, oR.width() + 2, oR.height() + 2, FALSE ); @@ -1200,7 +1203,7 @@ if ( view ) { if ( QRect( view->contentsX(), view->contentsY(), - view->visibleWidth(), view->visibleHeight() ). + view->visibleWidthSB(), view->visibleHeightSB() ). intersects( oR ) ) view->repaintContents( oR.x() - 1, oR.y() - 1, oR.width() + 2, oR.height() + 2, FALSE ); @@ -2727,10 +2730,12 @@ d->lastItem = 0; d->count = 0; d->mousePressed = FALSE; + d->controlPressed = FALSE; d->selectionMode = Single; d->currentItem = 0; d->highlightedItem = 0; d->rubber = 0; + d->canStartRubber = FALSE; d->scrollTimer = 0; d->startDragItem = 0; d->tmpCurrentItem = 0; @@ -3292,9 +3297,18 @@ alreadyIntersected = TRUE; QIconViewItem *item = c->items.first(); for ( ; item; item = c->items.next() ) { - if ( d->selectedItems.find( item ) ) - continue; - if ( !item->intersects( nr ) ) { + if ( d->selectedItems.find( item ) ) { + if ( item->intersects( nr ) && item->isSelected() && d->controlPressed ) { + item->setSelected( FALSE ); + changed = TRUE; + rr = rr.unite( item->rect() ); + } else if ( !item->intersects( nr ) && !item->isSelected() && d->controlPressed ) { + item->setSelected( TRUE, TRUE ); + changed = TRUE; + rr = rr.unite( item->rect() ); + } else + continue; + } else if ( !item->intersects( nr ) ) { if ( item->isSelected() ) { item->setSelected( FALSE ); changed = TRUE; @@ -4485,34 +4499,25 @@ } } } else if ( ( d->selectionMode != Single || e->button() == RightButton ) - && !( e->state() & ControlButton ) ) + && !( e->state() & ControlButton ) && !( e->state() & ShiftButton ) ) selectAll( FALSE ); setCurrentItem( item ); + d->canStartRubber = FALSE; if ( e->button() == LeftButton ) { - if ( !item && ( d->selectionMode == Multi || - d->selectionMode == Extended ) ) { - d->tmpCurrentItem = d->currentItem; - d->currentItem = 0; - repaintItem( d->tmpCurrentItem ); - if ( d->rubber ) - delete d->rubber; - d->rubber = 0; - d->rubber = new QRect( e->x(), e->y(), 0, 0 ); - d->selectedItems.clear(); - if ( ( e->state() & ControlButton ) == ControlButton ) { - for ( QIconViewItem *i = firstItem(); i; i = i->nextItem() ) - if ( i->isSelected() ) - d->selectedItems.insert( i, i ); - } + if ( !item && ( d->selectionMode == Multi || d->selectionMode == Extended ) ) + { + d->canStartRubber = TRUE; + d->rubberStartX = e->x(); + d->rubberStartY = e->y(); } - d->mousePressed = TRUE; + d->controlPressed = ( ( e->state() & ControlButton ) == ControlButton ); } emit_signals: - if ( !d->rubber ) { + if ( !d->canStartRubber ) { emit mouseButtonPressed( e->button(), item, e->globalPos() ); emit pressed( item ); emit pressed( item, e->globalPos() ); @@ -4556,6 +4561,7 @@ d->mousePressed = FALSE; d->startDragItem = 0; + d->canStartRubber = FALSE; if ( d->rubber ) { QPainter p; p.begin( viewport() ); @@ -4645,7 +4651,22 @@ if ( d->tmpCurrentItem ) repaintItem( d->tmpCurrentItem ); } - } else if ( d->mousePressed && !d->currentItem && d->rubber ) { + } else if ( d->mousePressed && ((!d->currentItem && d->rubber) || d->canStartRubber) ) { + if ( d->canStartRubber ) { + d->canStartRubber = FALSE; + d->tmpCurrentItem = d->currentItem; + d->currentItem = 0; + repaintItem( d->tmpCurrentItem ); + delete d->rubber; + d->rubber = new QRect( d->rubberStartX, d->rubberStartY, 0, 0 ); + d->selectedItems.clear(); + if ( ( e->state() & ControlButton ) == ControlButton || + ( e->state() & ShiftButton ) == ShiftButton ) { + for ( QIconViewItem *i = firstItem(); i; i = i->nextItem() ) + if ( i->isSelected() ) + d->selectedItems.insert( i, i ); + } + } doAutoScroll(); } } @@ -4775,7 +4796,7 @@ QIconViewItem *i = findItem( e->pos() ); - if ( !i && e->source() == viewport() && d->currentItem && !d->cleared ) { + if ( (!i || i == d->currentItem) && e->source() == viewport() && d->currentItem && !d->cleared ) { if ( !d->rearrangeEnabled ) return; QRect r = d->currentItem->rect(); @@ -5222,11 +5243,11 @@ d->findContainers( dir, relativeTo, searchRect); cList->first(); - while ( cList->current() && !centerMatch ) { + while ( cList->current() ) { QPtrList &list = (cList->current())->items; for ( item = list.first(); item; item = list.next() ) { if ( neighbourItem( dir, relativeTo, item ) && - searchRect.contains( item->rect().center() ) && + searchRect.intersects( item->rect() ) && item != currentItem() ) { int ml = (relativeTo - item->rect().center()).manhattanLength(); if ( centerMatch ) { @@ -5448,8 +5469,8 @@ } item->dirty = FALSE; } else { - QRegion r( QRect( 0, 0, QMAX( contentsWidth(), visibleWidth() ), - QMAX( contentsHeight(), visibleHeight() ) ) ); + QRegion r( QRect( 0, 0, QMAX( contentsWidth(), visibleWidthSB() ), + QMAX( contentsHeight(), visibleHeightSB() ) ) ); QIconViewItem *i = d->firstItem; int y = -1; @@ -5707,7 +5728,7 @@ QIconViewItem *item = begin; for (;;) { x += d->spacing + item->width(); - if ( x > visibleWidth() && item != begin ) { + if ( x > visibleWidthSB() && item != begin ) { item = item->prev; break; } @@ -5732,7 +5753,7 @@ int x; if ( item == begin ) { if ( reverse ) - x = visibleWidth() - d->spacing - item->width(); + x = visibleWidthSB() - d->spacing - item->width(); else x = d->spacing; } else { @@ -5768,7 +5789,7 @@ i += r; x = i * d->rastX + sp * d->spacing; } - if ( x > visibleWidth() && item != begin ) { + if ( x > visibleWidthSB() && item != begin ) { item = item->prev; break; } @@ -5831,7 +5852,7 @@ QIconViewItem *item = begin; for (;;) { y += d->spacing + item->height(); - if ( y > visibleHeight() && item != begin ) { + if ( y > visibleHeightSB() && item != begin ) { item = item->prev; break; } @@ -6145,7 +6166,9 @@ item->d->container2 = 0; c->items.append( item ); item = item->next; - } else if ( c->rect.intersects( item->rect() ) ) { + } else if ( c->rect.intersects( item->rect() ) && ( + ( d->arrangement == LeftToRight && item->y() >= c->rect.y() ) || + ( d->arrangement == TopToBottom && item->x() >= c->rect.x() ) ) ) { item->d->container1 = c; c->items.append( item ); c = c->n; @@ -6378,4 +6401,24 @@ #endif } +int QIconView::visibleWidthSB() const +{ + if ( vScrollBarMode() != Auto ) + return visibleWidth(); + + int offset = verticalScrollBar()->isVisible() ? 0 + : style().pixelMetric( QStyle::PM_ScrollBarExtent, verticalScrollBar() ); + return QMAX( 0, visibleWidth() - offset ); +} + +int QIconView::visibleHeightSB() const +{ + if ( hScrollBarMode() != Auto ) + return visibleHeight(); + + int offset = horizontalScrollBar()->isVisible() ? 0 + : style().pixelMetric( QStyle::PM_ScrollBarExtent, horizontalScrollBar() ); + return QMAX( 0, visibleHeight() - offset ); +} + #endif // QT_NO_ICONVIEW diff -uNr qt-x11-free-3.3.3/src/iconview/qiconview.h qt-x11-free-3.3.3-new/src/iconview/qiconview.h --- qt-x11-free-3.3.3/src/iconview/qiconview.h Thu Aug 5 10:42:00 2004 +++ qt-x11-free-3.3.3-new/src/iconview/qiconview.h Mon Oct 25 17:57:05 2004 @@ -496,6 +496,8 @@ const QPoint &relativeTo, const QIconViewItem *item ) const; QBitmap mask( QPixmap *pix ) const; + int visibleWidthSB() const; + int visibleHeightSB() const; QIconViewPrivate *d; diff -uNr qt-x11-free-3.3.3/src/kernel/qapplication_x11.cpp qt-x11-free-3.3.3-new/src/kernel/qapplication_x11.cpp --- qt-x11-free-3.3.3/src/kernel/qapplication_x11.cpp Thu Aug 5 10:42:03 2004 +++ qt-x11-free-3.3.3-new/src/kernel/qapplication_x11.cpp Mon Oct 25 17:57:05 2004 @@ -3402,10 +3402,23 @@ // update the size for desktop widget int scr = XRRRootToScreen( appDpy, event->xany.window ); + + // Determine if we're at right-angles & thus DisplayWidth/DisplayHeight should be switched + XRRScreenConfiguration* xrrconfig; + xrrconfig = XRRGetScreenInfo( appDpy, event->xany.window ); + Rotation rotation; + XRRConfigCurrentConfiguration( xrrconfig, &rotation ); + XRRFreeScreenConfigInfo( xrrconfig ); + QWidget *w = desktop()->screen( scr ); QSize oldSize( w->size() ); - w->crect.setWidth( DisplayWidth( appDpy, scr ) ); - w->crect.setHeight( DisplayHeight( appDpy, scr ) ); + if (rotation & (RR_Rotate_90 | RR_Rotate_270)) { + w->crect.setWidth( DisplayHeight( appDpy, scr ) ); + w->crect.setHeight( DisplayWidth( appDpy, scr ) ); + } else { + w->crect.setWidth( DisplayWidth( appDpy, scr ) ); + w->crect.setHeight( DisplayHeight( appDpy, scr ) ); + } if ( w->size() != oldSize ) { QResizeEvent e( w->size(), oldSize ); QApplication::sendEvent( w, &e ); @@ -3964,7 +3977,7 @@ // Keyboard event translation // -static int translateButtonState( int s ) +int qt_x11_translateButtonState( int s ) { int bst = 0; if ( s & Button1Mask ) @@ -4030,7 +4043,7 @@ pos.ry() = lastMotion.y; globalPos.rx() = lastMotion.x_root; globalPos.ry() = lastMotion.y_root; - state = translateButtonState( lastMotion.state ); + state = qt_x11_translateButtonState( lastMotion.state ); if ( qt_button_down && (state & (LeftButton | MidButton | RightButton ) ) == 0 ) @@ -4054,7 +4067,7 @@ pos.ry() = xevent->xcrossing.y; globalPos.rx() = xevent->xcrossing.x_root; globalPos.ry() = xevent->xcrossing.y_root; - state = translateButtonState( xevent->xcrossing.state ); + state = qt_x11_translateButtonState( xevent->xcrossing.state ); if ( qt_button_down && (state & (LeftButton | MidButton | RightButton ) ) == 0 ) @@ -4066,7 +4079,7 @@ pos.ry() = event->xbutton.y; globalPos.rx() = event->xbutton.x_root; globalPos.ry() = event->xbutton.y_root; - state = translateButtonState( event->xbutton.state ); + state = qt_x11_translateButtonState( event->xbutton.state ); switch ( event->xbutton.button ) { case Button1: button = LeftButton; break; case Button2: button = MidButton; break; @@ -5004,7 +5017,7 @@ XKeyEvent xkeyevent = event->xkey; // save the modifier state, we will use the keystate uint later by passing - // it to translateButtonState + // it to qt_x11_translateButtonState uint keystate = event->xkey.state; // remove the modifiers where mode_switch exists... HPUX machines seem // to have alt *AND* mode_switch both in Mod1Mask, which causes @@ -5118,7 +5131,7 @@ } #endif // !QT_NO_XIM - state = translateButtonState( keystate ); + state = qt_x11_translateButtonState( keystate ); static int directionKeyEvent = 0; if ( qt_use_rtl_extensions && type == QEvent::KeyRelease ) { diff -uNr qt-x11-free-3.3.3/src/kernel/qclipboard_x11.cpp qt-x11-free-3.3.3-new/src/kernel/qclipboard_x11.cpp --- qt-x11-free-3.3.3/src/kernel/qclipboard_x11.cpp Thu Aug 5 10:42:05 2004 +++ qt-x11-free-3.3.3-new/src/kernel/qclipboard_x11.cpp Mon Oct 25 17:57:05 2004 @@ -109,6 +109,7 @@ static bool pending_clipboard_changed = FALSE; static bool pending_selection_changed = FALSE; +Q_EXPORT bool qt_qclipboard_bailout_hack = false; // event capture mechanism for qt_xclb_wait_for_event static bool waiting_for_data = FALSE; @@ -453,6 +454,15 @@ return 0; } +static bool selection_request_pending = false; + +static Bool check_selection_request_pending( Display*, XEvent* e, XPointer ) + { + if( e->type == SelectionRequest && e->xselectionrequest.owner == owner->winId()) + selection_request_pending = true; + return False; + } + bool qt_xclb_wait_for_event( Display *dpy, Window win, int type, XEvent *event, int timeout ) { @@ -504,6 +514,14 @@ do { if ( XCheckTypedWindowEvent(dpy,win,type,event) ) return TRUE; + if( qt_qclipboard_bailout_hack ) { + XEvent dummy; + selection_request_pending = false; + if ( owner != NULL ) + XCheckIfEvent(dpy,&dummy,check_selection_request_pending,NULL); + if( selection_request_pending ) + return TRUE; + } now = QTime::currentTime(); if ( started > now ) // crossed midnight diff -uNr qt-x11-free-3.3.3/src/kernel/qdesktopwidget_x11.cpp qt-x11-free-3.3.3-new/src/kernel/qdesktopwidget_x11.cpp --- qt-x11-free-3.3.3/src/kernel/qdesktopwidget_x11.cpp Thu Aug 5 10:42:11 2004 +++ qt-x11-free-3.3.3-new/src/kernel/qdesktopwidget_x11.cpp Mon Oct 25 17:57:05 2004 @@ -44,6 +44,9 @@ // defined in qapplication_x11.cpp extern Atom qt_net_workarea; extern bool qt_net_supports(Atom atom); +#ifndef QT_NO_XRANDR +extern bool qt_use_xrandr; +#endif // function to update the workarea of the screen static bool qt_desktopwidget_workarea_dirty = TRUE; @@ -154,6 +157,22 @@ y = 0; w = WidthOfScreen(ScreenOfDisplay(QPaintDevice::x11AppDisplay(), i)); h = HeightOfScreen(ScreenOfDisplay(QPaintDevice::x11AppDisplay(), i)); + +#ifndef QT_NO_XRANDR + if (qt_use_xrandr) { + XRRScreenConfiguration* xrrconfig; + xrrconfig = XRRGetScreenInfo(QPaintDevice::x11AppDisplay(), QPaintDevice::x11AppRootWindow( i )); + Rotation rotation; + XRRConfigCurrentConfiguration(xrrconfig, &rotation); + XRRFreeScreenConfigInfo(xrrconfig); + + if (rotation & (RR_Rotate_90 | RR_Rotate_270)) { + int tmp = h; + h = w; + w = tmp; + } + } +#endif } rects[i].setRect(x, y, w, h); diff -uNr qt-x11-free-3.3.3/src/kernel/qdnd_x11.cpp qt-x11-free-3.3.3-new/src/kernel/qdnd_x11.cpp --- qt-x11-free-3.3.3/src/kernel/qdnd_x11.cpp Thu Aug 5 10:42:09 2004 +++ qt-x11-free-3.3.3-new/src/kernel/qdnd_x11.cpp Mon Oct 25 17:57:05 2004 @@ -49,13 +49,15 @@ #include "qdragobject.h" #include "qobjectlist.h" #include "qcursor.h" +#include "qbitmap.h" +#include "qpainter.h" #include "qt_x11_p.h" // conflict resolution -// unused, may be used again later: const int XKeyPress = KeyPress; -// unused, may be used again later: const int XKeyRelease = KeyRelease; +const int XKeyPress = KeyPress; +const int XKeyRelease = KeyRelease; #undef KeyPress #undef KeyRelease @@ -79,6 +81,7 @@ extern Window qt_x11_findClientWindow( Window, Atom, bool ); extern Atom qt_wm_state; extern Time qt_x_time; +extern Time qt_x_user_time; // this stuff is copied from qclb_x11.cpp @@ -112,6 +115,8 @@ Atom qt_xdnd_type_list; const int qt_xdnd_version = 4; +extern int qt_x11_translateButtonState( int s ); + // Actions // // The Xdnd spec allows for user-defined actions. This could be implemented @@ -196,6 +201,8 @@ static int qt_xdnd_current_screen = -1; // state of dragging... true if dragging, false if not bool qt_xdnd_dragging = FALSE; +// need to check state of keyboard modifiers +static bool need_modifiers_check = FALSE; // dict of payload data, sorted by type atom static QIntDict * qt_xdnd_target_data = 0; @@ -251,20 +258,47 @@ public: QShapedPixmapWidget(int screen = -1) : QWidget(QApplication::desktop()->screen( screen ), - 0, WStyle_Customize | WStyle_Tool | WStyle_NoBorder | WX11BypassWM ) + 0, WStyle_Customize | WStyle_Tool | WStyle_NoBorder | WX11BypassWM ), oldpmser( 0 ), oldbmser( 0 ) { } - void setPixmap(QPixmap pm) + void setPixmap(QPixmap pm, QPoint hot) { - if ( pm.mask() ) { + int bmser = pm.mask() ? pm.mask()->serialNumber() : 0; + if( oldpmser == pm.serialNumber() && oldbmser == bmser + && oldhot == hot ) + return; + oldpmser = pm.serialNumber(); + oldbmser = bmser; + oldhot = hot; + bool hotspot_in = !(hot.x() < 0 || hot.y() < 0 || hot.x() >= pm.width() || hot.y() >= pm.height()); +// if the pixmap has hotspot in its area, make a "hole" in it at that position +// this will allow XTranslateCoordinates() to find directly the window below the cursor instead +// of finding this pixmap, and therefore there won't be needed any (slow) search for the window +// using findRealWindow() + if( hotspot_in ) { + QBitmap mask = pm.mask() ? *pm.mask() : QBitmap( pm.width(), pm.height()); + if( !pm.mask()) + mask.fill( Qt::color1 ); + QPainter p( &mask ); + p.setPen( Qt::color0 ); + p.drawPoint( hot.x(), hot.y()); + p.end(); + pm.setMask( mask ); + setMask( mask ); + } else if ( pm.mask() ) { setMask( *pm.mask() ); } else { clearMask(); } resize(pm.width(),pm.height()); setErasePixmap(pm); + erase(); } +private: + int oldpmser; + int oldbmser; + QPoint oldhot; }; static QShapedPixmapWidget * qt_xdnd_deco = 0; @@ -801,6 +835,9 @@ // l[0], qt_xdnd_dragsource_xid ); return; } + + if( l[2] != 0 ) + qt_x_user_time = l[2]; if ( qt_xdnd_source_object ) qt_xdnd_source_object->setTarget( qt_xdnd_current_widget ); @@ -851,8 +888,59 @@ void QDragManager::timerEvent( QTimerEvent* e ) { - if ( e->timerId() == heartbeat && qt_xdnd_source_sameanswer.isNull() ) - move( QCursor::pos() ); + if ( e->timerId() == heartbeat ) { + if( need_modifiers_check ) { + Window root, child; + int root_x, root_y, win_x, win_y; + unsigned int mask; + XQueryPointer( qt_xdisplay(), qt_xrootwin( qt_xdnd_current_screen ), + &root, &child, &root_x, &root_y, &win_x, &win_y, &mask ); + if( updateMode( (ButtonState)qt_x11_translateButtonState( mask ))) + qt_xdnd_source_sameanswer = QRect(); // force move + } + need_modifiers_check = TRUE; + if( qt_xdnd_source_sameanswer.isNull() ) + move( QCursor::pos() ); + } +} + +static bool qt_xdnd_was_move = false; +static bool qt_xdnd_found = false; +// check whole incoming X queue for move events +// checking whole queue is done by always returning False in the predicate +// if there's another move event in the queue, and there's not a mouse button +// or keyboard or ClientMessage event before it, the current move event +// may be safely discarded +// this helps avoiding being overloaded by being flooded from many events +// from the XServer +static +Bool qt_xdnd_predicate( Display*, XEvent* ev, XPointer ) +{ + if( qt_xdnd_found ) + return False; + if( ev->type == MotionNotify ) + { + qt_xdnd_was_move = true; + qt_xdnd_found = true; + } + if( ev->type == ButtonPress || ev->type == ButtonRelease + || ev->type == XKeyPress || ev->type == XKeyRelease + || ev->type == ClientMessage ) + { + qt_xdnd_was_move = false; + qt_xdnd_found = true; + } + return False; +} + +static +bool qt_xdnd_another_movement() +{ + qt_xdnd_was_move = false; + qt_xdnd_found = false; + XEvent dummy; + XCheckIfEvent( qt_xdisplay(), &dummy, qt_xdnd_predicate, NULL ); + return qt_xdnd_was_move; } bool QDragManager::eventFilter( QObject * o, QEvent * e) @@ -877,8 +965,11 @@ if ( e->type() == QEvent::MouseMove ) { QMouseEvent* me = (QMouseEvent *)e; - updateMode(me->stateAfter()); - move( me->globalPos() ); + if( !qt_xdnd_another_movement()) { + updateMode(me->stateAfter()); + move( me->globalPos() ); + } + need_modifiers_check = FALSE; return TRUE; } else if ( e->type() == QEvent::MouseButtonRelease ) { qApp->removeEventFilter( this ); @@ -917,9 +1008,11 @@ beingCancelled = FALSE; qApp->exit_loop(); } else { - updateMode(ke->stateAfter()); - qt_xdnd_source_sameanswer = QRect(); // force move - move( QCursor::pos() ); + if( updateMode(ke->stateAfter())) { + qt_xdnd_source_sameanswer = QRect(); // force move + move( QCursor::pos() ); + } + need_modifiers_check = FALSE; } return TRUE; // Eat all key events } @@ -946,10 +1039,10 @@ static Qt::ButtonState oldstate; -void QDragManager::updateMode( ButtonState newstate ) +bool QDragManager::updateMode( ButtonState newstate ) { if ( newstate == oldstate ) - return; + return false; const int both = ShiftButton|ControlButton; if ( (newstate & both) == both ) { global_requested_action = QDropEvent::Link; @@ -973,6 +1066,7 @@ } } oldstate = newstate; + return true; } @@ -1109,7 +1203,7 @@ qt_xdnd_deco->grabMouse(); } } - updatePixmap(); + updatePixmap( globalPos ); if ( qt_xdnd_source_sameanswer.contains( globalPos ) && qt_xdnd_source_sameanswer.isValid() ) { @@ -1281,9 +1375,9 @@ drop.format = 32; drop.message_type = qt_xdnd_drop; drop.data.l[0] = object->source()->winId(); - drop.data.l[1] = 1 << 24; // flags - drop.data.l[2] = 0; // ### - drop.data.l[3] = qt_x_time; + drop.data.l[1] = 0; // flags + drop.data.l[2] = qt_x_time; + drop.data.l[3] = 0; drop.data.l[4] = 0; QWidget * w = QWidget::find( qt_xdnd_current_proxy_target ); @@ -1637,6 +1731,7 @@ qt_xdnd_source_sameanswer = QRect(); move(QCursor::pos()); heartbeat = startTimer(200); + need_modifiers_check = FALSE; #ifndef QT_NO_CURSOR qApp->setOverrideCursor( arrowCursor ); @@ -1670,7 +1765,7 @@ // qt_xdnd_source_object persists until we get an xdnd_finish message } -void QDragManager::updatePixmap() +void QDragManager::updatePixmap( const QPoint& cursorPos ) { if ( qt_xdnd_deco ) { QPixmap pm; @@ -1685,15 +1780,19 @@ defaultPm = new QPixmap(default_pm); pm = *defaultPm; } - qt_xdnd_deco->setPixmap(pm); - qt_xdnd_deco->move(QCursor::pos()-pm_hot); - qt_xdnd_deco->repaint(FALSE); + qt_xdnd_deco->setPixmap(pm, pm_hot); + qt_xdnd_deco->move(cursorPos-pm_hot); //if ( willDrop ) { qt_xdnd_deco->show(); //} else { // qt_xdnd_deco->hide(); //} } +} + +void QDragManager::updatePixmap() +{ + updatePixmap( QCursor::pos()); } #endif // QT_NO_DRAGANDDROP diff -uNr qt-x11-free-3.3.3/src/kernel/qdragobject.cpp qt-x11-free-3.3.3-new/src/kernel/qdragobject.cpp --- qt-x11-free-3.3.3/src/kernel/qdragobject.cpp Thu Aug 5 10:42:05 2004 +++ qt-x11-free-3.3.3-new/src/kernel/qdragobject.cpp Mon Oct 25 17:57:05 2004 @@ -890,6 +890,16 @@ { if(!e) return FALSE; + + // when subtype is not specified, try text/plain first, otherwise this may read + // things like text/x-moz-url even though better targets are available + if( subtype.isNull()) { + QCString subtmp = "plain"; + if( decode( e, str, subtmp )) { + subtype = subtmp; + return true; + } + } if ( e->cacheType == QMimeSource::Text ) { str = *e->cache.txt.str; diff -uNr qt-x11-free-3.3.3/src/kernel/qdragobject.h qt-x11-free-3.3.3-new/src/kernel/qdragobject.h --- qt-x11-free-3.3.3/src/kernel/qdragobject.h Thu Aug 5 10:42:12 2004 +++ qt-x11-free-3.3.3-new/src/kernel/qdragobject.h Mon Oct 25 17:57:05 2004 @@ -245,10 +245,11 @@ void move( const QPoint & ); void drop(); void updatePixmap(); + void updatePixmap( const QPoint& cursorPos ); private: QDragObject * object; - void updateMode( ButtonState newstate ); + bool updateMode( ButtonState newstate ); void updateCursor(); QWidget * dragSource; diff -uNr qt-x11-free-3.3.3/src/kernel/qfontdatabase_x11.cpp qt-x11-free-3.3.3-new/src/kernel/qfontdatabase_x11.cpp --- qt-x11-free-3.3.3/src/kernel/qfontdatabase_x11.cpp Thu Aug 5 10:42:06 2004 +++ qt-x11-free-3.3.3-new/src/kernel/qfontdatabase_x11.cpp Mon Oct 25 17:57:05 2004 @@ -1002,8 +1002,7 @@ style->smoothScalable = TRUE; QtFontSize *size = style->pixelSize( SMOOTH_SCALABLE, TRUE ); QtFontEncoding *enc = size->encodingID( -1, 0, 0, 0, 0, TRUE ); - enc->pitch = ( spacing_value >= XFT_CHARCELL ? 'c' : - ( spacing_value >= XFT_MONO ? 'm' : 'p' ) ); + enc->pitch = (f->fixed ? 'm' : 'p'); } ++f; } diff -uNr qt-x11-free-3.3.3/src/kernel/qpainter_x11.cpp qt-x11-free-3.3.3-new/src/kernel/qpainter_x11.cpp --- qt-x11-free-3.3.3/src/kernel/qpainter_x11.cpp Thu Aug 5 10:42:09 2004 +++ qt-x11-free-3.3.3-new/src/kernel/qpainter_x11.cpp Mon Oct 25 17:57:05 2004 @@ -3012,15 +3012,15 @@ engine.currentItem = 0; engine.firstItemInLine = -1; - if ( !simple ) { - layout.setBoundary( pos ); - layout.setBoundary( pos + len ); - } - if ( dir != Auto ) { int level = dir == RTL ? 1 : 0; for ( int i = engine.items.size(); i >= 0; i-- ) engine.items[i].analysis.bidiLevel = level; + } + + if ( !simple ) { + layout.setBoundary( pos ); + layout.setBoundary( pos + len ); } // small hack to force skipping of unneeded items diff -uNr qt-x11-free-3.3.3/src/kernel/qpixmap_x11.cpp qt-x11-free-3.3.3-new/src/kernel/qpixmap_x11.cpp --- qt-x11-free-3.3.3/src/kernel/qpixmap_x11.cpp Thu Aug 5 10:42:05 2004 +++ qt-x11-free-3.3.3-new/src/kernel/qpixmap_x11.cpp Mon Oct 25 17:57:05 2004 @@ -37,7 +37,19 @@ // NOT REVISED +#include "qplatformdefs.h" + +#if defined(Q_OS_WIN32) && defined(QT_MITSHM) +#undef QT_MITSHM +#endif + +#ifdef QT_MITSHM + +// Use the MIT Shared Memory extension for pixmap<->image conversions +#define QT_MITSHM_CONVERSIONS + // Uncomment the next line to enable the MIT Shared Memory extension +// for QPixmap::xForm() // // WARNING: This has some problems: // @@ -45,14 +57,13 @@ // 2. Qt does not handle the ShmCompletion message, so you will // get strange effects if you xForm() repeatedly. // -// #define QT_MITSHM +// #define QT_MITSHM_XFORM -#if defined(Q_OS_WIN32) && defined(QT_MITSHM) -#undef QT_MITSHM +#else +#undef QT_MITSHM_CONVERSIONS +#undef QT_MITSHM_XFORM #endif -#include "qplatformdefs.h" - #include "qbitmap.h" #include "qpaintdevicemetrics.h" #include "qimage.h" @@ -91,7 +102,7 @@ MIT Shared Memory Extension support: makes xForm noticeably (~20%) faster. *****************************************************************************/ -#if defined(QT_MITSHM) +#if defined(QT_MITSHM_XFORM) static bool xshminit = FALSE; static XShmSegmentInfo xshminfo; @@ -173,8 +184,100 @@ // return FALSE; // } -#endif // QT_MITSHM +#endif // QT_MITSHM_XFORM + +#ifdef QT_MITSHM_CONVERSIONS +static bool qt_mitshm_error = false; +static int qt_mitshm_errorhandler( Display*, XErrorEvent* ) +{ + qt_mitshm_error = true; + return 0; +} + +static XImage* qt_XShmCreateImage( Display* dpy, Visual* visual, unsigned int depth, + int format, int /*offset*/, char* /*data*/, unsigned int width, unsigned int height, + int /*bitmap_pad*/, int /*bytes_per_line*/, XShmSegmentInfo* shminfo ) +{ + if( width * height * depth < 100*100*32 ) + return NULL; + static int shm_inited = -1; + if( shm_inited == -1 ) { + if( XShmQueryExtension( dpy )) + shm_inited = 1; + else + shm_inited = 0; + } + if( shm_inited == 0 ) + return NULL; + XImage* xi = XShmCreateImage( dpy, visual, depth, format, NULL, shminfo, width, + height ); + if( xi == NULL ) + return NULL; + shminfo->shmid = shmget( IPC_PRIVATE, xi->bytes_per_line * xi->height, + IPC_CREAT|0777); + if( shminfo->shmid < 0 ) { + XDestroyImage( xi ); + return NULL; + } + shminfo->readOnly = False; + shminfo->shmaddr = (char*)shmat( shminfo->shmid, 0, 0 ); + if( shminfo->shmaddr == (char*)-1 ) { + XDestroyImage( xi ); + shmctl( shminfo->shmid, IPC_RMID, 0 ); + return NULL; + } + xi->data = shminfo->shmaddr; +#ifndef QT_MITSHM_RMID_IGNORES_REFCOUNT + // mark as deleted to automatically free the memory in case + // of a crash (but this doesn't work e.g. on Solaris) + shmctl( shminfo->shmid, IPC_RMID, 0 ); +#endif + if( shm_inited == 1 ) { // first time + XErrorHandler old_h = XSetErrorHandler( qt_mitshm_errorhandler ); + XShmAttach( dpy, shminfo ); + shm_inited = 2; + XSync( dpy, False ); + XSetErrorHandler( old_h ); + if( qt_mitshm_error ) { // oops ... perhaps we are remote? + shm_inited = 0; + XDestroyImage( xi ); + shmdt( shminfo->shmaddr ); +#ifdef QT_MITSHM_RMID_IGNORES_REFCOUNT + shmctl( shminfo->shmid, IPC_RMID, 0 ); +#endif + return NULL; + } + } else + XShmAttach( dpy, shminfo ); + return xi; +} + +static void qt_XShmDestroyImage( XImage* xi, XShmSegmentInfo* shminfo ) +{ + XShmDetach( QPaintDevice::x11AppDisplay(), shminfo ); + XDestroyImage( xi ); + shmdt( shminfo->shmaddr ); +#ifdef QT_MITSHM_RMID_IGNORES_REFCOUNT + shmctl( shminfo->shmid, IPC_RMID, 0 ); +#endif +} + +static XImage* qt_XShmGetImage( const QPixmap* pix, int format, + XShmSegmentInfo* shminfo ) +{ + XImage* xi = qt_XShmCreateImage( pix->x11Display(), (Visual*)pix->x11Visual(), + pix->depth(), format, 0, 0, pix->width(), pix->height(), 32, 0, shminfo ); + if( xi == NULL ) + return NULL; + if( XShmGetImage( pix->x11Display(), pix->handle(), xi, 0, 0, AllPlanes ) == False ) { + qt_XShmDestroyImage( xi, shminfo ); + return NULL; + } + return xi; +} + +#endif // QT_MITSHM_CONVERSIONS /***************************************************************************** Internal functions @@ -625,9 +728,20 @@ d = 32; // > 8 ==> 32 XImage *xi = (XImage *)data->ximage; // any cached ximage? - if ( !xi ) // fetch data from X server - xi = XGetImage( x11Display(), hd, 0, 0, w, h, AllPlanes, +#ifdef QT_MITSHM_CONVERSIONS + bool mitshm_ximage = false; + XShmSegmentInfo shminfo; +#endif + if ( !xi ) { // fetch data from X server +#ifdef QT_MITSHM_CONVERSIONS + xi = qt_XShmGetImage( this, mono ? XYPixmap : ZPixmap, &shminfo ); + if( xi ) { + mitshm_ximage = true; + } else +#endif + xi = XGetImage( x11Display(), hd, 0, 0, w, h, AllPlanes, mono ? XYPixmap : ZPixmap ); + } Q_CHECK_PTR( xi ); QImage::Endian bitOrder = QImage::IgnoreEndian; @@ -636,15 +750,31 @@ QImage::LittleEndian : QImage::BigEndian; } image.create( w, h, d, 0, bitOrder ); - if ( image.isNull() ) // could not create image + if ( image.isNull() ) { // could not create image +#ifdef QT_MITSHM_CONVERSIONS + if( mitshm_ximage ) + qt_XShmDestroyImage( xi, &shminfo ); + else +#endif + qSafeXDestroyImage( xi ); return image; + } const QPixmap* msk = mask(); const QPixmap *alf = data->alphapm; QImage alpha; if (alf) { - XImage *axi = XGetImage(x11Display(), alf->hd, 0, 0, w, h, AllPlanes, ZPixmap); + XImage* axi; +#ifdef QT_MITSHM_CONVERSIONS + bool mitshm_aximage = false; + XShmSegmentInfo ashminfo; + axi = qt_XShmGetImage( alf, ZPixmap, &ashminfo ); + if( axi ) { + mitshm_aximage = true; + } else +#endif + axi = XGetImage(x11Display(), alf->hd, 0, 0, w, h, AllPlanes, ZPixmap); if (axi) { image.setAlphaBuffer( TRUE ); @@ -658,7 +788,12 @@ src += axi->bytes_per_line; } - qSafeXDestroyImage( axi ); +#ifdef QT_MITSHM_CONVERSIONS + if( mitshm_aximage ) + qt_XShmDestroyImage( axi, &ashminfo ); + else +#endif + qSafeXDestroyImage( axi ); } } else if (msk) { image.setAlphaBuffer( TRUE ); @@ -800,6 +935,12 @@ xi->bits_per_pixel ); #endif image.reset(); +#ifdef QT_MITSHM_CONVERSIONS + if( mitshm_ximage ) + qt_XShmDestroyImage( xi, &shminfo ); + else +#endif + qSafeXDestroyImage( xi ); return image; } @@ -905,10 +1046,22 @@ delete [] carr; } if ( data->optim != BestOptim ) { // throw away image data - qSafeXDestroyImage( xi ); +#ifdef QT_MITSHM_CONVERSIONS + if( mitshm_ximage ) + qt_XShmDestroyImage( xi, &shminfo ); + else +#endif + qSafeXDestroyImage( xi ); ((QPixmap*)this)->data->ximage = 0; - } else // keep ximage data + } else { // keep ximage data +#ifdef QT_MITSHM_CONVERSIONS + if( mitshm_ximage ) { // copy the XImage? + qt_XShmDestroyImage( xi, &shminfo ); + xi = 0; + } +#endif ((QPixmap*)this)->data->ximage = xi; + } return image; } @@ -1078,6 +1231,11 @@ bool trucol = (visual->c_class == TrueColor); int nbytes = image.numBytes(); uchar *newbits= 0; + int newbits_size = 0; +#ifdef QT_MITSHM_CONVERSIONS + bool mitshm_ximage = false; + XShmSegmentInfo shminfo; +#endif if ( trucol ) { // truecolor display QRgb pix[256]; // pixel translation table @@ -1106,17 +1264,23 @@ } } - xi = XCreateImage( dpy, visual, dd, ZPixmap, 0, 0, w, h, 32, 0 ); +#ifdef QT_MITSHM_CONVERSIONS + xi = qt_XShmCreateImage( dpy, visual, dd, ZPixmap, 0, 0, w, h, 32, 0, &shminfo ); + if( xi != NULL ) { + mitshm_ximage = true; + newbits = (uchar*)xi->data; + } + else +#endif + xi = XCreateImage( dpy, visual, dd, ZPixmap, 0, 0, w, h, 32, 0 ); Q_CHECK_PTR( xi ); - newbits = (uchar *)malloc( xi->bytes_per_line*h ); + if( newbits == NULL ) + newbits = (uchar *)malloc( xi->bytes_per_line*h ); Q_CHECK_PTR( newbits ); if ( !newbits ) // no memory return FALSE; int bppc = xi->bits_per_pixel; - if ( bppc > 8 && xi->byte_order == LSBFirst ) - bppc++; - bool contig_bits = n_bits(red_mask) == rbits && n_bits(green_mask) == gbits && n_bits(blue_mask) == bbits; @@ -1165,32 +1329,70 @@ } init=TRUE; } + + enum { BPP8, + BPP16_8_3_M3, BPP16_7_2_M3, BPP16_MSB, BPP16_LSB, + BPP24_MSB, BPP24_LSB, + BPP32_16_8_0, BPP32_MSB, BPP32_LSB + } mode = BPP8; - for ( uint y=0; ybytes_per_line*y; - QRgb* p = (QRgb *)src; + if ( bppc > 8 && xi->byte_order == LSBFirst ) + bppc++; -#define GET_RGB \ - int r = qRed ( *p ); \ - int g = qGreen( *p ); \ - int b = qBlue ( *p++ ); \ - r = red_shift > 0 \ - ? r << red_shift : r >> -red_shift; \ - g = green_shift > 0 \ - ? g << green_shift : g >> -green_shift; \ - b = blue_shift > 0 \ - ? b << blue_shift : b >> -blue_shift; + int wordsize; + bool bigendian; + qSysInfo( &wordsize, &bigendian ); + bool same_msb_lsb = ( xi->byte_order == MSBFirst ) == ( bigendian ); + + if( bppc == 8 ) // 8 bit + mode = BPP8; + else if( bppc == 16 || bppc == 17 ) { // 16 bit MSB/LSB + if( red_shift == 8 && green_shift == 3 && blue_shift == -3 + && !d8 && same_msb_lsb ) + mode = BPP16_8_3_M3; + else if( red_shift == 7 && green_shift == 2 && blue_shift == -3 + && !d8 && same_msb_lsb ) + mode = BPP16_7_2_M3; + else + mode = bppc == 17 ? BPP16_LSB : BPP16_MSB; + } else if( bppc == 24 || bppc == 25 ) { // 24 bit MSB/LSB + mode = bppc == 25 ? BPP24_LSB : BPP24_MSB; + } else if( bppc == 32 || bppc == 33 ) { // 32 bit MSB/LSB + if( red_shift == 16 && green_shift == 8 && blue_shift == 0 + && !d8 && same_msb_lsb ) + mode = BPP32_16_8_0; + else + mode = bppc == 33 ? BPP32_LSB : BPP32_MSB; + } else + qFatal("Logic error 3"); #define GET_PIXEL \ int pixel; \ if ( d8 ) pixel = pix[*src++]; \ else { \ - GET_RGB \ - pixel = (b & blue_mask)|(g & green_mask) | (r & red_mask) \ + int r = qRed ( *p ); \ + int g = qGreen( *p ); \ + int b = qBlue ( *p++ ); \ + r = red_shift > 0 \ + ? r << red_shift : r >> -red_shift; \ + g = green_shift > 0 \ + ? g << green_shift : g >> -green_shift; \ + b = blue_shift > 0 \ + ? b << blue_shift : b >> -blue_shift; \ + pixel = (r & red_mask)|(g & green_mask) | (b & blue_mask) \ | ~(blue_mask | green_mask | red_mask); \ } +// optimized case - no d8 case, shift only once instead of twice, mask only once instead of twice, +// use direct values instead of variables, and use only one statement +// (*p >> 16), (*p >> 8 ) and (*p) are qRed(),qGreen() and qBlue() without masking +// shifts have to be passed including the shift operator (e.g. '>>3'), because of the direction +#define GET_PIXEL_OPT(red_shift,green_shift,blue_shift,red_mask,green_mask,blue_mask) \ + int pixel = ((( *p >> 16 ) red_shift ) & red_mask ) \ + | ((( *p >> 8 ) green_shift ) & green_mask ) \ + | ((( *p ) blue_shift ) & blue_mask ); \ + ++p; + #define GET_PIXEL_DITHER_TC \ int r = qRed ( *p ); \ int g = qGreen( *p ); \ @@ -1211,91 +1413,177 @@ ? g << green_shift : g >> -green_shift; \ b = blue_shift > 0 \ ? b << blue_shift : b >> -blue_shift; \ - int pixel = (b & blue_mask)|(g & green_mask) | (r & red_mask); + int pixel = (r & red_mask)|(g & green_mask) | (b & blue_mask); - if ( dither_tc ) { - uint x; - switch ( bppc ) { - case 16: // 16 bit MSB - for ( x=0; x> 8); - *dst++ = pixel; - } +// again, optimized case +// can't be optimized that much :( +#define GET_PIXEL_DITHER_TC_OPT(red_shift,green_shift,blue_shift,red_mask,green_mask,blue_mask, \ + rbits,gbits,bbits) \ + const int thres = D[x%16][y%16]; \ + int r = qRed ( *p ); \ + if ( r <= (255-(1<<(8-rbits))) && ((r< thres) \ + r += (1<<(8-rbits)); \ + int g = qGreen( *p ); \ + if ( g <= (255-(1<<(8-gbits))) && ((g< thres) \ + g += (1<<(8-gbits)); \ + int b = qBlue ( *p++ ); \ + if ( b <= (255-(1<<(8-bbits))) && ((b< thres) \ + b += (1<<(8-bbits)); \ + int pixel = (( r red_shift ) & red_mask ) \ + | (( g green_shift ) & green_mask ) \ + | (( b blue_shift ) & blue_mask ); + +#define CYCLE(body) \ + for ( uint y=0; ybytes_per_line*y; \ + QRgb* p = (QRgb *)src; \ + body \ + } + + if ( dither_tc ) { + switch ( mode ) { + case BPP16_8_3_M3: + CYCLE( + Q_INT16* dst16 = (Q_INT16*)dst; + for ( uint x=0; x>3,0xf800,0x7e0,0x1f,5,6,5) + *dst16++ = pixel; + } + ) break; - case 17: // 16 bit LSB - for ( x=0; x> 8; - } + case BPP16_7_2_M3: + CYCLE( + Q_INT16* dst16 = (Q_INT16*)dst; + for ( uint x=0; x>3,0x7c00,0x3e0,0x1f,5,5,5) + *dst16++ = pixel; + } + ) + break; + case BPP16_MSB: // 16 bit MSB + CYCLE( + for ( uint x=0; x> 8); + *dst++ = pixel; + } + ) + break; + case BPP16_LSB: // 16 bit LSB + CYCLE( + for ( uint x=0; x> 8; + } + ) break; default: qFatal("Logic error"); } - } else { - uint x; - switch ( bppc ) { - case 8: // 8 bit - for ( x=0; x> 8); - *dst++ = pixel; - } + case BPP16_8_3_M3: + CYCLE( + Q_INT16* dst16 = (Q_INT16*)dst; + for ( uint x=0; x>3,0xf800,0x7e0,0x1f) + *dst16++ = pixel; + } + ) break; - case 17: // 16 bit LSB - for ( x=0; x> 8; - } + case BPP16_7_2_M3: + CYCLE( + Q_INT16* dst16 = (Q_INT16*)dst; + for ( uint x=0; x>3,0x7c00,0x3e0,0x1f) + *dst16++ = pixel; + } + ) break; - case 24: // 24 bit MSB - for ( x=0; x> 16; - *dst++ = pixel >> 8; - *dst++ = pixel; - } + case BPP16_MSB: // 16 bit MSB + CYCLE( + for ( uint x=0; x> 8); + *dst++ = pixel; + } + ) break; - case 25: // 24 bit LSB - for ( x=0; x> 8; - *dst++ = pixel >> 16; - } + case BPP16_LSB: // 16 bit LSB + CYCLE( + for ( uint x=0; x> 8; + } + ) break; - case 32: // 32 bit MSB - for ( x=0; x> 24; - *dst++ = pixel >> 16; - *dst++ = pixel >> 8; - *dst++ = pixel; - } + case BPP24_MSB: // 24 bit MSB + CYCLE( + for ( uint x=0; x> 16; + *dst++ = pixel >> 8; + *dst++ = pixel; + } + ) break; - case 33: // 32 bit LSB - for ( x=0; x> 8; - *dst++ = pixel >> 16; - *dst++ = pixel >> 24; - } + case BPP24_LSB: // 24 bit LSB + CYCLE( + for ( uint x=0; x> 8; + *dst++ = pixel >> 16; + } + ) break; - default: - qFatal("Logic error 2"); - } - } - } - xi->data = (char *)newbits; + case BPP32_16_8_0: + CYCLE( + memcpy( dst, p, w * 4 ); + ) + break; + case BPP32_MSB: // 32 bit MSB + CYCLE( + for ( uint x=0; x> 24; + *dst++ = pixel >> 16; + *dst++ = pixel >> 8; + *dst++ = pixel; + } + ) + break; + case BPP32_LSB: // 32 bit LSB + CYCLE( + for ( uint x=0; x> 8; + *dst++ = pixel >> 16; + *dst++ = pixel >> 24; + } + ) + break; + default: + qFatal("Logic error 2"); + } + } + xi->data = (char *)newbits; } if ( d == 8 && !trucol ) { // 8 bit pixmap @@ -1314,6 +1602,7 @@ } newbits = (uchar *)malloc( nbytes ); // copy image into newbits + newbits_size = nbytes; Q_CHECK_PTR( newbits ); if ( !newbits ) // no memory return FALSE; @@ -1431,11 +1720,18 @@ } if ( !xi ) { // X image not created - xi = XCreateImage( dpy, visual, dd, ZPixmap, 0, 0, w, h, 32, 0 ); +#ifdef QT_MITSHM_CONVERSIONS + xi = qt_XShmCreateImage( dpy, visual, dd, ZPixmap, 0, 0, w, h, 32, 0, &shminfo ); + if( xi != NULL ) + mitshm_ximage = true; + else +#endif + xi = XCreateImage( dpy, visual, dd, ZPixmap, 0, 0, w, h, 32, 0 ); if ( xi->bits_per_pixel == 16 ) { // convert 8 bpp ==> 16 bpp ushort *p2; int p2inc = xi->bytes_per_line/sizeof(ushort); ushort *newerbits = (ushort *)malloc( xi->bytes_per_line * h ); + newbits_size = xi->bytes_per_line * h; Q_CHECK_PTR( newerbits ); if ( !newerbits ) // no memory return FALSE; @@ -1453,7 +1749,15 @@ "(bpp=%d)", xi->bits_per_pixel ); #endif } - xi->data = (char *)newbits; +#ifdef QT_MITSHM_CONVERSIONS + if( newbits_size > 0 && mitshm_ximage ) { // need to copy to shared memory + memcpy( xi->data, newbits, newbits_size ); + free( newbits ); + newbits = (uchar*)xi->data; + } + else +#endif + xi->data = (char *)newbits; } if ( hd && (width() != (int)w || height() != (int)h || this->depth() != dd) ) { @@ -1486,19 +1790,24 @@ } - XPutImage( dpy, hd, qt_xget_readonly_gc( x11Screen(), FALSE ), - xi, 0, 0, 0, 0, w, h ); +#ifdef QT_MITSHM_CONVERSIONS + if( mitshm_ximage ) + XShmPutImage( dpy, hd, qt_xget_readonly_gc( x11Screen(), FALSE ), + xi, 0, 0, 0, 0, w, h, False ); + else +#endif + XPutImage( dpy, hd, qt_xget_readonly_gc( x11Screen(), FALSE ), + xi, 0, 0, 0, 0, w, h ); - if ( data->optim != BestOptim ) { // throw away image - qSafeXDestroyImage( xi ); - data->ximage = 0; - } else { // keep ximage that we created - data->ximage = xi; - } data->w = w; data->h = h; data->d = dd; + XImage* axi = NULL; +#ifdef QT_MITSHM_CONVERSIONS + bool mitshm_aximage = false; + XShmSegmentInfo ashminfo; +#endif if ( image.hasAlphaBuffer() ) { QBitmap m; m = image.createAlphaMask( conversion_flags ); @@ -1534,38 +1843,90 @@ data->alphapm->rendhd = (HANDLE) XftDrawCreateAlpha( x11Display(), data->alphapm->hd, 8 ); - XImage *axi = XCreateImage(x11Display(), (Visual *) x11Visual(), - 8, ZPixmap, 0, 0, w, h, 8, 0); +#ifdef QT_MITSHM_CONVERSIONS + axi = qt_XShmCreateImage( x11Display(), (Visual*)x11Visual(), + 8, ZPixmap, 0, 0, w, h, 8, 0, &ashminfo ); + if( axi != NULL ) + mitshm_aximage = true; + else +#endif + axi = XCreateImage(x11Display(), (Visual *) x11Visual(), + 8, ZPixmap, 0, 0, w, h, 8, 0); if (axi) { - // the data is deleted by qSafeXDestroyImage - axi->data = (char *) malloc(h * axi->bytes_per_line); - Q_CHECK_PTR( axi->data ); + if( axi->data==NULL ) { + // the data is deleted by qSafeXDestroyImage + axi->data = (char *) malloc(h * axi->bytes_per_line); + Q_CHECK_PTR( axi->data ); + } char *aptr = axi->data; if (image.depth() == 32) { const int *iptr = (const int *) image.bits(); - int max = w * h; - while (max--) - *aptr++ = *iptr++ >> 24; // squirt + if( axi->bytes_per_line == (int)w ) { + int max = w * h; + while (max--) + *aptr++ = *iptr++ >> 24; // squirt + } else { + for (uint i = 0; i < h; ++i ) { + for (uint j = 0; j < w; ++j ) + *aptr++ = *iptr++ >> 24; // squirt + aptr += ( axi->bytes_per_line - w ); + } + } } else if (image.depth() == 8) { const QRgb * const rgb = image.colorTable(); for (uint y = 0; y < h; ++y) { const uchar *iptr = image.scanLine(y); for (uint x = 0; x < w; ++x) *aptr++ = qAlpha(rgb[*iptr++]); + aptr += ( axi->bytes_per_line - w ); } } GC gc = XCreateGC(x11Display(), data->alphapm->hd, 0, 0); - XPutImage(dpy, data->alphapm->hd, gc, axi, 0, 0, 0, 0, w, h); +#ifdef QT_MITSHM_CONVERSIONS + if( mitshm_aximage ) + XShmPutImage( dpy, data->alphapm->hd, gc, axi, 0, 0, 0, 0, w, h, False ); + else +#endif + XPutImage(dpy, data->alphapm->hd, gc, axi, 0, 0, 0, 0, w, h); XFreeGC(x11Display(), gc); - qSafeXDestroyImage(axi); } } #endif // QT_NO_XFTFREETYPE } +#ifdef QT_MITSHM_CONVERSIONS + if( mitshm_ximage || mitshm_aximage ) + XSync( x11Display(), False ); // wait until processed +#endif + + if ( data->optim != BestOptim ) { // throw away image +#ifdef QT_MITSHM_CONVERSIONS + if( mitshm_ximage ) + qt_XShmDestroyImage( xi, &shminfo ); + else +#endif + qSafeXDestroyImage( xi ); + data->ximage = 0; + } else { // keep ximage that we created +#ifdef QT_MITSHM_CONVERSIONS + if( mitshm_ximage ) { // copy the XImage? + qt_XShmDestroyImage( xi, &shminfo ); + xi = 0; + } +#endif + data->ximage = xi; + } + if( axi ) { +#ifdef QT_MITSHM_CONVERSIONS + if( mitshm_aximage ) + qt_XShmDestroyImage( axi, &ashminfo ); + else +#endif + qSafeXDestroyImage(axi); + } return TRUE; } @@ -1722,7 +2083,7 @@ return pm; } -#if defined(QT_MITSHM) +#if defined(QT_MITSHM_XFORM) static bool try_once = TRUE; if (try_once) { try_once = FALSE; @@ -1755,7 +2116,7 @@ dbpl = ((w*bpp+31)/32)*4; dbytes = dbpl*h; -#if defined(QT_MITSHM) +#if defined(QT_MITSHM_XFORM) if ( use_mitshm ) { dptr = (uchar *)xshmimg->data; uchar fillbyte = bpp == 8 ? white.pixel() : 0xff; @@ -1771,7 +2132,7 @@ memset( dptr, Qt::white.pixel( x11Screen() ), dbytes ); else memset( dptr, 0xff, dbytes ); -#if defined(QT_MITSHM) +#if defined(QT_MITSHM_XFORM) } #endif @@ -1802,7 +2163,7 @@ } else { xbpl = (w*bpp)/8; p_inc = dbpl - xbpl; -#if defined(QT_MITSHM) +#if defined(QT_MITSHM_XFORM) if ( use_mitshm ) p_inc = xshmimg->bytes_per_line - xbpl; #endif @@ -1839,7 +2200,7 @@ QPixmap pm( w, h ); pm.data->uninit = FALSE; pm.x11SetScreen( x11Screen() ); -#if defined(QT_MITSHM) +#if defined(QT_MITSHM_XFORM) if ( use_mitshm ) { XCopyArea( dpy, xshmpm, pm.handle(), gc, 0, 0, w, h, 0, 0 ); } else { @@ -1848,7 +2209,7 @@ ZPixmap, 0, (char *)dptr, w, h, 32, 0 ); XPutImage( dpy, pm.handle(), gc, xi, 0, 0, 0, 0, w, h); qSafeXDestroyImage( xi ); -#if defined(QT_MITSHM) +#if defined(QT_MITSHM_XFORM) } #endif diff -uNr qt-x11-free-3.3.3/src/kernel/qpngio.cpp qt-x11-free-3.3.3-new/src/kernel/qpngio.cpp --- qt-x11-free-3.3.3/src/kernel/qpngio.cpp Thu Aug 5 10:42:11 2004 +++ qt-x11-free-3.3.3-new/src/kernel/qpngio.cpp Mon Oct 25 17:57:05 2004 @@ -110,10 +110,18 @@ static void setup_qt( QImage& image, png_structp png_ptr, png_infop info_ptr, float screen_gamma=0.0 ) { - if ( screen_gamma != 0.0 && png_get_valid(png_ptr, info_ptr, PNG_INFO_gAMA) ) { + if ( 0.0 == screen_gamma ) + // PNG docs say this is a good guess for a PC monitor + // in a dark room + screen_gamma = 2.2; + if ( png_get_valid(png_ptr, info_ptr, PNG_INFO_gAMA) ) { + // the file has a gAMA attribute double file_gamma; - png_get_gAMA(png_ptr, info_ptr, &file_gamma); - png_set_gamma( png_ptr, screen_gamma, file_gamma ); + if ( png_get_gAMA(png_ptr, info_ptr, &file_gamma)) + png_set_gamma( png_ptr, screen_gamma, file_gamma ); + } else { + // no file gamma, use a reasonable default + png_set_gamma( png_ptr, screen_gamma, 0.45455 ); } png_uint_32 width; diff -uNr qt-x11-free-3.3.3/src/kernel/qprocess_unix.cpp qt-x11-free-3.3.3-new/src/kernel/qprocess_unix.cpp --- qt-x11-free-3.3.3/src/kernel/qprocess_unix.cpp Thu Aug 5 10:42:05 2004 +++ qt-x11-free-3.3.3-new/src/kernel/qprocess_unix.cpp Mon Oct 25 17:57:05 2004 @@ -761,7 +761,7 @@ #endif i++; } -#ifdef Q_OS_MACX +#if defined(Q_OS_MACX) || defined(Q_OS_DARWIN) if(i) { QCString arg_bundle = arglistQ[0]; QFileInfo fi(arg_bundle); @@ -819,7 +819,7 @@ if ( env == 0 ) { // inherit environment and start process QString command = _arguments[0]; -#if defined(Q_OS_MACX) //look in a bundle +#if defined(Q_OS_MACX) || defined(Q_OS_DARWIN) //look in a bundle const QString mac_bundle_suffix = ".app/Contents/MacOS/"; if(!QFile::exists(command) && QFile::exists(command + mac_bundle_suffix)) { QString exec = command; @@ -839,7 +839,7 @@ } else { // start process with environment settins as specified in env // construct the environment for exec int numEntries = env->count(); -#if defined(Q_OS_MACX) +#if defined(Q_OS_MACX) || defined(Q_OS_DARWIN) QString ld_library_path("DYLD_LIBRARY_PATH"); #else QString ld_library_path("LD_LIBRARY_PATH"); @@ -871,7 +871,7 @@ QStringList pathList = QStringList::split( ':', getenv( "PATH" ) ); for (QStringList::Iterator it = pathList.begin(); it != pathList.end(); ++it ) { QString dir = *it; -#if defined(Q_OS_MACX) //look in a bundle +#if defined(Q_OS_MACX) || defined(Q_OS_DARWIN) //look in a bundle if(!QFile::exists(dir + "/" + command) && QFile::exists(dir + "/" + command + ".app")) dir += "/" + command + ".app/Contents/MacOS"; #endif @@ -881,7 +881,7 @@ QFileInfo fileInfo( dir + "/" + command ); #endif if ( fileInfo.isExecutable() ) { -#if defined(Q_OS_MACX) +#if defined(Q_OS_MACX) || defined(Q_OS_DARWIN) arglistQ[0] = fileInfo.absFilePath().local8Bit(); #else arglistQ[0] = fileInfo.filePath().local8Bit(); @@ -892,7 +892,7 @@ } } } -#if defined(Q_OS_MACX) +#if defined(Q_OS_MACX) || defined(Q_OS_DARWIN) if(!QFile::exists(arglist[0])) { QString command = arglist[0]; const QString mac_bundle_suffix = ".app/Contents/MacOS/"; diff -uNr qt-x11-free-3.3.3/src/kernel/qrichtext.cpp qt-x11-free-3.3.3-new/src/kernel/qrichtext.cpp --- qt-x11-free-3.3.3/src/kernel/qrichtext.cpp Thu Aug 5 10:42:06 2004 +++ qt-x11-free-3.3.3-new/src/kernel/qrichtext.cpp Mon Oct 25 17:57:05 2004 @@ -3801,6 +3801,7 @@ // determines the properties we need for layouting QTextEngine textEngine( toString(), 0 ); + textEngine.direction = (QChar::Direction) dir; textEngine.itemize(QTextEngine::SingleLine); const QCharAttributes *ca = textEngine.attributes() + length-1; QTextStringChar *ch = (QTextStringChar *)end - 1; @@ -3835,7 +3836,7 @@ } else if ( dir == QChar::DirL ) { that->rightToLeft = FALSE; } else { - that->rightToLeft = (textEngine.items[0].analysis.bidiLevel % 2); + that->rightToLeft = (textEngine.direction == QChar::DirR); } } @@ -4412,8 +4413,7 @@ return &str->at( i ); } - qWarning( "QTextParagraph::lineStartOfLine: couldn't find %d", line ); - return 0; + qWarning( "QTextParagraph::lineStartOfLine: couldn't find %d", line ); return 0; } int QTextParagraph::leftGap() const @@ -4510,6 +4510,8 @@ fullSelectionWidth = (hasdoc ? document()->width() : r.width()); QString qstr = str->toString(); + // detach string + qstr.setLength(qstr.length()); // ### workaround so that \n are not drawn, actually this should // be fixed in QFont somewhere (under Windows you get ugly boxes // otherwise) @@ -5310,7 +5312,7 @@ #endif // collects one line of the paragraph and transforms it to visual order -QTextLineStart *QTextFormatter::bidiReorderLine( QTextParagraph * /*parag*/, QTextString *text, QTextLineStart *line, +QTextLineStart *QTextFormatter::bidiReorderLine( QTextParagraph * parag, QTextString *text, QTextLineStart *line, QTextStringChar *startChar, QTextStringChar *lastChar, int align, int space ) { // ignore white space at the end of the line. @@ -5404,6 +5406,7 @@ } ch->x = x + toAdd; + ch->rightToLeft = ch->bidiLevel % 2; //qDebug("visual: %d (%p) placed at %d rightToLeft=%d", visual[i], ch, x +toAdd, ch->rightToLeft ); int ww = 0; if ( ch->c.unicode() >= 32 || ch->c == '\t' || ch->c == '\n' || ch->isCustom() ) { @@ -5419,12 +5422,14 @@ while ( endSpaces-- ) { ++lastChar; int sw = lastChar->format()->width( ' ' ); - if ( lastChar->rightToLeft ) { + if ( text->isRightToLeft() ) { xorig -= sw; lastChar->x = xorig; + ch->rightToLeft = TRUE; } else { lastChar->x = x; x += sw; + ch->rightToLeft = FALSE; } } diff -uNr qt-x11-free-3.3.3/src/kernel/qtextengine.cpp qt-x11-free-3.3.3-new/src/kernel/qtextengine.cpp --- qt-x11-free-3.3.3/src/kernel/qtextengine.cpp Thu Aug 5 10:42:08 2004 +++ qt-x11-free-3.3.3-new/src/kernel/qtextengine.cpp Mon Oct 25 17:57:05 2004 @@ -268,6 +268,10 @@ if ( sdir != QChar::DirL && sdir != QChar::DirR && sdir != QChar::DirEN && sdir != QChar::DirAN ) sdir = QChar::DirON; status.eor = sdir; +#if (BIDI_DEBUG >= 2) + qDebug("---- bidiReorder --- '%s'", engine->string.utf8().data()); + qDebug("rightToLeft = %d", rightToLeft); +#endif status.lastStrong = rightToLeft ? QChar::DirR : QChar::DirL;; status.last = status.lastStrong; status.dir = sdir; @@ -353,6 +357,10 @@ if ( !first ) { appendItems(engine, sor, eor, control, dir); dir = eor < length ? direction( unicode[eor] ) : control.basicDirection(); + status.eor = dir; + } + else{ + eor = current; status.eor = dir; } break; diff -uNr qt-x11-free-3.3.3/src/kernel/qtextlayout.cpp qt-x11-free-3.3.3-new/src/kernel/qtextlayout.cpp --- qt-x11-free-3.3.3/src/kernel/qtextlayout.cpp Thu Aug 5 10:42:10 2004 +++ qt-x11-free-3.3.3-new/src/kernel/qtextlayout.cpp Mon Oct 25 17:57:05 2004 @@ -631,3 +631,7 @@ return attributes[pos].charStop; } +void QTextLayout::setDirection(QChar::Direction dir) +{ + d->direction = dir; +} diff -uNr qt-x11-free-3.3.3/src/kernel/qtextlayout_p.h qt-x11-free-3.3.3-new/src/kernel/qtextlayout_p.h --- qt-x11-free-3.3.3/src/kernel/qtextlayout_p.h Thu Aug 5 10:42:10 2004 +++ qt-x11-free-3.3.3-new/src/kernel/qtextlayout_p.h Mon Oct 25 17:57:05 2004 @@ -153,7 +153,8 @@ bool validCursorPosition( int pos ) const; int nextCursorPosition( int oldPos, CursorMode mode = SkipCharacters ) const; int previousCursorPosition( int oldPos, CursorMode mode = SkipCharacters ) const; - +void setDirection(QChar::Direction); + private: QTextLayout( QTextEngine *e ) : d( e ) {} /* disable copy and assignment */ diff -uNr qt-x11-free-3.3.3/src/moc/moc.pro qt-x11-free-3.3.3-new/src/moc/moc.pro --- qt-x11-free-3.3.3/src/moc/moc.pro Fri Oct 31 09:36:28 2003 +++ qt-x11-free-3.3.3-new/src/moc/moc.pro Mon Oct 25 17:57:05 2004 @@ -48,6 +48,8 @@ unix:SOURCES += ../tools/qfile_unix.cpp ../tools/qdir_unix.cpp ../tools/qfileinfo_unix.cpp win32:SOURCES += ../tools/qfile_win.cpp ../tools/qdir_win.cpp ../tools/qfileinfo_win.cpp macx:LIBS += -framework Carbon +CFLAGS += -mdynamic-no-pic +CXXFLAGS += -mdynamic-no-pic target.path=$$bins.path INSTALLS += target diff -uNr qt-x11-free-3.3.3/src/qtmain.pro qt-x11-free-3.3.3-new/src/qtmain.pro --- qt-x11-free-3.3.3/src/qtmain.pro Fri Oct 31 09:36:28 2003 +++ qt-x11-free-3.3.3-new/src/qtmain.pro Mon Oct 25 17:57:05 2004 @@ -2,6 +2,7 @@ TEMPLATE = lib TARGET = qtmain VERSION = 3.1.0 +COMPATIBILITY_VERSION = 3.0.0 DESTDIR = $$QMAKE_LIBDIR_QT CONFIG += qt staticlib warn_on release diff -uNr qt-x11-free-3.3.3/src/tools/qdir_unix.cpp qt-x11-free-3.3.3-new/src/tools/qdir_unix.cpp --- qt-x11-free-3.3.3/src/tools/qdir_unix.cpp Thu Aug 5 10:41:57 2004 +++ qt-x11-free-3.3.3-new/src/tools/qdir_unix.cpp Mon Oct 25 17:57:05 2004 @@ -88,7 +88,7 @@ bool QDir::mkdir( const QString &dirName, bool acceptAbsPath ) const { -#if defined(Q_OS_MACX) // Mac X doesn't support trailing /'s +#if defined(Q_OS_MACX) || defined(Q_OS_DARWIN) // Mac X doesn't support trailing /'s QString name = dirName; if (dirName[dirName.length() - 1] == "/") name = dirName.left( dirName.length() - 1 ); diff -uNr qt-x11-free-3.3.3/src/tools/qglobal.h qt-x11-free-3.3.3-new/src/tools/qglobal.h --- qt-x11-free-3.3.3/src/tools/qglobal.h Thu Aug 5 10:41:56 2004 +++ qt-x11-free-3.3.3-new/src/tools/qglobal.h Mon Oct 25 17:57:05 2004 @@ -79,6 +79,10 @@ UNIX - Any UNIX BSD/SYSV system */ +#ifndef __DARWIN_X11__ +#define __DARWIN_X11__ +#endif + #if defined(__DARWIN_X11__) # define Q_OS_DARWIN #elif defined(__APPLE__) && (defined(__GNUC__) || defined(__xlC__)) @@ -545,6 +549,8 @@ #if defined(Q_OS_MAC9) # define Q_WS_MAC9 +#elif defined(__DARWIN_X11__) +# define Q_WS_X11 #elif defined(Q_OS_MSDOS) # define Q_WS_WIN16 # error "Qt requires Win32 and does not work with Windows 3.x" diff -uNr qt-x11-free-3.3.3/src/tools/qgpluginmanager.cpp qt-x11-free-3.3.3-new/src/tools/qgpluginmanager.cpp --- qt-x11-free-3.3.3/src/tools/qgpluginmanager.cpp Thu Aug 5 10:41:56 2004 +++ qt-x11-free-3.3.3-new/src/tools/qgpluginmanager.cpp Mon Oct 25 17:57:05 2004 @@ -316,7 +316,7 @@ #if defined(Q_OS_WIN32) QString filter = "*.dll"; -#elif defined(Q_OS_MACX) +#elif defined(Q_OS_MACX) || defined(Q_OS_DARWIN) QString filter = "*.dylib; *.so; *.bundle"; #elif defined(Q_OS_HPUX) QString filter = "*.sl"; diff -uNr qt-x11-free-3.3.3/src/tools/qlibrary.cpp qt-x11-free-3.3.3-new/src/tools/qlibrary.cpp --- qt-x11-free-3.3.3/src/tools/qlibrary.cpp Thu Aug 5 10:41:55 2004 +++ qt-x11-free-3.3.3-new/src/tools/qlibrary.cpp Mon Oct 25 17:57:05 2004 @@ -399,7 +399,7 @@ filename += ".dll"; #else QStringList filters = ""; -#ifdef Q_OS_MACX +#if defined(Q_OS_MACX) || defined(Q_OS_DARWIN) filters << ".so"; filters << ".bundle"; filters << ".dylib"; //the last one is also the default one.. diff -uNr qt-x11-free-3.3.3/src/tools/qmutex_unix.cpp qt-x11-free-3.3.3-new/src/tools/qmutex_unix.cpp --- qt-x11-free-3.3.3/src/tools/qmutex_unix.cpp Thu Aug 5 10:41:56 2004 +++ qt-x11-free-3.3.3-new/src/tools/qmutex_unix.cpp Mon Oct 25 17:57:06 2004 @@ -44,7 +44,7 @@ // POSIX threads mutex types #if ((defined(PTHREAD_MUTEX_RECURSIVE) && defined(PTHREAD_MUTEX_DEFAULT)) || \ defined(Q_OS_FREEBSD)) && !defined(Q_OS_UNIXWARE) && !defined(Q_OS_SOLARIS) && \ - !defined(Q_OS_MAC) + !defined(Q_OS_MAC) && !defined(Q_OS_DARWIN) // POSIX 1003.1c-1995 - We love this OS # define Q_MUTEX_SET_TYPE(a, b) pthread_mutexattr_settype((a), (b)) # if defined(QT_CHECK_RANGE) diff -uNr qt-x11-free-3.3.3/src/tools/qstring.cpp qt-x11-free-3.3.3-new/src/tools/qstring.cpp --- qt-x11-free-3.3.3/src/tools/qstring.cpp Thu Aug 5 10:41:58 2004 +++ qt-x11-free-3.3.3-new/src/tools/qstring.cpp Mon Oct 25 17:57:06 2004 @@ -1362,7 +1362,7 @@ QStringData* QString::makeSharedNull() { QString::shared_null = new QStringData; -#if defined( Q_OS_MAC ) || defined(Q_OS_SOLARIS) || defined(Q_OS_HPUX) || defined(Q_OS_AIX) +#if defined( Q_OS_MAC ) || defined(Q_OS_DARWIN) || defined(Q_OS_SOLARIS) || defined(Q_OS_HPUX) || defined(Q_OS_AIX) QString *that = const_cast(&QString::null); that->d = QString::shared_null; #endif @@ -2922,7 +2922,7 @@ if (!l) return -1; -#if defined(Q_OS_MACX) && defined(QT_MACOSX_VERSION) && QT_MACOSX_VERSION >= 0x1020 +#if defined(Q_OS_MACX) && ((defined(QT_MACOSX_VERSION) && QT_MACOSX_VERSION >= 0x1020) | defined(Q_OS_DARWIN)) if ( sl == 1 ) return find( *str.unicode(), index, cs ); #endif @@ -3021,7 +3021,7 @@ int QString::findRev( QChar c, int index, bool cs ) const { -#if defined(Q_OS_MACX) && defined(QT_MACOSX_VERSION) && QT_MACOSX_VERSION < 0x1020 +#if defined(Q_OS_MACX) && ((defined(QT_MACOSX_VERSION) && QT_MACOSX_VERSION >= 0x1020) | defined(Q_OS_DARWIN)) return findRev( QString( c ), index, cs ); #else const uint l = length(); @@ -3077,7 +3077,7 @@ if ( index > delta ) index = delta; -#if defined(Q_OS_MACX) && defined(QT_MACOSX_VERSION) && QT_MACOSX_VERSION >= 0x1020 +#if defined(Q_OS_MACX) && ((defined(QT_MACOSX_VERSION) && QT_MACOSX_VERSION >= 0x1020) | defined(Q_OS_DARWIN)) if ( sl == 1 ) return findRev( *str.unicode(), index, cs ); #endif diff -uNr qt-x11-free-3.3.3/src/tools/qvaluelist.h qt-x11-free-3.3.3-new/src/tools/qvaluelist.h --- qt-x11-free-3.3.3/src/tools/qvaluelist.h Thu Aug 5 10:41:56 2004 +++ qt-x11-free-3.3.3-new/src/tools/qvaluelist.h Mon Oct 25 17:57:06 2004 @@ -636,13 +636,11 @@ l.clear(); Q_UINT32 c; s >> c; - for( Q_UINT32 i = 0; i < c; ++i ) + for( Q_UINT32 i = 0; i < c && !s.atEnd(); ++i ) { T t; s >> t; l.append( t ); - if ( s.atEnd() ) - break; } return s; } diff -uNr qt-x11-free-3.3.3/src/widgets/qheader.cpp qt-x11-free-3.3.3-new/src/widgets/qheader.cpp --- qt-x11-free-3.3.3/src/widgets/qheader.cpp Thu Aug 5 10:42:20 2004 +++ qt-x11-free-3.3.3-new/src/widgets/qheader.cpp Mon Oct 25 17:57:06 2004 @@ -1490,8 +1490,12 @@ p->save(); p->setClipRect( fr ); // hack to keep styles working if ( orientation() == Horizontal ) { + QRect rr = QRect(fr.x() - 2, fr.y() - 2, fr.width() + 4, fr.height() + 4); + if (QApplication::reverseLayout()) + rr.moveBy( 2*(fr.right() - rr.right()) + rr.width() - fr.width(), 0 ); + style().drawPrimitive( QStyle::PE_HeaderSection, p, - QRect(fr.x() - 2, fr.y() - 2, fr.width() + 4, fr.height() + 4), + rr, colorGroup(), flags, QStyleOption( this ) ); @@ -1588,8 +1592,14 @@ flags |= QStyle::Style_Down; else flags |= QStyle::Style_Up; + + QRect rr = QRect(fr.x() + tw - arrowWidth - 6 + ew, 4, arrowWidth, arrowHeight); + + if (QApplication::reverseLayout()) + rr.moveBy( 2*(fr.right() - rr.right()) + rr.width() - fr.width(), 0 ); + style().drawPrimitive( QStyle::PE_HeaderArrow, p, - QRect(fr.x() + tw - arrowWidth - 6 + ew, 4, arrowWidth, arrowHeight), + rr, colorGroup(), flags, QStyleOption( this ) ); } } diff -uNr qt-x11-free-3.3.3/src/widgets/qlineedit.cpp qt-x11-free-3.3.3-new/src/widgets/qlineedit.cpp --- qt-x11-free-3.3.3/src/widgets/qlineedit.cpp Thu Aug 5 10:42:21 2004 +++ qt-x11-free-3.3.3-new/src/widgets/qlineedit.cpp Mon Oct 25 17:57:06 2004 @@ -1758,6 +1758,7 @@ } if ( e->key() == Key_Direction_L || e->key() == Key_Direction_R ) { d->direction = (e->key() == Key_Direction_L) ? QChar::DirL : QChar::DirR; + d->updateTextLayout(); update(); } @@ -2270,6 +2271,9 @@ } textLayout.setText( str, q->font() ); // ### want to do textLayout.setRightToLeft( text.isRightToLeft() ); + //qDebug("dir = %d", direction); + textLayout.setDirection((QChar::Direction)direction); + textLayout.beginLayout(QTextLayout::SingleLine); textLayout.beginLine( INT_MAX ); while ( !textLayout.atEnd() ) diff -uNr qt-x11-free-3.3.3/src/widgets/qpopupmenu.cpp qt-x11-free-3.3.3-new/src/widgets/qpopupmenu.cpp --- qt-x11-free-3.3.3/src/widgets/qpopupmenu.cpp Thu Aug 5 10:42:21 2004 +++ qt-x11-free-3.3.3-new/src/widgets/qpopupmenu.cpp Mon Oct 25 17:57:06 2004 @@ -2529,7 +2529,7 @@ constPolish(); QPopupMenu* that = (QPopupMenu*) this; //We do not need a resize here, just the sizeHint.. - return that->updateSize(FALSE, FALSE).expandedTo( QApplication::globalStrut() ); + return that->updateSize(FALSE).expandedTo( QApplication::globalStrut() ); } diff -uNr qt-x11-free-3.3.3/src/widgets/qprogressbar.cpp qt-x11-free-3.3.3-new/src/widgets/qprogressbar.cpp --- qt-x11-free-3.3.3/src/widgets/qprogressbar.cpp Thu Aug 5 10:42:20 2004 +++ qt-x11-free-3.3.3-new/src/widgets/qprogressbar.cpp Mon Oct 25 17:57:06 2004 @@ -47,6 +47,14 @@ #endif #include +class QProgressBarPrivate +{ + public: + QProgressBarPrivate() : last_painted_progress( 0 ) { } + + int last_painted_progress; +}; + /*! \class QProgressBar qprogressbar.h \brief The QProgressBar widget provides a horizontal progress bar. @@ -99,7 +107,7 @@ center_indicator( TRUE ), auto_indicator( TRUE ), percentage_visible( TRUE ), - d( 0 ) + d( new QProgressBarPrivate ) { setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); initFrame(); @@ -130,12 +138,20 @@ center_indicator( TRUE ), auto_indicator( TRUE ), percentage_visible( TRUE ), - d( 0 ) + d( new QProgressBarPrivate ) { setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); initFrame(); } +/*! + Destroys the object and frees any allocated ressources. +*/ + +QProgressBar::~QProgressBar() +{ + delete d; +} /*! Reset the progress bar. The progress bar "rewinds" and shows no @@ -188,11 +204,16 @@ progress < 0 || ( ( progress > total_steps ) && total_steps ) ) return; + const bool needRepaint = isVisible() && requireRepaint( progress ); + progress_val = progress; setIndicator( progress_str, progress_val, total_steps ); - repaint( FALSE ); + if ( needRepaint ) { + repaint( FALSE ); + d->last_painted_progress = progress; + } #if defined(QT_ACCESSIBILITY_SUPPORT) QAccessible::updateAccessibility( this, 0, QAccessible::ValueChanged ); @@ -318,6 +339,31 @@ QFrame::styleChange( old ); } +/*! + This method returns whether changing the progress to the \a newValue + would require a repaint of the progress bar. This allows efficient + repainting. +*/ +bool QProgressBar::requireRepaint( int newProgress ) const +{ + if ( newProgress == progress_val || + newProgress == d->last_painted_progress ) { + return false; + } + + const int width = contentsRect().width(); + if ( width == 0 ) { + return false; + } + + float progressPerPixel = 1.0; + if ( total_steps > width ) { + progressPerPixel = float( total_steps ) / float( width ); + } + + const int delta = d->last_painted_progress - newProgress; + return QABS( delta ) >= progressPerPixel; +} /*! This method is called to generate the text displayed in the center diff -uNr qt-x11-free-3.3.3/src/widgets/qprogressbar.h qt-x11-free-3.3.3-new/src/widgets/qprogressbar.h --- qt-x11-free-3.3.3/src/widgets/qprogressbar.h Thu Aug 5 10:42:21 2004 +++ qt-x11-free-3.3.3-new/src/widgets/qprogressbar.h Mon Oct 25 17:57:06 2004 @@ -61,6 +61,7 @@ public: QProgressBar( QWidget* parent=0, const char* name=0, WFlags f=0 ); QProgressBar( int totalSteps, QWidget* parent=0, const char* name=0, WFlags f=0 ); + virtual ~QProgressBar(); int totalSteps() const; int progress() const; @@ -91,6 +92,7 @@ virtual bool setIndicator( QString & progress_str, int progress, int totalSteps ); void styleChange( QStyle& ); + bool requireRepaint( int newProgress ) const; private: int total_steps; diff -uNr qt-x11-free-3.3.3/src/widgets/qscrollview.cpp qt-x11-free-3.3.3-new/src/widgets/qscrollview.cpp --- qt-x11-free-3.3.3/src/widgets/qscrollview.cpp Thu Aug 5 10:42:21 2004 +++ qt-x11-free-3.3.3-new/src/widgets/qscrollview.cpp Mon Oct 25 17:57:06 2004 @@ -1551,6 +1551,9 @@ case QEvent::LayoutHint: d->autoResizeHint(this); break; + case QEvent::WindowActivate: + case QEvent::WindowDeactivate: + return TRUE; default: break; } diff -uNr qt-x11-free-3.3.3/src/widgets/qtoolbar.cpp qt-x11-free-3.3.3-new/src/widgets/qtoolbar.cpp --- qt-x11-free-3.3.3/src/widgets/qtoolbar.cpp Thu Aug 5 10:42:20 2004 +++ qt-x11-free-3.3.3-new/src/widgets/qtoolbar.cpp Mon Oct 25 17:57:06 2004 @@ -648,7 +648,7 @@ QString s = b->textLabel(); if ( s.isEmpty() ) s = b->text(); - if ( b->popup() && b->popupDelay() == 0 ) + if ( b->popup() && b->popupDelay() <= 0 ) id = d->extensionPopup->insertItem( b->iconSet(), s, b->popup() ); else id = d->extensionPopup->insertItem( b->iconSet(), s, b, SLOT( emulateClick() ) ) ; diff -uNr qt-x11-free-3.3.3/tools/assistant/assistant.pro qt-x11-free-3.3.3-new/tools/assistant/assistant.pro --- qt-x11-free-3.3.3/tools/assistant/assistant.pro Mon Nov 17 07:40:25 2003 +++ qt-x11-free-3.3.3-new/tools/assistant/assistant.pro Mon Oct 25 17:57:06 2004 @@ -32,6 +32,8 @@ win32:RC_FILE = assistant.rc mac:RC_FILE = assistant.icns +CFLAGS += -mdynamic-no-pic +CXXFLAGS += -mdynamic-no-pic target.path = $$bins.path INSTALLS += target diff -uNr qt-x11-free-3.3.3/tools/designer/app/app.pro qt-x11-free-3.3.3-new/tools/designer/app/app.pro --- qt-x11-free-3.3.3/tools/designer/app/app.pro Fri Jan 16 19:51:08 2004 +++ qt-x11-free-3.3.3-new/tools/designer/app/app.pro Mon Oct 25 17:57:06 2004 @@ -20,7 +20,8 @@ QMAKE_INFO_PLIST = Info_mac.plist staticlib:CONFIG -= global_init_link_order #yuck } - +CFLAGS += -mdynamic-no-pic +CXXFLAGS += -mdynamic-no-pic target.path=$$bins.path INSTALLS += target diff -uNr qt-x11-free-3.3.3/tools/designer/designer/designer.pro qt-x11-free-3.3.3-new/tools/designer/designer/designer.pro --- qt-x11-free-3.3.3/tools/designer/designer/designer.pro Thu Jul 29 09:09:50 2004 +++ qt-x11-free-3.3.3-new/tools/designer/designer/designer.pro Mon Oct 25 17:57:06 2004 @@ -1,6 +1,6 @@ TEMPLATE = lib -CONFIG += qt warn_on staticlib qmake_cache +CONFIG += qt warn_on qmake_cache CONFIG -= dll !force_static:!win32:contains(QT_PRODUCT,qt-internal) { CONFIG -= staticlib diff -uNr qt-x11-free-3.3.3/tools/designer/designer/hierarchyview.cpp qt-x11-free-3.3.3-new/tools/designer/designer/hierarchyview.cpp --- qt-x11-free-3.3.3/tools/designer/designer/hierarchyview.cpp Fri Dec 5 07:47:56 2003 +++ qt-x11-free-3.3.3-new/tools/designer/designer/hierarchyview.cpp Mon Oct 25 17:57:06 2004 @@ -605,6 +605,7 @@ formWindow->mainWindow()->setupTabWidgetHierarchyMenu( this, SLOT( addTabPage() ), SLOT( removeTabPage() ) ); + tabWidgetMenu->setItemEnabled(MainWindow::POPUP_REMOVE_PAGE_ID, ((QDesignerTabWidget*)w )->count() > 1); tabWidgetMenu->popup( p ); } } diff -uNr qt-x11-free-3.3.3/tools/designer/designer/mainwindow.cpp qt-x11-free-3.3.3-new/tools/designer/designer/mainwindow.cpp --- qt-x11-free-3.3.3/tools/designer/designer/mainwindow.cpp Mon Mar 29 11:14:05 2004 +++ qt-x11-free-3.3.3-new/tools/designer/designer/mainwindow.cpp Mon Oct 25 17:57:06 2004 @@ -2457,8 +2457,8 @@ { QPopupMenu *menu = new QPopupMenu( parent ); - menu->insertItem( tr( "Add Page" ), parent, addSlot ); - menu->insertItem( tr( "Delete Page" ), parent, removeSlot ); + menu->insertItem( tr( "Add Page" ), parent, addSlot, 0, POPUP_REMOVE_PAGE_ID+1 ); + menu->insertItem( tr( "Delete Page" ), parent, removeSlot, 0, POPUP_REMOVE_PAGE_ID ); menu->insertSeparator(); actionEditCut->addTo( menu ); actionEditCopy->addTo( menu ); diff -uNr qt-x11-free-3.3.3/tools/designer/designer/mainwindow.h qt-x11-free-3.3.3-new/tools/designer/designer/mainwindow.h --- qt-x11-free-3.3.3/tools/designer/designer/mainwindow.h Fri Oct 17 13:33:47 2003 +++ qt-x11-free-3.3.3-new/tools/designer/designer/mainwindow.h Mon Oct 25 17:57:06 2004 @@ -107,6 +107,7 @@ QPopupMenu *setupNormalHierarchyMenu( QWidget *parent ); QPopupMenu *setupTabWidgetHierarchyMenu( QWidget *parent, const char *addSlot, const char *removeSlot ); + static const int POPUP_REMOVE_PAGE_ID = 1; FormWindow *openFormWindow( const QString &fn, bool validFileName = TRUE, FormFile *ff = 0 ); bool isCustomWidgetUsed( MetaDataBase::CustomWidget *w ); diff -uNr qt-x11-free-3.3.3/tools/designer/editor/editor.pro qt-x11-free-3.3.3-new/tools/designer/editor/editor.pro --- qt-x11-free-3.3.3/tools/designer/editor/editor.pro Fri Oct 31 09:36:28 2003 +++ qt-x11-free-3.3.3-new/tools/designer/editor/editor.pro Mon Oct 25 17:57:06 2004 @@ -1,5 +1,5 @@ TEMPLATE = lib -CONFIG += qt warn_on staticlib +CONFIG += qt warn_on CONFIG -= dll HEADERS = editor.h \ parenmatcher.h \ diff -uNr qt-x11-free-3.3.3/tools/designer/uic/uic.pro qt-x11-free-3.3.3-new/tools/designer/uic/uic.pro --- qt-x11-free-3.3.3/tools/designer/uic/uic.pro Fri Oct 31 09:36:28 2003 +++ qt-x11-free-3.3.3-new/tools/designer/uic/uic.pro Mon Oct 25 17:57:06 2004 @@ -40,3 +40,6 @@ LIBS += $$MWERKSDIR/Libraries/PluginLib4.shlb SOURCES += mwerks_mac.cpp } +CFLAGS += -mdynamic-no-pic +CXXFLAGS += -mdynamic-no-pic + diff -uNr qt-x11-free-3.3.3/tools/linguist/linguist/linguist.pro qt-x11-free-3.3.3-new/tools/linguist/linguist/linguist.pro --- qt-x11-free-3.3.3/tools/linguist/linguist/linguist.pro Fri Oct 31 09:36:28 2003 +++ qt-x11-free-3.3.3-new/tools/linguist/linguist/linguist.pro Mon Oct 25 17:57:06 2004 @@ -43,6 +43,8 @@ staticlib:CONFIG -= global_init_link_order #yuck RC_FILE = linguist.icns } +CFLAGS += -mdynamic-no-pic +CXXFLAGS += -mdynamic-no-pic PROJECTNAME = Qt Linguist diff -uNr qt-x11-free-3.3.3/tools/linguist/linguist.pro qt-x11-free-3.3.3-new/tools/linguist/linguist.pro --- qt-x11-free-3.3.3/tools/linguist/linguist.pro Tue Jun 8 04:06:56 2004 +++ qt-x11-free-3.3.3-new/tools/linguist/linguist.pro Mon Oct 25 17:57:06 2004 @@ -1,8 +1,5 @@ TEMPLATE = subdirs SUBDIRS = linguist \ - tutorial/tt1 \ - tutorial/tt2 \ - tutorial/tt3 \ lrelease \ lupdate \ qm2ts diff -uNr qt-x11-free-3.3.3/tools/linguist/lrelease/lrelease.pro qt-x11-free-3.3.3-new/tools/linguist/lrelease/lrelease.pro --- qt-x11-free-3.3.3/tools/linguist/lrelease/lrelease.pro Fri Oct 31 09:36:28 2003 +++ qt-x11-free-3.3.3-new/tools/linguist/lrelease/lrelease.pro Mon Oct 25 17:57:06 2004 @@ -15,3 +15,6 @@ target.path=$$bins.path INSTALLS += target + +QMAKE_CFLAGS += -mdynamic-no-pic +QMAKE_CXXFLAGS += -mdynamic-no-pic diff -uNr qt-x11-free-3.3.3/tools/linguist/lupdate/lupdate.pro qt-x11-free-3.3.3-new/tools/linguist/lupdate/lupdate.pro --- qt-x11-free-3.3.3/tools/linguist/lupdate/lupdate.pro Fri Oct 31 09:36:28 2003 +++ qt-x11-free-3.3.3-new/tools/linguist/lupdate/lupdate.pro Mon Oct 25 17:57:06 2004 @@ -19,3 +19,7 @@ target.path=$$bins.path INSTALLS += target + +macx:CFLAGS += -mdynamic-no-pic +macx:CXXFLAGS += -mdynamic-no-pic + diff -uNr qt-x11-free-3.3.3/tools/linguist/qm2ts/qm2ts.pro qt-x11-free-3.3.3-new/tools/linguist/qm2ts/qm2ts.pro --- qt-x11-free-3.3.3/tools/linguist/qm2ts/qm2ts.pro Fri Oct 31 09:36:28 2003 +++ qt-x11-free-3.3.3-new/tools/linguist/qm2ts/qm2ts.pro Mon Oct 25 17:57:06 2004 @@ -13,3 +13,6 @@ target.path=$$bins.path INSTALLS += target + +CFLAGS += -mdynamic-no-pic +CXXFLAGS += -mdynamic-no-pic diff -uNr qt-x11-free-3.3.3/tools/qtconfig/qtconfig.pro qt-x11-free-3.3.3-new/tools/qtconfig/qtconfig.pro --- qt-x11-free-3.3.3/tools/qtconfig/qtconfig.pro Tue Jun 8 04:08:54 2004 +++ qt-x11-free-3.3.3-new/tools/qtconfig/qtconfig.pro Mon Oct 25 17:57:06 2004 @@ -15,4 +15,7 @@ INSTALLS += target INCLUDEPATH += . DBFILE = qtconfig.db + +CFLAGS += -mdynamic-no-pic +CXXFLAGS += -mdynamic-no-pic REQUIRES=full-config nocrosscompiler