parent
596c6587c8
commit
be74b66794
@ -1,492 +0,0 @@
|
||||
#ifndef TQTGLOBALDEFINES_H
|
||||
#define TQTGLOBALDEFINES_H
|
||||
|
||||
#include "tqtglobalsettings.h"
|
||||
|
||||
// #ifdef USE_QT4
|
||||
// #define QT3_SUPPORT
|
||||
// #endif
|
||||
//
|
||||
#ifdef USE_QT4
|
||||
|
||||
#include <Qt/qglobal.h>
|
||||
#include <Qt/qnamespace.h>
|
||||
#include <Qt/qobjectdefs.h>
|
||||
|
||||
#ifdef QT_NO_TRANSLATION
|
||||
#define TQT_NO_TRANSLATION
|
||||
#endif // QT_NO_TRANSLATION
|
||||
|
||||
#ifdef QT_THREAD_SUPPORT
|
||||
#define TQT_THREAD_SUPPORT
|
||||
#endif // QT_THREAD_SUPPORT
|
||||
|
||||
// #define tqqt_cast qobject_cast
|
||||
|
||||
// Mark certain Qt3 static variables squarely OFF LIMITS
|
||||
#define qt_x_time "Usage of the qt_x_time static variable is strongly deprecated in TQt, and is unavailable in TQt for Qt4. Use GET_QT_X_TIME/SET_QT_X_TIME instead"
|
||||
#define qt_x_user_time "Usage of the qt_x_time static variable is strongly deprecated in TQt, and is unavailable in TQt for Qt4. Use GET_QT_X_USER_TIME/SET_QT_X_USER_TIME instead"
|
||||
|
||||
// #define TQT_TQOBJECT(x) (static_cast<TQObject*>(static_cast<TQT_BASE_OBJECT_NAME*>(x)))
|
||||
#define TQT_TQOBJECT(x) (convertFromTQT_BASE_OBJECT_NAMEPointer(x))
|
||||
#define TQT_TQWIDGET(x) TQWidget::tqt_ensure_valid_widget_painting(static_cast<TQWidget*>(static_cast<QWidget*>(static_cast<TQT_BASE_OBJECT_NAME*>(x))))
|
||||
#define TQT_TQSIZEPOLICY(x) (static_cast<TQSizePolicy*>(static_cast<QSizePolicy*>(x)))
|
||||
#define TQT_TQLAYOUT(x) (static_cast<TQLayout*>(static_cast<QLayout*>(x)))
|
||||
#define TQT_TQGRIDLAYOUT(x) (static_cast<TQGridLayout*>(static_cast<QGridLayout*>(x)))
|
||||
#define TQT_TQPAINTER(x) (static_cast<TQPainter*>(static_cast<QPainter*>(x)))
|
||||
#define TQT_TQPAINTDEVICE(x) (static_cast<TQPaintDevice*>(static_cast<QPaintDevice*>(x)))
|
||||
#define TQT_TQLAYOUTITEM(x) (static_cast<TQLayoutItem*>(static_cast<QLayoutItem*>(x)))
|
||||
#define TQT_TQIODEVICE(x) (static_cast<TQIODevice*>(static_cast<QIODevice*>(x)))
|
||||
#define TQT_TQCOLOR(x) (static_cast<TQColor*>(static_cast<QColor*>(x)))
|
||||
#define TQT_TQCHAR(x) TQChar(x)
|
||||
#define TQT_TQSTRING(x) TQString(x)
|
||||
#define TQT_TQPOINT(x) (static_cast<TQPoint*>(static_cast<QPoint*>(x)))
|
||||
#define TQT_TQBUFFER(x) (static_cast<TQBuffer*>(static_cast<QBuffer*>(x)))
|
||||
#define TQT_TQWMATRIX(x) (static_cast<TQWMatrix*>(static_cast<QMatrix*>(x)))
|
||||
#define TQT_TQFILE(x) (static_cast<TQFile*>(static_cast<QFile*>(x)))
|
||||
#define TQT_TQBYTEARRAY(x) (static_cast<TQByteArray*>(static_cast<QByteArray*>(x)))
|
||||
#define TQT_TQMIMESOURCE(x) (static_cast<TQMimeSource*>(static_cast<QMimeSource*>(x)))
|
||||
#define TQT_TQWEXTRA(x) (static_cast<TQWExtra*>(static_cast<QWExtra*>(x)))
|
||||
#define TQT_TQPIXMAP(x) (static_cast<TQPixmap*>(static_cast<QPixmap*>(x)))
|
||||
#define TQT_TQCLIPBOARD(x) (static_cast<TQClipboard*>(static_cast<QClipboard*>(x)))
|
||||
#define TQT_TQPRINTER(x) (static_cast<TQPrinter*>(static_cast<QPrinter*>(x)))
|
||||
#define TQT_TQVARIANT(x) (static_cast<TQVariant*>(static_cast<QVariant*>(x)))
|
||||
#define TQT_TQMETAOBJECT(x) (static_cast<TQMetaObject*>(static_cast<QMetaObject*>(x)))
|
||||
#define TQT_TQSTYLEOPTION(x) (static_cast<TQStyleOption*>(static_cast<TQStyleOption*>(x)))
|
||||
#define TQT_TQEVENT(x) (static_cast<TQEvent*>(static_cast<QEvent*>(x)))
|
||||
#define TQT_TQKEYEVENT(x) (static_cast<TQKeyEvent*>(static_cast<QKeyEvent*>(static_cast<QEvent*>(x))))
|
||||
#define TQT_TQSHOWEVENT(x) (static_cast<TQShowEvent*>(static_cast<QShowEvent*>(static_cast<QEvent*>(x))))
|
||||
#define TQT_TQMOUSEEVENT(x) (static_cast<TQMouseEvent*>(static_cast<QMouseEvent*>(static_cast<QEvent*>(x))))
|
||||
#define TQT_TQWHEELEVENT(x) (static_cast<TQWheelEvent*>(static_cast<QWheelEvent*>(static_cast<QEvent*>(x))))
|
||||
#define TQT_TQFOCUSEVENT(x) (static_cast<TQFocusEvent*>(static_cast<QFocusEvent*>(static_cast<QEvent*>(x))))
|
||||
#define TQT_TQPAINTEVENT(x) (static_cast<TQPaintEvent*>(static_cast<QPaintEvent*>(static_cast<QEvent*>(x))))
|
||||
#define TQT_TQCHILDEVENT(x) (static_cast<TQChildEvent*>(static_cast<QChildEvent*>(static_cast<QEvent*>(x))))
|
||||
#define TQT_TQCLOSEEVENT(x) (static_cast<TQCloseEvent*>(static_cast<QCloseEvent*>(static_cast<QEvent*>(x))))
|
||||
#define TQT_TQTIMEREVENT(x) (static_cast<TQTimerEvent*>(static_cast<QTimerEvent*>(static_cast<QEvent*>(x))))
|
||||
#define TQT_TQRESIZEEVENT(x) (static_cast<TQResizeEvent*>(static_cast<QResizeEvent*>(static_cast<QEvent*>(x))))
|
||||
#define TQT_TQCONTEXTMENUEVENT(x) (static_cast<TQContextMenuEvent*>(static_cast<QContextMenuEvent*>(static_cast<QEvent*>(x))))
|
||||
|
||||
#define TQT_TQOBJECT_OBJECT(x) (convertFromTQT_BASE_OBJECT_NAME(x))
|
||||
#define TQT_TQSIZEPOLICY_OBJECT(x) (convertFromQSizePolicy(x))
|
||||
#define TQT_TQLAYOUT_OBJECT(x) (convertFromQLayout(x))
|
||||
#define TQT_TQCOLOR_OBJECT(x) (convertFromQColor(x))
|
||||
#define TQT_TQSTRING_OBJECT(x) (convertFromQString(x))
|
||||
#define TQT_TQSTRLIST_OBJECT(x) (convertFromQStrList(x))
|
||||
#define TQT_TQSTRINGLIST_OBJECT(x) (TQStringList::convertFromQStringList(x))
|
||||
#define TQT_TQWMATRIX_OBJECT(x) (convertFromQMatrix(x))
|
||||
#define TQT_TQRECT_OBJECT(x) TQRect(x)
|
||||
#define TQT_TQBYTEARRAY_OBJECT(x) (convertFromQByteArray(x))
|
||||
#define TQT_TQPIXMAP_OBJECT(x) (convertFromQPixmap(x))
|
||||
#define TQT_TQTIME_OBJECT(x) (TQTime::convertFromQTime(x))
|
||||
#define TQT_TQDATE_OBJECT(x) (TQDate::convertFromQDate(x))
|
||||
#define TQT_TQDATETIME_OBJECT(x) (TQDateTime::convertFromQDateTime(x))
|
||||
#define TQT_TQBRUSH_OBJECT(x) (convertFromQBrush(x))
|
||||
#define TQT_TQPALETTE_OBJECT(x) (convertFromQPalette(x))
|
||||
#define TQT_TQPOINT_OBJECT(x) (convertFromQPoint(x))
|
||||
#define TQT_TQREGION_OBJECT(x) (convertFromQRegion(x))
|
||||
#define TQT_TQIMAGE_OBJECT(x) (convertFromQImage(x))
|
||||
#define TQT_TQPAINTDEVICE_OBJECT(x) (convertFromQPaintDevice(x))
|
||||
#define TQT_TQVARIANT_OBJECT(x) (convertFromQVariant(x))
|
||||
#define TQT_TQIODEVICE_OBJECT(x) (convertFromQIODevice(x))
|
||||
#define TQT_TQSESSIONMANAGER_OBJECT(x) (convertFromQSessionManager(x))
|
||||
#define TQT_TQSTYLEOPTION_OBJECT(x) (TQStyleOption(x))
|
||||
|
||||
// #define TQT_TQOBJECT_CONST(x) (static_cast<const TQObject*>(static_cast<const TQT_BASE_OBJECT_NAME*>(x)))
|
||||
#define TQT_TQOBJECT_CONST(x) (convertFromTQT_BASE_OBJECT_NAMEPointerConst(x))
|
||||
#define TQT_TQWIDGET_CONST(x) (static_cast<const TQWidget*>(static_cast<const QWidget*>(static_cast<const TQT_BASE_OBJECT_NAME*>(x))))
|
||||
#define TQT_TQMIMESOURCE_CONST(x) (static_cast<const TQMimeSource*>(static_cast<const QMimeSource*>(x)))
|
||||
#define TQT_TQPOINT_CONST(x) (static_cast<const TQPoint*>(static_cast<const QPoint*>(x)))
|
||||
#define TQT_TQBRUSH_CONST(x) (static_cast<const TQBrush*>(static_cast<const QBrush*>(x)))
|
||||
#define TQT_TQPIXMAP_CONST(x) (static_cast<const TQPixmap*>(static_cast<const QPixmap*>(x)))
|
||||
#define TQT_TQPAINTDEVICE_CONST(x) (static_cast<const TQPaintDevice*>(static_cast<const QPaintDevice*>(x)))
|
||||
#define TQT_TQCOLOR_CONST(x) (static_cast<const TQColor*>(static_cast<const QColor*>(x)))
|
||||
#define TQT_TQPRINTER_CONST(x) (static_cast<const TQPrinter*>(static_cast<const QPrinter*>(x)))
|
||||
#define TQT_TQIODEVICE_CONST(x) (static_cast<const TQIODevice*>(static_cast<const QIODevice*>(x)))
|
||||
#define TQT_TQVARIANT_CONST(x) (static_cast<const TQVariant*>(static_cast<const QVariant*>(x)))
|
||||
#define TQT_TQMETAOBJECT_CONST(x) (static_cast<const TQMetaObject*>(static_cast<const QMetaObject*>(x)))
|
||||
#define TQT_TQSTYLEOPTION_CONST(x) (static_cast<const TQStyleOption*>(static_cast<const TQStyleOption*>(x)))
|
||||
|
||||
#define TQPOINT_OBJECT_NAME_STRING "TQPoint"
|
||||
#define TQBYTEARRAY_OBJECT_NAME_STRING "TQByteArray"
|
||||
#define TQPIXMAP_OBJECT_NAME_STRING "TQPixmap"
|
||||
#define TQSTRING_OBJECT_NAME_STRING "TQString"
|
||||
#define TQSTRINGLIST_OBJECT_NAME_STRING "TQStringList"
|
||||
#define TQLAYOUT_OBJECT_NAME_STRING "TQLayout"
|
||||
#define TQBOXLAYOUT_OBJECT_NAME_STRING "TQBoxLayout"
|
||||
#define TQHBOXLAYOUT_OBJECT_NAME_STRING "TQHBoxLayout"
|
||||
#define TQVBOXLAYOUT_OBJECT_NAME_STRING "TQVBoxLayout"
|
||||
#define TQGRIDLAYOUT_OBJECT_NAME_STRING "TQGridLayout"
|
||||
#define TQHBOX_OBJECT_NAME_STRING "TQHBox"
|
||||
#define TQVBOX_OBJECT_NAME_STRING "TQVBox"
|
||||
#define TQGRID_OBJECT_NAME_STRING "TQGrid"
|
||||
#define TQTABWIDGET_OBJECT_NAME_STRING "TQTabWidget"
|
||||
#define TQCHECKBOX_OBJECT_NAME_STRING "TQCheckBox"
|
||||
#define TQLINEEDIT_OBJECT_NAME_STRING "TQLineEdit"
|
||||
#define TQTEXTEDIT_OBJECT_NAME_STRING "TQTextEdit"
|
||||
#define TQOBJECT_OBJECT_NAME_STRING "TQObject"
|
||||
#define TQWIDGET_OBJECT_NAME_STRING "TQWidget"
|
||||
#define TQGLWIDGET_OBJECT_NAME_STRING "TQGLWidget"
|
||||
#define TQLABEL_OBJECT_NAME_STRING "TQLabel"
|
||||
#define TQTIMER_OBJECT_NAME_STRING "TQTimer"
|
||||
#define TQFRAME_OBJECT_NAME_STRING "TQFrame"
|
||||
#define TQACCEL_OBJECT_NAME_STRING "TQAccel"
|
||||
#define TQDIALOG_OBJECT_NAME_STRING "TQDialog"
|
||||
#define TQDIAL_OBJECT_NAME_STRING "TQDial"
|
||||
#define TQACTION_OBJECT_NAME_STRING "TQAction"
|
||||
#define TQACTIONGROUP_OBJECT_NAME_STRING "TQActionGroup"
|
||||
#define TQLCDNUMBER_OBJECT_NAME_STRING "TQLCDNumber"
|
||||
#define TQPROGRESSBAR_OBJECT_NAME_STRING "TQProgressBar"
|
||||
#define TQTABDIALOG_OBJECT_NAME_STRING "TQTabDialog"
|
||||
#define TQTABWIDGET_OBJECT_NAME_STRING "TQTabWidget"
|
||||
#define TQDOCKWINDOW_OBJECT_NAME_STRING "TQDockWindow"
|
||||
#define TQGROUPBOX_OBJECT_NAME_STRING "TQGroupBox"
|
||||
#define TQCOMBOBOX_OBJECT_NAME_STRING "TQComboBox"
|
||||
#define TQSPINBOX_OBJECT_NAME_STRING "TQSpinBox"
|
||||
#define TQSPINWIDGET_OBJECT_NAME_STRING "TQSpinWidget"
|
||||
#define TQLISTBOX_OBJECT_NAME_STRING "TQListBox"
|
||||
#define TQTOOLBOX_OBJECT_NAME_STRING "TQToolBox"
|
||||
#define TQTOOLBOXBUTTON_OBJECT_NAME_STRING "TQToolBoxButton"
|
||||
#define TQVGROUPBOX_OBJECT_NAME_STRING "TQVGroupBox"
|
||||
#define TQSPLITTER_OBJECT_NAME_STRING "TQSplitter"
|
||||
#define TQSPLITTERHANDLE_OBJECT_NAME_STRING "TQSplitterHandle"
|
||||
#define TQBUTTON_OBJECT_NAME_STRING "TQButton"
|
||||
#define TQGRIDVIEW_OBJECT_NAME_STRING "TQGridView"
|
||||
#define TQSLIDER_OBJECT_NAME_STRING "TQSlider"
|
||||
#define TQPUSHBUTTON_OBJECT_NAME_STRING "TQPushButton"
|
||||
#define TQTOOLBUTTON_OBJECT_NAME_STRING "TQToolButton"
|
||||
#define TQRADIOBUTTON_OBJECT_NAME_STRING "TQRadioButton"
|
||||
#define TQPOPUPMENU_OBJECT_NAME_STRING "TQPopupMenu"
|
||||
#define TQTOOLBAR_OBJECT_NAME_STRING "TQToolBar"
|
||||
#define TQMENUBAR_OBJECT_NAME_STRING "TQMenuBar"
|
||||
#define TQTABBAR_OBJECT_NAME_STRING "TQTabBar"
|
||||
#define TQLISTVIEW_OBJECT_NAME_STRING "TQListView"
|
||||
#define TQSCROLLBAR_OBJECT_NAME_STRING "TQScrollBar"
|
||||
#define TQSCROLLVIEW_OBJECT_NAME_STRING "TQScrollView"
|
||||
#define TQRANGECONTROL_OBJECT_NAME_STRING "TQRangeControl"
|
||||
#define TQCANVASITEM_OBJECT_NAME_STRING "TQCanvasItem"
|
||||
#define TQICONVIEW_OBJECT_NAME_STRING "TQIconView"
|
||||
#define TQMULTILINEEDIT_OBJECT_NAME_STRING "TQMultiLineEdit"
|
||||
#define TQINTVALIDATOR_OBJECT_NAME_STRING "TQIntValidator"
|
||||
#define TQDATEEDIT_OBJECT_NAME_STRING "TQDateEdit"
|
||||
#define TQTIMEEDIT_OBJECT_NAME_STRING "TQTimeEdit"
|
||||
#define TQDATETIMEEDIT_OBJECT_NAME_STRING "TQDateTimeEdit"
|
||||
#define TQHEADER_OBJECT_NAME_STRING "TQHeader"
|
||||
#define TQSIZEGRIP_OBJECT_NAME_STRING "TQSizeGrip"
|
||||
#define TQDOCKWINDOWHANDLE_OBJECT_NAME_STRING "TQDockWindowHandle"
|
||||
#define TQHIDEDOCK_OBJECT_NAME_STRING "TQHideDock"
|
||||
#define TQTABLE_OBJECT_NAME_STRING "TQTable"
|
||||
#define TQWIZARD_OBJECT_NAME_STRING "TQWizard"
|
||||
#define TQDATATABLE_OBJECT_NAME_STRING "TQDataTable"
|
||||
#define TQDATABROWSER_OBJECT_NAME_STRING "TQDataBrowser"
|
||||
#define TQDATAVIEW_OBJECT_NAME_STRING "TQDataView"
|
||||
#define TQMAINWINDOW_OBJECT_NAME_STRING "TQMainWindow"
|
||||
#define TQWIDGETSTACK_OBJECT_NAME_STRING "TQWidgetStack"
|
||||
#define TQBUTTONGROUP_OBJECT_NAME_STRING "TQButtonGroup"
|
||||
#define TQTEXTVIEW_OBJECT_NAME_STRING "TQTextView"
|
||||
#define TQTEXTBROWSER_OBJECT_NAME_STRING "TQTextBrowser"
|
||||
#define TQLAYOUTWIDGET_OBJECT_NAME_STRING "TQLayoutWidget"
|
||||
|
||||
#define TQMOTIFPLUSSTYLE_OBJECT_NAME_STRING "TQMotifPlusStyle"
|
||||
|
||||
// #define tqarrowCursor Qt::ArrowCursor
|
||||
// #define tqupArrowCursor Qt::UpArrowCursor
|
||||
// #define tqcrossCursor Qt::CrossCursor
|
||||
// #define tqwaitCursor Qt::WaitCursor
|
||||
// #define tqibeamCursor Qt::IBeamCursor
|
||||
// #define tqsizeVerCursor Qt::SizeVerCursor
|
||||
// #define tqsizeHorCursor Qt::SizeHorCursor
|
||||
// #define tqsizeBDiagCursor Qt::SizeBDiagCursor
|
||||
// #define tqsizeFDiagCursor Qt::SizeFDiagCursor
|
||||
// #define tqsizeAllCursor Qt::SizeAllCursor
|
||||
// #define tqblankCursor Qt::BlankCursor
|
||||
// #define tqsplitVCursor Qt::SplitVCursor
|
||||
// #define tqsplitHCursor Qt::SplitHCursor
|
||||
// #define tqpointingHandCursor Qt::PointingHandCursor
|
||||
// #define tqforbiddenCursor Qt::ForbiddenCursor
|
||||
// #define tqwhatsThisCursor Qt::WhatsThisCursor
|
||||
// #define tqbusyCursor Qt::BusyCursor
|
||||
|
||||
#define tqarrowCursor TQt::arrowCursor
|
||||
#define tqupArrowCursor TQt::upArrowCursor
|
||||
#define tqcrossCursor TQt::crossCursor
|
||||
#define tqwaitCursor TQt::waitCursor
|
||||
#define tqibeamCursor TQt::ibeamCursor
|
||||
#define tqsizeVerCursor TQt::sizeVerCursor
|
||||
#define tqsizeHorCursor TQt::sizeHorCursor
|
||||
#define tqsizeBDiagCursor TQt::sizeBDiagCursor
|
||||
#define tqsizeFDiagCursor TQt::sizeFDiagCursor
|
||||
#define tqsizeAllCursor TQt::sizeAllCursor
|
||||
#define tqblankCursor TQt::blankCursor
|
||||
#define tqsplitVCursor TQt::splitVCursor
|
||||
#define tqsplitHCursor TQt::splitHCursor
|
||||
#define tqpointingHandCursor TQt::pointingHandCursor
|
||||
#define tqforbiddenCursor TQt::forbiddenCursor
|
||||
#define tqwhatsThisCursor TQt::whatsThisCursor
|
||||
#define tqbusyCursor TQt::busyCursor
|
||||
|
||||
#define tqreadBlock readData
|
||||
#define tqwriteBlock writeData
|
||||
#define TQT_TQIO_LONG qint64
|
||||
#define TQT_TQIO_ULONG qint64
|
||||
#define TQ_WFlags WFlags
|
||||
|
||||
#define SET_QT_X_TIME(x) QX11Info::setAppTime(x)
|
||||
#define GET_QT_X_TIME(x) QX11Info::appTime()
|
||||
#define SET_QT_X_USER_TIME(x) QX11Info::setAppUserTime(x)
|
||||
#define GET_QT_X_USER_TIME(x) QX11Info::appUserTime()
|
||||
|
||||
// // [FIXME]
|
||||
// // This should try a dynamic cast first before resorting to conversion (which entails a create/copy/delete operation)
|
||||
// // Also, is simply overwriting the origin pointer enough to make this work in all cases???
|
||||
// template <class T, class U>
|
||||
// U* tqt_convert_object(T* orig)
|
||||
// {
|
||||
// T* orig_ptr = orig;
|
||||
// U* temp = new U();
|
||||
// *temp = *orig;
|
||||
// orig_ptr = temp;
|
||||
// delete orig;
|
||||
// return temp;
|
||||
// }
|
||||
//
|
||||
// #define TQT_TQPIXMAP(x) (tqt_convert_object<QPixmap, TQPixmap>(x))
|
||||
// #define TQT_TQPIXMAP_CONST(x) (tqt_convert_object<const QPixmap, const TQPixmap>(x))
|
||||
|
||||
// [NOTE]
|
||||
// It is IMPOSSIBLE to downcast an abstract base class [ABC] to a derived type. Period. End of story.
|
||||
// Think of it this way...is it ever possible to instantiate an ABC on its own (e.g. with new)? No!
|
||||
// Therefore, it is also impossible to copy an ABC.
|
||||
// static_cast won't work because an ABC has a completely different structure than a non abstract class.
|
||||
// Specifically, you will get segmentation faults in typeinfo for the ABC at runtime.
|
||||
// This is probably due to the complete absence of the abstract method implementations in the static_casted object.
|
||||
// The only exception that I can think of MIGHT be if NO CHANGES are made to the abstracted methods,
|
||||
// including addition, modification, or removal of said methods. Don't bet the farm on this however!
|
||||
|
||||
// #define TQT_TQLAYOUTITEM_CONST(x) (static_cast<const TQLayoutItem*>(static_cast<const QLayoutItem*>(x)))
|
||||
|
||||
// // [FIXME]
|
||||
// // This should try a dynamic cast first before resorting to conversion (which entails a create/copy/delete operation)
|
||||
// // There is half a chance that this sort of nasty hackery is only required for abstract base classes, such as QStyle and QLayoutItem
|
||||
// // For other class types a simple static_cast *might* suffice. [???]
|
||||
// template <class T, class U>
|
||||
// U* tqt_convert_object(T* orig)
|
||||
// {
|
||||
// T* orig_ptr = orig;
|
||||
// U* temp = new U();
|
||||
// *temp = *orig;
|
||||
// orig_ptr = temp;
|
||||
// delete orig;
|
||||
// return temp;
|
||||
// }
|
||||
//
|
||||
// #define TQT_TQLAYOUTITEM_CONST(x) (tqt_convert_object<const QLayoutItem, const TQLayoutItem>(x))
|
||||
|
||||
// TQT_BASE_OBJECT is here for equality operators, as pointers will only be considered equal if the top (base) classes are compared
|
||||
// This is because all widget/extension/etc. classes will have one and only one TQT_BASE_OBJECT class instance in memory
|
||||
// Thus casting both pointers to TQT_BASE_OBJECT and comparing will reveal if the objects being compared are truly the same
|
||||
// For TQT 3 TQObject is the real base class, while in TQt 4 QObject is the real base class
|
||||
#define TQT_BASE_OBJECT_NAME QObject
|
||||
#define TQT_BASE_OBJECT(x) (static_cast<TQT_BASE_OBJECT_NAME*>(x))
|
||||
#define TQT_BASE_OBJECT_CONST(x) (static_cast<const TQT_BASE_OBJECT_NAME*>(x))
|
||||
|
||||
// This can be used to change any object name within TQt
|
||||
// x is a QString or TQString
|
||||
#define TQT_OBJECT_NAME_HANDLER(x) TQString(x)
|
||||
|
||||
// Safe casts
|
||||
template <class T>
|
||||
T tqt_dynamic_cast(TQT_BASE_OBJECT_NAME* a) { return dynamic_cast<T>(a); }
|
||||
|
||||
template <class T>
|
||||
T tqt_dynamic_cast(const TQT_BASE_OBJECT_NAME* a) { return dynamic_cast<T>(a); }
|
||||
|
||||
// Interface defines
|
||||
#define QABS(n) qAbs(n)
|
||||
#define QMIN(x, y) qMin(x, y)
|
||||
#define QMAX(x, y) qMax(x, y)
|
||||
|
||||
#define tqt_mo_access access()
|
||||
|
||||
// [FIXME] The underlying problem in uic creating the need for these defines should probably be fixed sometime in the future...
|
||||
// See object.cpp e.g. line 571
|
||||
#define setTqmaximumSize setMaximumSize
|
||||
#define setTqminimumSize setMinimumSize
|
||||
#define setTqalignment tqsetAlignment
|
||||
#define setTqgeometry setGeometry
|
||||
|
||||
#define Q_UINT16 quint16
|
||||
|
||||
#define ttqqt_cast( x ) tqqt_cast(TQT_TQOBJECT(x))
|
||||
|
||||
// TQT for Qt3 compatibility defines
|
||||
#define tqred red
|
||||
#define tqgreen green
|
||||
#define tqblue blue
|
||||
#define tqcyan cyan
|
||||
#define tqmagenta magenta
|
||||
#define tqyellow yellow
|
||||
#define tqdarkRed darkRed
|
||||
#define tqdarkGreen darkGreen
|
||||
#define tqdarkBlue darkBlue
|
||||
#define tqdarkCyan darkCyan
|
||||
#define tqdarkMagenta darkMagenta
|
||||
#define tqdarkYellow darkYellow
|
||||
#define tqwhite white
|
||||
#define tqwhiteptr &TQt::white
|
||||
#define tqlightGray lightGray
|
||||
#define tqgray gray
|
||||
#define tqdarkGray darkGray
|
||||
#define tqblack black
|
||||
#define tqblackptr &TQt::black
|
||||
#define tqcolor0 color0
|
||||
#define tqcolor1 color1
|
||||
|
||||
// #define tqaccess access
|
||||
// #define tqcolorTable colorTable
|
||||
#define TQSO_Default Default
|
||||
// #define tqqt_cast ::qt_cast
|
||||
#define TQ_Alignment Qt::Alignment
|
||||
#define TQ_Horizontal Horizontal
|
||||
#define TQ_Vertical Vertical
|
||||
#define TQImage_ScaleFree ScaleFree
|
||||
#define TQ_Key_Shift Key_Shift
|
||||
#define TQ_Key_Control Key_Control
|
||||
#define TQ_Key_Alt Key_Alt
|
||||
#define TQ_Key_Meta Key_Meta
|
||||
#define TQ_Key_Super_L Key_Super_L
|
||||
#define TQ_Key_Super_R Key_Super_R
|
||||
#define TQ_Key_Hyper_L Key_Hyper_L
|
||||
#define TQ_Key_Hyper_R Key_Hyper_R
|
||||
#define TQ_ButtonState TQt::ButtonState
|
||||
#define TQ_LeftButton Qt::LeftButton
|
||||
#define TQ_MidButton Qt::MidButton
|
||||
#define TQ_RightButton Qt::RightButton
|
||||
#define TQ_ShiftButton ShiftButton
|
||||
#define TQ_ControlButton ControlButton
|
||||
#define TQ_AltButton AltButton
|
||||
#define TQ_MetaButton MetaButton
|
||||
#define TQ_ScaleFree ScaleFree
|
||||
#define TQ_ScaleMin ScaleMin
|
||||
#define TQ_ScaleMax ScaleMax
|
||||
#define TQ_ScaleMode ScaleMode
|
||||
#define TQ_StrongFocus Qt::StrongFocus
|
||||
#define TQ_NoFocus Qt::NoFocus
|
||||
#define TQ_WheelFocus Qt::WheelFocus
|
||||
#define TQ_ClickFocus Qt::ClickFocus
|
||||
#define TQ_TabFocus Qt::TabFocus
|
||||
#define TQ_FocusPolicy Qt::FocusPolicy
|
||||
#define TQ_SPExpandData Qt::Orientations
|
||||
#define TQIODevice_OpenModeFlag QIODevice::OpenModeFlag
|
||||
#define TQ_OpenMode OpenMode
|
||||
|
||||
// #define Orientation Qt::Orientation
|
||||
|
||||
// #define SubRect SubElement
|
||||
// #define SR_PushButtonContents SE_PushButtonContents
|
||||
// #define SR_PushButtonFocusRect SE_PushButtonFocusRect
|
||||
// #define SR_CheckBoxIndicator SE_CheckBoxIndicator
|
||||
// #define SR_CheckBoxContents SE_CheckBoxContents
|
||||
// #define SR_CheckBoxFocusRect SE_CheckBoxFocusRect
|
||||
// #define SR_RadioButtonIndicator SE_RadioButtonIndicator
|
||||
// #define SR_RadioButtonContents SE_RadioButtonContents
|
||||
// #define SR_RadioButtonFocusRect SE_RadioButtonFocusRect
|
||||
// #define SR_ComboBoxFocusRect SE_ComboBoxFocusRect
|
||||
// #define SR_SliderFocusRect SE_SliderFocusRect
|
||||
// #define SR_DockWindowHandleRect SE_DockWindowHandleRect
|
||||
// #define SR_ProgressBarGroove SE_ProgressBarGroove
|
||||
// #define SR_ProgressBarContents SE_ProgressBarContents
|
||||
// #define SR_ProgressBarLabel SE_ProgressBarLabel
|
||||
// #define SR_ToolButtonContents SE_ToolButtonContents
|
||||
// #define SR_DialogButtonAccept SE_DialogButtonAccept
|
||||
// #define SR_DialogButtonReject SE_DialogButtonReject
|
||||
// #define SR_DialogButtonApply SE_DialogButtonApply
|
||||
// #define SR_DialogButtonHelp SE_DialogButtonHelp
|
||||
// #define SR_DialogButtonAll SE_DialogButtonAll
|
||||
// #define SR_DialogButtonAbort SE_DialogButtonAbort
|
||||
// #define SR_DialogButtonIgnore SE_DialogButtonIgnore
|
||||
// #define SR_DialogButtonRetry SE_DialogButtonRetry
|
||||
// #define SR_DialogButtonCustom SE_DialogButtonCustom
|
||||
// #define SR_ToolBoxTabContents SE_ToolBoxTabContents
|
||||
// #define SR_CustomBase SE_CustomBase
|
||||
//
|
||||
// #define StylePixmap StandardPixmap
|
||||
// // #define SP_TitleBarMinButton SC_TitleBarMinButton
|
||||
// // #define SP_TitleBarMaxButton SC_TitleBarMaxButton
|
||||
// // #define SP_TitleBarCloseButton SC_TitleBarCloseButton
|
||||
// // #define SP_TitleBarNormalButton SC_TitleBarNormalButton
|
||||
// // #define SP_TitleBarShadeButton SC_TitleBarShadeButton
|
||||
// // #define SP_TitleBarUnshadeButton SC_TitleBarUnshadeButton
|
||||
// #define SP_DockWindowCloseButton SP_DockWidgetCloseButton
|
||||
// // #define SP_MessageBoxInformation SC_MessageBoxInformation
|
||||
// // #define SP_MessageBoxWarning SC_MessageBoxWarning
|
||||
// // #define SP_MessageBoxCritical SC_MessageBoxCritical
|
||||
// // #define SP_MessageBoxQuestion SC_MessageBoxQuestion
|
||||
// // #define SP_CustomBase SC_CustomBase
|
||||
//
|
||||
// #define StyleFlags StateFlags
|
||||
// #define Style_Default QStyle::State_Default
|
||||
// #define Style_Enabled QStyle::State_Enabled
|
||||
// #define Style_Raised QStyle::State_Raised
|
||||
// #define Style_Sunken QStyle::State_Sunken
|
||||
// #define Style_Off QStyle::State_Off
|
||||
// #define Style_NoChange QStyle::State_NoChange
|
||||
// #define Style_On QStyle::State_On
|
||||
// #define Style_Down QStyle::State_DownArrow
|
||||
// #define Style_Horizontal QStyle::State_Horizontal
|
||||
// #define Style_HasFocus QStyle::State_HasFocus
|
||||
// #define Style_To QStyle::State_To
|
||||
// #define Style_Bottom QStyle::State_Bottom
|
||||
// #define Style_FocusAtBorder QStyle::State_FocusAtBorder
|
||||
// #define Style_AutoRaise QStyle::State_AutoRaise
|
||||
// #define Style_MouseOver QStyle::State_MouseOver
|
||||
// #define Style_Up QStyle::State_UpArrow
|
||||
// #define Style_Selected QStyle::State_Selected
|
||||
// #define Style_Active QStyle::State_Active
|
||||
// #define Style_ButtonDefault QStyle::State_ButtonDefault
|
||||
//
|
||||
// #define PE_ArrowDown PE_IndicatorArrowDown
|
||||
// #define PE_ArrowUp PE_IndicatorArrowUp
|
||||
// #define PE_ButtonTool PE_PanelButtonTool
|
||||
// #define PE_DockWindowHandle PE_IndicatorToolBarHandle
|
||||
// #define PE_DockWindowSeparator PE_Q3DockWindowSeparator
|
||||
// // Verify this one -------------v
|
||||
// #define PE_FocusRect PE_FrameFocusRect
|
||||
// #define PE_Panel PE_Frame
|
||||
// #define PE_RubberBand CE_RubberBand
|
||||
// #define PE_ScrollBarAddLine CE_ScrollBarAddLine
|
||||
// #define PE_ScrollBarAddPage CE_ScrollBarAddPage
|
||||
// #define PE_ScrollBarFirst CE_ScrollBarFirst
|
||||
// #define PE_ScrollBarLast CE_ScrollBarLast
|
||||
// #define PE_ScrollBarSlider CE_ScrollBarSlider
|
||||
// #define PE_ScrollBarSubLine CE_ScrollBarSubLine
|
||||
// #define PE_ScrollBarSubPage CE_ScrollBarSubPage
|
||||
//
|
||||
// #define SC_ListView SC_Q3ListView
|
||||
// #define SC_ListViewBranch SC_Q3ListViewBranch
|
||||
// #define SC_ListViewExpand SC_Q3ListViewExpand
|
||||
//
|
||||
// #define CC_ListView CC_Q3ListView
|
||||
//
|
||||
// #define WState Qt::WidgetAttribute
|
||||
// #define WState_Polished Qt::WA_WState_Polished
|
||||
// //#define WState_ForceHide Qt::WA_WState_ForceHide
|
||||
// #define WState_ForceHide Qt::WA_WState_Hidden
|
||||
//
|
||||
// #define SH_PopupMenu_Scrollable SH_Menu_Scrollable
|
||||
// #define SH_PopupMenu_SloppySubMenus SH_Menu_SloppySubMenus
|
||||
// #define SH_PopupMenu_SubMenuPopupDelay SH_Menu_SubMenuPopupDelay
|
||||
// #define SH_PopupMenu_AllowActiveAndDisabled SH_Menu_AllowActiveAndDisabled
|
||||
// #define SH_PopupMenu_MouseTracking SH_Menu_MouseTracking
|
||||
//
|
||||
// #define CE_PopupMenuScroller CE_MenuScroller
|
||||
//
|
||||
// #define PM_DockWindowHandleExtent PM_DockWidgetHandleExtent
|
||||
// #define PM_MenuBarFrameWidth PM_ToolBarFrameWidth
|
||||
// #define PM_DockWindowFrameWidth PM_DockWidgetFrameWidth
|
||||
// #define PM_PopupMenuScrollerHeight PM_MenuScrollerHeight
|
||||
//
|
||||
// // #define WFlags Qt::WindowFlags
|
||||
|
||||
#endif // USE_QT4
|
||||
|
||||
#endif // TQTGLOBALDEFINES_H
|
File diff suppressed because it is too large
Load Diff
@ -1,724 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Definition of TQApplication class
|
||||
**
|
||||
** Created : 931107
|
||||
**
|
||||
** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA.
|
||||
**
|
||||
** 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 TQAPPLICATION_H
|
||||
#define TQAPPLICATION_H
|
||||
|
||||
#include "tqtglobaldefines.h"
|
||||
|
||||
#ifndef TQT_H
|
||||
#include "tqdesktopwidget.h"
|
||||
#include "tqasciidict.h"
|
||||
#include "tqpalette.h"
|
||||
#include "tqtranslator.h"
|
||||
#include "tqstrlist.h"
|
||||
#include "tqstringlist.h"
|
||||
#include "tqwidgetlist.h"
|
||||
#include "tqclipboard.h"
|
||||
#include "tqcursor.h"
|
||||
#endif // TQT_H
|
||||
|
||||
#ifdef USE_QT4
|
||||
|
||||
#include "private/qt4_qapplication_p.h"
|
||||
#include <Qt/qapplication.h>
|
||||
#include <Qt/qstyle.h>
|
||||
|
||||
#endif // USE_QT4
|
||||
|
||||
class TQSessionManager;
|
||||
class TQStyle;
|
||||
class TQTranslator;
|
||||
class TQEventLoop;
|
||||
#if defined(TQ_WS_TQWS)
|
||||
class TQWSDecoration;
|
||||
#endif
|
||||
|
||||
#ifdef TQT_THREAD_SUPPORT
|
||||
class TQMutex;
|
||||
#endif // TQT_THREAD_SUPPORT
|
||||
|
||||
#ifdef USE_QT4
|
||||
|
||||
#define TQAPPLICATION_GUI_VAR_INIT if (( QApplication::type() != QApplication::GuiClient ) && ( QApplication::type() != QApplication::GuiServer )) { qt_is_gui_used = FALSE; } else { qt_is_gui_used = TRUE; } tqAppReal = static_cast<TQApplication*>(qApp);
|
||||
#define TQAPPLICATION_GUI_CONDITIONAL_VAR_INIT if (GUIenabled == false) { qt_is_gui_used = FALSE; } else { qt_is_gui_used = TRUE; } tqAppReal = static_cast<TQApplication*>(qApp);
|
||||
#define TQAPPLICATION_XORG_FULL_INIT if (qt_is_gui_used == true) { qt_init( dpy, visual, cmap ); }
|
||||
#define TQAPPLICATION_XORG_PARTIAL_INIT qt_init( &argc, argv, t );
|
||||
#define TQAPPLICATION_XORG_CONDITIONAL_INIT if (GUIenabled == true) { qt_init( &argc, argv, QApplication::GuiClient ); }
|
||||
#define TQAPPLICATION_REGISTER_TQ_DATATYPES qRegisterMetaType<TQChar>("TQChar"); \
|
||||
qRegisterMetaType<TQString>("TQString"); \
|
||||
qRegisterMetaType<TQColor>("TQColor");
|
||||
|
||||
class TQApplication;
|
||||
extern TQ_EXPORT TQApplication *tqAppReal; // global application object
|
||||
#define tqApp tqAppReal
|
||||
|
||||
class TQ_EXPORT TQApplication : public QApplication, virtual public TQt
|
||||
{
|
||||
Q_OBJECT
|
||||
TQ_OBJECT
|
||||
public:
|
||||
TQApplication( int &argc, char **argv );
|
||||
TQApplication( int &argc, char **argv, bool GUIenabled );
|
||||
TQApplication( int &argc, char **argv, Type t );
|
||||
#if defined(TQ_WS_X11)
|
||||
TQApplication( Display* dpy, Qt::HANDLE visual = 0, Qt::HANDLE cmap = 0 );
|
||||
TQApplication( Display *dpy, int argc, char **argv, Qt::HANDLE visual = 0, Qt::HANDLE cmap= 0 );
|
||||
#endif
|
||||
|
||||
#ifndef Q_QDOC
|
||||
enum ColorMode { NormalColors, CustomColors };
|
||||
static ColorMode colorMode();
|
||||
static void setColorMode( TQApplication::ColorMode );
|
||||
#endif
|
||||
|
||||
int exec();
|
||||
|
||||
const char *tqname() const;
|
||||
const char *name() const;
|
||||
const char *name(const char *defaultName) const;
|
||||
void setName(const char *aName);
|
||||
|
||||
virtual void commitData( TQSessionManager& sm );
|
||||
virtual void saveState( TQSessionManager& sm );
|
||||
|
||||
// Qt4 session manager interconnect
|
||||
virtual void commitData( QSessionManager& sm );
|
||||
virtual void saveState( QSessionManager& sm );
|
||||
|
||||
static void exit_loop();
|
||||
static int enter_loop();
|
||||
static void processOneEvent();
|
||||
void tqprocessEvents();
|
||||
void tqprocessEvents( int maxtime );
|
||||
int loopLevel() const;
|
||||
static void flushX();
|
||||
TQWidget *tqfocusWidget() const;
|
||||
static TQWidget *widgetAt( const TQPoint &p, bool child=FALSE );
|
||||
static TQWidget *widgetAt( int x, int y, bool child=FALSE );
|
||||
static int horizontalAlignment( int align );
|
||||
|
||||
inline static void sendPostedEvents( QObject *receiver, int event_type );
|
||||
inline static void sendPostedEvents();
|
||||
|
||||
#ifndef TQT_NO_CURSOR
|
||||
// static void setOverrideCursor( const QCursor &cur, bool tqreplace=FALSE );
|
||||
static void setOverrideCursor( const QCursor &cur, bool tqreplace=FALSE );
|
||||
#endif
|
||||
|
||||
static void setReverseLayout(bool b);
|
||||
static bool reverseLayout();
|
||||
|
||||
static TQPalette tqpalette( const TQWidget*w = 0 );
|
||||
|
||||
static TQWidgetList *tqtopLevelWidgets();
|
||||
|
||||
static TQEventLoop *eventLoop();
|
||||
|
||||
static TQStyle &tqstyle();
|
||||
static void setStyle( TQStyle* );
|
||||
static TQStyle* setStyle( const TQString& );
|
||||
|
||||
static TQDesktopWidget *desktop();
|
||||
static const QColor &winStyleHighlightColor();
|
||||
static void tqsetPalette(const QPalette &pal, bool informWidgets=FALSE, const char* className = 0);
|
||||
static void tqsetFont(const QFont &font, bool informWidgets=FALSE, const char* className = 0);
|
||||
static void setWinStyleHighlightColor( const QColor c );
|
||||
#ifndef TQT_NO_CLIPBOARD
|
||||
// static inline TQClipboard *tqclipboard() { return TQT_TQCLIPBOARD(clipboard()); }
|
||||
static TQClipboard *tqclipboard();
|
||||
#endif
|
||||
|
||||
static TQStringList libraryPaths();
|
||||
static void tqsetLibraryPaths( const QStringList &qsl );
|
||||
// inline static void tqsetLibraryPaths( const TQStringList &tqsl ) { setLibraryPaths(static_cast<const QStringList*>(&tqsl)); }
|
||||
|
||||
static TQWidgetList *tqallWidgets();
|
||||
|
||||
virtual void polish( QWidget * );
|
||||
|
||||
TQMetaObject *tqmetaObject() const;
|
||||
|
||||
static bool hasGlobalMouseTracking();
|
||||
static void setGlobalMouseTracking( bool enable );
|
||||
|
||||
Q_SIGNALS:
|
||||
void guiThreadAwake(); // Does not exist in Qt4; therefore will never be triggered
|
||||
|
||||
public:
|
||||
TQWidget *mainWidget();
|
||||
void setMainWidget(QWidget *);
|
||||
|
||||
// [FIXME]
|
||||
#if defined(TQ_WS_X11)
|
||||
static void create_xim();
|
||||
static void close_xim();
|
||||
static bool x11_apply_settings();
|
||||
#endif
|
||||
#ifndef TQT_NO_TRANSLATION
|
||||
#ifndef TQT_NO_TEXTCODEC
|
||||
void setDefaultCodec( TQTextCodec * );
|
||||
TQTextCodec* defaultCodec() const;
|
||||
#endif
|
||||
// void installTranslator( TQTranslator * );
|
||||
// void removeTranslator( TQTranslator * );
|
||||
#endif
|
||||
|
||||
void wakeUpGuiThread();
|
||||
#ifdef TQT_THREAD_SUPPORT
|
||||
void lock();
|
||||
void unlock(bool wakeUpGui = TRUE);
|
||||
bool locked();
|
||||
bool tryLock();
|
||||
#endif
|
||||
|
||||
public slots:
|
||||
void aboutTQt();
|
||||
|
||||
private:
|
||||
static TQEventLoop* eventloop; // Will this work as-is or do I need code behind it?
|
||||
static int app_cspec;
|
||||
static TQStyle *app_style;
|
||||
#ifndef TQT_NO_PALETTE
|
||||
static TQPalette *app_pal;
|
||||
#endif
|
||||
static TQPtrList<QEventLoop> tqt_event_loop_stack;
|
||||
static TQWidgetList tqt_all_widgets_list;
|
||||
static QWidget* current_app_main_widget;
|
||||
mutable TQString static_object_name;
|
||||
friend class TQWidget;
|
||||
friend class TQETWidget;
|
||||
friend class TQDialog;
|
||||
friend class TQAccelManager;
|
||||
friend class TQEvent;
|
||||
friend class TQTranslator;
|
||||
friend class TQEventLoop;
|
||||
friend TQ_EXPORT void qt_ucm_initialize( TQApplication * );
|
||||
#if defined(TQ_WS_WIN)
|
||||
friend bool qt_sendSpontaneousEvent( TQObject*, TQEvent* );
|
||||
#endif
|
||||
#if defined(TQ_WS_TQWS)
|
||||
friend class TQInputContext;
|
||||
#endif
|
||||
|
||||
friend void qt_init(int *, char **, TQApplication::Type);
|
||||
|
||||
#ifdef TQT_THREAD_SUPPORT
|
||||
static TQMutex *qt_mutex;
|
||||
#endif // TQT_THREAD_SUPPORT
|
||||
|
||||
public:
|
||||
static int composedUnicode; // Value, meta-composed character
|
||||
static bool metaComposeUnicode;
|
||||
|
||||
protected:
|
||||
inline bool event(QEvent *e) { TQT_TQOBJECT_CHILDEVENT_REQUIRED_HANDLER(e) return QApplication::event(e); }
|
||||
};
|
||||
|
||||
#else // USE_QT4
|
||||
|
||||
class TQApplication;
|
||||
extern TQ_EXPORT TQApplication *tqApp; // global application object
|
||||
|
||||
|
||||
class TQ_EXPORT TQApplication : public TQObject
|
||||
{
|
||||
Q_OBJECT
|
||||
TQ_OBJECT
|
||||
public:
|
||||
TQApplication( int &argc, char **argv );
|
||||
TQApplication( int &argc, char **argv, bool GUIenabled );
|
||||
enum Type { Tty, GuiClient, GuiServer };
|
||||
TQApplication( int &argc, char **argv, Type );
|
||||
#if defined(TQ_WS_X11)
|
||||
TQApplication( Display* dpy, HANDLE visual = 0, HANDLE cmap = 0 );
|
||||
TQApplication( Display *dpy, int argc, char **argv,
|
||||
HANDLE visual = 0, HANDLE cmap= 0 );
|
||||
#endif
|
||||
virtual ~TQApplication();
|
||||
|
||||
int argc() const;
|
||||
char **argv() const;
|
||||
|
||||
Type type() const;
|
||||
|
||||
#ifndef TQT_NO_STYLE
|
||||
static TQStyle &tqstyle();
|
||||
static void setStyle( TQStyle* );
|
||||
static TQStyle* setStyle( const TQString& );
|
||||
#endif
|
||||
#ifndef TQ_TQDOC
|
||||
enum ColorMode { NormalColors, CustomColors };
|
||||
static ColorMode colorMode();
|
||||
static void setColorMode( TQApplication::ColorMode );
|
||||
#endif
|
||||
|
||||
enum ColorSpec { NormalColor=0, CustomColor=1, ManyColor=2 };
|
||||
static int colorSpec();
|
||||
static void setColorSpec( int );
|
||||
#ifndef TQT_NO_CURSOR
|
||||
static TQCursor *overrideCursor();
|
||||
static void setOverrideCursor( const TQCursor &, bool tqreplace=FALSE );
|
||||
static void restoreOverrideCursor();
|
||||
#endif
|
||||
static bool hasGlobalMouseTracking();
|
||||
static void setGlobalMouseTracking( bool enable );
|
||||
#ifndef TQT_NO_PALETTE
|
||||
static TQPalette palette( const TQWidget* = 0 );
|
||||
static void setPalette( const TQPalette &, bool informWidgets=FALSE,
|
||||
const char* className = 0 );
|
||||
#endif
|
||||
static TQFont font( const TQWidget* = 0 );
|
||||
static void setFont( const TQFont &, bool informWidgets=FALSE,
|
||||
const char* className = 0 );
|
||||
static TQFontMetrics fontMetrics();
|
||||
|
||||
TQWidget *mainWidget() const;
|
||||
virtual void setMainWidget( TQWidget * );
|
||||
virtual void polish( TQWidget * );
|
||||
|
||||
static TQWidgetList *allWidgets();
|
||||
static TQWidgetList *tqtopLevelWidgets();
|
||||
|
||||
static TQDesktopWidget *desktop();
|
||||
|
||||
static TQWidget *activePopupWidget();
|
||||
static TQWidget *activeModalWidget();
|
||||
#ifndef TQT_NO_CLIPBOARD
|
||||
static TQClipboard *clipboard();
|
||||
#endif
|
||||
TQWidget *tqfocusWidget() const;
|
||||
TQWidget *activeWindow() const;
|
||||
|
||||
static TQWidget *widgetAt( int x, int y, bool child=FALSE );
|
||||
static TQWidget *widgetAt( const TQPoint &, bool child=FALSE );
|
||||
|
||||
static TQEventLoop *eventLoop();
|
||||
|
||||
int exec();
|
||||
void processEvents();
|
||||
void processEvents( int maxtime );
|
||||
void processOneEvent();
|
||||
bool hasPendingEvents();
|
||||
int enter_loop();
|
||||
void exit_loop();
|
||||
int loopLevel() const;
|
||||
static void exit( int retcode=0 );
|
||||
|
||||
static bool sendEvent( TQObject *receiver, TQEvent *event );
|
||||
static void postEvent( TQObject *receiver, TQEvent *event );
|
||||
static void sendPostedEvents( TQObject *receiver, int event_type );
|
||||
static void sendPostedEvents();
|
||||
|
||||
static void removePostedEvents( TQObject *receiver );
|
||||
|
||||
virtual bool notify( TQObject *, TQEvent * );
|
||||
|
||||
static bool startingUp();
|
||||
static bool closingDown();
|
||||
|
||||
static void flushX();
|
||||
static void flush();
|
||||
static void syncX();
|
||||
|
||||
static void beep();
|
||||
|
||||
#ifndef TQT_NO_TRANSLATION
|
||||
# ifndef TQT_NO_TEXTCODEC
|
||||
void setDefaultCodec( TQTextCodec * );
|
||||
TQTextCodec* defaultCodec() const;
|
||||
# endif
|
||||
void installTranslator( TQTranslator * );
|
||||
void removeTranslator( TQTranslator * );
|
||||
#endif
|
||||
enum Encoding { DefaultCodec, UnicodeUTF8 };
|
||||
TQString translate( const char * context,
|
||||
const char * key,
|
||||
const char * comment = 0,
|
||||
Encoding encoding = DefaultCodec ) const;
|
||||
#ifndef TQT_NO_DIR
|
||||
TQString applicationDirPath();
|
||||
TQString applicationFilePath();
|
||||
#endif
|
||||
#ifndef TQT_NO_PALETTE
|
||||
// obsolete functions
|
||||
static void setWinStyleHighlightColor( const TQColor &c ) {
|
||||
TQPalette p( palette() );
|
||||
p.setColor( TQColorGroup::Highlight, c );
|
||||
setPalette( p, TRUE);
|
||||
}
|
||||
static const TQColor &winStyleHighlightColor() {
|
||||
return palette().active().highlight();
|
||||
}
|
||||
#endif
|
||||
static void setDesktopSettingsAware( bool );
|
||||
static bool desktopSettingsAware();
|
||||
|
||||
static void setCursorFlashTime( int );
|
||||
static int cursorFlashTime();
|
||||
|
||||
static void setDoubleClickInterval( int );
|
||||
static int doubleClickInterval();
|
||||
#ifndef TQT_NO_WHEELEVENT
|
||||
static void setWheelScrollLines( int );
|
||||
static int wheelScrollLines();
|
||||
#endif
|
||||
static void setGlobalStrut( const TQSize & );
|
||||
static TQSize globalStrut();
|
||||
|
||||
#ifndef TQT_NO_COMPONENT
|
||||
static void tqsetLibraryPaths( const TQStringList & );
|
||||
static TQStringList libraryPaths();
|
||||
static void addLibraryPath( const TQString & );
|
||||
static void removeLibraryPath( const TQString & );
|
||||
#endif // TQT_NO_COMPONENT
|
||||
static void setStartDragTime( int ms );
|
||||
static int startDragTime();
|
||||
static void setStartDragDistance( int l );
|
||||
static int startDragDistance();
|
||||
|
||||
static void setReverseLayout( bool b );
|
||||
static bool reverseLayout();
|
||||
|
||||
static int horizontalAlignment( int align );
|
||||
|
||||
static bool isEffectEnabled( TQt::UIEffect );
|
||||
static void setEffectEnabled( TQt::UIEffect, bool enable = TRUE );
|
||||
|
||||
#if defined(TQ_WS_MAC)
|
||||
virtual bool macEventFilter( EventHandlerCallRef, EventRef );
|
||||
#endif
|
||||
#if defined(TQ_WS_WIN)
|
||||
virtual bool winEventFilter( MSG * );
|
||||
#endif
|
||||
#if defined(TQ_WS_X11)
|
||||
virtual bool x11EventFilter( XEvent * );
|
||||
virtual int x11ClientMessage( TQWidget*, XEvent*, bool passive_only);
|
||||
int x11ProcessEvent( XEvent* );
|
||||
#endif
|
||||
#if defined(TQ_WS_TQWS)
|
||||
virtual bool qwsEventFilter( TQWSEvent * );
|
||||
int qwsProcessEvent( TQWSEvent* );
|
||||
void qwsSetCustomColors( TQRgb *colortable, int start, int numColors );
|
||||
/*!
|
||||
\internal
|
||||
Returns true if the process is GUI server
|
||||
*/
|
||||
bool qwsIsGUIServer();
|
||||
#ifndef TQT_NO_TQWS_MANAGER
|
||||
static TQWSDecoration &qwsDecoration();
|
||||
static void qwsSetDecoration( TQWSDecoration *);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(TQ_OS_WIN32) || defined(TQ_OS_CYGWIN)
|
||||
static WindowsVersion winVersion();
|
||||
#elif defined(TQ_OS_MAC)
|
||||
static MacintoshVersion macVersion();
|
||||
#endif
|
||||
#if defined(TQ_WS_WIN)
|
||||
void winFocus( TQWidget *, bool );
|
||||
static void winMouseButtonUp();
|
||||
#endif
|
||||
|
||||
#ifndef TQT_NO_SESSIONMANAGER
|
||||
// session management
|
||||
bool isSessionRestored() const;
|
||||
TQString sessionId() const;
|
||||
TQString sessionKey() const;
|
||||
virtual void commitData( TQSessionManager& sm );
|
||||
virtual void saveState( TQSessionManager& sm );
|
||||
#endif
|
||||
#if defined(TQ_WS_X11)
|
||||
static void create_xim();
|
||||
static void close_xim();
|
||||
static bool x11_apply_settings();
|
||||
#endif
|
||||
void wakeUpGuiThread();
|
||||
#if defined(TQT_THREAD_SUPPORT)
|
||||
void lock();
|
||||
void unlock(bool wakeUpGui = TRUE);
|
||||
bool locked();
|
||||
bool tryLock();
|
||||
#endif
|
||||
|
||||
Q_SIGNALS:
|
||||
void lastWindowClosed();
|
||||
void aboutToQuit();
|
||||
void guiThreadAwake();
|
||||
|
||||
public Q_SLOTS:
|
||||
void quit();
|
||||
void closeAllWindows();
|
||||
void aboutTQt();
|
||||
|
||||
#if defined(TQ_WS_TQWS)
|
||||
protected:
|
||||
void setArgs(int, char **);
|
||||
#endif
|
||||
|
||||
protected:
|
||||
bool event(TQEvent *);
|
||||
|
||||
private:
|
||||
void construct( int &argc, char **argv, Type );
|
||||
void initialize( int, char ** );
|
||||
void init_precmdline();
|
||||
void process_cmdline( int* argcptr, char ** argv );
|
||||
bool internalNotify( TQObject *, TQEvent * );
|
||||
#if defined(TQ_WS_TQWS)
|
||||
static TQWidget *tqfindChildWidget( const TQWidget *p, const TQPoint &pos );
|
||||
static TQWidget *tqfindWidget( const TQObjectList&, const TQPoint &, bool rec );
|
||||
#endif
|
||||
|
||||
#if defined(TQ_WS_MAC)
|
||||
bool do_mouse_down(Point *, bool *);
|
||||
static TQMAC_PASCAL OStqStatus globalEventProcessor(EventHandlerCallRef, EventRef, void *);
|
||||
static TQMAC_PASCAL OStqStatus globalAppleEventProcessor(const AppleEvent *, AppleEvent *, long);
|
||||
static TQMAC_PASCAL void qt_context_timer_callbk(EventLoopTimerRef, void *);
|
||||
static TQMAC_PASCAL void qt_select_timer_callbk(EventLoopTimerRef, void *);
|
||||
static bool qt_mac_apply_settings();
|
||||
friend class TQMacInputMethod;
|
||||
friend TQMAC_PASCAL OStqStatus qt_window_event(EventHandlerCallRef, EventRef, void *);
|
||||
friend void qt_mac_update_os_settings();
|
||||
friend bool qt_set_socket_handler( int, int, TQObject *, bool);
|
||||
friend void qt_mac_destroy_widget(TQWidget *);
|
||||
friend void qt_init(int *, char **, TQApplication::Type);
|
||||
#endif
|
||||
|
||||
#ifdef TQT_THREAD_SUPPORT
|
||||
static TQMutex *qt_mutex;
|
||||
#endif // TQT_THREAD_SUPPORT
|
||||
|
||||
int app_argc;
|
||||
char **app_argv;
|
||||
bool quit_now;
|
||||
int quit_code;
|
||||
static TQStyle *app_style;
|
||||
static int app_cspec;
|
||||
#ifndef TQT_NO_PALETTE
|
||||
static TQPalette *app_pal;
|
||||
#endif
|
||||
static TQFont *app_font;
|
||||
#ifndef TQT_NO_CURSOR
|
||||
static TQCursor *app_cursor;
|
||||
#endif
|
||||
static TQEventLoop* eventloop;
|
||||
static int app_tracking;
|
||||
static bool is_app_running;
|
||||
static bool is_app_closing;
|
||||
static bool app_exit_loop;
|
||||
static int loop_level;
|
||||
static TQWidget *main_widget;
|
||||
static TQWidget *focus_widget;
|
||||
static TQWidget *active_window;
|
||||
static bool obey_desktop_settings;
|
||||
static int cursor_flash_time;
|
||||
static int mouse_double_click_time;
|
||||
static int wheel_scroll_lines;
|
||||
static int composedUnicode; // Value, meta-composed character
|
||||
|
||||
static bool animate_ui;
|
||||
static bool animate_menu;
|
||||
static bool animate_tooltip;
|
||||
static bool animate_combo;
|
||||
static bool fade_menu;
|
||||
static bool fade_tooltip;
|
||||
static bool animate_toolbox;
|
||||
static bool widgetCount; // Coupled with -widgetcount switch
|
||||
static bool metaComposeUnicode;
|
||||
|
||||
TQValueList<TQTranslator*> *translators;
|
||||
#ifndef TQT_NO_SESSIONMANAGER
|
||||
TQSessionManager *session_manager;
|
||||
TQString session_id;
|
||||
static TQString* session_key;
|
||||
bool is_session_restored;
|
||||
#endif
|
||||
#if defined(TQ_WS_X11) && !defined (TQT_NO_STYLE )
|
||||
static void x11_initialize_style();
|
||||
#endif
|
||||
|
||||
static TQSize app_strut;
|
||||
#ifndef TQT_NO_COMPONENT
|
||||
static TQStringList *app_libpaths;
|
||||
#endif
|
||||
static TQAsciiDict<TQPalette> *app_palettes;
|
||||
static TQAsciiDict<TQFont> *app_fonts;
|
||||
|
||||
static TQWidgetList *popupWidgets;
|
||||
bool inPopupMode() const;
|
||||
void closePopup( TQWidget *popup );
|
||||
void openPopup( TQWidget *popup );
|
||||
void setActiveWindow( TQWidget* act );
|
||||
|
||||
static bool sendSpontaneousEvent( TQObject *receiver, TQEvent *event );
|
||||
static void removePostedEvent( TQEvent * );
|
||||
|
||||
friend class TQWidget;
|
||||
friend class TQETWidget;
|
||||
friend class TQDialog;
|
||||
friend class TQAccelManager;
|
||||
friend class TQEvent;
|
||||
friend class TQTranslator;
|
||||
friend class TQEventLoop;
|
||||
friend TQ_EXPORT void qt_ucm_initialize( TQApplication * );
|
||||
#if defined(TQ_WS_WIN)
|
||||
friend bool qt_sendSpontaneousEvent( TQObject*, TQEvent* );
|
||||
#endif
|
||||
#if defined(TQ_WS_TQWS)
|
||||
friend class TQInputContext;
|
||||
#endif
|
||||
private: // Disabled copy constructor and operator=
|
||||
#if defined(TQ_DISABLE_COPY)
|
||||
TQApplication( const TQApplication & );
|
||||
TQApplication &operator=( const TQApplication & );
|
||||
#endif
|
||||
};
|
||||
|
||||
inline int TQApplication::argc() const
|
||||
{
|
||||
return app_argc;
|
||||
}
|
||||
|
||||
inline char **TQApplication::argv() const
|
||||
{
|
||||
return app_argv;
|
||||
}
|
||||
|
||||
#if defined(TQ_WS_TQWS)
|
||||
inline void TQApplication::setArgs(int c, char **v)
|
||||
{
|
||||
app_argc = c;
|
||||
app_argv = v;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef TQT_NO_CURSOR
|
||||
inline TQCursor *TQApplication::overrideCursor()
|
||||
{
|
||||
return app_cursor;
|
||||
}
|
||||
#endif
|
||||
inline bool TQApplication::hasGlobalMouseTracking()
|
||||
{
|
||||
return app_tracking > 0;
|
||||
}
|
||||
|
||||
inline TQWidget *TQApplication::mainWidget() const
|
||||
{
|
||||
return main_widget;
|
||||
}
|
||||
|
||||
inline TQWidget *TQApplication::tqfocusWidget() const
|
||||
{
|
||||
return focus_widget;
|
||||
}
|
||||
|
||||
inline TQWidget *TQApplication::activeWindow() const
|
||||
{
|
||||
return active_window;
|
||||
}
|
||||
|
||||
inline TQWidget *TQApplication::widgetAt( const TQPoint &p, bool child )
|
||||
{
|
||||
return widgetAt( p.x(), p.y(), child );
|
||||
}
|
||||
|
||||
inline bool TQApplication::inPopupMode() const
|
||||
{
|
||||
return popupWidgets != 0;
|
||||
}
|
||||
#ifndef TQT_NO_SESSIONMANAGER
|
||||
inline bool TQApplication::isSessionRestored() const
|
||||
{
|
||||
return is_session_restored;
|
||||
}
|
||||
|
||||
inline TQString TQApplication::sessionId() const
|
||||
{
|
||||
return session_id;
|
||||
}
|
||||
|
||||
inline TQString TQApplication::sessionKey() const
|
||||
{
|
||||
return session_key ? *session_key : TQString::null;
|
||||
}
|
||||
#endif
|
||||
inline TQSize TQApplication::globalStrut()
|
||||
{
|
||||
return app_strut;
|
||||
}
|
||||
|
||||
inline bool TQApplication::sendEvent( TQObject *receiver, TQEvent *event )
|
||||
{ if ( event ) event->spont = FALSE; return tqApp ? tqApp->notify( receiver, event ) : FALSE; }
|
||||
|
||||
inline bool TQApplication::sendSpontaneousEvent( TQObject *receiver, TQEvent *event )
|
||||
{ if ( event ) event->spont = TRUE; return tqApp ? tqApp->notify( receiver, event ) : FALSE; }
|
||||
|
||||
#ifdef TQT_NO_TRANSLATION
|
||||
// Simple versions
|
||||
inline TQString TQApplication::translate( const char *, const char *sourceText,
|
||||
const char *, Encoding encoding ) const
|
||||
{
|
||||
#ifndef TQT_NO_TEXTCODEC
|
||||
if ( encoding == UnicodeUTF8 )
|
||||
return TQString::fromUtf8( sourceText );
|
||||
else
|
||||
#endif
|
||||
return TQString::tqfromLatin1( sourceText );
|
||||
}
|
||||
#endif
|
||||
|
||||
inline int TQApplication::horizontalAlignment( int align )
|
||||
{
|
||||
align &= AlignHorizontal_Mask;
|
||||
if ( align == AlignAuto ) {
|
||||
if ( reverseLayout() )
|
||||
align = AlignRight;
|
||||
else
|
||||
align = AlignLeft;
|
||||
}
|
||||
return align;
|
||||
}
|
||||
|
||||
#endif // TQAPPLICATION_H
|
||||
|
||||
#endif // USE_QT4
|
File diff suppressed because it is too large
Load Diff
@ -1,403 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Definition of TQMetaObject class
|
||||
**
|
||||
** Created : 930419
|
||||
**
|
||||
** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA.
|
||||
**
|
||||
** 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 TQMETAOBJECT_H
|
||||
#define TQMETAOBJECT_H
|
||||
|
||||
#include "tqtglobaldefines.h"
|
||||
|
||||
#ifndef TQT_H
|
||||
#include "tqconnection.h"
|
||||
#include "tqstrlist.h"
|
||||
#endif // TQT_H
|
||||
|
||||
#ifndef TQ_TQMOC_OUTPUT_REVISION
|
||||
#define TQ_TQMOC_OUTPUT_REVISION 26
|
||||
#endif
|
||||
|
||||
#ifdef USE_QT4
|
||||
|
||||
#include <Qt/qmetaobject.h>
|
||||
|
||||
#endif // USE_QT4
|
||||
|
||||
#ifdef USE_QT4
|
||||
|
||||
struct TQUMethod;
|
||||
|
||||
class TQ_EXPORT TQMetaEnum : public QMetaEnum, virtual public TQt
|
||||
{
|
||||
public:
|
||||
TQMetaEnum();
|
||||
|
||||
struct Item // - a name/value pair
|
||||
{
|
||||
const char *key;
|
||||
int value;
|
||||
};
|
||||
|
||||
uint count() const;
|
||||
Item* items() const;
|
||||
|
||||
private:
|
||||
mutable Item* internal_item_list;
|
||||
};
|
||||
|
||||
class TQ_EXPORT TQMetaData : public QMetaMethod, virtual public TQt
|
||||
{
|
||||
public:
|
||||
TQMetaData();
|
||||
|
||||
const char *name() const;
|
||||
const TQUMethod* method() const;
|
||||
|
||||
mutable TQUMethod* internal_method_information;
|
||||
};
|
||||
|
||||
class TQ_EXPORT TQMetaProperty : public QMetaProperty, virtual public TQt
|
||||
{
|
||||
public:
|
||||
TQMetaProperty();
|
||||
|
||||
bool isSetType() const;
|
||||
int keyToValue( const char* key ) const;
|
||||
const char* valueToKey( int value ) const;
|
||||
int keysToValue( const TQStrList& keys_in ) const;
|
||||
TQStrList valueToKeys( int value ) const;
|
||||
bool writable() const;
|
||||
const char* type() const;
|
||||
TQStrList enumKeys() const;
|
||||
|
||||
bool designable( TQT_BASE_OBJECT_NAME *o = 0 ) const;
|
||||
bool scriptable( TQT_BASE_OBJECT_NAME *o = 0 ) const;
|
||||
bool stored( TQT_BASE_OBJECT_NAME *o = 0 ) const;
|
||||
|
||||
bool stdSet() const; // internal
|
||||
|
||||
// inline bool reset( TQT_BASE_OBJECT_NAME *o ) const { return isResettable(o); }
|
||||
};
|
||||
|
||||
class TQ_EXPORT TQClassInfo : public QMetaClassInfo, virtual public TQt
|
||||
{
|
||||
public:
|
||||
TQClassInfo() : QMetaClassInfo() {}
|
||||
};
|
||||
|
||||
class TQ_EXPORT TQMetaObject : public QMetaObject, virtual public TQt
|
||||
{
|
||||
public:
|
||||
TQMetaObject( const char * const class_name, TQMetaObject *superclass, const TQMetaData * const slot_data, int n_Q_SLOTS, const TQMetaData * const signal_data, int n_Q_SIGNALS,
|
||||
#ifndef TQT_NO_PROPERTIES
|
||||
const TQMetaProperty *const prop_data, int n_props, const TQMetaEnum *const enum_data, int n_enums,
|
||||
#endif // TQT_NO_PROPERTIES
|
||||
const TQClassInfo *const class_info, int n_info );
|
||||
|
||||
#ifndef TQT_NO_PROPERTIES
|
||||
TQMetaObject( const char * const class_name, TQMetaObject *superclass, const TQMetaData * const slot_data, int n_Q_SLOTS, const TQMetaData * const signal_data, int n_Q_SIGNALS, const TQMetaProperty *const prop_data, int n_props, const TQMetaEnum *const enum_data, int n_enums, bool (*qt_static_property)(TQObject*, int, int, TQVariant*), const TQClassInfo *const class_info, int n_info );
|
||||
#endif // TQT_NO_PROPERTIES
|
||||
|
||||
TQStrList slotNames( bool super = FALSE ) const;
|
||||
TQStrList signalNames( bool super = FALSE ) const;
|
||||
|
||||
#ifndef TQT_NO_PROPERTIES
|
||||
int tqfindProperty( const char *name, bool super = FALSE ) const;
|
||||
TQMetaObject *tqsuperClass() const;
|
||||
const char *tqsuperClassName() const;
|
||||
TQStrList propertyNames( bool super = FALSE ) const;
|
||||
|
||||
int numSlots( bool super = FALSE ) const;
|
||||
int numSignals( bool super = FALSE ) const;
|
||||
int numClassInfo( bool super = FALSE ) const;
|
||||
|
||||
const TQMetaData *slot( int index, bool super = FALSE ) const;
|
||||
const TQMetaData *signal( int index, bool super = FALSE ) const;
|
||||
|
||||
int tqfindSlot( const char *, bool super = FALSE ) const;
|
||||
int tqfindSignal( const char *, bool super = FALSE ) const;
|
||||
|
||||
int numProperties( bool super = FALSE ) const;
|
||||
const TQMetaProperty *property( int index, bool super = FALSE ) const;
|
||||
|
||||
const TQMetaEnum *enumerator( const char* name, bool super = FALSE ) const;
|
||||
TQStrList enumeratorNames( bool super = FALSE ) const;
|
||||
#endif // TQT_NO_PROPERTIES
|
||||
|
||||
const TQClassInfo *classInfo( int index, bool super = FALSE ) const;
|
||||
const char *classInfo( const char* name, bool super = FALSE ) const;
|
||||
};
|
||||
|
||||
#else // USE_QT4
|
||||
|
||||
class TQObject;
|
||||
struct TQUMethod;
|
||||
class TQMetaObjectPrivate;
|
||||
|
||||
struct TQMetaData // - member function meta data
|
||||
{ // for signal and Q_SLOTS
|
||||
const char *name; // - member name
|
||||
const TQUMethod* method; // - detailed method description
|
||||
enum Access { Private, Protected, Public };
|
||||
Access access; // - access permission
|
||||
};
|
||||
|
||||
#ifndef TQT_NO_PROPERTIES
|
||||
struct TQMetaEnum // enumerator meta data
|
||||
{ // for properties
|
||||
const char *name; // - enumerator name
|
||||
uint count; // - number of values
|
||||
struct Item // - a name/value pair
|
||||
{
|
||||
const char *key;
|
||||
int value;
|
||||
};
|
||||
const Item *items; // - the name/value pairs
|
||||
bool set; // whether enum has to be treated as a set
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifndef TQT_NO_PROPERTIES
|
||||
|
||||
class TQ_EXPORT TQMetaProperty // property meta data
|
||||
{
|
||||
public:
|
||||
const char* type() const { return t; } // type of the property
|
||||
const char* name() const { return n; } // name of the property
|
||||
|
||||
bool writable() const;
|
||||
bool isValid() const;
|
||||
|
||||
bool isSetType() const;
|
||||
bool isEnumType() const;
|
||||
TQStrList enumKeys() const; // enumeration names
|
||||
|
||||
int keyToValue( const char* key ) const; // enum and set conversion functions
|
||||
const char* valueToKey( int value ) const;
|
||||
int keysToValue( const TQStrList& keys ) const;
|
||||
TQStrList valueToKeys( int value ) const;
|
||||
|
||||
bool designable( TQObject* = 0 ) const;
|
||||
bool scriptable( TQObject* = 0 ) const;
|
||||
bool stored( TQObject* = 0 ) const;
|
||||
|
||||
bool reset( TQObject* ) const;
|
||||
|
||||
const char* t; // internal
|
||||
const char* n; // internal
|
||||
|
||||
enum Flags {
|
||||
Invalid = 0x00000000,
|
||||
Readable = 0x00000001,
|
||||
Writable = 0x00000002,
|
||||
EnumOrSet = 0x00000004,
|
||||
UnresolvedEnum = 0x00000008,
|
||||
StdSet = 0x00000100,
|
||||
Override = 0x00000200
|
||||
};
|
||||
|
||||
uint flags; // internal
|
||||
bool testFlags( uint f ) const; // internal
|
||||
bool stdSet() const; // internal
|
||||
int id() const; // internal
|
||||
|
||||
TQMetaObject** meta; // internal
|
||||
|
||||
const TQMetaEnum* enumData; // internal
|
||||
int _id; // internal
|
||||
void clear(); // internal
|
||||
};
|
||||
|
||||
inline bool TQMetaProperty::testFlags( uint f ) const
|
||||
{ return (flags & (uint)f) != (uint)0; }
|
||||
|
||||
#endif // TQT_NO_PROPERTIES
|
||||
|
||||
struct TQClassInfo // class info meta data
|
||||
{
|
||||
const char* name; // - name of the info
|
||||
const char* value; // - value of the info
|
||||
};
|
||||
|
||||
class TQ_EXPORT TQMetaObject // meta object class
|
||||
{
|
||||
public:
|
||||
TQMetaObject( const char * const class_name, TQMetaObject *superclass,
|
||||
const TQMetaData * const slot_data, int n_Q_SLOTS,
|
||||
const TQMetaData * const signal_data, int n_Q_SIGNALS,
|
||||
#ifndef TQT_NO_PROPERTIES
|
||||
const TQMetaProperty *const prop_data, int n_props,
|
||||
const TQMetaEnum *const enum_data, int n_enums,
|
||||
#endif
|
||||
const TQClassInfo *const class_info, int n_info );
|
||||
|
||||
#ifndef TQT_NO_PROPERTIES
|
||||
TQMetaObject( const char * const class_name, TQMetaObject *superclass,
|
||||
const TQMetaData * const slot_data, int n_Q_SLOTS,
|
||||
const TQMetaData * const signal_data, int n_Q_SIGNALS,
|
||||
const TQMetaProperty *const prop_data, int n_props,
|
||||
const TQMetaEnum *const enum_data, int n_enums,
|
||||
bool (*qt_static_property)(TQObject*, int, int, TQVariant*),
|
||||
const TQClassInfo *const class_info, int n_info );
|
||||
#endif
|
||||
|
||||
|
||||
virtual ~TQMetaObject();
|
||||
|
||||
const char *className() const { return classname; }
|
||||
const char *superClassName() const { return superclassname; }
|
||||
|
||||
TQMetaObject *superClass() const { return superclass; }
|
||||
|
||||
bool inherits( const char* clname ) const;
|
||||
|
||||
int numSlots( bool super = FALSE ) const;
|
||||
int numSignals( bool super = FALSE ) const;
|
||||
|
||||
int tqfindSlot( const char *, bool super = FALSE ) const;
|
||||
int tqfindSignal( const char *, bool super = FALSE ) const;
|
||||
|
||||
const TQMetaData *slot( int index, bool super = FALSE ) const;
|
||||
const TQMetaData *signal( int index, bool super = FALSE ) const;
|
||||
|
||||
TQStrList slotNames( bool super = FALSE ) const;
|
||||
TQStrList signalNames( bool super = FALSE ) const;
|
||||
|
||||
int slotOffset() const;
|
||||
int signalOffset() const;
|
||||
int propertyOffset() const;
|
||||
|
||||
int numClassInfo( bool super = FALSE ) const;
|
||||
const TQClassInfo *classInfo( int index, bool super = FALSE ) const;
|
||||
const char *classInfo( const char* name, bool super = FALSE ) const;
|
||||
|
||||
#ifndef TQT_NO_PROPERTIES
|
||||
const TQMetaProperty *property( int index, bool super = FALSE ) const;
|
||||
int tqfindProperty( const char *name, bool super = FALSE ) const;
|
||||
int indexOfProperty( const TQMetaProperty*, bool super = FALSE ) const;
|
||||
const TQMetaProperty* resolveProperty( const TQMetaProperty* ) const;
|
||||
int resolveProperty( int ) const;
|
||||
TQStrList propertyNames( bool super = FALSE ) const;
|
||||
int numProperties( bool super = FALSE ) const;
|
||||
#endif
|
||||
|
||||
// static wrappers around constructors, necessary to work around a
|
||||
// Windows-DLL limitation: objects can only be deleted within a
|
||||
// DLL if they were actually created within that DLL.
|
||||
static TQMetaObject *new_metaobject( const char *, TQMetaObject *,
|
||||
const TQMetaData *const, int,
|
||||
const TQMetaData *const, int,
|
||||
#ifndef TQT_NO_PROPERTIES
|
||||
const TQMetaProperty *const prop_data, int n_props,
|
||||
const TQMetaEnum *const enum_data, int n_enums,
|
||||
#endif
|
||||
const TQClassInfo *const class_info, int n_info );
|
||||
#ifndef TQT_NO_PROPERTIES
|
||||
static TQMetaObject *new_metaobject( const char *, TQMetaObject *,
|
||||
const TQMetaData *const, int,
|
||||
const TQMetaData *const, int,
|
||||
const TQMetaProperty *const prop_data, int n_props,
|
||||
const TQMetaEnum *const enum_data, int n_enums,
|
||||
bool (*qt_static_property)(TQObject*, int, int, TQVariant*),
|
||||
const TQClassInfo *const class_info, int n_info );
|
||||
TQStrList enumeratorNames( bool super = FALSE ) const;
|
||||
int numEnumerators( bool super = FALSE ) const;
|
||||
const TQMetaEnum *enumerator( const char* name, bool super = FALSE ) const;
|
||||
#endif
|
||||
|
||||
static TQMetaObject *tqmetaObject( const char *class_name );
|
||||
static bool hasMetaObject( const char *class_name );
|
||||
|
||||
private:
|
||||
TQMemberDict *init( const TQMetaData *, int );
|
||||
|
||||
const char *classname; // class name
|
||||
const char *superclassname; // super class name
|
||||
TQMetaObject *superclass; // super class meta object
|
||||
TQMetaObjectPrivate *d; // private data for...
|
||||
void *reserved; // ...binary compatibility
|
||||
const TQMetaData *slotData; // slot meta data
|
||||
TQMemberDict *slotDict; // slot dictionary
|
||||
const TQMetaData *signalData; // signal meta data
|
||||
TQMemberDict *signalDict; // signal dictionary
|
||||
int signaloffset;
|
||||
int slotoffset;
|
||||
#ifndef TQT_NO_PROPERTIES
|
||||
int propertyoffset;
|
||||
public:
|
||||
bool qt_static_property( TQObject* o, int id, int f, TQVariant* v);
|
||||
private:
|
||||
friend class TQMetaProperty;
|
||||
#endif
|
||||
|
||||
private: // Disabled copy constructor and operator=
|
||||
#if defined(TQ_DISABLE_COPY)
|
||||
TQMetaObject( const TQMetaObject & );
|
||||
TQMetaObject &operator=( const TQMetaObject & );
|
||||
#endif
|
||||
};
|
||||
|
||||
inline int TQMetaObject::slotOffset() const
|
||||
{ return slotoffset; }
|
||||
|
||||
inline int TQMetaObject::signalOffset() const
|
||||
{ return signaloffset; }
|
||||
|
||||
#ifndef TQT_NO_PROPERTIES
|
||||
inline int TQMetaObject::propertyOffset() const
|
||||
{ return propertyoffset; }
|
||||
#endif
|
||||
|
||||
typedef TQMetaObject *(*TQtStaticMetaObjectFunction)();
|
||||
|
||||
class TQ_EXPORT TQMetaObjectCleanUp
|
||||
{
|
||||
public:
|
||||
TQMetaObjectCleanUp( const char *mo_name, TQtStaticMetaObjectFunction );
|
||||
TQMetaObjectCleanUp();
|
||||
~TQMetaObjectCleanUp();
|
||||
|
||||
void setMetaObject( TQMetaObject *&mo );
|
||||
|
||||
private:
|
||||
TQMetaObject **tqmetaObject;
|
||||
};
|
||||
|
||||
#endif // USE_QT4
|
||||
|
||||
#endif // TQMETAOBJECT_H
|
File diff suppressed because it is too large
Load Diff
@ -1,993 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Definition of TQPainter class
|
||||
**
|
||||
** Created : 940112
|
||||
**
|
||||
** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA.
|
||||
**
|
||||
** 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 TQPAINTER_H
|
||||
#define TQPAINTER_H
|
||||
|
||||
#include "tqtglobaldefines.h"
|
||||
|
||||
#ifndef TQT_H
|
||||
#include "tqcolor.h"
|
||||
#include "tqfontmetrics.h"
|
||||
#include "tqfontinfo.h"
|
||||
#include "tqregion.h"
|
||||
#include "tqpen.h"
|
||||
#include "tqbrush.h"
|
||||
#include "tqpointarray.h"
|
||||
#include "tqwmatrix.h"
|
||||
#endif // TQT_H
|
||||
|
||||
#ifdef USE_QT4
|
||||
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** All rights reserved.
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** This file is part of the Qt3Support module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** Commercial Usage
|
||||
** Licensees holding valid Qt Commercial licenses may use this file in
|
||||
** accordance with the Qt Commercial License Agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and Nokia.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3.0 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU General Public License version 3.0 requirements will be
|
||||
** met: http://www.gnu.org/copyleft/gpl.html.
|
||||
**
|
||||
** If you have questions regarding the use of this file, please contact
|
||||
** Nokia at qt-info@nokia.com.
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "tqwidget.h"
|
||||
#include "tqpaintdevice.h"
|
||||
#include <QtGui/qpainter.h>
|
||||
|
||||
QT_BEGIN_HEADER
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class Q_COMPAT_EXPORT TQPainter : public QPainter, virtual public TQt
|
||||
{
|
||||
public:
|
||||
enum TextDirection {
|
||||
Auto,
|
||||
RTL,
|
||||
LTR
|
||||
};
|
||||
|
||||
enum CoordinateMode { CoordDevice, CoordPainter };
|
||||
|
||||
TQPainter();
|
||||
TQPainter( const QWidget *pdev, bool unclipped = FALSE);
|
||||
TQPainter( QPaintDevice *pdev, bool unclipped = FALSE);
|
||||
TQPainter( QWidget *pdev, const QWidget *w, bool unclipped = FALSE );
|
||||
TQPainter( QPaintDevice *pdev, const QWidget *w, bool unclipped = FALSE );
|
||||
|
||||
void flush();
|
||||
void flush( const TQRegion ®ion, CoordinateMode cm = CoordDevice );
|
||||
|
||||
void drawRect(const QRect &rect);
|
||||
inline void drawRect(int x1, int y1, int w, int h)
|
||||
{ drawRect(QRect(x1, y1, w, h)); }
|
||||
|
||||
void drawRoundRect(const QRect &r, int xround = 25, int yround = 25);
|
||||
inline void drawRoundRect(int x, int y, int w, int h, int xround = 25, int yround = 25)
|
||||
{ drawRoundRect(QRect(x, y, w, h), xround, yround); }
|
||||
|
||||
void drawEllipse(const QRect &r);
|
||||
inline void drawEllipse(int x, int y, int w, int h)
|
||||
{ drawEllipse(QRect(x, y, w, h)); }
|
||||
|
||||
void drawArc(const QRect &r, int a, int alen);
|
||||
inline void drawArc(int x, int y, int w, int h, int a, int alen)
|
||||
{ drawArc(QRect(x, y, w, h), a, alen); }
|
||||
|
||||
void drawPie(const QRect &r, int a, int alen);
|
||||
inline void drawPie(int x, int y, int w, int h, int a, int alen)
|
||||
{ drawPie(QRect(x, y, w, h), a, alen); }
|
||||
|
||||
void drawChord(const QRect &r, int a, int alen);
|
||||
inline void drawChord(int x, int y, int w, int h, int a, int alen)
|
||||
{ drawChord(QRect(x, y, w, h), a, alen); }
|
||||
|
||||
void drawImage( int x, int y, const TQImage image, int sx = 0, int sy = 0, int sw = -1, int sh = -1, int conversionFlags = 0 );
|
||||
void drawImage( const TQPoint &p, const TQImage image, const TQRect &sr, int conversionFlags = 0 );
|
||||
void drawImage( const TQPoint &p, const TQImage image, int conversion_flags = 0 );
|
||||
void drawImage( const TQRect &r, const TQImage image );
|
||||
|
||||
void drawLineSegments(const QPolygon &points, int index = 0, int nlines = -1);
|
||||
|
||||
void setBrush(const QBrush &brush);
|
||||
void setBrush(Qt::BrushStyle style);
|
||||
void setBrush(TQt::BrushStyle style);
|
||||
|
||||
inline void tqdrawPixmap( int x, int y, const TQPixmap &tqpm, int sx=0, int sy=0, int sw=-1, int sh=-1 ) { drawPixmap(x, y, tqpm, sx, sy, sw, sh); }
|
||||
|
||||
TQPoint pos() const;
|
||||
|
||||
// Qt4 requires the QPainter to have a valid QPaintDevice (engine) for boundingRect() to work
|
||||
// So, we create one off-screen!
|
||||
#define TQT_INITIALIZE_QPAINTER_TEMPORARY_ENGINE_CONDITIONAL \
|
||||
bool neededEngine = FALSE; \
|
||||
if (QPainter::isActive() == 0) { \
|
||||
printf("[WARNING] Painter was inactive when TQPainter::boundingRect was called; this indicates a likely problem in painting within your application (check Qt::WA_PaintOutsidePaintEvent == true)\n\r"); \
|
||||
QImage image(1,1,QImage::Format_RGB32); \
|
||||
neededEngine = TRUE; \
|
||||
QPainter::begin(&image); \
|
||||
}
|
||||
|
||||
#define TQT_DESTROY_QPAINTER_TEMPORARY_ENGINE_CONDITIONAL \
|
||||
if (neededEngine == TRUE) { \
|
||||
QPainter::end(); \
|
||||
}
|
||||
|
||||
QRectF boundingRect(const QRectF &rect, int flags, const QString &text);
|
||||
QRect boundingRect(const QRect &rect, int flags, const QString &text);
|
||||
QRect boundingRect(int x, int y, int w, int h, int flags, const QString &text);
|
||||
QRectF boundingRect(const QRectF &rect, const QString &text, const QTextOption &o = QTextOption());
|
||||
|
||||
TQRect boundingRect(const QRect &rect, int flags, const QString &text, int len);
|
||||
TQRect boundingRect(int x, int y, int w, int h, int flags, const QString &text, int len);
|
||||
|
||||
void drawText(const QPointF &p, const QString &s);
|
||||
void drawText(const QPoint &p, const QString &s);
|
||||
void drawText(int x, int y, const QString &s);
|
||||
void drawText(const QPointF &p, const QString &str, int tf, int justificationPadding);
|
||||
void drawText(const QRectF &r, int flags, const QString &text, QRectF *br=0);
|
||||
void drawText(const QRect &r, int flags, const QString &text, QRect *br=0);
|
||||
void drawText(int x, int y, int w, int h, int flags, const QString &text, QRect *br=0);
|
||||
void drawText(const QRectF &r, const QString &text, const QTextOption &o = QTextOption());
|
||||
|
||||
void drawText( int x, int y, const TQString &s, int len = -1, TextDirection dir = Auto );
|
||||
void drawText( const TQPoint &p, const TQString &s, int len = -1, TextDirection dir = Auto );
|
||||
void drawText( int x, int y, const TQString &s, int pos, int len, TextDirection dir = Auto );
|
||||
void drawText( const TQPoint &p, const TQString &s, int pos, int len, TextDirection dir = Auto );
|
||||
|
||||
void drawText(int x, int y, const QString &s, int pos, int len);
|
||||
void drawText(const QPoint &p, const QString &s, int pos, int len);
|
||||
void drawText(int x, int y, const QString &s, int len);
|
||||
void drawText(const QPoint &p, const QString &s, int len);
|
||||
void drawText(const QRect &r, int flags, const QString &str, int len, QRect *br=0);
|
||||
void drawText(int x, int y, int w, int h, int flags, const QString &text, int len, QRect *br=0);
|
||||
|
||||
void map(int x, int y, int *rx, int *ry) const;
|
||||
void map( int, int, int, int, int *, int *, int *, int * ) const;
|
||||
TQPoint xForm(const QPoint &) const; // map virtual -> deviceb
|
||||
TQRect xForm(const QRect &) const;
|
||||
// TQPolygon xForm(const QPolygon &) const;
|
||||
// TQPolygon xForm(const QPolygon &, int index, int npoints) const;
|
||||
TQPoint xFormDev(const QPoint &) const; // map device -> virtual
|
||||
TQRect xFormDev(const QRect &) const;
|
||||
// TQPolygon xFormDev(const QPolygon &) const;
|
||||
// TQPolygon xFormDev(const QPolygon &, int index, int npoints) const;
|
||||
qreal translationX() const;
|
||||
qreal translationY() const;
|
||||
|
||||
void resetXForm();
|
||||
|
||||
// [FIXME] The drawWinFocusRect methods below probably need tweaking to exactly match the old Qt3 behaviour
|
||||
void drawWinFocusRect( int x, int y, int w, int h );
|
||||
void drawWinFocusRect( int x, int y, int w, int h, const TQColor &bgColor );
|
||||
void drawWinFocusRect( const TQRect &tqr );
|
||||
void drawWinFocusRect( const TQRect &tqr, const TQColor &bgColor );
|
||||
|
||||
// inline const TQWMatrix &tqworldMatrix() const { return (*(static_cast<const TQWMatrix*>(&worldMatrix()))); }
|
||||
const TQWMatrix &tqworldMatrix() const;
|
||||
|
||||
inline TQPaintDevice *tqdevice() const { return static_cast<TQPaintDevice*>(device()); }
|
||||
|
||||
TQRegion clipRegion( CoordinateMode cm = CoordDevice ) const;
|
||||
|
||||
void setClipRegion( const QRegion &qr, CoordinateMode cm = CoordDevice );
|
||||
|
||||
void setBackgroundColor(const QColor &color);
|
||||
const QColor &backgroundColor() const;
|
||||
|
||||
void setClipRect(const QRectF &qrf, Qt::ClipOperation op = Qt::ReplaceClip);
|
||||
void setClipRect(const QRect &qr, Qt::ClipOperation op = Qt::ReplaceClip);
|
||||
void setClipRect( const TQRect &qr, CoordinateMode cm = CoordDevice );
|
||||
void setClipRect( int x, int y, int w, int h, CoordinateMode cm = CoordDevice );
|
||||
|
||||
inline double m11() const { return deviceTransform().m11(); }
|
||||
inline double m12() const { return deviceTransform().m12(); }
|
||||
inline double m21() const { return deviceTransform().m21(); }
|
||||
inline double m22() const { return deviceTransform().m22(); }
|
||||
inline double dx() const { return deviceTransform().dx(); }
|
||||
inline double dy() const { return deviceTransform().dy(); }
|
||||
inline double im11() const { return deviceTransform().inverted().m11(); }
|
||||
inline double im12() const { return deviceTransform().inverted().m12(); }
|
||||
inline double im21() const { return deviceTransform().inverted().m21(); }
|
||||
inline double im22() const { return deviceTransform().inverted().m22(); }
|
||||
inline double idx() const { return deviceTransform().inverted().dx(); }
|
||||
inline double idy() const { return deviceTransform().inverted().dy(); }
|
||||
|
||||
void moveTo( int x, int y );
|
||||
void moveTo( const TQPoint & );
|
||||
void lineTo( int x, int y );
|
||||
void lineTo( const TQPoint & );
|
||||
|
||||
void tqdrawTextItem( int x, int y, const TQTextItem &ti, int textflags = 0 );
|
||||
void tqdrawTextItem( const TQPoint& p, const TQTextItem &ti, int textflags = 0 );
|
||||
|
||||
static void redirect(QPaintDevice *pdev, QPaintDevice *replacement);
|
||||
static TQPaintDevice *redirect(QPaintDevice *pdev);
|
||||
|
||||
TQt::RasterOp rasterOp() const;
|
||||
void setRasterOp( TQt::RasterOp );
|
||||
|
||||
bool tqbegin( QPaintDevice *pdev, bool unclipped = FALSE );
|
||||
bool tqbegin( QPaintDevice *pdev, const QWidget *init, bool unclipped = FALSE );
|
||||
|
||||
inline void tqdrawPolyline(const QPolygon &pa, int index, int npoints = -1) { drawPolyline(pa.constData() + index, npoints == -1 ? pa.size() - index : npoints); }
|
||||
inline void tqdrawPolygon(const QPolygon &pa, bool winding, int index = 0, int npoints = -1) { drawPolygon(pa.constData() + index, npoints == -1 ? pa.size() - index : npoints, winding ? Qt::WindingFill : Qt::OddEvenFill); }
|
||||
inline void tqdrawPolygon(const QPolygonF &polygon, bool winding, int index = 0, int npoints = -1) { drawPolygon(polygon.constData() + index, npoints == -1 ? polygon.size() - index : npoints, winding ? Qt::WindingFill : Qt::OddEvenFill); }
|
||||
inline void tqdrawConvexPolygon(const QPolygonF &polygon, int index, int npoints = -1) { drawConvexPolygon(polygon.constData() + index, npoints == -1 ? polygon.size() - index : npoints); }
|
||||
inline void tqdrawConvexPolygon(const QPolygon &pa, int index, int npoints = -1) { drawConvexPolygon(pa.constData() + index, npoints == -1 ? pa.size() - index : npoints); }
|
||||
// static inline void redirect(QPaintDevice *pdev, QPaintDevice *replacement) { setRedirected(pdev, replacement); }
|
||||
// static inline TQPaintDevice *redirect(QPaintDevice *pdev) { return const_cast<QPaintDevice*>(redirected(pdev)); }
|
||||
void setWorldXForm(bool enabled);
|
||||
bool hasWorldXForm() const;
|
||||
// inline void resetXForm() { resetTransform(); }
|
||||
void setViewXForm(bool enabled);
|
||||
bool hasViewXForm() const;
|
||||
|
||||
// [FIXME]
|
||||
static void initialize();
|
||||
static void cleanup();
|
||||
|
||||
bool has_qwidget;
|
||||
mutable QWidget* qwidget_ptr;
|
||||
|
||||
private:
|
||||
QRect adjustedRectangle(const QRect &r);
|
||||
int rectSubtraction() const;
|
||||
uchar rop;
|
||||
enum { IsActive=0x01, ExtDev=0x02, IsStartingUp=0x04, NoCache=0x08,
|
||||
VxF=0x10, WxF=0x20, ClipOn=0x40, SafePolygon=0x80, MonoDev=0x100,
|
||||
DirtyFont=0x200, DirtyPen=0x400, DirtyBrush=0x800,
|
||||
RGBColor=0x1000, FontMet=0x2000, FontInf=0x4000, CtorBegin=0x8000,
|
||||
UsePrivateCx = 0x10000, VolatileDC = 0x20000, TQt2Compat = 0x40000 };
|
||||
// uint flags;
|
||||
// bool testf( uint b ) const { return (flags&b)!=0; }
|
||||
bool testf( uint b ) const;
|
||||
void drawWinFocusRect( int x, int y, int w, int h, bool xorPaint, const QColor &penColor );
|
||||
void fix_neg_rect( int *x, int *y, int *w, int *h );
|
||||
|
||||
TQPoint current_penpos;
|
||||
|
||||
Q_DISABLE_COPY(TQPainter)
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
QT_END_HEADER
|
||||
|
||||
#else // USE_QT4
|
||||
|
||||
class TQGfx;
|
||||
class TQTextCodec;
|
||||
class TQTextParag;
|
||||
class TQPaintDevice;
|
||||
class TQTextItem;
|
||||
#if defined( TQ_WS_MAC )
|
||||
class TQMacSavedPortInfo;
|
||||
#endif
|
||||
class TQPainterPrivate;
|
||||
|
||||
#if defined(TQ_WS_TQWS)
|
||||
class TQScreen;
|
||||
#endif
|
||||
|
||||
class TQ_EXPORT TQPainter : public TQt
|
||||
{
|
||||
public:
|
||||
enum CoordinateMode { CoordDevice, CoordPainter };
|
||||
|
||||
TQPainter();
|
||||
TQPainter( const TQPaintDevice *, bool unclipped = FALSE );
|
||||
TQPainter( const TQPaintDevice *, const TQWidget *, bool unclipped = FALSE );
|
||||
~TQPainter();
|
||||
|
||||
bool begin( const TQPaintDevice *, bool unclipped = FALSE );
|
||||
bool begin( const TQPaintDevice *, const TQWidget *, bool unclipped = FALSE );
|
||||
bool end();
|
||||
TQPaintDevice *tqdevice() const;
|
||||
|
||||
#ifdef TQ_WS_TQWS
|
||||
TQGfx * internalGfx();
|
||||
#ifdef TQT_TQWS_EXPERIMENTAL_SCREENPAINTER
|
||||
bool begin(TQScreen *screen);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static void redirect( TQPaintDevice *pdev, TQPaintDevice *tqreplacement );
|
||||
static TQPaintDevice *redirect( TQPaintDevice *pdev );
|
||||
|
||||
bool isActive() const;
|
||||
|
||||
void flush( const TQRegion ®ion, CoordinateMode cm = CoordDevice );
|
||||
void flush();
|
||||
void save();
|
||||
void restore();
|
||||
|
||||
// Drawing tools
|
||||
|
||||
TQFontMetrics fontMetrics() const;
|
||||
TQFontInfo fontInfo() const;
|
||||
|
||||
const TQFont &font() const;
|
||||
void setFont( const TQFont & );
|
||||
const TQPen &pen() const;
|
||||
void setPen( const TQPen & );
|
||||
void setPen( PenStyle );
|
||||
void setPen( const TQColor & );
|
||||
const TQBrush &brush() const;
|
||||
void setBrush( const TQBrush & );
|
||||
void setBrush( BrushStyle );
|
||||
void setBrush( const TQColor & );
|
||||
TQPoint pos() const;
|
||||
|
||||
// Drawing attributes/modes
|
||||
|
||||
const TQColor &backgroundColor() const;
|
||||
void setBackgroundColor( const TQColor & );
|
||||
BGMode backgroundMode() const;
|
||||
void setBackgroundMode( BGMode );
|
||||
RasterOp rasterOp() const;
|
||||
void setRasterOp( RasterOp );
|
||||
const TQPoint &brushOrigin() const;
|
||||
void setBrushOrigin( int x, int y );
|
||||
void setBrushOrigin( const TQPoint & );
|
||||
|
||||
// Scaling and transformations
|
||||
|
||||
// PaintUnit unit() const; // get set painter unit
|
||||
// void setUnit( PaintUnit ); // NOT IMPLEMENTED!!!
|
||||
|
||||
bool hasViewXForm() const;
|
||||
bool hasWorldXForm() const;
|
||||
|
||||
#ifndef TQT_NO_TRANSFORMATIONS
|
||||
void setViewXForm( bool ); // set xform on/off
|
||||
TQRect window() const; // get window
|
||||
void setWindow( const TQRect & ); // set window
|
||||
void setWindow( int x, int y, int w, int h );
|
||||
TQRect viewport() const; // get viewport
|
||||
void setViewport( const TQRect & ); // set viewport
|
||||
void setViewport( int x, int y, int w, int h );
|
||||
|
||||
void setWorldXForm( bool ); // set world xform on/off
|
||||
const TQWMatrix &tqworldMatrix() const; // get/set world xform matrix
|
||||
void setWorldMatrix( const TQWMatrix &, bool combine=FALSE );
|
||||
|
||||
void saveWorldMatrix();
|
||||
void restoreWorldMatrix();
|
||||
|
||||
void scale( double sx, double sy );
|
||||
void shear( double sh, double sv );
|
||||
void rotate( double a );
|
||||
#endif
|
||||
void translate( double dx, double dy );
|
||||
void resetXForm();
|
||||
double translationX() const;
|
||||
double translationY() const;
|
||||
|
||||
TQPoint xForm( const TQPoint & ) const; // map virtual -> tqdevice
|
||||
TQRect xForm( const TQRect & ) const;
|
||||
TQPointArray xForm( const TQPointArray & ) const;
|
||||
TQPointArray xForm( const TQPointArray &, int index, int npoints ) const;
|
||||
TQPoint xFormDev( const TQPoint & ) const; // map tqdevice -> virtual
|
||||
TQRect xFormDev( const TQRect & ) const;
|
||||
TQPointArray xFormDev( const TQPointArray & ) const;
|
||||
TQPointArray xFormDev( const TQPointArray &, int index, int npoints ) const;
|
||||
|
||||
// Clipping
|
||||
|
||||
void setClipping( bool ); // set clipping on/off
|
||||
bool hasClipping() const;
|
||||
TQRegion clipRegion( CoordinateMode = CoordDevice ) const;
|
||||
void setClipRect( const TQRect &, CoordinateMode = CoordDevice ); // set clip rectangle
|
||||
void setClipRect( int x, int y, int w, int h, CoordinateMode = CoordDevice );
|
||||
void setClipRegion( const TQRegion &, CoordinateMode = CoordDevice );// set clip region
|
||||
|
||||
// Graphics drawing functions
|
||||
|
||||
void drawPoint( int x, int y );
|
||||
void drawPoint( const TQPoint & );
|
||||
void drawPoints( const TQPointArray& a,
|
||||
int index=0, int npoints=-1 );
|
||||
void moveTo( int x, int y );
|
||||
void moveTo( const TQPoint & );
|
||||
void lineTo( int x, int y );
|
||||
void lineTo( const TQPoint & );
|
||||
void drawLine( int x1, int y1, int x2, int y2 );
|
||||
void drawLine( const TQPoint &, const TQPoint & );
|
||||
void drawRect( int x, int y, int w, int h );
|
||||
void drawRect( const TQRect & );
|
||||
void drawWinFocusRect( int x, int y, int w, int h );
|
||||
void drawWinFocusRect( int x, int y, int w, int h,
|
||||
const TQColor &bgColor );
|
||||
void drawWinFocusRect( const TQRect & );
|
||||
void drawWinFocusRect( const TQRect &,
|
||||
const TQColor &bgColor );
|
||||
void drawRoundRect( int x, int y, int w, int h, int = 25, int = 25 );
|
||||
void drawRoundRect( const TQRect &, int = 25, int = 25 );
|
||||
void drawEllipse( int x, int y, int w, int h );
|
||||
void drawEllipse( const TQRect & );
|
||||
void drawArc( int x, int y, int w, int h, int a, int alen );
|
||||
void drawArc( const TQRect &, int a, int alen );
|
||||
void drawPie( int x, int y, int w, int h, int a, int alen );
|
||||
void drawPie( const TQRect &, int a, int alen );
|
||||
void drawChord( int x, int y, int w, int h, int a, int alen );
|
||||
void drawChord( const TQRect &, int a, int alen );
|
||||
void drawLineSegments( const TQPointArray &,
|
||||
int index=0, int nlines=-1 );
|
||||
void drawPolyline( const TQPointArray &,
|
||||
int index=0, int npoints=-1 );
|
||||
void drawPolygon( const TQPointArray &, bool winding=FALSE,
|
||||
int index=0, int npoints=-1 );
|
||||
void drawConvexPolygon( const TQPointArray &,
|
||||
int index=0, int npoints=-1 );
|
||||
#ifndef TQT_NO_BEZIER
|
||||
void drawCubicBezier( const TQPointArray &, int index=0 );
|
||||
#endif
|
||||
void drawPixmap( int x, int y, const TQPixmap &,
|
||||
int sx=0, int sy=0, int sw=-1, int sh=-1 );
|
||||
void drawPixmap( const TQPoint &, const TQPixmap &,
|
||||
const TQRect &sr );
|
||||
void drawPixmap( const TQPoint &, const TQPixmap & );
|
||||
void drawPixmap( const TQRect &, const TQPixmap & );
|
||||
void drawImage( int x, int y, const TQImage &,
|
||||
int sx = 0, int sy = 0, int sw = -1, int sh = -1,
|
||||
int conversionFlags = 0 );
|
||||
void drawImage( const TQPoint &, const TQImage &,
|
||||
const TQRect &sr, int conversionFlags = 0 );
|
||||
void drawImage( const TQPoint &, const TQImage &,
|
||||
int conversion_flags = 0 );
|
||||
void drawImage( const TQRect &, const TQImage & );
|
||||
void drawTiledPixmap( int x, int y, int w, int h, const TQPixmap &,
|
||||
int sx=0, int sy=0 );
|
||||
void drawTiledPixmap( const TQRect &, const TQPixmap &,
|
||||
const TQPoint & );
|
||||
void drawTiledPixmap( const TQRect &, const TQPixmap & );
|
||||
#ifndef TQT_NO_PICTURE
|
||||
void drawPicture( const TQPicture & );
|
||||
void drawPicture( int x, int y, const TQPicture & );
|
||||
void drawPicture( const TQPoint &, const TQPicture & );
|
||||
#endif
|
||||
|
||||
void fillRect( int x, int y, int w, int h, const TQBrush & );
|
||||
void fillRect( const TQRect &, const TQBrush & );
|
||||
void eraseRect( int x, int y, int w, int h );
|
||||
void eraseRect( const TQRect & );
|
||||
|
||||
// Text drawing functions
|
||||
|
||||
enum TextDirection {
|
||||
Auto,
|
||||
RTL,
|
||||
LTR
|
||||
};
|
||||
|
||||
void drawText( int x, int y, const TQString &, int len = -1, TextDirection dir = Auto );
|
||||
void drawText( const TQPoint &, const TQString &, int len = -1, TextDirection dir = Auto );
|
||||
|
||||
void drawText( int x, int y, const TQString &, int pos, int len, TextDirection dir = Auto );
|
||||
void drawText( const TQPoint &p, const TQString &, int pos, int len, TextDirection dir = Auto );
|
||||
|
||||
void drawText( int x, int y, int w, int h, int flags,
|
||||
const TQString&, int len = -1, TQRect *br=0,
|
||||
TQTextParag **intern=0 );
|
||||
void drawText( const TQRect &, int flags,
|
||||
const TQString&, int len = -1, TQRect *br=0,
|
||||
TQTextParag **intern=0 );
|
||||
|
||||
void tqdrawTextItem( int x, int y, const TQTextItem &ti, int textflags = 0 );
|
||||
void tqdrawTextItem( const TQPoint& p, const TQTextItem &ti, int textflags = 0 );
|
||||
|
||||
TQRect boundingRect( int x, int y, int w, int h, int flags,
|
||||
const TQString&, int len = -1, TQTextParag **intern=0 );
|
||||
TQRect boundingRect( const TQRect &, int flags,
|
||||
const TQString&, int len = -1, TQTextParag **intern=0 );
|
||||
|
||||
int tabStops() const;
|
||||
void setTabStops( int );
|
||||
int *tabArray() const;
|
||||
void setTabArray( int * );
|
||||
|
||||
// Other functions
|
||||
|
||||
#if defined(TQ_WS_WIN)
|
||||
HDC handle() const;
|
||||
#elif defined(TQ_WS_X11) || defined(TQ_WS_MAC)
|
||||
HANDLE handle() const;
|
||||
#endif
|
||||
|
||||
|
||||
static void initialize();
|
||||
static void cleanup();
|
||||
|
||||
private:
|
||||
void init();
|
||||
void destroy();
|
||||
void updateFont();
|
||||
void updatePen();
|
||||
void updateBrush();
|
||||
#ifndef TQT_NO_TRANSFORMATIONS
|
||||
void updateXForm();
|
||||
void updateInvXForm();
|
||||
#endif
|
||||
void map( int, int, int *rx, int *ry ) const;
|
||||
void map( int, int, int, int, int *, int *, int *, int * ) const;
|
||||
void mapInv( int, int, int *, int * ) const;
|
||||
void mapInv( int, int, int, int, int *, int *, int *, int * ) const;
|
||||
void drawPolyInternal( const TQPointArray &, bool close=TRUE );
|
||||
void drawWinFocusRect( int x, int y, int w, int h, bool xorPaint,
|
||||
const TQColor &penColor );
|
||||
|
||||
enum { IsActive=0x01, ExtDev=0x02, IsStartingUp=0x04, NoCache=0x08,
|
||||
VxF=0x10, WxF=0x20, ClipOn=0x40, SafePolygon=0x80, MonoDev=0x100,
|
||||
DirtyFont=0x200, DirtyPen=0x400, DirtyBrush=0x800,
|
||||
RGBColor=0x1000, FontMet=0x2000, FontInf=0x4000, CtorBegin=0x8000,
|
||||
UsePrivateCx = 0x10000, VolatileDC = 0x20000, TQt2Compat = 0x40000 };
|
||||
uint flags;
|
||||
bool testf( uint b ) const { return (flags&b)!=0; }
|
||||
void setf( uint b ) { flags |= b; }
|
||||
void setf( uint b, bool v );
|
||||
void clearf( uint b ) { flags &= (uint)(~b); }
|
||||
void fix_neg_rect( int *x, int *y, int *w, int *h );
|
||||
|
||||
TQPainterPrivate *d;
|
||||
TQPaintDevice *pdev;
|
||||
TQColor bg_col;
|
||||
uchar bg_mode;
|
||||
uchar rop;
|
||||
uchar pu;
|
||||
TQPoint bro;
|
||||
TQFont cfont;
|
||||
TQFont *pfont; // font used for metrics (might be different for printers)
|
||||
TQPen cpen;
|
||||
TQBrush cbrush;
|
||||
TQRegion crgn;
|
||||
int tabstops;
|
||||
int *tabarray;
|
||||
int tabarraylen;
|
||||
bool block_ext; // for temporary blocking of external tqdevices
|
||||
|
||||
// Transformations
|
||||
#ifndef TQT_NO_TRANSFORMATIONS
|
||||
TQCOORD wx, wy, ww, wh;
|
||||
TQCOORD vx, vy, vw, vh;
|
||||
TQWMatrix wxmat;
|
||||
|
||||
// Cached composition (and inverse) of transformations
|
||||
TQWMatrix xmat;
|
||||
TQWMatrix ixmat;
|
||||
|
||||
|
||||
|
||||
double m11() const { return xmat.m11(); }
|
||||
double m12() const { return xmat.m12(); }
|
||||
double m21() const { return xmat.m21(); }
|
||||
double m22() const { return xmat.m22(); }
|
||||
double dx() const { return xmat.dx(); }
|
||||
double dy() const { return xmat.dy(); }
|
||||
double im11() const { return ixmat.m11(); }
|
||||
double im12() const { return ixmat.m12(); }
|
||||
double im21() const { return ixmat.m21(); }
|
||||
double im22() const { return ixmat.m22(); }
|
||||
double idx() const { return ixmat.dx(); }
|
||||
double idy() const { return ixmat.dy(); }
|
||||
|
||||
int txop;
|
||||
bool txinv;
|
||||
|
||||
#else
|
||||
// even without transformations we still have translations
|
||||
int xlatex;
|
||||
int xlatey;
|
||||
#endif
|
||||
|
||||
void *penRef; // pen cache ref
|
||||
void *brushRef; // brush cache ref
|
||||
void *ps_stack;
|
||||
void *wm_stack;
|
||||
void killPStack();
|
||||
|
||||
protected:
|
||||
#ifdef TQ_OS_TEMP
|
||||
TQPoint internalCurrentPos;
|
||||
uint old_pix; // ### All win platforms in 4.0
|
||||
#endif
|
||||
#if defined(TQ_WS_WIN)
|
||||
friend class TQFontEngineWin;
|
||||
friend class TQFontEngineBox;
|
||||
TQT_WIN_PAINTER_MEMBERS
|
||||
#elif defined(TQ_WS_X11)
|
||||
friend class TQFontEngineXLFD;
|
||||
friend class TQFontEngineXft;
|
||||
friend class TQFontEngineBox;
|
||||
Display *dpy; // current display
|
||||
int scrn; // current screen
|
||||
TQt::HANDLE hd; // handle to drawable
|
||||
TQt::HANDLE rendhd; // handle to Xft draw
|
||||
GC gc; // graphics context (standard)
|
||||
GC gc_brush; // graphics contect for brush
|
||||
TQPoint curPt; // current point
|
||||
uint clip_serial; // clipping serial number
|
||||
#elif defined(TQ_WS_MAC)
|
||||
TQt::HANDLE hd; // handle to drawable
|
||||
void initPaintDevice(bool force=FALSE, TQPoint *off=NULL, TQRegion *rgn=NULL);
|
||||
friend const TQRegion &qt_mac_update_painter(TQPainter *, bool);
|
||||
friend class TQFontEngineMac;
|
||||
friend class TQMacPainter;
|
||||
#elif defined(TQ_WS_TQWS)
|
||||
friend class TQFontEngine;
|
||||
TQGfx * gfx;
|
||||
friend void qwsUpdateActivePainters();
|
||||
#endif
|
||||
friend class TQFontMetrics;
|
||||
friend class TQFontInfo;
|
||||
friend class TQTextLayout;
|
||||
friend void qt_format_text( const TQFont &, const TQRect &r,
|
||||
int tf, const TQString& str, int len, TQRect *brect,
|
||||
int tabstops, int* tabarray, int tabarraylen,
|
||||
TQTextParag **internal, TQPainter* painter );
|
||||
friend void qt_draw_background( TQPainter *p, int x, int y, int w, int h );
|
||||
friend void qt_draw_transformed_rect( TQPainter *p, int x, int y, int w, int h, bool fill );
|
||||
friend class TQPrinter;
|
||||
|
||||
private: // Disabled copy constructor and operator=
|
||||
#if defined(TQ_DISABLE_COPY)
|
||||
TQPainter( const TQPainter & );
|
||||
TQPainter &operator=( const TQPainter & );
|
||||
#endif
|
||||
|
||||
enum TransformationCodes {
|
||||
TxNone = 0, // transformation codes
|
||||
TxTranslate = 1, // copy in qpainter_*.cpp
|
||||
TxScale = 2,
|
||||
TxRotShear = 3
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
TQPainter member functions
|
||||
*****************************************************************************/
|
||||
|
||||
inline TQPaintDevice *TQPainter::tqdevice() const
|
||||
{
|
||||
return pdev;
|
||||
}
|
||||
|
||||
inline bool TQPainter::isActive() const
|
||||
{
|
||||
return testf(IsActive);
|
||||
}
|
||||
|
||||
inline const TQFont &TQPainter::font() const
|
||||
{
|
||||
return cfont;
|
||||
}
|
||||
|
||||
inline const TQPen &TQPainter::pen() const
|
||||
{
|
||||
return cpen;
|
||||
}
|
||||
|
||||
inline const TQBrush &TQPainter::brush() const
|
||||
{
|
||||
return cbrush;
|
||||
}
|
||||
|
||||
/*
|
||||
inline PaintUnit TQPainter::unit() const
|
||||
{
|
||||
return (PaintUnit)pu;
|
||||
}
|
||||
*/
|
||||
|
||||
inline const TQColor &TQPainter::backgroundColor() const
|
||||
{
|
||||
return bg_col;
|
||||
}
|
||||
|
||||
inline TQt::BGMode TQPainter::backgroundMode() const
|
||||
{
|
||||
return (BGMode)bg_mode;
|
||||
}
|
||||
|
||||
inline TQt::RasterOp TQPainter::rasterOp() const
|
||||
{
|
||||
return (RasterOp)rop;
|
||||
}
|
||||
|
||||
inline const TQPoint &TQPainter::brushOrigin() const
|
||||
{
|
||||
return bro;
|
||||
}
|
||||
|
||||
inline bool TQPainter::hasViewXForm() const
|
||||
{
|
||||
#ifndef TQT_NO_TRANSFORMATIONS
|
||||
return testf(VxF);
|
||||
#else
|
||||
return xlatex || xlatey;
|
||||
#endif
|
||||
}
|
||||
|
||||
inline bool TQPainter::hasWorldXForm() const
|
||||
{
|
||||
#ifndef TQT_NO_TRANSFORMATIONS
|
||||
return testf(WxF);
|
||||
#else
|
||||
return xlatex || xlatey;
|
||||
#endif
|
||||
}
|
||||
|
||||
inline double TQPainter::translationX() const
|
||||
{
|
||||
#ifndef TQT_NO_TRANSFORMATIONS
|
||||
return tqworldMatrix().dx();
|
||||
#else
|
||||
return xlatex;
|
||||
#endif
|
||||
}
|
||||
|
||||
inline double TQPainter::translationY() const
|
||||
{
|
||||
#ifndef TQT_NO_TRANSFORMATIONS
|
||||
return tqworldMatrix().dy();
|
||||
#else
|
||||
return xlatey;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
inline bool TQPainter::hasClipping() const
|
||||
{
|
||||
return testf(ClipOn);
|
||||
}
|
||||
|
||||
inline int TQPainter::tabStops() const
|
||||
{
|
||||
return tabstops;
|
||||
}
|
||||
|
||||
inline int *TQPainter::tabArray() const
|
||||
{
|
||||
return tabarray;
|
||||
}
|
||||
|
||||
#if defined(TQ_WS_WIN)
|
||||
inline HDC TQPainter::handle() const
|
||||
{
|
||||
return hdc;
|
||||
}
|
||||
#elif defined(TQ_WS_X11) || defined(TQ_WS_MAC)
|
||||
inline TQt::HANDLE TQPainter::handle() const
|
||||
{
|
||||
return hd;
|
||||
}
|
||||
#endif
|
||||
|
||||
inline void TQPainter::setBrushOrigin( const TQPoint &p )
|
||||
{
|
||||
setBrushOrigin( p.x(), p.y() );
|
||||
}
|
||||
|
||||
#ifndef TQT_NO_TRANSFORMATIONS
|
||||
inline void TQPainter::setWindow( const TQRect &r )
|
||||
{
|
||||
setWindow( r.x(), r.y(), r.width(), r.height() );
|
||||
}
|
||||
|
||||
inline void TQPainter::setViewport( const TQRect &r )
|
||||
{
|
||||
setViewport( r.x(), r.y(), r.width(), r.height() );
|
||||
}
|
||||
#endif
|
||||
|
||||
inline void TQPainter::setClipRect( int x, int y, int w, int h, CoordinateMode m )
|
||||
{
|
||||
setClipRect( TQRect(x,y,w,h), m );
|
||||
}
|
||||
|
||||
inline void TQPainter::drawPoint( const TQPoint &p )
|
||||
{
|
||||
drawPoint( p.x(), p.y() );
|
||||
}
|
||||
|
||||
inline void TQPainter::moveTo( const TQPoint &p )
|
||||
{
|
||||
moveTo( p.x(), p.y() );
|
||||
}
|
||||
|
||||
inline void TQPainter::lineTo( const TQPoint &p )
|
||||
{
|
||||
lineTo( p.x(), p.y() );
|
||||
}
|
||||
|
||||
inline void TQPainter::drawLine( const TQPoint &p1, const TQPoint &p2 )
|
||||
{
|
||||
drawLine( p1.x(), p1.y(), p2.x(), p2.y() );
|
||||
}
|
||||
|
||||
inline void TQPainter::drawRect( const TQRect &r )
|
||||
{
|
||||
drawRect( r.x(), r.y(), r.width(), r.height() );
|
||||
}
|
||||
|
||||
inline void TQPainter::drawWinFocusRect( const TQRect &r )
|
||||
{
|
||||
drawWinFocusRect( r.x(), r.y(), r.width(), r.height() );
|
||||
}
|
||||
|
||||
inline void TQPainter::drawWinFocusRect( const TQRect &r,const TQColor &penColor )
|
||||
{
|
||||
drawWinFocusRect( r.x(), r.y(), r.width(), r.height(), penColor );
|
||||
}
|
||||
|
||||
inline void TQPainter::drawRoundRect( const TQRect &r, int xRnd, int yRnd )
|
||||
{
|
||||
drawRoundRect( r.x(), r.y(), r.width(), r.height(), xRnd, yRnd );
|
||||
}
|
||||
|
||||
inline void TQPainter::drawEllipse( const TQRect &r )
|
||||
{
|
||||
drawEllipse( r.x(), r.y(), r.width(), r.height() );
|
||||
}
|
||||
|
||||
inline void TQPainter::drawArc( const TQRect &r, int a, int alen )
|
||||
{
|
||||
drawArc( r.x(), r.y(), r.width(), r.height(), a, alen );
|
||||
}
|
||||
|
||||
inline void TQPainter::drawPie( const TQRect &r, int a, int alen )
|
||||
{
|
||||
drawPie( r.x(), r.y(), r.width(), r.height(), a, alen );
|
||||
}
|
||||
|
||||
inline void TQPainter::drawChord( const TQRect &r, int a, int alen )
|
||||
{
|
||||
drawChord( r.x(), r.y(), r.width(), r.height(), a, alen );
|
||||
}
|
||||
|
||||
inline void TQPainter::drawPixmap( const TQPoint &p, const TQPixmap &pm,
|
||||
const TQRect &sr )
|
||||
{
|
||||
drawPixmap( p.x(), p.y(), pm, sr.x(), sr.y(), sr.width(), sr.height() );
|
||||
}
|
||||
|
||||
inline void TQPainter::drawImage( const TQPoint &p, const TQImage &pm,
|
||||
const TQRect &sr, int conversionFlags )
|
||||
{
|
||||
drawImage( p.x(), p.y(), pm,
|
||||
sr.x(), sr.y(), sr.width(), sr.height(), conversionFlags );
|
||||
}
|
||||
|
||||
inline void TQPainter::drawTiledPixmap( const TQRect &r, const TQPixmap &pm,
|
||||
const TQPoint &sp )
|
||||
{
|
||||
drawTiledPixmap( r.x(), r.y(), r.width(), r.height(), pm, sp.x(), sp.y() );
|
||||
}
|
||||
|
||||
inline void TQPainter::drawTiledPixmap( const TQRect &r, const TQPixmap &pm )
|
||||
{
|
||||
drawTiledPixmap( r.x(), r.y(), r.width(), r.height(), pm, 0, 0 );
|
||||
}
|
||||
|
||||
inline void TQPainter::fillRect( const TQRect &r, const TQBrush &brush )
|
||||
{
|
||||
fillRect( r.x(), r.y(), r.width(), r.height(), brush );
|
||||
}
|
||||
|
||||
inline void TQPainter::eraseRect( int x, int y, int w, int h )
|
||||
{
|
||||
fillRect( x, y, w, h, backgroundColor() );
|
||||
}
|
||||
|
||||
inline void TQPainter::eraseRect( const TQRect &r )
|
||||
{
|
||||
fillRect( r.x(), r.y(), r.width(), r.height(), backgroundColor() );
|
||||
}
|
||||
|
||||
inline void TQPainter::drawText( const TQPoint &p, const TQString &s, int len, TextDirection dir )
|
||||
{
|
||||
drawText( p.x(), p.y(), s, 0, len, dir );
|
||||
}
|
||||
|
||||
inline void TQPainter::drawText( const TQPoint &p, const TQString &s, int pos, int len, TextDirection dir )
|
||||
{
|
||||
drawText( p.x(), p.y(), s, pos, len, dir );
|
||||
}
|
||||
|
||||
inline void TQPainter::drawText( int x, int y, int w, int h, int tf,
|
||||
const TQString& str, int len, TQRect *br, TQTextParag **i )
|
||||
{
|
||||
TQRect r(x, y, w, h);
|
||||
drawText( r, tf, str, len, br, i );
|
||||
}
|
||||
|
||||
inline void TQPainter::tqdrawTextItem( const TQPoint& p, const TQTextItem &ti, int textflags )
|
||||
{
|
||||
tqdrawTextItem( p.x(), p.y(), ti, textflags );
|
||||
}
|
||||
|
||||
inline TQRect TQPainter::boundingRect( int x, int y, int w, int h, int tf,
|
||||
const TQString& str, int len, TQTextParag **i )
|
||||
{
|
||||
TQRect r(x, y, w, h);
|
||||
return boundingRect( r, tf, str, len, i );
|
||||
}
|
||||
|
||||
#if defined(TQ_WS_TQWS)
|
||||
inline TQGfx * TQPainter::internalGfx()
|
||||
{
|
||||
return gfx;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // USE_QT4
|
||||
|
||||
#endif // TQPAINTER_H
|
File diff suppressed because it is too large
Load Diff
@ -1,193 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Definition of TQWMatrix class
|
||||
**
|
||||
** Created : 941020
|
||||
**
|
||||
** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA.
|
||||
**
|
||||
** 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 TQWMATRIX_H
|
||||
#define TQWMATRIX_H
|
||||
|
||||
#include "tqtglobaldefines.h"
|
||||
|
||||
#ifndef TQT_H
|
||||
#include "tqwindowdefs.h"
|
||||
#include "tqpointarray.h"
|
||||
#include "tqrect.h"
|
||||
#include "tqregion.h"
|
||||
#endif // TQT_H
|
||||
|
||||
#ifndef TQT_NO_WMATRIX
|
||||
|
||||
#ifdef USE_QT4
|
||||
|
||||
#include <Qt/qpixmap.h>
|
||||
#include <Qt/qbitmap.h>
|
||||
|
||||
// #include "tqimage.h"
|
||||
|
||||
#endif // USE_QT4
|
||||
|
||||
#ifdef USE_QT4
|
||||
|
||||
class TQ_EXPORT TQWMatrix : public QMatrix, virtual public TQt
|
||||
{
|
||||
public:
|
||||
TQWMatrix() : QMatrix() {}
|
||||
TQWMatrix( double m11, double m12, double m21, double m22, double dx, double dy ) : QMatrix( m11, m12, m21, m22, dx, dy ) {}
|
||||
|
||||
//TQWMatrix invert(bool *invertible=0);
|
||||
inline TQWMatrix invert(bool *invertible=0) const { const QMatrix &ref = inverted(invertible); return (*static_cast<const TQWMatrix*>(&ref)); }
|
||||
|
||||
inline TQRect map(const QRect &r) const { return mapRect(r); }
|
||||
|
||||
inline void map( int x, int y, int *tx, int *ty ) const { return QMatrix::map(x, y, tx, ty); }
|
||||
inline void map( double x, double y, double *tx, double *ty ) const { return QMatrix::map(x, y, tx, ty); }
|
||||
inline TQPoint map( const QPoint &p ) const { return QMatrix::map(p); }
|
||||
inline TQRegion map( const QRegion &r ) const { return QMatrix::map(r); }
|
||||
TQPointArray map( const TQPointArray &a ) const;
|
||||
|
||||
TQRegion mapToRegion(const QRect &r) const;
|
||||
|
||||
enum TransformationMode {
|
||||
Points, Areas
|
||||
};
|
||||
static void setTransformationMode( TQWMatrix::TransformationMode m );
|
||||
static TransformationMode transformationMode();
|
||||
|
||||
TQPointArray operator * ( const TQPointArray &a ) const;
|
||||
|
||||
TQWMatrix &operator*=( const TQWMatrix & );
|
||||
|
||||
// Interoperability
|
||||
inline TQWMatrix &operator=( const QMatrix &qm ) { return *this = qm; }
|
||||
|
||||
// TQWMatrix(QMatrix a) {
|
||||
// setMatrix(a.m11(), a.m12()
|
||||
// }
|
||||
|
||||
// inline operator QMatrix() const { return *this; }
|
||||
|
||||
// Interoperability
|
||||
static const TQWMatrix& convertFromQMatrix( QMatrix& qs );
|
||||
};
|
||||
|
||||
// Interoperability
|
||||
inline static const TQWMatrix& convertFromQMatrix( const QMatrix& qs ) {
|
||||
return (*static_cast<const TQWMatrix*>(&qs));
|
||||
}
|
||||
|
||||
TQ_EXPORT TQWMatrix operator*( const TQWMatrix &, const TQWMatrix & );
|
||||
|
||||
#else // USE_QT4
|
||||
|
||||
class TQ_EXPORT TQWMatrix // 2D transform matrix
|
||||
{
|
||||
public:
|
||||
TQWMatrix();
|
||||
TQWMatrix( double m11, double m12, double m21, double m22,
|
||||
double dx, double dy );
|
||||
|
||||
void setMatrix( double m11, double m12, double m21, double m22,
|
||||
double dx, double dy );
|
||||
|
||||
double m11() const { return _m11; }
|
||||
double m12() const { return _m12; }
|
||||
double m21() const { return _m21; }
|
||||
double m22() const { return _m22; }
|
||||
double dx() const { return _dx; }
|
||||
double dy() const { return _dy; }
|
||||
|
||||
void map( int x, int y, int *tx, int *ty ) const;
|
||||
void map( double x, double y, double *tx, double *ty ) const;
|
||||
TQRect mapRect( const TQRect & ) const;
|
||||
|
||||
TQPoint map( const TQPoint &p ) const { return operator *( p ); }
|
||||
TQRect map( const TQRect &r ) const { return mapRect ( r ); }
|
||||
TQPointArray map( const TQPointArray &a ) const { return operator * ( a ); }
|
||||
TQRegion map( const TQRegion &r ) const { return operator *( r ); }
|
||||
TQRegion mapToRegion( const TQRect &r ) const { return operator *( r ); }
|
||||
TQPointArray mapToPolygon( const TQRect &r ) const;
|
||||
|
||||
void reset();
|
||||
bool isIdentity() const;
|
||||
|
||||
TQWMatrix &translate( double dx, double dy );
|
||||
TQWMatrix &scale( double sx, double sy );
|
||||
TQWMatrix &shear( double sh, double sv );
|
||||
TQWMatrix &rotate( double a );
|
||||
|
||||
bool isInvertible() const { return (_m11*_m22 - _m12*_m21) != 0; }
|
||||
double det() const { return _m11*_m22 - _m12*_m21; }
|
||||
|
||||
TQWMatrix invert( bool * = 0 ) const;
|
||||
|
||||
bool operator==( const TQWMatrix & ) const;
|
||||
bool operator!=( const TQWMatrix & ) const;
|
||||
TQWMatrix &operator*=( const TQWMatrix & );
|
||||
|
||||
/* we use matrix multiplication semantics here */
|
||||
TQPoint operator * (const TQPoint & ) const;
|
||||
TQRegion operator * (const TQRect & ) const;
|
||||
TQRegion operator * (const TQRegion & ) const;
|
||||
TQPointArray operator * ( const TQPointArray &a ) const;
|
||||
|
||||
enum TransformationMode {
|
||||
Points, Areas
|
||||
};
|
||||
static void setTransformationMode( TQWMatrix::TransformationMode m );
|
||||
static TransformationMode transformationMode();
|
||||
private:
|
||||
double _m11, _m12;
|
||||
double _m21, _m22;
|
||||
double _dx, _dy;
|
||||
};
|
||||
|
||||
TQ_EXPORT TQWMatrix operator*( const TQWMatrix &, const TQWMatrix & );
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
TQWMatrix stream functions
|
||||
*****************************************************************************/
|
||||
|
||||
TQ_EXPORT TQDataStream &operator<<( TQDataStream &, const TQWMatrix & );
|
||||
TQ_EXPORT TQDataStream &operator>>( TQDataStream &, TQWMatrix & );
|
||||
|
||||
#endif // USE_QT4
|
||||
|
||||
#endif // TQT_NO_WMATRIX
|
||||
|
||||
#endif // TQWMATRIX_H
|
@ -1,219 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Definition of TQBuffer class
|
||||
**
|
||||
** Created : 930812
|
||||
**
|
||||
** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA.
|
||||
**
|
||||
** This file is part of the tools 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 TQBUFFER_H
|
||||
#define TQBUFFER_H
|
||||
|
||||
#include "tqtglobaldefines.h"
|
||||
|
||||
#ifndef TQT_H
|
||||
#include "tqiodevice.h"
|
||||
#include "tqstring.h"
|
||||
#endif // TQT_H
|
||||
|
||||
#ifdef USE_QT4
|
||||
|
||||
#include <Qt/qbuffer.h>
|
||||
|
||||
#endif // USE_QT4
|
||||
|
||||
#ifdef USE_QT4
|
||||
|
||||
class TQ_EXPORT TQBuffer : public QBuffer
|
||||
{
|
||||
public:
|
||||
#if defined(TQT_ABI_QT4)
|
||||
typedef TQ_LLONG Offset;
|
||||
#else
|
||||
typedef TQ_ULONG Offset;
|
||||
#endif
|
||||
|
||||
#warning Please remember that TQByteArray is no longer explicitly shared. If you get weird crashes while using TQt stream objects please see tqbuffer.h line 69
|
||||
// NOTE:
|
||||
// QByteArray was explicitly shared in Qt3
|
||||
// This is no longer the case in Qt4
|
||||
// If you get weird crashes inside TQBuffer, it probably means you did something like this:
|
||||
//
|
||||
// main() {
|
||||
// aFunction();
|
||||
// otherFunction();
|
||||
// }
|
||||
//
|
||||
// aFunction() {
|
||||
// TQBuffer m_Buffer(QByteArray());
|
||||
// }
|
||||
//
|
||||
// otherFunction() {
|
||||
// m_Buffer.putch('H');
|
||||
// }
|
||||
//
|
||||
// The QByteArray object was created within aFunction, but as it went out of scope it was destroyed before otherFunction was called
|
||||
// Therefore, the TQBuffer's internal reference to the TQByteArray was invalid at the time putch() was called
|
||||
// You could do this instead:
|
||||
//
|
||||
// aFunction() {
|
||||
// TQBuffer m_Buffer();
|
||||
// m_Buffer.tqsetBufferFromCopy(QByteArray());
|
||||
// }
|
||||
|
||||
TQBuffer() : QBuffer() {}
|
||||
TQBuffer( TQByteArray &ba ) : QBuffer( &ba, 0 ) {}
|
||||
TQBuffer( const TQByteArray &ba ) : QBuffer( const_cast<TQByteArray*>(&ba), 0 ) {}
|
||||
// TQBuffer( TQByteArray ba ) : QBuffer(), internal_ba_copy(ba) { QBuffer::setBuffer(&internal_ba_copy); } // Make a copy of ba
|
||||
|
||||
inline int state() const { return isOpen() ? 0x1000 : 0; }
|
||||
inline int mode() const { return (int) openMode(); }
|
||||
inline int flags() const { return (int) openMode(); }
|
||||
inline bool tqopen( int mode ) { return open((OpenModeFlag)mode); }
|
||||
|
||||
inline Offset at() const { return pos(); }
|
||||
inline bool at(Offset offset) { return seek(offset); }
|
||||
inline Offset tqat() const { return pos(); }
|
||||
inline bool tqat(Offset offset) { return seek(offset); }
|
||||
|
||||
// virtual inline qint64 readBlock(char *data, quint64 maxlen) { return read(data, maxlen); }
|
||||
// virtual inline qint64 writeBlock(const char *data, quint64 len) { return write(data, len); }
|
||||
// virtual inline qint64 writeBlock(const QByteArray &data) { return write(data); }
|
||||
inline qint64 readBlock(char *data, quint64 maxlen) { return read(data, maxlen); }
|
||||
inline qint64 writeBlock(const char *data, quint64 len) { return write(data, len); }
|
||||
inline qint64 writeBlock(const QByteArray &data) { return write(data); }
|
||||
|
||||
// virtual inline qint64 readData ( char * data, qint64 maxSize ) { return readBlock(data, maxSize); }
|
||||
// virtual inline qint64 writeData ( const char * data, qint64 maxSize ) { return writeBlock(data, maxSize); }
|
||||
|
||||
inline int getch() { char c; return getChar(&c) ? int(uchar(c)) : -1; }
|
||||
inline int putch(int c) { return putChar(char(c)) ? int(uchar(c)) : -1; }
|
||||
inline int ungetch(int c) { ungetChar(uchar(c)); return c; }
|
||||
|
||||
inline bool isDirectAccess() const { return !isSequential(); }
|
||||
inline bool isSequentialAccess() const { return isSequential(); }
|
||||
inline bool isCombinedAccess() const { return false; }
|
||||
inline bool isBuffered() const { return true; }
|
||||
inline bool isRaw() const { return false; }
|
||||
inline bool isSynchronous() const { return true; }
|
||||
inline bool isAsynchronous() const { return false; }
|
||||
inline bool isTranslated() const { return (openMode() & Text) != 0; }
|
||||
inline bool isInactive() const { return !isOpen(); }
|
||||
|
||||
inline TQByteArray &buffer() { return static_cast<TQByteArray&>(QBuffer::buffer()); }
|
||||
inline bool setBuffer( TQByteArray &tqba ) { if (isOpen() == TRUE) return FALSE; QBuffer::setBuffer(&tqba); return TRUE; }
|
||||
inline bool tqsetBufferFromCopy( TQByteArray tqba ) { if (isOpen() == TRUE) return FALSE; internal_ba_copy = tqba; QBuffer::setBuffer(&internal_ba_copy); return TRUE; }
|
||||
// inline bool setBuffer( TQByteArray tqba ) { if (isOpen() == TRUE) return FALSE; internal_ba_copy = tqba; QBuffer::setBuffer(&internal_ba_copy); return TRUE; }
|
||||
|
||||
public:
|
||||
typedef int Status;
|
||||
Status status() const {
|
||||
#if !defined(QT_NO_QOBJECT)
|
||||
const QFile *f = qobject_cast<const QFile *>(this);
|
||||
if (f) return (int) f->error();
|
||||
#endif
|
||||
return isOpen() ? 0 /* IO_Ok */ : 8 /* IO_UnspecifiedError */;
|
||||
}
|
||||
void resetStatus() {
|
||||
#if !defined(QT_NO_QOBJECT)
|
||||
QFile *f = qobject_cast<QFile *>(this);
|
||||
if (f) f->unsetError();
|
||||
#endif
|
||||
}
|
||||
|
||||
void setqStatus( int ) { std::cout << "[WARNING] TQBuffer::setqStatus() UNIMPLEMENTED\n\r"; }
|
||||
void resetqStatus() { resetStatus(); }
|
||||
|
||||
private:
|
||||
TQByteArray internal_ba_copy;
|
||||
};
|
||||
|
||||
#else // USE_QT4
|
||||
|
||||
class TQ_EXPORT TQBuffer : public TQIODevice
|
||||
{
|
||||
public:
|
||||
TQBuffer();
|
||||
TQBuffer( TQByteArray );
|
||||
~TQBuffer();
|
||||
|
||||
TQByteArray buffer() const;
|
||||
bool setBuffer( TQByteArray );
|
||||
|
||||
bool open( int );
|
||||
void close();
|
||||
void flush();
|
||||
|
||||
Offset size() const;
|
||||
Offset at() const;
|
||||
bool at( Offset );
|
||||
|
||||
TQ_LONG readBlock( char *p, TQ_ULONG );
|
||||
TQ_LONG writeBlock( const char *p, TQ_ULONG );
|
||||
TQ_LONG writeBlock( const TQByteArray& data )
|
||||
{ return TQIODevice::writeBlock(data); }
|
||||
TQ_LONG readLine( char *p, TQ_ULONG );
|
||||
|
||||
int getch();
|
||||
int putch( int );
|
||||
int ungetch( int );
|
||||
|
||||
protected:
|
||||
TQByteArray a;
|
||||
|
||||
private:
|
||||
uint a_len;
|
||||
uint a_inc;
|
||||
|
||||
private: // Disabled copy constructor and operator=
|
||||
#if defined(TQ_DISABLE_COPY)
|
||||
TQBuffer( const TQBuffer & );
|
||||
TQBuffer &operator=( const TQBuffer & );
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
inline TQByteArray TQBuffer::buffer() const
|
||||
{ return a; }
|
||||
|
||||
inline TQIODevice::Offset TQBuffer::size() const
|
||||
{ return (Offset)a.size(); }
|
||||
|
||||
inline TQIODevice::Offset TQBuffer::at() const
|
||||
{ return ioIndex; }
|
||||
|
||||
#endif // USE_QT4
|
||||
|
||||
#endif // TQBUFFER_H
|
@ -1,310 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Definition of TQIODevice class
|
||||
**
|
||||
** Created : 940913
|
||||
**
|
||||
** Copyright (C) 2010 Timothy Pearson and (C) 1992-2008 Trolltech ASA.
|
||||
**
|
||||
** This file is part of the tools 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 TQIODEVICE_H
|
||||
#define TQIODEVICE_H
|
||||
|
||||
#include "tqtglobaldefines.h"
|
||||
|
||||
#ifndef TQT_H
|
||||
#include "tqglobal.h"
|
||||
#include "tqcstring.h"
|
||||
#endif // TQT_H
|
||||
|
||||
#ifdef USE_QT4
|
||||
|
||||
#include <Qt/qiodevice.h>
|
||||
#include <Qt/qfile.h>
|
||||
#include <iostream>
|
||||
|
||||
#endif // USE_QT4
|
||||
|
||||
#ifdef USE_QT4
|
||||
|
||||
#define IO_Direct 0x0100 // direct access tqdevice
|
||||
#define IO_Sequential 0x0200 // sequential access tqdevice
|
||||
#define IO_Combined 0x0300 // combined direct/sequential
|
||||
#define IO_TypeMask 0x0f00
|
||||
|
||||
// IO handling modes
|
||||
|
||||
#define IO_Raw 0x0040 // raw access (not buffered)
|
||||
#define IO_Async 0x0080 // asynchronous mode
|
||||
|
||||
// IO tqdevice open modes
|
||||
|
||||
#define IO_ReadOnly (QIODevice::OpenModeFlag)0x0001 // readable tqdevice
|
||||
#define IO_WriteOnly (QIODevice::OpenModeFlag)0x0002 // writable tqdevice
|
||||
#define IO_ReadWrite (QIODevice::OpenModeFlag)0x0003 // read+write tqdevice
|
||||
#define IO_Append (QIODevice::OpenModeFlag)0x0004 // append
|
||||
#define IO_Truncate (QIODevice::OpenModeFlag)0x0008 // truncate tqdevice
|
||||
#define IO_Translate (QIODevice::OpenModeFlag)0x0010 // translate CR+LF
|
||||
#define IO_ModeMask (QIODevice::OpenModeFlag)0x00ff
|
||||
|
||||
// IO tqdevice state
|
||||
|
||||
#define IO_Open 0x1000 // tqdevice is open
|
||||
#define IO_StateMask 0xf000
|
||||
|
||||
// IO tqdevice status
|
||||
|
||||
#define IO_Ok 0
|
||||
#define IO_ReadError 1 // read error
|
||||
#define IO_WriteError 2 // write error
|
||||
#define IO_FatalError 3 // fatal unrecoverable error
|
||||
#define IO_ResourceError 4 // resource limitation
|
||||
#define IO_OpenError 5 // cannot open tqdevice
|
||||
#define IO_ConnectError 5 // cannot connect to tqdevice
|
||||
#define IO_AbortError 6 // abort error
|
||||
#define IO_TimeOutError 7 // time out
|
||||
#define IO_UnspecifiedError 8 // unspecified error
|
||||
|
||||
class TQ_EXPORT TQIODevice : public QIODevice
|
||||
{
|
||||
public:
|
||||
#if defined(TQT_ABI_QT4)
|
||||
typedef TQ_LLONG Offset;
|
||||
#else
|
||||
typedef TQ_ULONG Offset;
|
||||
#endif
|
||||
|
||||
TQIODevice() : QIODevice() {}
|
||||
|
||||
inline int state() const { return isOpen() ? 0x1000 : 0; }
|
||||
inline int mode() const { return (int) openMode(); }
|
||||
inline int flags() const { return (int) openMode(); }
|
||||
inline bool tqopen( int mode ) { return open((OpenModeFlag)mode); }
|
||||
|
||||
inline Offset at() const { return pos(); }
|
||||
inline bool at(Offset offset) { return seek(offset); }
|
||||
inline Offset tqat() const { return pos(); }
|
||||
inline bool tqat(Offset offset) { return seek(offset); }
|
||||
|
||||
// virtual inline qint64 readBlock(char *data, quint64 maxlen) { return read(data, maxlen); }
|
||||
// virtual inline qint64 writeBlock(const char *data, quint64 len) { return write(data, len); }
|
||||
// virtual inline qint64 writeBlock(const QByteArray &data) { return write(data); }
|
||||
inline qint64 readBlock(char *data, quint64 maxlen) { return read(data, maxlen); }
|
||||
inline qint64 writeBlock(const char *data, quint64 len) { return write(data, len); }
|
||||
inline qint64 writeBlock(const QByteArray &data) { return write(data); }
|
||||
|
||||
// virtual inline qint64 readData ( char * data, qint64 maxSize ) { return readBlock(data, maxSize); }
|
||||
// virtual inline qint64 writeData ( const char * data, qint64 maxSize ) { return writeBlock(data, maxSize); }
|
||||
|
||||
inline int getch() { char c; return getChar(&c) ? int(uchar(c)) : -1; }
|
||||
inline int putch(int c) { return putChar(char(c)) ? int(uchar(c)) : -1; }
|
||||
inline int ungetch(int c) { ungetChar(uchar(c)); return c; }
|
||||
virtual void flush() = 0;
|
||||
|
||||
inline bool isDirectAccess() const { return !isSequential(); }
|
||||
inline bool isSequentialAccess() const { return isSequential(); }
|
||||
inline bool isCombinedAccess() const { return false; }
|
||||
inline bool isBuffered() const { return true; }
|
||||
inline bool isRaw() const { return false; }
|
||||
inline bool isSynchronous() const { return true; }
|
||||
inline bool isAsynchronous() const { return false; }
|
||||
inline bool isTranslated() const { return (openMode() & Text) != 0; }
|
||||
inline bool isInactive() const { return !isOpen(); }
|
||||
|
||||
// inline bool open( int mode ) = 0;
|
||||
|
||||
protected:
|
||||
void setFlags( int f ) { setOpenMode((QIODevice::OpenModeFlag)f); }
|
||||
void setType( int ) { printf("[WARNING] TQIODevice::setType() unimplemented\n\r"); }
|
||||
void setMode( int f ) { setOpenMode((QIODevice::OpenModeFlag)f); }
|
||||
void setState( int state ) {
|
||||
switch (state) {
|
||||
case (IO_Open):
|
||||
QIODevice::open(openMode());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
typedef int Status;
|
||||
Status status() const {
|
||||
#if !defined(QT_NO_QOBJECT)
|
||||
const QFile *f = qobject_cast<const QFile *>(this);
|
||||
if (f) return (int) f->error();
|
||||
#endif
|
||||
return isOpen() ? 0 /* IO_Ok */ : 8 /* IO_UnspecifiedError */;
|
||||
}
|
||||
void resetStatus() {
|
||||
#if !defined(QT_NO_QOBJECT)
|
||||
QFile *f = qobject_cast<QFile *>(this);
|
||||
if (f) f->unsetError();
|
||||
#endif
|
||||
}
|
||||
|
||||
protected:
|
||||
void setqStatus( int ) { std::cout << "[WARNING] TQIODevice::setqStatus() UNIMPLEMENTED\n\r"; }
|
||||
void resetqStatus() { resetStatus(); }
|
||||
|
||||
friend class TQFile;
|
||||
friend class TQIODeviceSource;
|
||||
friend class TQImageIO;
|
||||
|
||||
public:
|
||||
// Interoperability
|
||||
static TQIODevice& convertFromQIODevice( QIODevice& qiod );
|
||||
};
|
||||
|
||||
// Interoperability
|
||||
inline static TQIODevice& convertFromQIODevice( QIODevice& qiod ) {
|
||||
return (*static_cast<TQIODevice*>(&qiod));
|
||||
}
|
||||
|
||||
#else // USE_QT4
|
||||
|
||||
// IO tqdevice access types
|
||||
|
||||
#define IO_Direct 0x0100 // direct access tqdevice
|
||||
#define IO_Sequential 0x0200 // sequential access tqdevice
|
||||
#define IO_Combined 0x0300 // combined direct/sequential
|
||||
#define IO_TypeMask 0x0f00
|
||||
|
||||
// IO handling modes
|
||||
|
||||
#define IO_Raw 0x0040 // raw access (not buffered)
|
||||
#define IO_Async 0x0080 // asynchronous mode
|
||||
|
||||
// IO tqdevice open modes
|
||||
|
||||
#define IO_ReadOnly 0x0001 // readable tqdevice
|
||||
#define IO_WriteOnly 0x0002 // writable tqdevice
|
||||
#define IO_ReadWrite 0x0003 // read+write tqdevice
|
||||
#define IO_Append 0x0004 // append
|
||||
#define IO_Truncate 0x0008 // truncate tqdevice
|
||||
#define IO_Translate 0x0010 // translate CR+LF
|
||||
#define IO_ModeMask 0x00ff
|
||||
|
||||
// IO tqdevice state
|
||||
|
||||
#define IO_Open 0x1000 // tqdevice is open
|
||||
#define IO_StateMask 0xf000
|
||||
|
||||
// IO tqdevice status
|
||||
|
||||
#define IO_Ok 0
|
||||
#define IO_ReadError 1 // read error
|
||||
#define IO_WriteError 2 // write error
|
||||
#define IO_FatalError 3 // fatal unrecoverable error
|
||||
#define IO_ResourceError 4 // resource limitation
|
||||
#define IO_OpenError 5 // cannot open tqdevice
|
||||
#define IO_ConnectError 5 // cannot connect to tqdevice
|
||||
#define IO_AbortError 6 // abort error
|
||||
#define IO_TimeOutError 7 // time out
|
||||
#define IO_UnspecifiedError 8 // unspecified error
|
||||
|
||||
|
||||
class TQ_EXPORT TQIODevice
|
||||
{
|
||||
public:
|
||||
#if defined(TQT_ABI_QT4)
|
||||
typedef TQ_LLONG Offset;
|
||||
#else
|
||||
typedef TQ_ULONG Offset;
|
||||
#endif
|
||||
|
||||
TQIODevice();
|
||||
virtual ~TQIODevice();
|
||||
|
||||
int flags() const { return ioMode; }
|
||||
int mode() const { return ioMode & IO_ModeMask; }
|
||||
int state() const { return ioMode & IO_StateMask; }
|
||||
|
||||
bool isDirectAccess() const { return ((ioMode & IO_Direct) == IO_Direct); }
|
||||
bool isSequentialAccess() const { return ((ioMode & IO_Sequential) == IO_Sequential); }
|
||||
bool isCombinedAccess() const { return ((ioMode & IO_Combined) == IO_Combined); }
|
||||
bool isBuffered() const { return ((ioMode & IO_Raw) != IO_Raw); }
|
||||
bool isRaw() const { return ((ioMode & IO_Raw) == IO_Raw); }
|
||||
bool isSynchronous() const { return ((ioMode & IO_Async) != IO_Async); }
|
||||
bool isAsynchronous() const { return ((ioMode & IO_Async) == IO_Async); }
|
||||
bool isTranslated() const { return ((ioMode & IO_Translate) == IO_Translate); }
|
||||
bool isReadable() const { return ((ioMode & IO_ReadOnly) == IO_ReadOnly); }
|
||||
bool isWritable() const { return ((ioMode & IO_WriteOnly) == IO_WriteOnly); }
|
||||
bool isReadWrite() const { return ((ioMode & IO_ReadWrite) == IO_ReadWrite); }
|
||||
bool isInactive() const { return state() == 0; }
|
||||
bool isOpen() const { return state() == IO_Open; }
|
||||
|
||||
int status() const { return ioSt; }
|
||||
void resetqStatus() { ioSt = IO_Ok; }
|
||||
|
||||
virtual bool open( int mode ) = 0;
|
||||
virtual void close() = 0;
|
||||
virtual void flush() = 0;
|
||||
|
||||
virtual Offset size() const = 0;
|
||||
virtual Offset at() const;
|
||||
virtual bool at( Offset );
|
||||
virtual bool atEnd() const;
|
||||
bool reset() { return at(0); }
|
||||
|
||||
virtual TQ_LONG readBlock( char *data, TQ_ULONG maxlen ) = 0;
|
||||
virtual TQ_LONG writeBlock( const char *data, TQ_ULONG len ) = 0;
|
||||
virtual TQ_LONG readLine( char *data, TQ_ULONG maxlen );
|
||||
TQ_LONG writeBlock( const TQByteArray& data );
|
||||
virtual TQByteArray readAll();
|
||||
|
||||
virtual int getch() = 0;
|
||||
virtual int putch( int ) = 0;
|
||||
virtual int ungetch( int ) = 0;
|
||||
|
||||
protected:
|
||||
void setFlags( int f ) { ioMode = f; }
|
||||
void setType( int );
|
||||
void setMode( int );
|
||||
void setState( int );
|
||||
void setqStatus( int );
|
||||
Offset ioIndex;
|
||||
|
||||
private:
|
||||
int ioMode;
|
||||
int ioSt;
|
||||
|
||||
private: // Disabled copy constructor and operator=
|
||||
#if defined(TQ_DISABLE_COPY)
|
||||
TQIODevice( const TQIODevice & );
|
||||
TQIODevice &operator=( const TQIODevice & );
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif // USE_QT4
|
||||
|
||||
#endif // TQIODEVICE_H
|
Loading…
Reference in new issue