From e42ec295c2134770a1eb07032f5f22ca4ba1daa6 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Sat, 31 Aug 2024 18:33:50 +0900 Subject: Rename remaining ntq[d-h]* related files to equivalent tq* Signed-off-by: Michele Calgaro --- src/kernel/ntqdrawutil.h | 128 ------ src/kernel/ntqfocusdata.h | 70 --- src/kernel/ntqgif.h | 61 --- src/kernel/ntqt.h | 16 +- src/kernel/qapplication.cpp | 4 +- src/kernel/qdrawutil.cpp | 957 ------------------------------------------ src/kernel/qfocusdata.cpp | 141 ------- src/kernel/qrichtext.cpp | 2 +- src/kernel/qt_kernel.pri | 10 +- src/kernel/tqaccel.cpp | 2 +- src/kernel/tqasyncimageio.cpp | 16 +- src/kernel/tqdragobject.cpp | 2 +- src/kernel/tqdrawutil.cpp | 957 ++++++++++++++++++++++++++++++++++++++++++ src/kernel/tqdrawutil.h | 128 ++++++ src/kernel/tqfocusdata.cpp | 141 +++++++ src/kernel/tqfocusdata.h | 70 +++ src/kernel/tqgif.h | 61 +++ src/kernel/tqmovie.cpp | 2 +- src/kernel/tqpainter.cpp | 2 +- src/kernel/tqurl.cpp | 4 +- src/kernel/tqwidget.cpp | 2 +- 21 files changed, 1388 insertions(+), 1388 deletions(-) delete mode 100644 src/kernel/ntqdrawutil.h delete mode 100644 src/kernel/ntqfocusdata.h delete mode 100644 src/kernel/ntqgif.h delete mode 100644 src/kernel/qdrawutil.cpp delete mode 100644 src/kernel/qfocusdata.cpp create mode 100644 src/kernel/tqdrawutil.cpp create mode 100644 src/kernel/tqdrawutil.h create mode 100644 src/kernel/tqfocusdata.cpp create mode 100644 src/kernel/tqfocusdata.h create mode 100644 src/kernel/tqgif.h (limited to 'src/kernel') diff --git a/src/kernel/ntqdrawutil.h b/src/kernel/ntqdrawutil.h deleted file mode 100644 index d8e2703d2..000000000 --- a/src/kernel/ntqdrawutil.h +++ /dev/null @@ -1,128 +0,0 @@ -/**************************************************************************** -** -** Definition of draw utilities -** -** Created : 950920 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial licenses may use this file in accordance with the TQt -** Commercial License Agreement provided with the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQDRAWUTIL_H -#define TQDRAWUTIL_H - -#ifndef QT_H -#include "ntqnamespace.h" -#include "tqstring.h" // char*->TQString conversion -#endif // QT_H - -class TQPainter; -class TQColorGroup; -class TQPoint; -class TQBrush; -class TQRect; -class TQPixmap; - -#ifndef TQT_NO_DRAWUTIL -// -// Standard shade drawing -// - -TQ_EXPORT void qDrawShadeLine( TQPainter *p, int x1, int y1, int x2, int y2, - const TQColorGroup &g, bool sunken = TRUE, - int lineWidth = 1, int midLineWidth = 0 ); - -TQ_EXPORT void qDrawShadeLine( TQPainter *p, const TQPoint &p1, const TQPoint &p2, - const TQColorGroup &g, bool sunken = TRUE, - int lineWidth = 1, int midLineWidth = 0 ); - -TQ_EXPORT void qDrawShadeRect( TQPainter *p, int x, int y, int w, int h, - const TQColorGroup &, bool sunken=FALSE, - int lineWidth = 1, int midLineWidth = 0, - const TQBrush *fill = 0 ); - -TQ_EXPORT void qDrawShadeRect( TQPainter *p, const TQRect &r, - const TQColorGroup &, bool sunken=FALSE, - int lineWidth = 1, int midLineWidth = 0, - const TQBrush *fill = 0 ); - -TQ_EXPORT void qDrawShadePanel( TQPainter *p, int x, int y, int w, int h, - const TQColorGroup &, bool sunken=FALSE, - int lineWidth = 1, const TQBrush *fill = 0 ); - -TQ_EXPORT void qDrawShadePanel( TQPainter *p, const TQRect &r, - const TQColorGroup &, bool sunken=FALSE, - int lineWidth = 1, const TQBrush *fill = 0 ); - -TQ_EXPORT void qDrawWinButton( TQPainter *p, int x, int y, int w, int h, - const TQColorGroup &g, bool sunken = FALSE, - const TQBrush *fill = 0 ); - -TQ_EXPORT void qDrawWinButton( TQPainter *p, const TQRect &r, - const TQColorGroup &g, bool sunken = FALSE, - const TQBrush *fill = 0 ); - -TQ_EXPORT void qDrawWinPanel( TQPainter *p, int x, int y, int w, int h, - const TQColorGroup &, bool sunken=FALSE, - const TQBrush *fill = 0 ); - -TQ_EXPORT void qDrawWinPanel( TQPainter *p, const TQRect &r, - const TQColorGroup &, bool sunken=FALSE, - const TQBrush *fill = 0 ); - -TQ_EXPORT void qDrawPlainRect( TQPainter *p, int x, int y, int w, int h, const TQColor &, - int lineWidth = 1, const TQBrush *fill = 0 ); - -TQ_EXPORT void qDrawPlainRect( TQPainter *p, const TQRect &r, const TQColor &, - int lineWidth = 1, const TQBrush *fill = 0 ); - - -// -// Other obsolete drawing functions. -// Use TQStyle::itemRect(), TQStyle::drawItem() and TQStyle::drawArrow() instead. -// -TQ_EXPORT TQRect qItemRect( TQPainter *p, TQt::GUIStyle gs, int x, int y, int w, int h, - int flags, bool enabled, - const TQPixmap *pixmap, const TQString& text, int len=-1 ); - -TQ_EXPORT void qDrawItem( TQPainter *p, TQt::GUIStyle gs, int x, int y, int w, int h, - int flags, const TQColorGroup &g, bool enabled, - const TQPixmap *pixmap, const TQString& text, - int len=-1, const TQColor* penColor = 0 ); - -TQ_EXPORT void qDrawArrow( TQPainter *p, TQt::ArrowType type, TQt::GUIStyle style, bool down, - int x, int y, int w, int h, - const TQColorGroup &g, bool enabled ); - -#endif // TQT_NO_DRAWUTIL -#endif // TQDRAWUTIL_H diff --git a/src/kernel/ntqfocusdata.h b/src/kernel/ntqfocusdata.h deleted file mode 100644 index f6eb57fe3..000000000 --- a/src/kernel/ntqfocusdata.h +++ /dev/null @@ -1,70 +0,0 @@ -/**************************************************************************** -** -** Definition of internal TQFocusData class -** -** Created : 980405 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial licenses may use this file in accordance with the TQt -** Commercial License Agreement provided with the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQFOCUSDATA_H -#define TQFOCUSDATA_H - -#ifndef QT_H -#include "tqwidgetlist.h" -#endif // QT_H - - -class TQ_EXPORT TQFocusData { -public: - TQWidget* focusWidget() const { return it.current(); } - - TQWidget* home(); - TQWidget* next(); - TQWidget* prev(); - TQWidget* first() const; - TQWidget* last() const; - int count() const { return focusWidgets.count(); } - -private: - friend class TQWidget; - - TQFocusData() - : it(focusWidgets) {} - TQWidgetList focusWidgets; - TQWidgetListIt it; -}; - - -#endif // TQFOCUSDATA_H diff --git a/src/kernel/ntqgif.h b/src/kernel/ntqgif.h deleted file mode 100644 index 9d1658a0c..000000000 --- a/src/kernel/ntqgif.h +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** To enable built-in reading of GIF images in TQt, change the definition -** below to "#define QT_BUILTIN_GIF_READER 1". -** -** To disable built-in reading of GIF images in TQt, change the definition -** below to "#define QT_BUILTIN_GIF_READER 0". -** -** WARNING: -** A separate license from Unisys may be required to use the gif -** reader. See http://www.unisys.com/about__unisys/lzw/ -** for information from Unisys -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial licenses may use this file in accordance with the TQt -** Commercial License Agreement provided with the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQGIF_H -#define TQGIF_H - -#ifndef QT_H -#include "tqglobal.h" -#endif // QT_H - -#ifndef QT_BUILTIN_GIF_READER -#define QT_BUILTIN_GIF_READER 0 -#endif - -bool qt_builtin_gif_reader(); - -#endif // TQGIF_H diff --git a/src/kernel/ntqt.h b/src/kernel/ntqt.h index 477e2ca68..e04574828 100644 --- a/src/kernel/ntqt.h +++ b/src/kernel/ntqt.h @@ -16,7 +16,7 @@ #ifndef QT_H #define QT_H #include "tqglobal.h" -#include "ntqfeatures.h" +#include "tqfeatures.h" #include "ntqshared.h" #include "tqptrcollection.h" #include "tqglist.h" @@ -60,7 +60,7 @@ #include "tqcolor.h" #include #include "tqobject.h" -#include +#include #include "tqbrush.h" #include "tqpalette.h" #include "tqwidget.h" @@ -81,13 +81,13 @@ #include "tqgroupbox.h" #include "tqdialog.h" #include -#include "ntqdockwindow.h" +#include "tqdockwindow.h" #include "tqcommonstyle.h" #include "tqnetworkprotocol.h" #include #include #include "tqgcache.h" -#include +#include #include #include #include @@ -156,7 +156,7 @@ #include #include #include -#include +#include #include #include "tqpopupmenu.h" #include @@ -172,7 +172,7 @@ #include #include #include -#include +#include #include "tqregexp.h" #include #include @@ -248,7 +248,7 @@ #include #include #include -#include +#include #include #include #include @@ -260,7 +260,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/kernel/qapplication.cpp b/src/kernel/qapplication.cpp index 6e1926e45..a4fded7f0 100644 --- a/src/kernel/qapplication.cpp +++ b/src/kernel/qapplication.cpp @@ -410,8 +410,8 @@ TQEventLoop* TQApplication::currentEventLoop() { #endif #ifndef TQT_NO_ACCEL -extern bool tqt_dispatchAccelEvent( TQWidget*, TQKeyEvent* ); // def in qaccel.cpp -extern bool tqt_tryComposeUnicode( TQWidget*, TQKeyEvent* ); // def in qaccel.cpp +extern bool tqt_dispatchAccelEvent( TQWidget*, TQKeyEvent* ); // def in tqaccel.cpp +extern bool tqt_tryComposeUnicode( TQWidget*, TQKeyEvent* ); // def in tqaccel.cpp #endif #if defined(QT_TABLET_SUPPORT) diff --git a/src/kernel/qdrawutil.cpp b/src/kernel/qdrawutil.cpp deleted file mode 100644 index 8abb9216f..000000000 --- a/src/kernel/qdrawutil.cpp +++ /dev/null @@ -1,957 +0,0 @@ -/**************************************************************************** -** -** Implementation of draw utilities -** -** Created : 950920 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial licenses may use this file in accordance with the TQt -** Commercial License Agreement provided with the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#include "ntqdrawutil.h" -#ifndef TQT_NO_DRAWUTIL -#include "tqbitmap.h" -#include "tqpixmapcache.h" -#include "ntqapplication.h" -#include "tqpainter.h" - -/*! - \relates TQPainter - - \c{#include } - - Draws a horizontal (\a y1 == \a y2) or vertical (\a x1 == \a x2) - shaded line using the painter \a p. - - Nothing is drawn if \a y1 != \a y2 and \a x1 != \a x2 (i.e. the - line is neither horizontal nor vertical). - - The color group argument \a g specifies the shading colors (\link - TQColorGroup::light() light\endlink, \link TQColorGroup::dark() - dark\endlink and \link TQColorGroup::mid() middle\endlink colors). - - The line appears sunken if \a sunken is TRUE, or raised if \a - sunken is FALSE. - - The \a lineWidth argument specifies the line width for each of the - lines. It is not the total line width. - - The \a midLineWidth argument specifies the width of a middle line - drawn in the TQColorGroup::mid() color. - - If you want to use a TQFrame widget instead, you can make it - display a shaded line, for example \c{TQFrame::setFrameStyle( - TQFrame::HLine | TQFrame::Sunken )}. - - \warning This function does not look at TQWidget::style() or - TQApplication::style(). Use the drawing functions in TQStyle to make - widgets that follow the current GUI style. - - \sa qDrawShadeRect(), qDrawShadePanel(), TQStyle::drawPrimitive() -*/ - -void qDrawShadeLine( TQPainter *p, int x1, int y1, int x2, int y2, - const TQColorGroup &g, bool sunken, - int lineWidth, int midLineWidth ) -{ - if (!( p && lineWidth >= 0 && midLineWidth >= 0 ) ) { -#if defined(QT_CHECK_RANGE) - tqWarning( "qDrawShadeLine invalid parameters." ); -#endif - return; - } - int tlw = lineWidth*2 + midLineWidth; // total line width - TQPen oldPen = p->pen(); // save pen - if ( sunken ) - p->setPen( g.dark() ); - else - p->setPen( g.light() ); - TQPointArray a; - int i; - if ( y1 == y2 ) { // horizontal line - int y = y1 - tlw/2; - if ( x1 > x2 ) { // swap x1 and x2 - int t = x1; - x1 = x2; - x2 = t; - } - x2--; - for ( i=0; idrawPolyline( a ); - } - if ( midLineWidth > 0 ) { - p->setPen( g.mid() ); - for ( i=0; idrawLine( x1+lineWidth, y+lineWidth+i, - x2-lineWidth, y+lineWidth+i ); - } - if ( sunken ) - p->setPen( g.light() ); - else - p->setPen( g.dark() ); - for ( i=0; idrawPolyline( a ); - } - } - else if ( x1 == x2 ) { // vertical line - int x = x1 - tlw/2; - if ( y1 > y2 ) { // swap y1 and y2 - int t = y1; - y1 = y2; - y2 = t; - } - y2--; - for ( i=0; idrawPolyline( a ); - } - if ( midLineWidth > 0 ) { - p->setPen( g.mid() ); - for ( i=0; idrawLine( x+lineWidth+i, y1+lineWidth, x+lineWidth+i, y2 ); - } - if ( sunken ) - p->setPen( g.light() ); - else - p->setPen( g.dark() ); - for ( i=0; idrawPolyline( a ); - } - } - p->setPen( oldPen ); -} - - -/*! - \relates TQPainter - - \c{#include } - - Draws the shaded rectangle specified by (\a x, \a y, \a w, \a h) - using the painter \a p. - - The color group argument \a g specifies the shading colors (\link - TQColorGroup::light() light\endlink, \link TQColorGroup::dark() - dark\endlink and \link TQColorGroup::mid() middle\endlink colors). - - The rectangle appears sunken if \a sunken is TRUE, or raised if \a - sunken is FALSE. - - The \a lineWidth argument specifies the line width for each of the - lines. It is not the total line width. - - The \a midLineWidth argument specifies the width of a middle line - drawn in the TQColorGroup::mid() color. - - The rectangle's interior is filled with the \a fill brush unless - \a fill is 0. - - If you want to use a TQFrame widget instead, you can make it - display a shaded rectangle, for example \c{TQFrame::setFrameStyle( - TQFrame::Box | TQFrame::Raised )}. - - \warning This function does not look at TQWidget::style() or - TQApplication::style(). Use the drawing functions in TQStyle to make - widgets that follow the current GUI style. - - \sa qDrawShadeLine(), qDrawShadePanel(), qDrawPlainRect(), - TQStyle::drawItem(), TQStyle::drawControl() - TQStyle::drawComplexControl() -*/ - -void qDrawShadeRect( TQPainter *p, int x, int y, int w, int h, - const TQColorGroup &g, bool sunken, - int lineWidth, int midLineWidth, - const TQBrush *fill ) -{ - if ( w == 0 || h == 0 ) - return; - if ( ! ( w > 0 && h > 0 && lineWidth >= 0 && midLineWidth >= 0 ) ) { -#if defined(QT_CHECK_RANGE) - tqWarning( "qDrawShadeRect(): Invalid parameters" ); -#endif - return; - } - TQPen oldPen = p->pen(); - if ( sunken ) - p->setPen( g.dark() ); - else - p->setPen( g.light() ); - int x1=x, y1=y, x2=x+w-1, y2=y+h-1; - TQPointArray a; - - if ( lineWidth == 1 && midLineWidth == 0 ) {// standard shade rectangle - p->drawRect( x1, y1, w-1, h-1 ); - if ( sunken ) - p->setPen( g.light() ); - else - p->setPen( g.dark() ); - a.setPoints( 8, x1+1,y1+1, x2-2,y1+1, x1+1,y1+2, x1+1,y2-2, - x1,y2, x2,y2, x2,y1, x2,y2-1 ); - p->drawLineSegments( a ); // draw bottom/right lines - } else { // more complicated - int m = lineWidth+midLineWidth; - int i, j=0, k=m; - for ( i=0; idrawLineSegments( a ); - k++; - } - p->setPen( g.mid() ); - j = lineWidth*2; - for ( i=0; idrawRect( x1+lineWidth+i, y1+lineWidth+i, w-j, h-j ); - j += 2; - } - if ( sunken ) - p->setPen( g.light() ); - else - p->setPen( g.dark() ); - k = m; - for ( i=0; idrawLineSegments( a ); - k++; - } - } - if ( fill ) { - TQBrush oldBrush = p->brush(); - int tlw = lineWidth + midLineWidth; - p->setPen( TQt::NoPen ); - p->setBrush( *fill ); - p->drawRect( x+tlw, y+tlw, w-2*tlw, h-2*tlw ); - p->setBrush( oldBrush ); - } - p->setPen( oldPen ); // restore pen -} - - -/*! - \relates TQPainter - - \c{#include } - - Draws the shaded panel specified by (\a x, \a y, \a w, \a h) using - the painter \a p. - - The color group argument \a g specifies the shading colors (\link - TQColorGroup::light() light\endlink, \link TQColorGroup::dark() - dark\endlink and \link TQColorGroup::mid() middle\endlink colors). - - The panel appears sunken if \a sunken is TRUE, or raised if \a - sunken is FALSE. - - The \a lineWidth argument specifies the line width. - - The panel's interior is filled with the \a fill brush unless \a - fill is 0. - - If you want to use a TQFrame widget instead, you can make it - display a shaded panel, for example \c{TQFrame::setFrameStyle( - TQFrame::Panel | TQFrame::Sunken )}. - - \warning This function does not look at TQWidget::style() or - TQApplication::style(). Use the drawing functions in TQStyle to make - widgets that follow the current GUI style. - - \sa qDrawWinPanel(), qDrawShadeLine(), qDrawShadeRect(), - TQStyle::drawPrimitive() -*/ - -void qDrawShadePanel( TQPainter *p, int x, int y, int w, int h, - const TQColorGroup &g, bool sunken, - int lineWidth, const TQBrush *fill ) -{ - if ( w == 0 || h == 0 ) - return; - if ( !( w > 0 && h > 0 && lineWidth >= 0 ) ) { -#if defined(QT_CHECK_RANGE) - tqWarning( "qDrawShadePanel() Invalid parameters." ); -#endif - } - TQColor shade = g.dark(); - TQColor light = g.light(); - if ( fill ) { - if ( fill->color() == shade ) - shade = g.shadow(); - if ( fill->color() == light ) - light = g.midlight(); - } - TQPen oldPen = p->pen(); // save pen - TQPointArray a( 4*lineWidth ); - if ( sunken ) - p->setPen( shade ); - else - p->setPen( light ); - int x1, y1, x2, y2; - int i; - int n = 0; - x1 = x; - y1 = y2 = y; - x2 = x+w-2; - for ( i=0; idrawLineSegments( a ); - n = 0; - if ( sunken ) - p->setPen( light ); - else - p->setPen( shade ); - x1 = x; - y1 = y2 = y+h-1; - x2 = x+w-1; - for ( i=0; idrawLineSegments( a ); - if ( fill ) { // fill with fill color - TQBrush oldBrush = p->brush(); - p->setPen( TQt::NoPen ); - p->setBrush( *fill ); - p->drawRect( x+lineWidth, y+lineWidth, w-lineWidth*2, h-lineWidth*2 ); - p->setBrush( oldBrush ); - } - p->setPen( oldPen ); // restore pen -} - - -/*! - \internal - This function draws a rectangle with two pixel line width. - It is called from qDrawWinButton() and qDrawWinPanel(). - - c1..c4 and fill are used: - - 1 1 1 1 1 2 - 1 3 3 3 4 2 - 1 3 F F 4 2 - 1 3 F F 4 2 - 1 4 4 4 4 2 - 2 2 2 2 2 2 -*/ - -static void qDrawWinShades( TQPainter *p, - int x, int y, int w, int h, - const TQColor &c1, const TQColor &c2, - const TQColor &c3, const TQColor &c4, - const TQBrush *fill ) -{ - if ( w < 2 || h < 2 ) // can't do anything with that - return; - TQPen oldPen = p->pen(); - TQPointArray a( 3 ); - a.setPoints( 3, x, y+h-2, x, y, x+w-2, y ); - p->setPen( c1 ); - p->drawPolyline( a ); - a.setPoints( 3, x, y+h-1, x+w-1, y+h-1, x+w-1, y ); - p->setPen( c2 ); - p->drawPolyline( a ); - if ( w > 4 && h > 4 ) { - a.setPoints( 3, x+1, y+h-3, x+1, y+1, x+w-3, y+1 ); - p->setPen( c3 ); - p->drawPolyline( a ); - a.setPoints( 3, x+1, y+h-2, x+w-2, y+h-2, x+w-2, y+1 ); - p->setPen( c4 ); - p->drawPolyline( a ); - if ( fill ) { - TQBrush oldBrush = p->brush(); - p->setBrush( *fill ); - p->setPen( TQt::NoPen ); - p->drawRect( x+2, y+2, w-4, h-4 ); - p->setBrush( oldBrush ); - } - } - p->setPen( oldPen ); -} - - -/*! - \relates TQPainter - - \c{#include } - - Draws the Windows-style button specified by (\a x, \a y, \a w, \a - h) using the painter \a p. - - The color group argument \a g specifies the shading colors (\link - TQColorGroup::light() light\endlink, \link TQColorGroup::dark() - dark\endlink and \link TQColorGroup::mid() middle\endlink colors). - - The button appears sunken if \a sunken is TRUE, or raised if \a - sunken is FALSE. - - The line width is 2 pixels. - - The button's interior is filled with the \a *fill brush unless \a - fill is 0. - - \warning This function does not look at TQWidget::style() or - TQApplication::style(). Use the drawing functions in TQStyle to make - widgets that follow the current GUI style. - - \sa qDrawWinPanel(), TQStyle::drawControl() -*/ - -void qDrawWinButton( TQPainter *p, int x, int y, int w, int h, - const TQColorGroup &g, bool sunken, - const TQBrush *fill ) -{ - if ( sunken ) - qDrawWinShades( p, x, y, w, h, - g.shadow(), g.light(), g.dark(), g.button(), fill ); - else - qDrawWinShades( p, x, y, w, h, - g.light(), g.shadow(), g.button(), g.dark(), fill ); -} - -/*! - \relates TQPainter - - \c{#include } - - Draws the Windows-style panel specified by (\a x, \a y, \a w, \a - h) using the painter \a p. - - The color group argument \a g specifies the shading colors. - - The panel appears sunken if \a sunken is TRUE, or raised if \a - sunken is FALSE. - - The line width is 2 pixels. - - The button's interior is filled with the \a fill brush unless \a - fill is 0. - - If you want to use a TQFrame widget instead, you can make it - display a shaded panel, for example \c{TQFrame::setFrameStyle( - TQFrame::WinPanel | TQFrame::Raised )}. - - \warning This function does not look at TQWidget::style() or - TQApplication::style(). Use the drawing functions in TQStyle to make - widgets that follow the current GUI style. - - \sa qDrawShadePanel(), qDrawWinButton(), TQStyle::drawPrimitive() -*/ - -void qDrawWinPanel( TQPainter *p, int x, int y, int w, int h, - const TQColorGroup &g, bool sunken, - const TQBrush *fill ) -{ - if ( sunken ) - qDrawWinShades( p, x, y, w, h, - g.dark(), g.light(), g.shadow(), g.midlight(), fill ); - else - qDrawWinShades( p, x, y, w, h, - g.light(), g.shadow(), g.midlight(), g.dark(), fill ); -} - - -/*! - \relates TQPainter - - \c{#include } - - Draws the plain rectangle specified by (\a x, \a y, \a w, \a h) - using the painter \a p. - - The color argument \a c specifies the line color. - - The \a lineWidth argument specifies the line width. - - The rectangle's interior is filled with the \a fill brush unless - \a fill is 0. - - If you want to use a TQFrame widget instead, you can make it - display a plain rectangle, for example \c{TQFrame::setFrameStyle( - TQFrame::Box | TQFrame::Plain )}. - - \warning This function does not look at TQWidget::style() or - TQApplication::style(). Use the drawing functions in TQStyle to make - widgets that follow the current GUI style. - - \sa qDrawShadeRect(), TQStyle::drawPrimitive() -*/ - -void qDrawPlainRect( TQPainter *p, int x, int y, int w, int h, const TQColor &c, - int lineWidth, const TQBrush *fill ) -{ - if ( w == 0 || h == 0 ) - return; - if ( !( w > 0 && h > 0 && lineWidth >= 0 ) ) { -#if defined(QT_CHECK_RANGE) - tqWarning( "qDrawPlainRect() Invalid parameters." ); -#endif - } - TQPen oldPen = p->pen(); - TQBrush oldBrush = p->brush(); - p->setPen( c ); - p->setBrush( TQt::NoBrush ); - for ( int i=0; idrawRect( x+i, y+i, w-i*2, h-i*2 ); - if ( fill ) { // fill with fill color - p->setPen( TQt::NoPen ); - p->setBrush( *fill ); - p->drawRect( x+lineWidth, y+lineWidth, w-lineWidth*2, h-lineWidth*2 ); - } - p->setPen( oldPen ); - p->setBrush( oldBrush ); -} - - -TQRect qItemRect( TQPainter *p, TQt::GUIStyle gs, - int x, int y, int w, int h, - int flags, - bool enabled, - const TQPixmap *pixmap, - const TQString& text, int len ) -{ - TQRect result; - - if ( pixmap ) { - if ( (flags & TQt::AlignVCenter) == TQt::AlignVCenter ) - y += h/2 - pixmap->height()/2; - else if ( (flags & TQt::AlignBottom) == TQt::AlignBottom) - y += h - pixmap->height(); - if ( (flags & TQt::AlignRight) == TQt::AlignRight ) - x += w - pixmap->width(); - else if ( (flags & TQt::AlignHCenter) == TQt::AlignHCenter ) - x += w/2 - pixmap->width()/2; - else if ( (flags & TQt::AlignLeft) != TQt::AlignLeft && TQApplication::reverseLayout() ) - x += w - pixmap->width(); - result = TQRect(x, y, pixmap->width(), pixmap->height()); - } else if ( !text.isNull() && p ) { - result = p->boundingRect( x, y, w, h, flags, text, len ); - if ( gs == TQt::WindowsStyle && !enabled ) { - result.setWidth(result.width()+1); - result.setHeight(result.height()+1); - } - } else { - result = TQRect(x, y, w, h); - } - - return result; -} - - -void qDrawItem( TQPainter *p, TQt::GUIStyle gs, - int x, int y, int w, int h, - int flags, - const TQColorGroup &g, bool enabled, - const TQPixmap *pixmap, - const TQString& text, int len , const TQColor* penColor ) -{ - p->setPen( penColor?*penColor:g.foreground() ); - if ( pixmap ) { - TQPixmap pm( *pixmap ); - bool clip = (flags & TQt::DontClip) == 0; - if ( clip ) { - if ( pm.width() < w && pm.height() < h ) - clip = FALSE; - else - p->setClipRect( x, y, w, h ); - } - if ( (flags & TQt::AlignVCenter) == TQt::AlignVCenter ) - y += h/2 - pm.height()/2; - else if ( (flags & TQt::AlignBottom) == TQt::AlignBottom) - y += h - pm.height(); - if ( (flags & TQt::AlignRight) == TQt::AlignRight ) - x += w - pm.width(); - else if ( (flags & TQt::AlignHCenter) == TQt::AlignHCenter ) - x += w/2 - pm.width()/2; - else if ( ((flags & TQt::AlignLeft) != TQt::AlignLeft) && TQApplication::reverseLayout() ) // AlignAuto && rightToLeft - x += w - pm.width(); - - if ( !enabled ) { - if ( pm.mask() ) { // pixmap with a mask - if ( !pm.selfMask() ) { // mask is not pixmap itself - TQPixmap pmm( *pm.mask() ); - pmm.setMask( *((TQBitmap *)&pmm) ); - pm = pmm; - } - } else if ( pm.depth() == 1 ) { // monochrome pixmap, no mask - pm.setMask( *((TQBitmap *)&pm) ); -#ifndef TQT_NO_IMAGE_HEURISTIC_MASK - } else { // color pixmap, no mask - TQString k; - k.sprintf( "$qt-drawitem-%x", pm.serialNumber() ); - TQPixmap *mask = TQPixmapCache::find(k); - bool del=FALSE; - if ( !mask ) { - mask = new TQPixmap( pm.createHeuristicMask() ); - mask->setMask( *((TQBitmap*)mask) ); - del = !TQPixmapCache::insert( k, mask ); - } - pm = *mask; - if (del) delete mask; -#endif - } - if ( gs == TQt::WindowsStyle ) { - p->setPen( g.light() ); - p->drawPixmap( x+1, y+1, pm ); - p->setPen( g.text() ); - } - } - p->drawPixmap( x, y, pm ); - if ( clip ) - p->setClipping( FALSE ); - } else if ( !text.isNull() ) { - if ( gs == TQt::WindowsStyle && !enabled ) { - p->setPen( g.light() ); - p->drawText( x+1, y+1, w, h, flags, text, len ); - p->setPen( g.text() ); - } - p->drawText( x, y, w, h, flags, text, len ); - } -} - - -/***************************************************************************** - Overloaded functions. - *****************************************************************************/ - -/*! - \overload void qDrawShadeLine( TQPainter *p, const TQPoint &p1, const TQPoint &p2, const TQColorGroup &g, bool sunken, int lineWidth, int midLineWidth ) -*/ - -void qDrawShadeLine( TQPainter *p, const TQPoint &p1, const TQPoint &p2, - const TQColorGroup &g, bool sunken, - int lineWidth, int midLineWidth ) -{ - qDrawShadeLine( p, p1.x(), p1.y(), p2.x(), p2.y(), g, sunken, - lineWidth, midLineWidth ); -} - -/*! - \overload void qDrawShadeRect( TQPainter *p, const TQRect &r, const TQColorGroup &g, bool sunken, int lineWidth, int midLineWidth, const TQBrush *fill ) -*/ - -void qDrawShadeRect( TQPainter *p, const TQRect &r, - const TQColorGroup &g, bool sunken, - int lineWidth, int midLineWidth, - const TQBrush *fill ) -{ - qDrawShadeRect( p, r.x(), r.y(), r.width(), r.height(), g, sunken, - lineWidth, midLineWidth, fill ); -} - -/*! - \overload void qDrawShadePanel( TQPainter *p, const TQRect &r, const TQColorGroup &g, bool sunken, int lineWidth, const TQBrush *fill ) -*/ - -void qDrawShadePanel( TQPainter *p, const TQRect &r, - const TQColorGroup &g, bool sunken, - int lineWidth, const TQBrush *fill ) -{ - qDrawShadePanel( p, r.x(), r.y(), r.width(), r.height(), g, sunken, - lineWidth, fill ); -} - -/*! - \overload void qDrawWinButton( TQPainter *p, const TQRect &r, const TQColorGroup &g, bool sunken, const TQBrush *fill ) -*/ - -void qDrawWinButton( TQPainter *p, const TQRect &r, - const TQColorGroup &g, bool sunken, - const TQBrush *fill ) -{ - qDrawWinButton( p, r.x(), r.y(), r.width(), r.height(), g, sunken, fill ); -} - -/*! - \overload void qDrawWinPanel( TQPainter *p, const TQRect &r, const TQColorGroup &g, bool sunken, const TQBrush *fill ) -*/ - -void qDrawWinPanel( TQPainter *p, const TQRect &r, - const TQColorGroup &g, bool sunken, - const TQBrush *fill ) -{ - qDrawWinPanel( p, r.x(), r.y(), r.width(), r.height(), g, sunken, fill ); -} - -/*! - \overload void qDrawPlainRect( TQPainter *p, const TQRect &r, const TQColor &c, int lineWidth, const TQBrush *fill ) -*/ - -void qDrawPlainRect( TQPainter *p, const TQRect &r, const TQColor &c, - int lineWidth, const TQBrush *fill ) -{ - qDrawPlainRect( p, r.x(), r.y(), r.width(), r.height(), c, - lineWidth, fill ); -} - - -static void qDrawWinArrow( TQPainter *p, TQt::ArrowType type, bool down, - int x, int y, int w, int h, - const TQColorGroup &g, bool enabled ) -{ - TQPointArray a; // arrow polygon - switch ( type ) { - case TQt::UpArrow: - a.setPoints( 7, -3,1, 3,1, -2,0, 2,0, -1,-1, 1,-1, 0,-2 ); - break; - case TQt::DownArrow: - a.setPoints( 7, -3,-1, 3,-1, -2,0, 2,0, -1,1, 1,1, 0,2 ); - break; - case TQt::LeftArrow: - a.setPoints( 7, 1,-3, 1,3, 0,-2, 0,2, -1,-1, -1,1, -2,0 ); - break; - case TQt::RightArrow: - a.setPoints( 7, -1,-3, -1,3, 0,-2, 0,2, 1,-1, 1,1, 2,0 ); - break; - } - if ( a.isNull() ) - return; - - if ( down ) { - x++; - y++; - } - - TQPen savePen = p->pen(); // save current pen - if (down) - p->setBrushOrigin(p->brushOrigin() + TQPoint(1,1)); - p->fillRect( x, y, w, h, g.brush( TQColorGroup::Button ) ); - if (down) - p->setBrushOrigin(p->brushOrigin() - TQPoint(1,1)); - if ( enabled ) { - a.translate( x+w/2, y+h/2 ); - p->setPen( g.foreground() ); - p->drawLineSegments( a, 0, 3 ); // draw arrow - p->drawPoint( a[6] ); - } else { - a.translate( x+w/2+1, y+h/2+1 ); - p->setPen( g.light() ); - p->drawLineSegments( a, 0, 3 ); // draw arrow - p->drawPoint( a[6] ); - a.translate( -1, -1 ); - p->setPen( g.mid() ); - p->drawLineSegments( a, 0, 3 ); // draw arrow - p->drawPoint( a[6] ); - } - p->setPen( savePen ); // restore pen -} - - -#if defined(Q_CC_MSVC) -#pragma warning(disable: 4244) -#endif - -#ifndef TQT_NO_STYLE_MOTIF -// motif arrows look the same whether they are used or not -// is this correct? -static void qDrawMotifArrow( TQPainter *p, TQt::ArrowType type, bool down, - int x, int y, int w, int h, - const TQColorGroup &g, bool ) -{ - TQPointArray bFill; // fill polygon - TQPointArray bTop; // top shadow. - TQPointArray bBot; // bottom shadow. - TQPointArray bLeft; // left shadow. -#ifndef TQT_NO_TRANSFORMATIONS - TQWMatrix matrix; // xform matrix -#endif - bool vertical = type == TQt::UpArrow || type == TQt::DownArrow; - bool horizontal = !vertical; - int dim = w < h ? w : h; - int colspec = 0x0000; // color specification array - - if ( dim < 2 ) // too small arrow - return; - - if ( dim > 3 ) { - if ( dim > 6 ) - bFill.resize( dim & 1 ? 3 : 4 ); - bTop.resize( (dim/2)*2 ); - bBot.resize( dim & 1 ? dim + 1 : dim ); - bLeft.resize( dim > 4 ? 4 : 2 ); - bLeft.putPoints( 0, 2, 0,0, 0,dim-1 ); - if ( dim > 4 ) - bLeft.putPoints( 2, 2, 1,2, 1,dim-3 ); - bTop.putPoints( 0, 4, 1,0, 1,1, 2,1, 3,1 ); - bBot.putPoints( 0, 4, 1,dim-1, 1,dim-2, 2,dim-2, 3,dim-2 ); - - for( int i=0; i 6 ) { // dim>6: must fill interior - bFill.putPoints( 0, 2, 1,dim-3, 1,2 ); - if ( dim & 1 ) // if size is an odd number - bFill.setPoint( 2, dim - 3, dim / 2 ); - else - bFill.putPoints( 2, 2, dim-4,dim/2-1, dim-4,dim/2 ); - } - } - else { - if ( dim == 3 ) { // 3x3 arrow pattern - bLeft.setPoints( 4, 0,0, 0,2, 1,1, 1,1 ); - bTop .setPoints( 2, 1,0, 1,0 ); - bBot .setPoints( 2, 1,2, 2,1 ); - } - else { // 2x2 arrow pattern - bLeft.setPoints( 2, 0,0, 0,1 ); - bTop .setPoints( 2, 1,0, 1,0 ); - bBot .setPoints( 2, 1,1, 1,1 ); - } - } - - if ( type == TQt::UpArrow || type == TQt::LeftArrow ) { -#ifndef TQT_NO_TRANSFORMATIONS // #### fix me! - matrix.translate( x, y ); - if ( vertical ) { - matrix.translate( 0, h - 1 ); - matrix.rotate( -90 ); - } else { - matrix.translate( w - 1, h - 1 ); - matrix.rotate( 180 ); - } -#endif - if ( down ) - colspec = horizontal ? 0x2334 : 0x2343; - else - colspec = horizontal ? 0x1443 : 0x1434; - } - else if ( type == TQt::DownArrow || type == TQt::RightArrow ) { -#ifndef TQT_NO_TRANSFORMATIONS // #### fix me! - matrix.translate( x, y ); - if ( vertical ) { - matrix.translate( w-1, 0 ); - matrix.rotate( 90 ); - } -#endif - if ( down ) - colspec = horizontal ? 0x2443 : 0x2434; - else - colspec = horizontal ? 0x1334 : 0x1343; - } - - TQColor *cols[5]; - cols[0] = 0; - cols[1] = (TQColor *)&g.button(); - cols[2] = (TQColor *)&g.mid(); - cols[3] = (TQColor *)&g.light(); - cols[4] = (TQColor *)&g.dark(); -#define CMID *cols[ (colspec>>12) & 0xf ] -#define CLEFT *cols[ (colspec>>8) & 0xf ] -#define CTOP *cols[ (colspec>>4) & 0xf ] -#define CBOT *cols[ colspec & 0xf ] - - TQPen savePen = p->pen(); // save current pen - TQBrush saveBrush = p->brush(); // save current brush -#ifndef TQT_NO_TRANSFORMATIONS - TQWMatrix wxm = p->worldMatrix(); -#endif - TQPen pen( TQt::NoPen ); - const TQBrush &brush = g.brush( TQColorGroup::Button ); - - p->setPen( pen ); - p->setBrush( brush ); -#ifndef TQT_NO_TRANSFORMATIONS - p->setWorldMatrix( matrix, TRUE ); // set transformation matrix -#endif - p->drawPolygon( bFill ); // fill arrow - p->setBrush( TQt::NoBrush ); // don't fill - - p->setPen( CLEFT ); - p->drawLineSegments( bLeft ); - p->setPen( CTOP ); - p->drawLineSegments( bTop ); - p->setPen( CBOT ); - p->drawLineSegments( bBot ); - -#ifndef TQT_NO_TRANSFORMATIONS - p->setWorldMatrix( wxm ); -#endif - p->setBrush( saveBrush ); // restore brush - p->setPen( savePen ); // restore pen - -#undef CMID -#undef CLEFT -#undef CTOP -#undef CBOT -} -#endif - -void qDrawArrow( TQPainter *p, TQt::ArrowType type, TQt::GUIStyle style, bool down, - int x, int y, int w, int h, - const TQColorGroup &g, bool enabled ) -{ - switch ( style ) { - case TQt::WindowsStyle: - qDrawWinArrow( p, type, down, x, y, w, h, g, enabled ); - break; -#ifndef TQT_NO_STYLE_MOTIF - case TQt::MotifStyle: - qDrawMotifArrow( p, type, down, x, y, w, h, g, enabled ); - break; -#endif - default: -#if defined(QT_CHECK_RANGE) - tqWarning( "qDrawArrow: Requested GUI style not supported" ); -#else - ; -#endif - } -} -#endif //TQT_NO_DRAWUTIL diff --git a/src/kernel/qfocusdata.cpp b/src/kernel/qfocusdata.cpp deleted file mode 100644 index 0f06da4e3..000000000 --- a/src/kernel/qfocusdata.cpp +++ /dev/null @@ -1,141 +0,0 @@ -/**************************************************************************** -** -** Implementation of TQFocusData class -** -** Created : 980622 -** -** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the kernel module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial licenses may use this file in accordance with the TQt -** Commercial License Agreement provided with the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#include "ntqfocusdata.h" - -/*! - \class TQFocusData ntqfocusdata.h - \brief The TQFocusData class maintains the list of widgets in the focus - chain. - - \ingroup misc - - This read-only list always contains at least one widget (i.e. the - top-level widget). It provides a simple cursor which can be reset - to the current focus widget using home(), or moved to its - neighboring widgets using next() and prev(). You can also retrieve - the count() of the number of widgets in the list. The list is a - loop, so if you keep iterating, for example using next(), you will - never come to the end. - - Some widgets in the list may not accept focus. Widgets are added - to the list as necessary, but not removed from it. This lets - widgets change focus policy dynamically without disrupting the - focus chain the user experiences. When a widget disables and - re-enables tab focus, its position in the focus chain does not - change. - - When reimplementing TQWidget::focusNextPrevChild() to provide - special focus flow, you will usually call TQWidget::focusData() to - retrieve the focus data stored at the top-level widget. A - top-level widget's focus data contains the focus list for its - hierarchy of widgets. - - The cursor may change at any time. - - This class is \e not thread-safe. - - \sa TQWidget::focusNextPrevChild() TQWidget::setTabOrder() - TQWidget::setFocusPolicy() -*/ - -/*! - \fn TQWidget* TQFocusData::focusWidget() const - - Returns the widgets in the hierarchy that are in the focus chain. -*/ - -/*! - \fn int TQFocusData::count() const - - Returns the number of widgets in the focus chain. -*/ - -/*! - Moves the cursor to the focusWidget() and returns that widget. You - must call this before next() or prev() to iterate meaningfully. -*/ -TQWidget* TQFocusData::home() -{ - focusWidgets.find(it.current()); - return focusWidgets.current(); -} - -/*! - Moves the cursor to the next widget in the focus chain. There is - \e always a next widget because the list is a loop. -*/ -TQWidget* TQFocusData::next() -{ - TQWidget* r = focusWidgets.next(); - if ( !r ) - r = focusWidgets.first(); - return r; -} - -/*! - Moves the cursor to the previous widget in the focus chain. There - is \e always a previous widget because the list is a loop. -*/ -TQWidget* TQFocusData::prev() -{ - TQWidget* r = focusWidgets.prev(); - if ( !r ) - r = focusWidgets.last(); - return r; -} - -/*! - Returns the last widget in the focus chain. - The cursor is not modified. -*/ -TQWidget *TQFocusData::last() const -{ - return focusWidgets.getLast(); -} - -/*! - Returns the first widget in the focus chain. - The cursor is not modified. -*/ -TQWidget *TQFocusData::first() const -{ - return focusWidgets.getFirst(); -} diff --git a/src/kernel/qrichtext.cpp b/src/kernel/qrichtext.cpp index 3e378fb47..247e181d9 100644 --- a/src/kernel/qrichtext.cpp +++ b/src/kernel/qrichtext.cpp @@ -56,7 +56,7 @@ #include "tqdragobject.h" #include "tqpaintdevicemetrics.h" #include "tqpainter.h" -#include "ntqdrawutil.h" +#include "tqdrawutil.h" #include "tqcursor.h" #include "tqptrstack.h" #include "tqptrdict.h" diff --git a/src/kernel/qt_kernel.pri b/src/kernel/qt_kernel.pri index c3b5c4b2d..d52783f7c 100644 --- a/src/kernel/qt_kernel.pri +++ b/src/kernel/qt_kernel.pri @@ -18,19 +18,19 @@ kernel { $$KERNEL_H/tqcursor.h \ $$KERNEL_H/tqdesktopwidget.h \ $$KERNEL_H/tqdragobject.h \ - $$KERNEL_H/ntqdrawutil.h \ + $$KERNEL_H/tqdrawutil.h \ $$KERNEL_H/tqdropsite.h \ $$KERNEL_H/tqevent.h \ $$KERNEL_H/tqeventloop.h \ $$KERNEL_P/tqeventloop_p.h \ $$KERNEL_P/tqeventloop_glib_p.h \ - $$KERNEL_H/ntqfocusdata.h \ + $$KERNEL_H/tqfocusdata.h \ $$KERNEL_H/tqfont.h \ $$KERNEL_P/tqfontdata_p.h \ $$KERNEL_H/tqfontinfo.h \ $$KERNEL_H/tqfontmetrics.h \ $$KERNEL_H/tqguardedptr.h \ - $$KERNEL_H/ntqgif.h \ + $$KERNEL_H/tqgif.h \ $$KERNEL_H/tqiconset.h \ $$KERNEL_H/tqimage.h \ $$KERNEL_P/tqimageformatinterface_p.h \ @@ -206,11 +206,11 @@ kernel { $$KERNEL_CPP/tqconnection.cpp \ $$KERNEL_CPP/tqcursor.cpp \ $$KERNEL_CPP/tqdragobject.cpp \ - $$KERNEL_CPP/qdrawutil.cpp \ + $$KERNEL_CPP/tqdrawutil.cpp \ $$KERNEL_CPP/tqdropsite.cpp \ $$KERNEL_CPP/tqevent.cpp \ $$KERNEL_CPP/tqeventloop.cpp \ - $$KERNEL_CPP/qfocusdata.cpp \ + $$KERNEL_CPP/tqfocusdata.cpp \ $$KERNEL_CPP/tqfont.cpp \ $$KERNEL_CPP/tqfontdatabase.cpp \ $$KERNEL_CPP/tqguardedptr.cpp \ diff --git a/src/kernel/tqaccel.cpp b/src/kernel/tqaccel.cpp index c5fcc30e6..39e0213f0 100644 --- a/src/kernel/tqaccel.cpp +++ b/src/kernel/tqaccel.cpp @@ -49,7 +49,7 @@ #include "tqwhatsthis.h" #include "tqguardedptr.h" #include "tqstatusbar.h" -#include "ntqdockwindow.h" +#include "tqdockwindow.h" #include "tqsignalslotimp.h" /*! \class TQAccel tqaccel.h diff --git a/src/kernel/tqasyncimageio.cpp b/src/kernel/tqasyncimageio.cpp index 56126b3d8..f4a144c1b 100644 --- a/src/kernel/tqasyncimageio.cpp +++ b/src/kernel/tqasyncimageio.cpp @@ -43,7 +43,7 @@ #ifndef TQT_NO_ASYNC_IMAGE_IO #include "tqptrlist.h" -#include "ntqgif.h" +#include "tqgif.h" #include extern void tqt_init_image_handlers(); @@ -178,7 +178,7 @@ extern void tqt_init_image_plugins(); \legalese TQt supports GIF reading if it is configured that way during - installation (see ntqgif.h). If it is, we are required to state that + installation (see tqgif.h). If it is, we are required to state that "The Graphics Interchange Format(c) is the Copyright property of CompuServe Incorporated. GIF(sm) is a Service Mark property of CompuServe Incorporated." @@ -199,7 +199,7 @@ static const int max_header = 32; -// See ntqgif.h for important information regarding this option +// See tqgif.h for important information regarding this option #if defined(QT_BUILTIN_GIF_READER) && QT_BUILTIN_GIF_READER == 1 class TQGIFFormat : public TQImageFormat { public: @@ -299,7 +299,7 @@ public: { if ( !factories ) { factories = new TQPtrList; -// See ntqgif.h for important information regarding this option +// See tqgif.h for important information regarding this option #if defined(QT_BUILTIN_GIF_READER) && QT_BUILTIN_GIF_READER == 1 gif_decoder_factory = new TQGIFFormatType; #endif @@ -310,7 +310,7 @@ public: static TQPtrList * factories; -// See ntqgif.h for important information regarding this option +// See tqgif.h for important information regarding this option #if defined(QT_BUILTIN_GIF_READER) && QT_BUILTIN_GIF_READER == 1 static TQGIFFormatType * gif_decoder_factory; #endif @@ -320,7 +320,7 @@ public: }; TQPtrList * TQImageDecoderPrivate::factories = 0; -// See ntqgif.h for important information regarding this option +// See tqgif.h for important information regarding this option #if defined(QT_BUILTIN_GIF_READER) && QT_BUILTIN_GIF_READER == 1 TQGIFFormatType * TQImageDecoderPrivate::gif_decoder_factory = 0; #endif @@ -330,7 +330,7 @@ void TQImageDecoderPrivate::cleanup() { delete factories; factories = 0; -// See ntqgif.h for important information regarding this option +// See tqgif.h for important information regarding this option #if defined(QT_BUILTIN_GIF_READER) && QT_BUILTIN_GIF_READER == 1 delete gif_decoder_factory; gif_decoder_factory = 0; @@ -659,7 +659,7 @@ bool qt_builtin_gif_reader() #endif } -// See ntqgif.h for important information regarding this option +// See tqgif.h for important information regarding this option #if defined(QT_BUILTIN_GIF_READER) && QT_BUILTIN_GIF_READER == 1 /* -- NOTDOC diff --git a/src/kernel/tqdragobject.cpp b/src/kernel/tqdragobject.cpp index f8557de55..b6fac2bd0 100644 --- a/src/kernel/tqdragobject.cpp +++ b/src/kernel/tqdragobject.cpp @@ -51,7 +51,7 @@ #include "tqpoint.h" #include "tqwidget.h" #include "tqbuffer.h" -#include "ntqgif.h" +#include "tqgif.h" #include "tqregexp.h" #include "tqdir.h" #include diff --git a/src/kernel/tqdrawutil.cpp b/src/kernel/tqdrawutil.cpp new file mode 100644 index 000000000..0c3283ddc --- /dev/null +++ b/src/kernel/tqdrawutil.cpp @@ -0,0 +1,957 @@ +/**************************************************************************** +** +** Implementation of draw utilities +** +** Created : 950920 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial licenses may use this file in accordance with the TQt +** Commercial License Agreement provided with the Software. +** +** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#include "tqdrawutil.h" +#ifndef TQT_NO_DRAWUTIL +#include "tqbitmap.h" +#include "tqpixmapcache.h" +#include "ntqapplication.h" +#include "tqpainter.h" + +/*! + \relates TQPainter + + \c{#include } + + Draws a horizontal (\a y1 == \a y2) or vertical (\a x1 == \a x2) + shaded line using the painter \a p. + + Nothing is drawn if \a y1 != \a y2 and \a x1 != \a x2 (i.e. the + line is neither horizontal nor vertical). + + The color group argument \a g specifies the shading colors (\link + TQColorGroup::light() light\endlink, \link TQColorGroup::dark() + dark\endlink and \link TQColorGroup::mid() middle\endlink colors). + + The line appears sunken if \a sunken is TRUE, or raised if \a + sunken is FALSE. + + The \a lineWidth argument specifies the line width for each of the + lines. It is not the total line width. + + The \a midLineWidth argument specifies the width of a middle line + drawn in the TQColorGroup::mid() color. + + If you want to use a TQFrame widget instead, you can make it + display a shaded line, for example \c{TQFrame::setFrameStyle( + TQFrame::HLine | TQFrame::Sunken )}. + + \warning This function does not look at TQWidget::style() or + TQApplication::style(). Use the drawing functions in TQStyle to make + widgets that follow the current GUI style. + + \sa qDrawShadeRect(), qDrawShadePanel(), TQStyle::drawPrimitive() +*/ + +void qDrawShadeLine( TQPainter *p, int x1, int y1, int x2, int y2, + const TQColorGroup &g, bool sunken, + int lineWidth, int midLineWidth ) +{ + if (!( p && lineWidth >= 0 && midLineWidth >= 0 ) ) { +#if defined(QT_CHECK_RANGE) + tqWarning( "qDrawShadeLine invalid parameters." ); +#endif + return; + } + int tlw = lineWidth*2 + midLineWidth; // total line width + TQPen oldPen = p->pen(); // save pen + if ( sunken ) + p->setPen( g.dark() ); + else + p->setPen( g.light() ); + TQPointArray a; + int i; + if ( y1 == y2 ) { // horizontal line + int y = y1 - tlw/2; + if ( x1 > x2 ) { // swap x1 and x2 + int t = x1; + x1 = x2; + x2 = t; + } + x2--; + for ( i=0; idrawPolyline( a ); + } + if ( midLineWidth > 0 ) { + p->setPen( g.mid() ); + for ( i=0; idrawLine( x1+lineWidth, y+lineWidth+i, + x2-lineWidth, y+lineWidth+i ); + } + if ( sunken ) + p->setPen( g.light() ); + else + p->setPen( g.dark() ); + for ( i=0; idrawPolyline( a ); + } + } + else if ( x1 == x2 ) { // vertical line + int x = x1 - tlw/2; + if ( y1 > y2 ) { // swap y1 and y2 + int t = y1; + y1 = y2; + y2 = t; + } + y2--; + for ( i=0; idrawPolyline( a ); + } + if ( midLineWidth > 0 ) { + p->setPen( g.mid() ); + for ( i=0; idrawLine( x+lineWidth+i, y1+lineWidth, x+lineWidth+i, y2 ); + } + if ( sunken ) + p->setPen( g.light() ); + else + p->setPen( g.dark() ); + for ( i=0; idrawPolyline( a ); + } + } + p->setPen( oldPen ); +} + + +/*! + \relates TQPainter + + \c{#include } + + Draws the shaded rectangle specified by (\a x, \a y, \a w, \a h) + using the painter \a p. + + The color group argument \a g specifies the shading colors (\link + TQColorGroup::light() light\endlink, \link TQColorGroup::dark() + dark\endlink and \link TQColorGroup::mid() middle\endlink colors). + + The rectangle appears sunken if \a sunken is TRUE, or raised if \a + sunken is FALSE. + + The \a lineWidth argument specifies the line width for each of the + lines. It is not the total line width. + + The \a midLineWidth argument specifies the width of a middle line + drawn in the TQColorGroup::mid() color. + + The rectangle's interior is filled with the \a fill brush unless + \a fill is 0. + + If you want to use a TQFrame widget instead, you can make it + display a shaded rectangle, for example \c{TQFrame::setFrameStyle( + TQFrame::Box | TQFrame::Raised )}. + + \warning This function does not look at TQWidget::style() or + TQApplication::style(). Use the drawing functions in TQStyle to make + widgets that follow the current GUI style. + + \sa qDrawShadeLine(), qDrawShadePanel(), qDrawPlainRect(), + TQStyle::drawItem(), TQStyle::drawControl() + TQStyle::drawComplexControl() +*/ + +void qDrawShadeRect( TQPainter *p, int x, int y, int w, int h, + const TQColorGroup &g, bool sunken, + int lineWidth, int midLineWidth, + const TQBrush *fill ) +{ + if ( w == 0 || h == 0 ) + return; + if ( ! ( w > 0 && h > 0 && lineWidth >= 0 && midLineWidth >= 0 ) ) { +#if defined(QT_CHECK_RANGE) + tqWarning( "qDrawShadeRect(): Invalid parameters" ); +#endif + return; + } + TQPen oldPen = p->pen(); + if ( sunken ) + p->setPen( g.dark() ); + else + p->setPen( g.light() ); + int x1=x, y1=y, x2=x+w-1, y2=y+h-1; + TQPointArray a; + + if ( lineWidth == 1 && midLineWidth == 0 ) {// standard shade rectangle + p->drawRect( x1, y1, w-1, h-1 ); + if ( sunken ) + p->setPen( g.light() ); + else + p->setPen( g.dark() ); + a.setPoints( 8, x1+1,y1+1, x2-2,y1+1, x1+1,y1+2, x1+1,y2-2, + x1,y2, x2,y2, x2,y1, x2,y2-1 ); + p->drawLineSegments( a ); // draw bottom/right lines + } else { // more complicated + int m = lineWidth+midLineWidth; + int i, j=0, k=m; + for ( i=0; idrawLineSegments( a ); + k++; + } + p->setPen( g.mid() ); + j = lineWidth*2; + for ( i=0; idrawRect( x1+lineWidth+i, y1+lineWidth+i, w-j, h-j ); + j += 2; + } + if ( sunken ) + p->setPen( g.light() ); + else + p->setPen( g.dark() ); + k = m; + for ( i=0; idrawLineSegments( a ); + k++; + } + } + if ( fill ) { + TQBrush oldBrush = p->brush(); + int tlw = lineWidth + midLineWidth; + p->setPen( TQt::NoPen ); + p->setBrush( *fill ); + p->drawRect( x+tlw, y+tlw, w-2*tlw, h-2*tlw ); + p->setBrush( oldBrush ); + } + p->setPen( oldPen ); // restore pen +} + + +/*! + \relates TQPainter + + \c{#include } + + Draws the shaded panel specified by (\a x, \a y, \a w, \a h) using + the painter \a p. + + The color group argument \a g specifies the shading colors (\link + TQColorGroup::light() light\endlink, \link TQColorGroup::dark() + dark\endlink and \link TQColorGroup::mid() middle\endlink colors). + + The panel appears sunken if \a sunken is TRUE, or raised if \a + sunken is FALSE. + + The \a lineWidth argument specifies the line width. + + The panel's interior is filled with the \a fill brush unless \a + fill is 0. + + If you want to use a TQFrame widget instead, you can make it + display a shaded panel, for example \c{TQFrame::setFrameStyle( + TQFrame::Panel | TQFrame::Sunken )}. + + \warning This function does not look at TQWidget::style() or + TQApplication::style(). Use the drawing functions in TQStyle to make + widgets that follow the current GUI style. + + \sa qDrawWinPanel(), qDrawShadeLine(), qDrawShadeRect(), + TQStyle::drawPrimitive() +*/ + +void qDrawShadePanel( TQPainter *p, int x, int y, int w, int h, + const TQColorGroup &g, bool sunken, + int lineWidth, const TQBrush *fill ) +{ + if ( w == 0 || h == 0 ) + return; + if ( !( w > 0 && h > 0 && lineWidth >= 0 ) ) { +#if defined(QT_CHECK_RANGE) + tqWarning( "qDrawShadePanel() Invalid parameters." ); +#endif + } + TQColor shade = g.dark(); + TQColor light = g.light(); + if ( fill ) { + if ( fill->color() == shade ) + shade = g.shadow(); + if ( fill->color() == light ) + light = g.midlight(); + } + TQPen oldPen = p->pen(); // save pen + TQPointArray a( 4*lineWidth ); + if ( sunken ) + p->setPen( shade ); + else + p->setPen( light ); + int x1, y1, x2, y2; + int i; + int n = 0; + x1 = x; + y1 = y2 = y; + x2 = x+w-2; + for ( i=0; idrawLineSegments( a ); + n = 0; + if ( sunken ) + p->setPen( light ); + else + p->setPen( shade ); + x1 = x; + y1 = y2 = y+h-1; + x2 = x+w-1; + for ( i=0; idrawLineSegments( a ); + if ( fill ) { // fill with fill color + TQBrush oldBrush = p->brush(); + p->setPen( TQt::NoPen ); + p->setBrush( *fill ); + p->drawRect( x+lineWidth, y+lineWidth, w-lineWidth*2, h-lineWidth*2 ); + p->setBrush( oldBrush ); + } + p->setPen( oldPen ); // restore pen +} + + +/*! + \internal + This function draws a rectangle with two pixel line width. + It is called from qDrawWinButton() and qDrawWinPanel(). + + c1..c4 and fill are used: + + 1 1 1 1 1 2 + 1 3 3 3 4 2 + 1 3 F F 4 2 + 1 3 F F 4 2 + 1 4 4 4 4 2 + 2 2 2 2 2 2 +*/ + +static void qDrawWinShades( TQPainter *p, + int x, int y, int w, int h, + const TQColor &c1, const TQColor &c2, + const TQColor &c3, const TQColor &c4, + const TQBrush *fill ) +{ + if ( w < 2 || h < 2 ) // can't do anything with that + return; + TQPen oldPen = p->pen(); + TQPointArray a( 3 ); + a.setPoints( 3, x, y+h-2, x, y, x+w-2, y ); + p->setPen( c1 ); + p->drawPolyline( a ); + a.setPoints( 3, x, y+h-1, x+w-1, y+h-1, x+w-1, y ); + p->setPen( c2 ); + p->drawPolyline( a ); + if ( w > 4 && h > 4 ) { + a.setPoints( 3, x+1, y+h-3, x+1, y+1, x+w-3, y+1 ); + p->setPen( c3 ); + p->drawPolyline( a ); + a.setPoints( 3, x+1, y+h-2, x+w-2, y+h-2, x+w-2, y+1 ); + p->setPen( c4 ); + p->drawPolyline( a ); + if ( fill ) { + TQBrush oldBrush = p->brush(); + p->setBrush( *fill ); + p->setPen( TQt::NoPen ); + p->drawRect( x+2, y+2, w-4, h-4 ); + p->setBrush( oldBrush ); + } + } + p->setPen( oldPen ); +} + + +/*! + \relates TQPainter + + \c{#include } + + Draws the Windows-style button specified by (\a x, \a y, \a w, \a + h) using the painter \a p. + + The color group argument \a g specifies the shading colors (\link + TQColorGroup::light() light\endlink, \link TQColorGroup::dark() + dark\endlink and \link TQColorGroup::mid() middle\endlink colors). + + The button appears sunken if \a sunken is TRUE, or raised if \a + sunken is FALSE. + + The line width is 2 pixels. + + The button's interior is filled with the \a *fill brush unless \a + fill is 0. + + \warning This function does not look at TQWidget::style() or + TQApplication::style(). Use the drawing functions in TQStyle to make + widgets that follow the current GUI style. + + \sa qDrawWinPanel(), TQStyle::drawControl() +*/ + +void qDrawWinButton( TQPainter *p, int x, int y, int w, int h, + const TQColorGroup &g, bool sunken, + const TQBrush *fill ) +{ + if ( sunken ) + qDrawWinShades( p, x, y, w, h, + g.shadow(), g.light(), g.dark(), g.button(), fill ); + else + qDrawWinShades( p, x, y, w, h, + g.light(), g.shadow(), g.button(), g.dark(), fill ); +} + +/*! + \relates TQPainter + + \c{#include } + + Draws the Windows-style panel specified by (\a x, \a y, \a w, \a + h) using the painter \a p. + + The color group argument \a g specifies the shading colors. + + The panel appears sunken if \a sunken is TRUE, or raised if \a + sunken is FALSE. + + The line width is 2 pixels. + + The button's interior is filled with the \a fill brush unless \a + fill is 0. + + If you want to use a TQFrame widget instead, you can make it + display a shaded panel, for example \c{TQFrame::setFrameStyle( + TQFrame::WinPanel | TQFrame::Raised )}. + + \warning This function does not look at TQWidget::style() or + TQApplication::style(). Use the drawing functions in TQStyle to make + widgets that follow the current GUI style. + + \sa qDrawShadePanel(), qDrawWinButton(), TQStyle::drawPrimitive() +*/ + +void qDrawWinPanel( TQPainter *p, int x, int y, int w, int h, + const TQColorGroup &g, bool sunken, + const TQBrush *fill ) +{ + if ( sunken ) + qDrawWinShades( p, x, y, w, h, + g.dark(), g.light(), g.shadow(), g.midlight(), fill ); + else + qDrawWinShades( p, x, y, w, h, + g.light(), g.shadow(), g.midlight(), g.dark(), fill ); +} + + +/*! + \relates TQPainter + + \c{#include } + + Draws the plain rectangle specified by (\a x, \a y, \a w, \a h) + using the painter \a p. + + The color argument \a c specifies the line color. + + The \a lineWidth argument specifies the line width. + + The rectangle's interior is filled with the \a fill brush unless + \a fill is 0. + + If you want to use a TQFrame widget instead, you can make it + display a plain rectangle, for example \c{TQFrame::setFrameStyle( + TQFrame::Box | TQFrame::Plain )}. + + \warning This function does not look at TQWidget::style() or + TQApplication::style(). Use the drawing functions in TQStyle to make + widgets that follow the current GUI style. + + \sa qDrawShadeRect(), TQStyle::drawPrimitive() +*/ + +void qDrawPlainRect( TQPainter *p, int x, int y, int w, int h, const TQColor &c, + int lineWidth, const TQBrush *fill ) +{ + if ( w == 0 || h == 0 ) + return; + if ( !( w > 0 && h > 0 && lineWidth >= 0 ) ) { +#if defined(QT_CHECK_RANGE) + tqWarning( "qDrawPlainRect() Invalid parameters." ); +#endif + } + TQPen oldPen = p->pen(); + TQBrush oldBrush = p->brush(); + p->setPen( c ); + p->setBrush( TQt::NoBrush ); + for ( int i=0; idrawRect( x+i, y+i, w-i*2, h-i*2 ); + if ( fill ) { // fill with fill color + p->setPen( TQt::NoPen ); + p->setBrush( *fill ); + p->drawRect( x+lineWidth, y+lineWidth, w-lineWidth*2, h-lineWidth*2 ); + } + p->setPen( oldPen ); + p->setBrush( oldBrush ); +} + + +TQRect qItemRect( TQPainter *p, TQt::GUIStyle gs, + int x, int y, int w, int h, + int flags, + bool enabled, + const TQPixmap *pixmap, + const TQString& text, int len ) +{ + TQRect result; + + if ( pixmap ) { + if ( (flags & TQt::AlignVCenter) == TQt::AlignVCenter ) + y += h/2 - pixmap->height()/2; + else if ( (flags & TQt::AlignBottom) == TQt::AlignBottom) + y += h - pixmap->height(); + if ( (flags & TQt::AlignRight) == TQt::AlignRight ) + x += w - pixmap->width(); + else if ( (flags & TQt::AlignHCenter) == TQt::AlignHCenter ) + x += w/2 - pixmap->width()/2; + else if ( (flags & TQt::AlignLeft) != TQt::AlignLeft && TQApplication::reverseLayout() ) + x += w - pixmap->width(); + result = TQRect(x, y, pixmap->width(), pixmap->height()); + } else if ( !text.isNull() && p ) { + result = p->boundingRect( x, y, w, h, flags, text, len ); + if ( gs == TQt::WindowsStyle && !enabled ) { + result.setWidth(result.width()+1); + result.setHeight(result.height()+1); + } + } else { + result = TQRect(x, y, w, h); + } + + return result; +} + + +void qDrawItem( TQPainter *p, TQt::GUIStyle gs, + int x, int y, int w, int h, + int flags, + const TQColorGroup &g, bool enabled, + const TQPixmap *pixmap, + const TQString& text, int len , const TQColor* penColor ) +{ + p->setPen( penColor?*penColor:g.foreground() ); + if ( pixmap ) { + TQPixmap pm( *pixmap ); + bool clip = (flags & TQt::DontClip) == 0; + if ( clip ) { + if ( pm.width() < w && pm.height() < h ) + clip = FALSE; + else + p->setClipRect( x, y, w, h ); + } + if ( (flags & TQt::AlignVCenter) == TQt::AlignVCenter ) + y += h/2 - pm.height()/2; + else if ( (flags & TQt::AlignBottom) == TQt::AlignBottom) + y += h - pm.height(); + if ( (flags & TQt::AlignRight) == TQt::AlignRight ) + x += w - pm.width(); + else if ( (flags & TQt::AlignHCenter) == TQt::AlignHCenter ) + x += w/2 - pm.width()/2; + else if ( ((flags & TQt::AlignLeft) != TQt::AlignLeft) && TQApplication::reverseLayout() ) // AlignAuto && rightToLeft + x += w - pm.width(); + + if ( !enabled ) { + if ( pm.mask() ) { // pixmap with a mask + if ( !pm.selfMask() ) { // mask is not pixmap itself + TQPixmap pmm( *pm.mask() ); + pmm.setMask( *((TQBitmap *)&pmm) ); + pm = pmm; + } + } else if ( pm.depth() == 1 ) { // monochrome pixmap, no mask + pm.setMask( *((TQBitmap *)&pm) ); +#ifndef TQT_NO_IMAGE_HEURISTIC_MASK + } else { // color pixmap, no mask + TQString k; + k.sprintf( "$qt-drawitem-%x", pm.serialNumber() ); + TQPixmap *mask = TQPixmapCache::find(k); + bool del=FALSE; + if ( !mask ) { + mask = new TQPixmap( pm.createHeuristicMask() ); + mask->setMask( *((TQBitmap*)mask) ); + del = !TQPixmapCache::insert( k, mask ); + } + pm = *mask; + if (del) delete mask; +#endif + } + if ( gs == TQt::WindowsStyle ) { + p->setPen( g.light() ); + p->drawPixmap( x+1, y+1, pm ); + p->setPen( g.text() ); + } + } + p->drawPixmap( x, y, pm ); + if ( clip ) + p->setClipping( FALSE ); + } else if ( !text.isNull() ) { + if ( gs == TQt::WindowsStyle && !enabled ) { + p->setPen( g.light() ); + p->drawText( x+1, y+1, w, h, flags, text, len ); + p->setPen( g.text() ); + } + p->drawText( x, y, w, h, flags, text, len ); + } +} + + +/***************************************************************************** + Overloaded functions. + *****************************************************************************/ + +/*! + \overload void qDrawShadeLine( TQPainter *p, const TQPoint &p1, const TQPoint &p2, const TQColorGroup &g, bool sunken, int lineWidth, int midLineWidth ) +*/ + +void qDrawShadeLine( TQPainter *p, const TQPoint &p1, const TQPoint &p2, + const TQColorGroup &g, bool sunken, + int lineWidth, int midLineWidth ) +{ + qDrawShadeLine( p, p1.x(), p1.y(), p2.x(), p2.y(), g, sunken, + lineWidth, midLineWidth ); +} + +/*! + \overload void qDrawShadeRect( TQPainter *p, const TQRect &r, const TQColorGroup &g, bool sunken, int lineWidth, int midLineWidth, const TQBrush *fill ) +*/ + +void qDrawShadeRect( TQPainter *p, const TQRect &r, + const TQColorGroup &g, bool sunken, + int lineWidth, int midLineWidth, + const TQBrush *fill ) +{ + qDrawShadeRect( p, r.x(), r.y(), r.width(), r.height(), g, sunken, + lineWidth, midLineWidth, fill ); +} + +/*! + \overload void qDrawShadePanel( TQPainter *p, const TQRect &r, const TQColorGroup &g, bool sunken, int lineWidth, const TQBrush *fill ) +*/ + +void qDrawShadePanel( TQPainter *p, const TQRect &r, + const TQColorGroup &g, bool sunken, + int lineWidth, const TQBrush *fill ) +{ + qDrawShadePanel( p, r.x(), r.y(), r.width(), r.height(), g, sunken, + lineWidth, fill ); +} + +/*! + \overload void qDrawWinButton( TQPainter *p, const TQRect &r, const TQColorGroup &g, bool sunken, const TQBrush *fill ) +*/ + +void qDrawWinButton( TQPainter *p, const TQRect &r, + const TQColorGroup &g, bool sunken, + const TQBrush *fill ) +{ + qDrawWinButton( p, r.x(), r.y(), r.width(), r.height(), g, sunken, fill ); +} + +/*! + \overload void qDrawWinPanel( TQPainter *p, const TQRect &r, const TQColorGroup &g, bool sunken, const TQBrush *fill ) +*/ + +void qDrawWinPanel( TQPainter *p, const TQRect &r, + const TQColorGroup &g, bool sunken, + const TQBrush *fill ) +{ + qDrawWinPanel( p, r.x(), r.y(), r.width(), r.height(), g, sunken, fill ); +} + +/*! + \overload void qDrawPlainRect( TQPainter *p, const TQRect &r, const TQColor &c, int lineWidth, const TQBrush *fill ) +*/ + +void qDrawPlainRect( TQPainter *p, const TQRect &r, const TQColor &c, + int lineWidth, const TQBrush *fill ) +{ + qDrawPlainRect( p, r.x(), r.y(), r.width(), r.height(), c, + lineWidth, fill ); +} + + +static void qDrawWinArrow( TQPainter *p, TQt::ArrowType type, bool down, + int x, int y, int w, int h, + const TQColorGroup &g, bool enabled ) +{ + TQPointArray a; // arrow polygon + switch ( type ) { + case TQt::UpArrow: + a.setPoints( 7, -3,1, 3,1, -2,0, 2,0, -1,-1, 1,-1, 0,-2 ); + break; + case TQt::DownArrow: + a.setPoints( 7, -3,-1, 3,-1, -2,0, 2,0, -1,1, 1,1, 0,2 ); + break; + case TQt::LeftArrow: + a.setPoints( 7, 1,-3, 1,3, 0,-2, 0,2, -1,-1, -1,1, -2,0 ); + break; + case TQt::RightArrow: + a.setPoints( 7, -1,-3, -1,3, 0,-2, 0,2, 1,-1, 1,1, 2,0 ); + break; + } + if ( a.isNull() ) + return; + + if ( down ) { + x++; + y++; + } + + TQPen savePen = p->pen(); // save current pen + if (down) + p->setBrushOrigin(p->brushOrigin() + TQPoint(1,1)); + p->fillRect( x, y, w, h, g.brush( TQColorGroup::Button ) ); + if (down) + p->setBrushOrigin(p->brushOrigin() - TQPoint(1,1)); + if ( enabled ) { + a.translate( x+w/2, y+h/2 ); + p->setPen( g.foreground() ); + p->drawLineSegments( a, 0, 3 ); // draw arrow + p->drawPoint( a[6] ); + } else { + a.translate( x+w/2+1, y+h/2+1 ); + p->setPen( g.light() ); + p->drawLineSegments( a, 0, 3 ); // draw arrow + p->drawPoint( a[6] ); + a.translate( -1, -1 ); + p->setPen( g.mid() ); + p->drawLineSegments( a, 0, 3 ); // draw arrow + p->drawPoint( a[6] ); + } + p->setPen( savePen ); // restore pen +} + + +#if defined(Q_CC_MSVC) +#pragma warning(disable: 4244) +#endif + +#ifndef TQT_NO_STYLE_MOTIF +// motif arrows look the same whether they are used or not +// is this correct? +static void qDrawMotifArrow( TQPainter *p, TQt::ArrowType type, bool down, + int x, int y, int w, int h, + const TQColorGroup &g, bool ) +{ + TQPointArray bFill; // fill polygon + TQPointArray bTop; // top shadow. + TQPointArray bBot; // bottom shadow. + TQPointArray bLeft; // left shadow. +#ifndef TQT_NO_TRANSFORMATIONS + TQWMatrix matrix; // xform matrix +#endif + bool vertical = type == TQt::UpArrow || type == TQt::DownArrow; + bool horizontal = !vertical; + int dim = w < h ? w : h; + int colspec = 0x0000; // color specification array + + if ( dim < 2 ) // too small arrow + return; + + if ( dim > 3 ) { + if ( dim > 6 ) + bFill.resize( dim & 1 ? 3 : 4 ); + bTop.resize( (dim/2)*2 ); + bBot.resize( dim & 1 ? dim + 1 : dim ); + bLeft.resize( dim > 4 ? 4 : 2 ); + bLeft.putPoints( 0, 2, 0,0, 0,dim-1 ); + if ( dim > 4 ) + bLeft.putPoints( 2, 2, 1,2, 1,dim-3 ); + bTop.putPoints( 0, 4, 1,0, 1,1, 2,1, 3,1 ); + bBot.putPoints( 0, 4, 1,dim-1, 1,dim-2, 2,dim-2, 3,dim-2 ); + + for( int i=0; i 6 ) { // dim>6: must fill interior + bFill.putPoints( 0, 2, 1,dim-3, 1,2 ); + if ( dim & 1 ) // if size is an odd number + bFill.setPoint( 2, dim - 3, dim / 2 ); + else + bFill.putPoints( 2, 2, dim-4,dim/2-1, dim-4,dim/2 ); + } + } + else { + if ( dim == 3 ) { // 3x3 arrow pattern + bLeft.setPoints( 4, 0,0, 0,2, 1,1, 1,1 ); + bTop .setPoints( 2, 1,0, 1,0 ); + bBot .setPoints( 2, 1,2, 2,1 ); + } + else { // 2x2 arrow pattern + bLeft.setPoints( 2, 0,0, 0,1 ); + bTop .setPoints( 2, 1,0, 1,0 ); + bBot .setPoints( 2, 1,1, 1,1 ); + } + } + + if ( type == TQt::UpArrow || type == TQt::LeftArrow ) { +#ifndef TQT_NO_TRANSFORMATIONS // #### fix me! + matrix.translate( x, y ); + if ( vertical ) { + matrix.translate( 0, h - 1 ); + matrix.rotate( -90 ); + } else { + matrix.translate( w - 1, h - 1 ); + matrix.rotate( 180 ); + } +#endif + if ( down ) + colspec = horizontal ? 0x2334 : 0x2343; + else + colspec = horizontal ? 0x1443 : 0x1434; + } + else if ( type == TQt::DownArrow || type == TQt::RightArrow ) { +#ifndef TQT_NO_TRANSFORMATIONS // #### fix me! + matrix.translate( x, y ); + if ( vertical ) { + matrix.translate( w-1, 0 ); + matrix.rotate( 90 ); + } +#endif + if ( down ) + colspec = horizontal ? 0x2443 : 0x2434; + else + colspec = horizontal ? 0x1334 : 0x1343; + } + + TQColor *cols[5]; + cols[0] = 0; + cols[1] = (TQColor *)&g.button(); + cols[2] = (TQColor *)&g.mid(); + cols[3] = (TQColor *)&g.light(); + cols[4] = (TQColor *)&g.dark(); +#define CMID *cols[ (colspec>>12) & 0xf ] +#define CLEFT *cols[ (colspec>>8) & 0xf ] +#define CTOP *cols[ (colspec>>4) & 0xf ] +#define CBOT *cols[ colspec & 0xf ] + + TQPen savePen = p->pen(); // save current pen + TQBrush saveBrush = p->brush(); // save current brush +#ifndef TQT_NO_TRANSFORMATIONS + TQWMatrix wxm = p->worldMatrix(); +#endif + TQPen pen( TQt::NoPen ); + const TQBrush &brush = g.brush( TQColorGroup::Button ); + + p->setPen( pen ); + p->setBrush( brush ); +#ifndef TQT_NO_TRANSFORMATIONS + p->setWorldMatrix( matrix, TRUE ); // set transformation matrix +#endif + p->drawPolygon( bFill ); // fill arrow + p->setBrush( TQt::NoBrush ); // don't fill + + p->setPen( CLEFT ); + p->drawLineSegments( bLeft ); + p->setPen( CTOP ); + p->drawLineSegments( bTop ); + p->setPen( CBOT ); + p->drawLineSegments( bBot ); + +#ifndef TQT_NO_TRANSFORMATIONS + p->setWorldMatrix( wxm ); +#endif + p->setBrush( saveBrush ); // restore brush + p->setPen( savePen ); // restore pen + +#undef CMID +#undef CLEFT +#undef CTOP +#undef CBOT +} +#endif + +void qDrawArrow( TQPainter *p, TQt::ArrowType type, TQt::GUIStyle style, bool down, + int x, int y, int w, int h, + const TQColorGroup &g, bool enabled ) +{ + switch ( style ) { + case TQt::WindowsStyle: + qDrawWinArrow( p, type, down, x, y, w, h, g, enabled ); + break; +#ifndef TQT_NO_STYLE_MOTIF + case TQt::MotifStyle: + qDrawMotifArrow( p, type, down, x, y, w, h, g, enabled ); + break; +#endif + default: +#if defined(QT_CHECK_RANGE) + tqWarning( "qDrawArrow: Requested GUI style not supported" ); +#else + ; +#endif + } +} +#endif //TQT_NO_DRAWUTIL diff --git a/src/kernel/tqdrawutil.h b/src/kernel/tqdrawutil.h new file mode 100644 index 000000000..d8e2703d2 --- /dev/null +++ b/src/kernel/tqdrawutil.h @@ -0,0 +1,128 @@ +/**************************************************************************** +** +** Definition of draw utilities +** +** Created : 950920 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial licenses may use this file in accordance with the TQt +** Commercial License Agreement provided with the Software. +** +** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQDRAWUTIL_H +#define TQDRAWUTIL_H + +#ifndef QT_H +#include "ntqnamespace.h" +#include "tqstring.h" // char*->TQString conversion +#endif // QT_H + +class TQPainter; +class TQColorGroup; +class TQPoint; +class TQBrush; +class TQRect; +class TQPixmap; + +#ifndef TQT_NO_DRAWUTIL +// +// Standard shade drawing +// + +TQ_EXPORT void qDrawShadeLine( TQPainter *p, int x1, int y1, int x2, int y2, + const TQColorGroup &g, bool sunken = TRUE, + int lineWidth = 1, int midLineWidth = 0 ); + +TQ_EXPORT void qDrawShadeLine( TQPainter *p, const TQPoint &p1, const TQPoint &p2, + const TQColorGroup &g, bool sunken = TRUE, + int lineWidth = 1, int midLineWidth = 0 ); + +TQ_EXPORT void qDrawShadeRect( TQPainter *p, int x, int y, int w, int h, + const TQColorGroup &, bool sunken=FALSE, + int lineWidth = 1, int midLineWidth = 0, + const TQBrush *fill = 0 ); + +TQ_EXPORT void qDrawShadeRect( TQPainter *p, const TQRect &r, + const TQColorGroup &, bool sunken=FALSE, + int lineWidth = 1, int midLineWidth = 0, + const TQBrush *fill = 0 ); + +TQ_EXPORT void qDrawShadePanel( TQPainter *p, int x, int y, int w, int h, + const TQColorGroup &, bool sunken=FALSE, + int lineWidth = 1, const TQBrush *fill = 0 ); + +TQ_EXPORT void qDrawShadePanel( TQPainter *p, const TQRect &r, + const TQColorGroup &, bool sunken=FALSE, + int lineWidth = 1, const TQBrush *fill = 0 ); + +TQ_EXPORT void qDrawWinButton( TQPainter *p, int x, int y, int w, int h, + const TQColorGroup &g, bool sunken = FALSE, + const TQBrush *fill = 0 ); + +TQ_EXPORT void qDrawWinButton( TQPainter *p, const TQRect &r, + const TQColorGroup &g, bool sunken = FALSE, + const TQBrush *fill = 0 ); + +TQ_EXPORT void qDrawWinPanel( TQPainter *p, int x, int y, int w, int h, + const TQColorGroup &, bool sunken=FALSE, + const TQBrush *fill = 0 ); + +TQ_EXPORT void qDrawWinPanel( TQPainter *p, const TQRect &r, + const TQColorGroup &, bool sunken=FALSE, + const TQBrush *fill = 0 ); + +TQ_EXPORT void qDrawPlainRect( TQPainter *p, int x, int y, int w, int h, const TQColor &, + int lineWidth = 1, const TQBrush *fill = 0 ); + +TQ_EXPORT void qDrawPlainRect( TQPainter *p, const TQRect &r, const TQColor &, + int lineWidth = 1, const TQBrush *fill = 0 ); + + +// +// Other obsolete drawing functions. +// Use TQStyle::itemRect(), TQStyle::drawItem() and TQStyle::drawArrow() instead. +// +TQ_EXPORT TQRect qItemRect( TQPainter *p, TQt::GUIStyle gs, int x, int y, int w, int h, + int flags, bool enabled, + const TQPixmap *pixmap, const TQString& text, int len=-1 ); + +TQ_EXPORT void qDrawItem( TQPainter *p, TQt::GUIStyle gs, int x, int y, int w, int h, + int flags, const TQColorGroup &g, bool enabled, + const TQPixmap *pixmap, const TQString& text, + int len=-1, const TQColor* penColor = 0 ); + +TQ_EXPORT void qDrawArrow( TQPainter *p, TQt::ArrowType type, TQt::GUIStyle style, bool down, + int x, int y, int w, int h, + const TQColorGroup &g, bool enabled ); + +#endif // TQT_NO_DRAWUTIL +#endif // TQDRAWUTIL_H diff --git a/src/kernel/tqfocusdata.cpp b/src/kernel/tqfocusdata.cpp new file mode 100644 index 000000000..87ef60534 --- /dev/null +++ b/src/kernel/tqfocusdata.cpp @@ -0,0 +1,141 @@ +/**************************************************************************** +** +** Implementation of TQFocusData class +** +** Created : 980622 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial licenses may use this file in accordance with the TQt +** Commercial License Agreement provided with the Software. +** +** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#include "tqfocusdata.h" + +/*! + \class TQFocusData tqfocusdata.h + \brief The TQFocusData class maintains the list of widgets in the focus + chain. + + \ingroup misc + + This read-only list always contains at least one widget (i.e. the + top-level widget). It provides a simple cursor which can be reset + to the current focus widget using home(), or moved to its + neighboring widgets using next() and prev(). You can also retrieve + the count() of the number of widgets in the list. The list is a + loop, so if you keep iterating, for example using next(), you will + never come to the end. + + Some widgets in the list may not accept focus. Widgets are added + to the list as necessary, but not removed from it. This lets + widgets change focus policy dynamically without disrupting the + focus chain the user experiences. When a widget disables and + re-enables tab focus, its position in the focus chain does not + change. + + When reimplementing TQWidget::focusNextPrevChild() to provide + special focus flow, you will usually call TQWidget::focusData() to + retrieve the focus data stored at the top-level widget. A + top-level widget's focus data contains the focus list for its + hierarchy of widgets. + + The cursor may change at any time. + + This class is \e not thread-safe. + + \sa TQWidget::focusNextPrevChild() TQWidget::setTabOrder() + TQWidget::setFocusPolicy() +*/ + +/*! + \fn TQWidget* TQFocusData::focusWidget() const + + Returns the widgets in the hierarchy that are in the focus chain. +*/ + +/*! + \fn int TQFocusData::count() const + + Returns the number of widgets in the focus chain. +*/ + +/*! + Moves the cursor to the focusWidget() and returns that widget. You + must call this before next() or prev() to iterate meaningfully. +*/ +TQWidget* TQFocusData::home() +{ + focusWidgets.find(it.current()); + return focusWidgets.current(); +} + +/*! + Moves the cursor to the next widget in the focus chain. There is + \e always a next widget because the list is a loop. +*/ +TQWidget* TQFocusData::next() +{ + TQWidget* r = focusWidgets.next(); + if ( !r ) + r = focusWidgets.first(); + return r; +} + +/*! + Moves the cursor to the previous widget in the focus chain. There + is \e always a previous widget because the list is a loop. +*/ +TQWidget* TQFocusData::prev() +{ + TQWidget* r = focusWidgets.prev(); + if ( !r ) + r = focusWidgets.last(); + return r; +} + +/*! + Returns the last widget in the focus chain. + The cursor is not modified. +*/ +TQWidget *TQFocusData::last() const +{ + return focusWidgets.getLast(); +} + +/*! + Returns the first widget in the focus chain. + The cursor is not modified. +*/ +TQWidget *TQFocusData::first() const +{ + return focusWidgets.getFirst(); +} diff --git a/src/kernel/tqfocusdata.h b/src/kernel/tqfocusdata.h new file mode 100644 index 000000000..f6eb57fe3 --- /dev/null +++ b/src/kernel/tqfocusdata.h @@ -0,0 +1,70 @@ +/**************************************************************************** +** +** Definition of internal TQFocusData class +** +** Created : 980405 +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial licenses may use this file in accordance with the TQt +** Commercial License Agreement provided with the Software. +** +** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQFOCUSDATA_H +#define TQFOCUSDATA_H + +#ifndef QT_H +#include "tqwidgetlist.h" +#endif // QT_H + + +class TQ_EXPORT TQFocusData { +public: + TQWidget* focusWidget() const { return it.current(); } + + TQWidget* home(); + TQWidget* next(); + TQWidget* prev(); + TQWidget* first() const; + TQWidget* last() const; + int count() const { return focusWidgets.count(); } + +private: + friend class TQWidget; + + TQFocusData() + : it(focusWidgets) {} + TQWidgetList focusWidgets; + TQWidgetListIt it; +}; + + +#endif // TQFOCUSDATA_H diff --git a/src/kernel/tqgif.h b/src/kernel/tqgif.h new file mode 100644 index 000000000..9d1658a0c --- /dev/null +++ b/src/kernel/tqgif.h @@ -0,0 +1,61 @@ +/**************************************************************************** +** +** To enable built-in reading of GIF images in TQt, change the definition +** below to "#define QT_BUILTIN_GIF_READER 1". +** +** To disable built-in reading of GIF images in TQt, change the definition +** below to "#define QT_BUILTIN_GIF_READER 0". +** +** WARNING: +** A separate license from Unisys may be required to use the gif +** reader. See http://www.unisys.com/about__unisys/lzw/ +** for information from Unisys +** +** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the kernel module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial licenses may use this file in accordance with the TQt +** Commercial License Agreement provided with the Software. +** +** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQGIF_H +#define TQGIF_H + +#ifndef QT_H +#include "tqglobal.h" +#endif // QT_H + +#ifndef QT_BUILTIN_GIF_READER +#define QT_BUILTIN_GIF_READER 0 +#endif + +bool qt_builtin_gif_reader(); + +#endif // TQGIF_H diff --git a/src/kernel/tqmovie.cpp b/src/kernel/tqmovie.cpp index 1a29a4315..6350f5ceb 100644 --- a/src/kernel/tqmovie.cpp +++ b/src/kernel/tqmovie.cpp @@ -90,7 +90,7 @@ The supported formats are MNG (if TQt is configured with MNG support enabled) and GIF (if TQt is configured with GIF support - enabled, see ntqgif.h). + enabled, see tqgif.h). If TQt is configured to support GIF reading, we are required to state that "The Graphics Interchange Format(c) is the Copyright diff --git a/src/kernel/tqpainter.cpp b/src/kernel/tqpainter.cpp index 359954168..b2c0d5fba 100644 --- a/src/kernel/tqpainter.cpp +++ b/src/kernel/tqpainter.cpp @@ -232,7 +232,7 @@ typedef TQPtrStack TQWMatrixStack; platforms may behave incorrectly with coordinates as small as +/-4000. - \headerfile ntqdrawutil.h + \headerfile tqdrawutil.h \sa TQPaintDevice TQWidget TQPixmap TQPrinter TQPicture \link simple-application.html Application Walkthrough \endlink diff --git a/src/kernel/tqurl.cpp b/src/kernel/tqurl.cpp index d2fcd9c59..1155e9fa1 100644 --- a/src/kernel/tqurl.cpp +++ b/src/kernel/tqurl.cpp @@ -126,13 +126,13 @@ static void slashify( TQString& s, bool allowMultiple = TRUE ) Example: - http://doc.trolltech.com/ntqdockarea.html#lines + http://doc.trolltech.com/tqdockarea.html#lines \table \header \i Function \i Returns \row \i \l protocol() \i "http" \row \i \l host() \i "doc.trolltech.com" - \row \i \l fileName() \i "ntqdockarea.html" + \row \i \l fileName() \i "tqdockarea.html" \row \i \l ref() \i "lines" \endtable diff --git a/src/kernel/tqwidget.cpp b/src/kernel/tqwidget.cpp index 9fe528f78..d0e37df41 100644 --- a/src/kernel/tqwidget.cpp +++ b/src/kernel/tqwidget.cpp @@ -44,7 +44,7 @@ #include "tqwidgetlist.h" #include "tqwidgetintdict.h" #include "tqptrdict.h" -#include "ntqfocusdata.h" +#include "tqfocusdata.h" #include "tqcursor.h" #include "tqpixmap.h" #include "ntqapplication.h" -- cgit v1.2.3