summaryrefslogtreecommitdiffstats
path: root/styles
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-14 05:14:51 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-14 05:14:51 +0000
commit1d077caf68127ab1a5518df84cc5592a1b47a965 (patch)
tree9729a338937930e9014ccbd70296f3313d6dc2cc /styles
parent771e57c60b52ff27c4d92cddc8e6bfc0b8dafd1a (diff)
downloadtdeartwork-1d077caf68127ab1a5518df84cc5592a1b47a965.zip
tdeartwork-1d077caf68127ab1a5518df84cc5592a1b47a965.tar.gz
TQt4 port kdeartwork
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeartwork@1246991 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'styles')
-rw-r--r--styles/dotnet/Makefile.am2
-rw-r--r--styles/dotnet/dotnet.cpp298
-rw-r--r--styles/dotnet/dotnet.h17
-rw-r--r--styles/phase/Makefile.am2
-rw-r--r--styles/phase/config/Makefile.am2
-rw-r--r--styles/phase/config/phasestyleconfig.cpp2
-rw-r--r--styles/phase/config/phasestyleconfig.h1
-rw-r--r--styles/phase/config/styledialog.ui8
-rw-r--r--styles/phase/phasestyle.cpp496
-rw-r--r--styles/phase/phasestyle.h19
10 files changed, 424 insertions, 423 deletions
diff --git a/styles/dotnet/Makefile.am b/styles/dotnet/Makefile.am
index 4c80bfa..513221e 100644
--- a/styles/dotnet/Makefile.am
+++ b/styles/dotnet/Makefile.am
@@ -24,7 +24,7 @@ METASOURCES = AUTO
INCLUDES = $(all_includes)
noinst_HEADERS = dotnet.h
kde_style_LTLIBRARIES = dotnet.la
-dotnet_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
+dotnet_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI) -lkdefx
dotnet_la_LIBADD = -lkdefx
dotnet_la_SOURCES = dotnet.cpp
diff --git a/styles/dotnet/dotnet.cpp b/styles/dotnet/dotnet.cpp
index 934e45a..df40c1a 100644
--- a/styles/dotnet/dotnet.cpp
+++ b/styles/dotnet/dotnet.cpp
@@ -53,7 +53,7 @@
/* This code registers the style with TQStyleFactory, which makes it possible
* for any code that uses TQStyle to find out about it. */
// -- Style Plugin Interface -------------------------
-class dotNETstylePlugin : public QStylePlugin
+class dotNETstylePlugin : public TQStylePlugin
{
public:
dotNETstylePlugin() {}
@@ -84,8 +84,8 @@ dotNETstyle::dotNETstyle() : KStyle( AllowMenuTransparency ), kickerMode(false)
winstyle = TQStyleFactory::create("B3");
}
- if (qApp->inherits("KApplication")) {
- connect( qApp, TQT_SIGNAL( kdisplayPaletteChanged() ), TQT_SLOT( paletteChanged() ));
+ if (tqApp->inherits("KApplication")) {
+ connect( tqApp, TQT_SIGNAL( kdisplayPaletteChanged() ), TQT_SLOT( paletteChanged() ));
}
TQSettings settings;
@@ -111,7 +111,7 @@ bool dotNETstyle::inheritsKHTML(const TQWidget* w) const
void dotNETstyle::polish(TQWidget* widget)
{
- if (!qstrcmp(qApp->argv()[0], "kicker") || widget->inherits("Kicker"))
+ if (!qstrcmp(tqApp->argv()[0], "kicker") || widget->inherits("Kicker"))
kickerMode = true;
if (widget->isTopLevel())
@@ -190,12 +190,12 @@ void dotNETstyle::renderButton(TQPainter *p,
if (pseudo3D) {
if (roundedCorners) {
- const QCOORD iCorners[] = { x, y + h - 2, x, y + 1, x + 1, y, x + w - 2, y, x + w - 1, y + 1, x + w - 1, y + h - 2, x + w - 2, y + h - 1, x + 1, y + h - 1 };
+ const TQCOORD iCorners[] = { x, y + h - 2, x, y + 1, x + 1, y, x + w - 2, y, x + w - 1, y + 1, x + w - 1, y + h - 2, x + w - 2, y + h - 1, x + 1, y + h - 1 };
p->fillRect(x+1, y+1, w-2, h-2, g.button());
p->setPen(g.button().dark());
p->drawLineSegments(TQPointArray(8, iCorners));
if (corners) {
- const QCOORD cPixels[] = { x, y, x + w - 1, y, x + w - 1, y + h - 1, x, y + h - 1 };
+ const TQCOORD cPixels[] = { x, y, x + w - 1, y, x + w - 1, y + h - 1, x, y + h - 1 };
p->setPen(g.button());
p->drawPoints(TQPointArray(4, cPixels));
}
@@ -205,13 +205,13 @@ void dotNETstyle::renderButton(TQPainter *p,
p->drawRect(r);
}
- const QCOORD oCorners[] = { x + 1, y + h - 2, x + 1, y + 1, x + w - 2, y + 1, x + w - 2, y + h - 2 };
+ const TQCOORD oCorners[] = { x + 1, y + h - 2, x + 1, y + 1, x + w - 2, y + 1, x + w - 2, y + h - 2 };
const TQPointArray outline(4, oCorners);
p->setPen(g.button().dark(115));
p->setBrush(TQBrush::NoBrush);
p->drawConvexPolygon(outline);
p->setPen(g.button().light());
- p->drawPolyline(outline, 0, 3);
+ p->tqdrawPolyline(outline, 0, 3);
} else {
p->setPen(g.button().dark());
p->setBrush(g.button());
@@ -289,7 +289,7 @@ void dotNETstyle::renderSlider(TQPainter *p,
}
/* This function does the rendering for most of the panels in dotNET.
- * The QCOORD stuff is used to provide the slightly-rounded corners.
+ * The TQCOORD stuff is used to provide the slightly-rounded corners.
* Changing this function will have pretty widespread effects. Also a good
* place to start if you're looking to make your own style.
*/
@@ -306,8 +306,8 @@ void dotNETstyle::renderPanel(TQPainter *p,
p->save();
if (pseudo3D) {
- const QCOORD oCorners[] = { x, y2, x, y, x2, y, x2, y2 };
- const QCOORD iCorners[] = { x+1, y2-1, x+1, y+1, x2-1, y+1, x2-1, y2-1 };
+ const TQCOORD oCorners[] = { x, y2, x, y, x2, y, x2, y2 };
+ const TQCOORD iCorners[] = { x+1, y2-1, x+1, y+1, x2-1, y+1, x2-1, y2-1 };
p->setPen(g.background().dark());
p->drawConvexPolygon(TQPointArray(4, oCorners));
@@ -331,17 +331,17 @@ void dotNETstyle::renderPanel(TQPainter *p,
}
} else {
if (sunken) {
- const QCOORD corners[] = { x2, y, x2, y2, x, y2, x, y };
+ const TQCOORD corners[] = { x2, y, x2, y2, x, y2, x, y };
p->setPen(g.background().dark());
p->drawConvexPolygon(TQPointArray(4, corners));
p->setPen(g.background().light());
- p->drawPolyline(TQPointArray(4, corners), 0, 3);
+ p->tqdrawPolyline(TQPointArray(4, corners), 0, 3);
} else {
- const QCOORD corners[] = { x, y2, x, y, x2, y, x2, y2 };
+ const TQCOORD corners[] = { x, y2, x, y, x2, y, x2, y2 };
p->setPen(g.background().dark());
p->drawPolygon(TQPointArray(4, corners));
p->setPen(g.background().light());
- p->drawPolyline(TQPointArray(4, corners), 0, 3);
+ p->tqdrawPolyline(TQPointArray(4, corners), 0, 3);
}
}
@@ -349,17 +349,17 @@ void dotNETstyle::renderPanel(TQPainter *p,
// Stolen wholesale from Keramik. I don't like it, but oh well.
if (!thick) {
if (sunken) {
- const QCOORD corners[] = { x2, y, x2, y2, x, y2, x, y };
+ const TQCOORD corners[] = { x2, y, x2, y2, x, y2, x, y };
p->setPen(g.background().dark());
p->drawConvexPolygon(TQPointArray(4, corners));
p->setPen(g.background().light());
- p->drawPolyline(TQPointArray(4, corners), 0, 3);
+ p->tqdrawPolyline(TQPointArray(4, corners), 0, 3);
} else {
- const QCOORD corners[] = { x, y2, x, y, x2, y, x2, y2 };
+ const TQCOORD corners[] = { x, y2, x, y, x2, y, x2, y2 };
p->setPen(g.background().dark());
p->drawPolygon(TQPointArray(4, corners));
p->setPen(g.background().light());
- p->drawPolyline(TQPointArray(4, corners), 0, 3);
+ p->tqdrawPolyline(TQPointArray(4, corners), 0, 3);
}
}
}
@@ -383,7 +383,7 @@ void dotNETstyle::drawKStylePrimitive(KStylePrimitive kpe,
const TQSlider* slider = (const TQSlider*)widget;
int x, y, w, h;
r.rect(&x, &y, &w, &h);
- bool horizontal = slider->orientation() == Horizontal;
+ bool horizontal = slider->orientation() ==Qt::Horizontal;
int gcenter = (horizontal ? h : w) / 2;
if (horizontal) {
@@ -416,7 +416,7 @@ void dotNETstyle::drawKStylePrimitive(KStylePrimitive kpe,
// This function draws primitive elements as well as their masks.
-void dotNETstyle::drawPrimitive(PrimitiveElement pe,
+void dotNETstyle::tqdrawPrimitive(TQ_PrimitiveElement pe,
TQPainter *p,
const TQRect &r,
const TQColorGroup &cg,
@@ -493,16 +493,16 @@ void dotNETstyle::drawPrimitive(PrimitiveElement pe,
// SCROLLBAR BUTTONS
// -----------------
case PE_ScrollBarSubLine: {
- drawPrimitive(PE_ButtonBevel, p, r, cg, flags);
+ tqdrawPrimitive(PE_ButtonBevel, p, r, cg, flags);
p->setPen(down ? cg.highlightedText() : cg.foreground());
- drawPrimitive((horiz ? PE_ArrowLeft : PE_ArrowUp), p, r, cg, flags);
+ tqdrawPrimitive((horiz ? PE_ArrowLeft : PE_ArrowUp), p, r, cg, flags);
break;
}
case PE_ScrollBarAddLine: {
- drawPrimitive(PE_ButtonBevel, p, r, cg, flags);
+ tqdrawPrimitive(PE_ButtonBevel, p, r, cg, flags);
p->setPen(down ? cg.highlightedText() : cg.foreground());
- drawPrimitive((horiz ? PE_ArrowRight : PE_ArrowDown), p, r, cg, flags);
+ tqdrawPrimitive((horiz ? PE_ArrowRight : PE_ArrowDown), p, r, cg, flags);
break;
}
@@ -517,7 +517,7 @@ void dotNETstyle::drawPrimitive(PrimitiveElement pe,
p->drawLine(x + 1, y + 1, x + 1, h - 2);
if (pseudo3D && roundedCorners) {
- const QCOORD corners[] = { x, y, x, y2, x2, y, x2, y2 };
+ const TQCOORD corners[] = { x, y, x, y2, x2, y, x2, y2 };
p->setPen(cg.background());
p->drawPoints(TQPointArray(4, corners));
}
@@ -541,8 +541,8 @@ void dotNETstyle::drawPrimitive(PrimitiveElement pe,
// RADIOBUTTONS
// ------------
case PE_ExclusiveIndicator: {
- const QCOORD outline[] = { 0, 7, 0, 5, 1, 4, 1, 3, 2, 2, 3, 1, 4, 1, 5, 0, 7, 0, 8, 1, 9, 1, 10, 2, 11, 3, 11, 4, 12, 5, 12, 7, 11, 8, 11, 9, 10, 10, 9, 11, 8, 11, 7, 12, 5, 12, 4, 11, 3, 11, 2, 10, 1, 9, 1, 8 };
- const QCOORD indark[] = { 1, 7, 1, 6, 1, 5, 2, 4, 2, 3, 3, 2, 4, 2, 5, 1, 6, 1, 7, 1 };
+ const TQCOORD outline[] = { 0, 7, 0, 5, 1, 4, 1, 3, 2, 2, 3, 1, 4, 1, 5, 0, 7, 0, 8, 1, 9, 1, 10, 2, 11, 3, 11, 4, 12, 5, 12, 7, 11, 8, 11, 9, 10, 10, 9, 11, 8, 11, 7, 12, 5, 12, 4, 11, 3, 11, 2, 10, 1, 9, 1, 8 };
+ const TQCOORD indark[] = { 1, 7, 1, 6, 1, 5, 2, 4, 2, 3, 3, 2, 4, 2, 5, 1, 6, 1, 7, 1 };
p->fillRect(r, cg.background());
p->setPen(cg.background().dark());
@@ -554,7 +554,7 @@ void dotNETstyle::drawPrimitive(PrimitiveElement pe,
}
case PE_ExclusiveIndicatorMask: {
- const QCOORD outline[] = { 0, 7, 0, 5, 1, 4, 1, 3, 2, 2, 3, 1, 4, 1, 5, 0, 7, 0, 8, 1, 9, 1, 10, 2, 11, 3, 11, 4, 12, 5, 12, 7, 11, 8, 11, 9, 10, 10, 9, 11, 8, 11, 7, 12, 5, 12, 4, 11, 3, 11, 2, 10, 1, 9, 1, 8 };
+ const TQCOORD outline[] = { 0, 7, 0, 5, 1, 4, 1, 3, 2, 2, 3, 1, 4, 1, 5, 0, 7, 0, 8, 1, 9, 1, 10, 2, 11, 3, 11, 4, 12, 5, 12, 7, 11, 8, 11, 9, 10, 10, 9, 11, 8, 11, 7, 12, 5, 12, 4, 11, 3, 11, 2, 10, 1, 9, 1, 8 };
p->fillRect(r, color0);
p->setPen(color1);
p->setBrush(color1);
@@ -591,7 +591,7 @@ void dotNETstyle::drawPrimitive(PrimitiveElement pe,
p->drawRect(r);
if (pseudo3D && roundedCorners) {
- const QCOORD corners[] = { x, y, x, y2, x2, y, x2, y2 };
+ const TQCOORD corners[] = { x, y, x, y2, x2, y, x2, y2 };
p->setPen(cg.background());
p->drawPoints(TQPointArray(4, corners));
}
@@ -669,11 +669,11 @@ void dotNETstyle::drawPrimitive(PrimitiveElement pe,
case PE_CheckMark: {
int x = r.center().x() - 3, y = r.center().y() - 3;
- const QCOORD check[] = { x, y + 2, x, y + 4, x + 2, y + 6, x + 6, y + 2, x + 6, y, x + 2, y + 4 };
+ const TQCOORD check[] = { x, y + 2, x, y + 4, x + 2, y + 6, x + 6, y + 2, x + 6, y, x + 2, y + 4 };
const TQPointArray a(6, check);
p->setPen(flags & Style_Down ? cg.highlight() : p->pen());
- p->setBrush(flags & Style_Down ? cg.highlight() : p->pen().color());
+ p->setBrush(flags & Style_Down ? cg.highlight() : TQColor(p->pen().color()));
p->drawPolygon(a);
break;
@@ -719,27 +719,27 @@ void dotNETstyle::drawPrimitive(PrimitiveElement pe,
p->save();
if (flags & Style_Down) {
- p->translate(pixelMetric(PM_ButtonShiftHorizontal),
- pixelMetric(PM_ButtonShiftVertical));
+ p->translate(tqpixelMetric(PM_ButtonShiftHorizontal),
+ tqpixelMetric(PM_ButtonShiftVertical));
}
if (flags & Style_Enabled) {
a.translate((r.x() + r.width()/2), (r.y() + r.height()/2));
- if (p->pen() == TQPen::NoPen) {
+ if (p->pen() == Qt::NoPen) {
p->setPen(cg.buttonText());
}
p->drawLineSegments(a, 0, 3);
p->drawPoint(a[6]);
} else {
a.translate((r.x() + r.width()/2)+1, (r.y() + r.height()/2)+1);
- if (p->pen() == TQPen::NoPen) {
+ if (p->pen() == Qt::NoPen) {
p->setPen(cg.highlightedText());
}
p->drawLineSegments(a, 0, 3);
p->drawPoint(a[6]);
a.translate(-1,-1);
- if (p->pen() == TQPen::NoPen) {
+ if (p->pen() == Qt::NoPen) {
p->setPen(cg.mid());
}
p->drawLineSegments(a, 0, 3);
@@ -751,13 +751,13 @@ void dotNETstyle::drawPrimitive(PrimitiveElement pe,
}
default: {
- return KStyle::drawPrimitive(pe, p, r, cg, flags, opt);
+ return KStyle::tqdrawPrimitive(pe, p, r, cg, flags, opt);
}
}
}
-void dotNETstyle::drawControl(ControlElement element,
+void dotNETstyle::tqdrawControl(TQ_ControlElement element,
TQPainter *p,
const TQWidget *widget,
const TQRect &r,
@@ -769,10 +769,10 @@ void dotNETstyle::drawControl(ControlElement element,
// CHECKBOXES
// ----------
case CE_CheckBox: {
- drawPrimitive(PE_Indicator, p, r, cg, flags);
+ tqdrawPrimitive(PE_Indicator, p, r, cg, flags);
if (flags & Style_On || flags & Style_Down) {
p->setPen(cg.foreground());
- drawPrimitive(PE_CheckMark, p, r, cg, flags);
+ tqdrawPrimitive(PE_CheckMark, p, r, cg, flags);
}
break;
}
@@ -818,16 +818,16 @@ void dotNETstyle::drawControl(ControlElement element,
if (pseudo3D) {
TQPointArray corners;
if (TQApplication::reverseLayout()) {
- const QCOORD c[] = { x, h, x, y, x + w, y, x + w, h };
+ const TQCOORD c[] = { x, h, x, y, x + w, y, x + w, h };
corners = TQPointArray(4, c);
} else {
- const QCOORD c[] = { x, h, x, y, w, y, w, h };
+ const TQCOORD c[] = { x, h, x, y, w, y, w, h };
corners = TQPointArray(4, c);
}
p->setPen(cg.highlight().dark(120));
p->drawConvexPolygon(corners);
p->setPen(cg.highlight().light(120));
- p->drawPolyline(corners, 0, 3);
+ p->tqdrawPolyline(corners, 0, 3);
if (roundedCorners) {
p->setPen(cg.background().dark());
p->drawPoints(corners);
@@ -840,10 +840,10 @@ void dotNETstyle::drawControl(ControlElement element,
// RADIOBUTTONS
// ------------
case CE_RadioButton: {
- drawPrimitive(PE_ExclusiveIndicator, p, r, cg, flags);
+ tqdrawPrimitive(PE_ExclusiveIndicator, p, r, cg, flags);
if (flags & Style_On || flags & Style_Down) {
- QCOORD center[] = { 4, 5, 4, 7, 5, 8, 7, 8, 8, 7, 8, 5, 7, 4, 5, 4 };
+ TQCOORD center[] = { 4, 5, 4, 7, 5, 8, 7, 8, 8, 7, 8, 5, 7, 4, 5, 4 };
TQPointArray c(8, center);
p->setPen(flags & Style_Down ? cg.highlight() : cg.text());
p->setBrush(flags & Style_Down ? cg.highlight() : cg.text());
@@ -857,7 +857,7 @@ void dotNETstyle::drawControl(ControlElement element,
case CE_TabBarTab: {
const TQTabBar *tb = (const TQTabBar *) widget;
bool cornerWidget = false;
- TQTabBar::Shape tbs = tb->shape();
+ TQTabBar::Shape tbs = tb->tqshape();
bool selected = flags & Style_Selected;
int x, x2, y, y2, w, h;
r.rect(&x, &y, &w, &h);
@@ -865,7 +865,7 @@ void dotNETstyle::drawControl(ControlElement element,
if (tb->parent()->inherits(TQTABWIDGET_OBJECT_NAME_STRING)) {
const TQTabWidget *tw = (const TQTabWidget *)tb->parent();
- TQWidget *cw = tw->cornerWidget(Qt::TopLeft);
+ TQWidget *cw = tw->cornerWidget(TQt::TopLeft);
if (cw) {
cornerWidget = true;
}
@@ -877,28 +877,28 @@ void dotNETstyle::drawControl(ControlElement element,
if (pseudo3D) {
p->setPen(cg.background().dark());
if (selected) {
- const QCOORD oCorners[] = { x, y2, x, y, x2, y, x2, y2 };
- p->drawPolyline(TQPointArray(4, oCorners));
+ const TQCOORD oCorners[] = { x, y2, x, y, x2, y, x2, y2 };
+ p->tqdrawPolyline(TQPointArray(4, oCorners));
if (roundedCorners) {
p->setPen(cg.background());
p->drawPoints(TQPointArray(4, oCorners), 1, 2);
}
- p->setPen(cg.background().dark(115));
+ p->setPen(TQColor(cg.background().dark(115)));
/* Right inner border */
p->drawLine(x + w - 2, y + 1, x + w - 2, y + h - 2);
- p->setPen(cg.background().light());
+ p->setPen(TQColor(cg.background().light()));
/* Top inner border */
p->drawLine(x + 1, y + 1, x + w - 2, y + 1);
/* Left inner border */
p->drawLine(x + 1, y + 1, x + 1, y + h - 1);
} else {
TQRect r2(x+1, y+3, w-2, h-5);
- p->fillRect(r2, cg.mid().light(105));
+ p->fillRect(r2, TQColor(cg.mid().light(105)));
- const QCOORD oCorners[] = { x, y2, x, y + 2, x2, y + 2, x2, y2 };
- p->drawPolyline(TQPointArray(4, oCorners));
+ const TQCOORD oCorners[] = { x, y2, x, y + 2, x2, y + 2, x2, y2 };
+ p->tqdrawPolyline(TQPointArray(4, oCorners));
p->setPen(cg.background());
@@ -951,8 +951,8 @@ void dotNETstyle::drawControl(ControlElement element,
if (pseudo3D) {
p->setPen(cg.background().dark());
if (selected) {
- const QCOORD oCorners[] = { x, y + 1, x, y2, x2, y2, x2, y + 1 };
- p->drawPolyline(TQPointArray(4, oCorners));
+ const TQCOORD oCorners[] = { x, y + 1, x, y2, x2, y2, x2, y + 1 };
+ p->tqdrawPolyline(TQPointArray(4, oCorners));
p->setPen(cg.background().dark(115));
p->drawLine(x + 1, y + h - 2, x + w - 2, y + h - 2);
@@ -963,11 +963,11 @@ void dotNETstyle::drawControl(ControlElement element,
p->drawLine(x + 1, y, x + 1, y + h - 2);
} else {
y2 -= 2;
- const QCOORD oCorners[] = { x, y, x, y2, x2, y2, x2, y };
+ const TQCOORD oCorners[] = { x, y, x, y2, x2, y2, x2, y };
TQRect r2(x + 1, y + 2, w - 2, h - 5);
p->fillRect(r2, cg.mid().light(105));
- p->drawPolyline(TQPointArray(4, oCorners));
+ p->tqdrawPolyline(TQPointArray(4, oCorners));
p->setPen(cg.mid().dark(115));
/* Inner right border */
@@ -1019,7 +1019,7 @@ void dotNETstyle::drawControl(ControlElement element,
}
default:
- winstyle->drawControl(element, p, widget, r, cg, flags, opt);
+ winstyle->tqdrawControl(element, p, widget, r, cg, flags, opt);
}
break;
@@ -1036,17 +1036,17 @@ void dotNETstyle::drawControl(ControlElement element,
p->drawText(r.x()+1, r.y()+1, r.width(), r.height(), text_flags, opt.tab()->text());
}
- p->setPen(flags & Style_Enabled ? cg.foreground() : cg.mid().dark());
+ p->setPen(flags & Style_Enabled ? TQColor(cg.foreground()) : TQColor(cg.mid().dark()));
if (!flags & Style_Selected) {
- p->translate(pixelMetric(PM_ButtonShiftHorizontal),
- pixelMetric(PM_ButtonShiftVertical));
+ p->translate(tqpixelMetric(PM_ButtonShiftHorizontal),
+ tqpixelMetric(PM_ButtonShiftVertical));
}
p->drawText(r, text_flags, opt.tab()->text());
if (flags & Style_HasFocus)
- drawPrimitive(PE_FocusRect, p, r, cg);
+ tqdrawPrimitive(PE_FocusRect, p, r, cg);
p->restore();
break;
@@ -1057,14 +1057,14 @@ void dotNETstyle::drawControl(ControlElement element,
TQRect br = r;
bool btnDefault = button->isDefault();
- static int di = pixelMetric(PM_ButtonDefaultIndicator);
+ static int di = tqpixelMetric(PM_ButtonDefaultIndicator);
br.addCoords(di, di, -di, -di);
if (btnDefault) {
- drawPrimitive(PE_ButtonDefault, p, r, cg, flags);
+ tqdrawPrimitive(PE_ButtonDefault, p, r, cg, flags);
}
- drawPrimitive(PE_ButtonBevel, p, br, cg, flags);
+ tqdrawPrimitive(PE_ButtonBevel, p, br, cg, flags);
break;
}
@@ -1076,8 +1076,8 @@ void dotNETstyle::drawControl(ControlElement element,
TQRect ur(r);
if (flags & Style_Down) {
- p->translate(pixelMetric(PM_ButtonShiftHorizontal),
- pixelMetric(PM_ButtonShiftVertical));
+ p->translate(tqpixelMetric(PM_ButtonShiftHorizontal),
+ tqpixelMetric(PM_ButtonShiftVertical));
}
if (!pb->text().isEmpty() && (flags & Style_ButtonDefault)) {
@@ -1120,13 +1120,13 @@ void dotNETstyle::drawControl(ControlElement element,
}
if (!pb->text().isEmpty()) {
- p->setPen(enabled ? cg.foreground() : pb->palette().disabled().buttonText());
+ p->setPen(enabled ? cg.foreground() : pb->tqpalette().disabled().buttonText());
p->drawText(ur, text_flags, pb->text());
}
if ( flags & Style_HasFocus )
- drawPrimitive( PE_FocusRect, p,
- visualRect( subRect( SR_PushButtonFocusRect, widget ), widget ),
+ tqdrawPrimitive( PE_FocusRect, p,
+ tqvisualRect( subRect( SR_PushButtonFocusRect, widget ), widget ),
cg, flags );
break;
@@ -1149,7 +1149,7 @@ void dotNETstyle::drawControl(ControlElement element,
p->setPen(down ? cg.highlight().light() : cg.highlight().dark());
p->drawRect(r);
if (pseudo3D && roundedCorners && !down) {
- const QCOORD corners[] = { x, y2, x, y, x2, y, x2, y2 };
+ const TQCOORD corners[] = { x, y2, x, y, x2, y, x2, y2 };
p->setPen(cg.background());
p->drawPoints(TQPointArray(4, corners));
}
@@ -1194,7 +1194,7 @@ void dotNETstyle::drawControl(ControlElement element,
static const int rightBorder = 20;
const int tab = opt.tabWidth();
- int checkcol = QMAX(opt.maxIconWidth(), 26);
+ int checkcol = TQMAX(opt.maxIconWidth(), 26);
int x, x2, y, y2, w, h;
r.rect(&x, &y, &w, &h);
r.coords(&x, &y, &x2, &y2);
@@ -1233,12 +1233,12 @@ void dotNETstyle::drawControl(ControlElement element,
p->fillRect(x + 2, y + 2, w - 4, h - 4, cg.highlight());
p->setPen(cg.highlight().dark());
if (pseudo3D && roundedCorners) {
- const QCOORD segments[] = { x+2, y+1, x2-2, y+1, x2-1, y+2, x2-1, y2-2, x2-2, y2-1, x+2, y2-1, x+1, y2-2, x+1, y+2 };
- const QCOORD icorners[] = { x+2, y+2, x2-2, y+2, x2-2,y2-2, x+2, y2-2 };
+ const TQCOORD segments[] = { x+2, y+1, x2-2, y+1, x2-1, y+2, x2-1, y2-2, x2-2, y2-1, x+2, y2-1, x+1, y2-2, x+1, y+2 };
+ const TQCOORD icorners[] = { x+2, y+2, x2-2, y+2, x2-2,y2-2, x+2, y2-2 };
p->drawLineSegments(TQPointArray(8, segments));
p->drawPoints(TQPointArray(4, icorners));
} else {
- const QCOORD corners[] = { x+1, y2-1, x+1, y+1, x2-1, y+1, x2-1, y2-1 };
+ const TQCOORD corners[] = { x+1, y2-1, x+1, y+1, x2-1, y+1, x2-1, y2-1 };
p->drawConvexPolygon(TQPointArray(4, corners));
}
p->setPen(cg.highlightedText());
@@ -1257,7 +1257,7 @@ void dotNETstyle::drawControl(ControlElement element,
pmr.moveCenter(cr.center());
if (TQApplication::reverseLayout())
- pmr = visualRect( pmr, r );
+ pmr = tqvisualRect( pmr, r );
p->setPen(cg.highlightedText());
p->drawPixmap(pmr.topLeft(), pixmap);
@@ -1295,7 +1295,7 @@ void dotNETstyle::drawControl(ControlElement element,
TQRect rr = TQRect(xp, y+m, tab, h-(2*m));
if (TQApplication::reverseLayout())
- rr = visualRect(rr, r);
+ rr = tqvisualRect(rr, r);
if (useTextShadows) {
TQPen op = p->pen();
@@ -1310,7 +1310,7 @@ void dotNETstyle::drawControl(ControlElement element,
TQRect rr = TQRect(xpos, y+m, w-xm-tab+1, h-(2*m));
if (TQApplication::reverseLayout()) {
- rr = visualRect(rr, r);
+ rr = tqvisualRect(rr, r);
text_flags |= AlignRight;
}
@@ -1325,17 +1325,17 @@ void dotNETstyle::drawControl(ControlElement element,
} else if (mi->pixmap()) {
TQPixmap *pixmap = mi->pixmap();
if (pixmap->depth() == 1) {
- p->setBackgroundMode(OpaqueMode);
+ p->setBackgroundMode(Qt::OpaqueMode);
}
p->drawPixmap(xpos, y, *pixmap);
if (pixmap->depth() == 1) {
- p->setBackgroundMode(TransparentMode);
+ p->setBackgroundMode(Qt::TransparentMode);
}
}
}
if (mi->popup()) {
- int dim = pixelMetric(PM_MenuButtonIndicator);
+ int dim = tqpixelMetric(PM_MenuButtonIndicator);
xpos = x+w - arrowHMargin - 2*itemFrame - dim;
@@ -1347,8 +1347,8 @@ void dotNETstyle::drawControl(ControlElement element,
TQRect rr = TQRect(xpos, y + h/2 - dim/2, dim, dim);
if (TQApplication::reverseLayout())
- rr = visualRect( rr, r );
- drawPrimitive((TQApplication::reverseLayout() ? PE_ArrowLeft : PE_ArrowRight), p, rr, cg, Style_Enabled);
+ rr = tqvisualRect( rr, r );
+ tqdrawPrimitive((TQApplication::reverseLayout() ? PE_ArrowLeft : PE_ArrowRight), p, rr, cg, Style_Enabled);
}
if (checkable) {
@@ -1364,9 +1364,9 @@ void dotNETstyle::drawControl(ControlElement element,
TQRect rr = TQRect( xp + 6, y + 6, 16, h - 6 );
if (TQApplication::reverseLayout())
- rr = visualRect( rr, r );
+ rr = tqvisualRect( rr, r );
- drawPrimitive(PE_CheckMark, p, rr, cg, cflags);
+ tqdrawPrimitive(PE_CheckMark, p, rr, cg, cflags);
}
}
@@ -1380,11 +1380,11 @@ void dotNETstyle::drawControl(ControlElement element,
p->fillRect(r, cg.button());
break;
default:
- winstyle->drawControl(element, p, widget, r, cg, flags, opt);
+ winstyle->tqdrawControl(element, p, widget, r, cg, flags, opt);
}
}
-void dotNETstyle::drawControlMask(ControlElement element,
+void dotNETstyle::tqdrawControlMask(TQ_ControlElement element,
TQPainter *p,
const TQWidget *w,
const TQRect &r,
@@ -1395,7 +1395,7 @@ void dotNETstyle::drawControlMask(ControlElement element,
if (pseudo3D && roundedCorners) {
int x1, y1, x2, y2;
r.coords (&x1, &y1, &x2, &y2);
- QCOORD corners[] = { x1, y1, x2, y1, x1, y2, x2, y2 };
+ TQCOORD corners[] = { x1, y1, x2, y1, x1, y2, x2, y2 };
p->fillRect (r, color1);
p->setPen (color0);
p->drawPoints (TQPointArray (4, corners));
@@ -1407,12 +1407,12 @@ void dotNETstyle::drawControlMask(ControlElement element,
}
default: {
- KStyle::drawControlMask (element, p, w, r, opt);
+ KStyle::tqdrawControlMask (element, p, w, r, opt);
}
}
}
-void dotNETstyle::drawComplexControlMask(ComplexControl c,
+void dotNETstyle::tqdrawComplexControlMask(ComplexControl c,
TQPainter *p,
const TQWidget *w,
const TQRect &r,
@@ -1423,7 +1423,7 @@ void dotNETstyle::drawComplexControlMask(ComplexControl c,
if (pseudo3D && roundedCorners) {
int x1, y1, x2, y2;
r.coords (&x1, &y1, &x2, &y2);
- QCOORD corners[] = { x1, y1, x2, y1, x1, y2, x2, y2 };
+ TQCOORD corners[] = { x1, y1, x2, y1, x1, y2, x2, y2 };
p->fillRect (r, color1);
p->setPen (color0);
p->drawPoints (TQPointArray (4, corners));
@@ -1434,12 +1434,12 @@ void dotNETstyle::drawComplexControlMask(ComplexControl c,
break;
}
default: {
- KStyle::drawComplexControlMask (c, p, w, r, o);
+ KStyle::tqdrawComplexControlMask (c, p, w, r, o);
}
}
}
-void dotNETstyle::drawComplexControl(ComplexControl control,
+void dotNETstyle::tqdrawComplexControl(ComplexControl control,
TQPainter *p,
const TQWidget *widget,
const TQRect &r,
@@ -1489,13 +1489,13 @@ void dotNETstyle::drawComplexControl(ComplexControl control,
}
TQRect hr = (pseudo3D ? TQRect(w - handle_offset - 1, y, handle_width + 2, h) : TQRect(w - handle_offset - 1, y + 1, handle_width + 2, h - 1));
- if (TQApplication::reverseLayout()) { hr = visualRect(hr, r); }
+ if (TQApplication::reverseLayout()) { hr = tqvisualRect(hr, r); }
p->drawRect(hr);
p->setBrush(NoBrush);
TQRect rr = (pseudo3D ? TQRect(x + 1, y + 1, w - 2, h - 2) : TQRect(x + 1, y + 1, w - 1, h - 1));
- if (TQApplication::reverseLayout()) { rr = visualRect( rr, r ); }
+ if (TQApplication::reverseLayout()) { rr = tqvisualRect( rr, r ); }
if (flags & Style_HasFocus || cg.highlight() == cg.midlight() ||
(cb->listBox() && cb->listBox()->isVisible())) {
@@ -1516,10 +1516,10 @@ void dotNETstyle::drawComplexControl(ComplexControl control,
ca.setPoint(1, hr.bottomRight());
ca.setPoint(2, hr.bottomLeft());
p->setPen(test.dark(120));
- p->drawPolyline(ca);
+ p->tqdrawPolyline(ca);
p->setPen(test.light(120));
ca.setPoint(1, hr.topLeft());
- p->drawPolyline(ca);
+ p->tqdrawPolyline(ca);
p->restore();
}
@@ -1544,7 +1544,7 @@ void dotNETstyle::drawComplexControl(ComplexControl control,
TQRect pmr(0, 0, 7, 4);
pmr.moveCenter(cr.center());
if (TQApplication::reverseLayout()) {
- pmr = visualRect( pmr, r );
+ pmr = tqvisualRect( pmr, r );
}
p->drawPixmap(pmr.topLeft(), downArrow);
@@ -1574,7 +1574,7 @@ void dotNETstyle::drawComplexControl(ComplexControl control,
if (controls & SC_ToolButton) {
// If we're pressed, on, or raised...
if (bflags & (Style_Down | Style_On | Style_Raised)) {
- drawPrimitive(PE_ButtonTool, p, button, cg, bflags, opt);
+ tqdrawPrimitive(PE_ButtonTool, p, button, cg, bflags, opt);
} else if (tb->parentWidget() &&
tb->parentWidget()->backgroundPixmap() &&
!tb->parentWidget()->backgroundPixmap()->isNull()) {
@@ -1586,15 +1586,15 @@ void dotNETstyle::drawComplexControl(ComplexControl control,
// Draw a toolbutton menu indicator if required
if (controls & SC_ToolButtonMenu) {
if (mflags & (Style_Down | Style_On | Style_Raised)) {
- drawPrimitive(PE_ButtonDropDown, p, menuarea, cg, mflags, opt);
+ tqdrawPrimitive(PE_ButtonDropDown, p, menuarea, cg, mflags, opt);
}
- drawPrimitive(PE_ArrowDown, p, menuarea, cg, mflags, opt);
+ tqdrawPrimitive(PE_ArrowDown, p, menuarea, cg, mflags, opt);
}
if (tb->hasFocus() && !tb->focusProxy()) {
TQRect fr = tb->rect();
fr.addCoords(2, 2, -2, -2);
- drawPrimitive(PE_FocusRect, p, fr, cg);
+ tqdrawPrimitive(PE_FocusRect, p, fr, cg);
}
break;
@@ -1605,10 +1605,10 @@ void dotNETstyle::drawComplexControl(ComplexControl control,
case CC_SpinWidget: {
const TQSpinWidget *sw = (const TQSpinWidget *) widget;
SFlags flags;
- PrimitiveElement pe;
+ TQ_PrimitiveElement pe;
TQRect swf = querySubControlMetrics(control, sw, SC_SpinWidgetFrame);
- swf = visualRect( swf, sw );
+ swf = tqvisualRect( swf, sw );
if (controls & SC_SpinWidgetFrame) {
// Don't draw the WindowsStyle thick frame.
@@ -1629,22 +1629,22 @@ void dotNETstyle::drawComplexControl(ComplexControl control,
pe = PE_SpinWidgetUp;
TQRect re = sw->upRect();
- TQColorGroup ucg = sw->isUpEnabled() ? cg : sw->palette().disabled();
+ TQColorGroup ucg = sw->isUpEnabled() ? cg : sw->tqpalette().disabled();
p->fillRect(re.x() + 1, re.y() + 1, re.width() - 2, re.height() - 1, flags & Style_Raised ? ucg.background() : ucg.highlight());
if (pseudo3D) {
- const QCOORD corners[] = { re.x(), re.bottom(), re.x(), re.y() + 1, re.x() + 1, re.y(), re.right() - 1, re.y(), re.right(), re.y() + 1, re.right(), re.bottom() };
- p->setPen(flags & Style_Raised ? ucg.background().dark() : ucg.highlight());
+ const TQCOORD corners[] = { re.x(), re.bottom(), re.x(), re.y() + 1, re.x() + 1, re.y(), re.right() - 1, re.y(), re.right(), re.y() + 1, re.right(), re.bottom() };
+ p->setPen(flags & Style_Raised ? TQColor(ucg.background().dark()) : ucg.highlight());
p->drawLineSegments(TQPointArray(6, corners));
- p->setPen(flags & Style_Raised ? ucg.background().light() : ucg.highlight());
+ p->setPen(flags & Style_Raised ? TQColor(ucg.background().light()) : ucg.highlight());
p->drawLine(re.x() + 1, re.y() + 1, re.x() + 1, re.bottom());
p->drawLine(re.x() + 1, re.y() + 1, re.right()-1, re.y() + 1);
- p->setPen(flags & Style_Raised ? ucg.background().dark(115) : ucg.highlight());
+ p->setPen(flags & Style_Raised ? TQColor(ucg.background().dark(115)) : ucg.highlight());
p->drawLine(re.right()-1, re.y() + 2, re.right()-1, re.bottom());
} else {
}
re.setX(re.x() + 1);
p->setPen(flags & Style_Raised ? ucg.foreground() : ucg.highlightedText());
- drawPrimitive(pe, p, re, ucg, flags);
+ tqdrawPrimitive(pe, p, re, ucg, flags);
}
if (controls & SC_SpinWidgetDown) {
@@ -1661,10 +1661,10 @@ void dotNETstyle::drawComplexControl(ComplexControl control,
pe = PE_SpinWidgetDown;
TQRect re = sw->downRect();
- TQColorGroup dcg = sw->isDownEnabled() ? cg : sw->palette().disabled();
+ TQColorGroup dcg = sw->isDownEnabled() ? cg : sw->tqpalette().disabled();
p->fillRect(re.x() + 1, re.y(), re.width() - 2, re.height() - 1, flags & Style_Raised ? dcg.background() : dcg.highlight());
if (pseudo3D) {
- const QCOORD corners[] = {
+ const TQCOORD corners[] = {
re.x(), re.top(),
re.x(), re.bottom(),
re.x() + 1, re.y() + re.height(),
@@ -1672,25 +1672,25 @@ void dotNETstyle::drawComplexControl(ComplexControl control,
re.right(), re.bottom(),
re.right(), re.y()
};
- p->setPen(flags & Style_Raised ? dcg.background().dark() : dcg.highlight());
+ p->setPen(flags & Style_Raised ? TQColor(dcg.background().dark()) : dcg.highlight());
p->drawLineSegments(TQPointArray(6, corners));
- p->setPen(flags & Style_Raised ? dcg.background().light() : dcg.highlight());
+ p->setPen(flags & Style_Raised ? TQColor(dcg.background().light()) : dcg.highlight());
p->drawLine(re.x() + 1, re.y(), re.x() + 1, re.bottom());
- p->setPen(flags & Style_Raised ? dcg.background().dark(115) : dcg.highlight());
+ p->setPen(flags & Style_Raised ? TQColor(dcg.background().dark(115)) : dcg.highlight());
p->drawLine(re.x() + 2, re.bottom(), re.right()-1, re.bottom());
p->drawLine(re.right()-1, re.y(), re.right()-1, re.bottom());
} else {
}
p->setPen(flags & Style_Raised ? dcg.foreground() : dcg.highlightedText());
re.setX(re.x() + 1);
- drawPrimitive(pe, p, re, dcg, flags);
+ tqdrawPrimitive(pe, p, re, dcg, flags);
}
break;
}
default:
- KStyle::drawComplexControl(control, p, widget,
+ KStyle::tqdrawComplexControl(control, p, widget,
r, cg, flags, controls,
active, opt);
break;
@@ -1708,7 +1708,7 @@ TQRect dotNETstyle::subRect(SubRect r, const TQWidget *widget) const
case SR_PushButtonFocusRect: {
TQRect rect = widget->rect();
- int margin = pixelMetric(PM_ButtonDefaultIndicator, widget) + pixelMetric(PM_DefaultFrameWidth, widget) + 2;
+ int margin = tqpixelMetric(PM_ButtonDefaultIndicator, widget) + tqpixelMetric(PM_DefaultFrameWidth, widget) + 2;
rect.addCoords(margin, margin, -margin, -margin);
return rect;
@@ -1749,10 +1749,10 @@ TQRect dotNETstyle::querySubControlMetrics(ComplexControl control,
}
case CC_SpinWidget: {
- int fw = pixelMetric(PM_SpinBoxFrameWidth, widget);
+ int fw = tqpixelMetric(PM_SpinBoxFrameWidth, widget);
TQSize bs;
- bs.setHeight(QMAX(8, widget->height()/2));
- bs.setWidth(QMIN(bs.height() * 8 / 5, widget->width() / 4));
+ bs.setHeight(TQMAX(8, widget->height()/2));
+ bs.setWidth(TQMIN(bs.height() * 8 / 5, widget->width() / 4));
int y = fw;
int x, lx, rx;
@@ -1787,15 +1787,15 @@ TQRect dotNETstyle::querySubControlMetrics(ComplexControl control,
return KStyle::querySubControlMetrics(control, widget, subcontrol, opt);
}
-int dotNETstyle::pixelMetric(PixelMetric m, const TQWidget *widget) const
+int dotNETstyle::tqpixelMetric(PixelMetric m, const TQWidget *widget) const
{
switch(m) {
// TABS
// ----
case PM_TabBarTabVSpace: {
const TQTabBar * tb = (const TQTabBar *) widget;
- if (tb->shape() == TQTabBar::RoundedAbove ||
- tb->shape() == TQTabBar::RoundedBelow)
+ if (tb->tqshape() == TQTabBar::RoundedAbove ||
+ tb->tqshape() == TQTabBar::RoundedBelow)
return 12;
else
return 0;
@@ -1803,8 +1803,8 @@ int dotNETstyle::pixelMetric(PixelMetric m, const TQWidget *widget) const
case PM_TabBarTabOverlap: {
const TQTabBar* tb = (const TQTabBar*)widget;
- if (tb->shape() != TQTabBar::RoundedAbove &&
- tb->shape() != TQTabBar::RoundedBelow)
+ if (tb->tqshape() != TQTabBar::RoundedAbove &&
+ tb->tqshape() != TQTabBar::RoundedBelow)
return 3; // Leave standard size alone
else
return 1; // Change size for our tabs only
@@ -1878,12 +1878,12 @@ int dotNETstyle::pixelMetric(PixelMetric m, const TQWidget *widget) const
}
default:
- return KStyle::pixelMetric(m, widget);
+ return KStyle::tqpixelMetric(m, widget);
}
}
-TQSize dotNETstyle::sizeFromContents(ContentsType t,
+TQSize dotNETstyle::tqsizeFromContents(ContentsType t,
const TQWidget *widget,
const TQSize &s,
const TQStyleOption &opt) const
@@ -1901,8 +1901,8 @@ TQSize dotNETstyle::sizeFromContents(ContentsType t,
bool checkable = popup->isCheckable();
if (mi->custom()) {
- w = mi->custom()->sizeHint().width();
- h = mi->custom()->sizeHint().height();
+ w = mi->custom()->tqsizeHint().width();
+ h = mi->custom()->tqsizeHint().height();
} else if (mi->widget()) {
// don't change the size in this case.
} else if (mi->isSeparator()) {
@@ -1910,13 +1910,13 @@ TQSize dotNETstyle::sizeFromContents(ContentsType t,
h = 1;
} else {
if (mi->pixmap()) {
- h = QMAX(h, mi->pixmap()->height() + 8);
+ h = TQMAX(h, mi->pixmap()->height() + 8);
}
- h = QMAX(h, widget->fontMetrics().height() + 10);
+ h = TQMAX(h, widget->fontMetrics().height() + 10);
if (mi->iconSet()) {
- h = QMAX(h, mi->iconSet()->pixmap(TQIconSet::Small, TQIconSet::Normal).height() + 8);
+ h = TQMAX(h, mi->iconSet()->pixmap(TQIconSet::Small, TQIconSet::Normal).height() + 8);
}
}
@@ -1945,10 +1945,10 @@ TQSize dotNETstyle::sizeFromContents(ContentsType t,
const TQPushButton* button = (const TQPushButton*) widget;
int w = s.width();
int h = s.height();
- int bm = pixelMetric( PM_ButtonMargin, widget );
- int fw = pixelMetric( PM_DefaultFrameWidth, widget ) * 2;
+ int bm = tqpixelMetric( PM_ButtonMargin, widget );
+ int fw = tqpixelMetric( PM_DefaultFrameWidth, widget ) * 2;
- //We use bold font sometimes, so that make take more space than Qt allocated.
+ //We use bold font sometimes, so that make take more space than TQt allocated.
TQFontMetrics origFM = button->fontMetrics();
TQFontMetrics boldFM = TQFontMetrics(TQFont(button->font().family(), button->font().pointSize(), 75));
int origTextWidth = origFM.size(ShowPrefix, button->text()).width();
@@ -1968,7 +1968,7 @@ TQSize dotNETstyle::sizeFromContents(ContentsType t,
// Compensate for default indicator. Doing it for all widgets lets us
// workaround changes in auto-default behavior in KDialogBase in 3.3
- int di = pixelMetric( PM_ButtonDefaultIndicator );
+ int di = tqpixelMetric( PM_ButtonDefaultIndicator );
w += di * 2;
h += di * 2;
@@ -1979,15 +1979,15 @@ TQSize dotNETstyle::sizeFromContents(ContentsType t,
case CT_ComboBox: {
int arrow = 21;
- return TQSize(s.width() + arrow, QMAX(s.height() + 4, 16));
+ return TQSize(s.width() + arrow, TQMAX(s.height() + 4, 16));
}
default:
- return KStyle::sizeFromContents (t, widget, s, opt);
+ return KStyle::tqsizeFromContents (t, widget, s, opt);
}
- return KStyle::sizeFromContents (t, widget, s, opt);
-// return winstyle->sizeFromContents(t, widget, s, opt);
+ return KStyle::tqsizeFromContents (t, widget, s, opt);
+// return winstyle->tqsizeFromContents(t, widget, s, opt);
}
void dotNETstyle::paletteChanged()
@@ -2011,7 +2011,7 @@ void dotNETstyle::paletteChanged()
void dotNETstyle::updatePalette( TQComboBox *combo )
{
- TQPalette pal = TQApplication::palette();
+ TQPalette pal = TQApplication::tqpalette();
pal.setColor(TQColorGroup::Dark,
pal.active().color(TQColorGroup::Base));
pal.setColor(TQColorGroup::Midlight,
@@ -2021,7 +2021,7 @@ void dotNETstyle::updatePalette( TQComboBox *combo )
void dotNETstyle::updatePalette( TQToolBar *bar )
{
- TQPalette pal = TQApplication::palette();
+ TQPalette pal = TQApplication::tqpalette();
pal.setColor(TQColorGroup::Button,
pal.active().color(TQColorGroup::Background));
bar->setPalette(pal);
@@ -2029,7 +2029,7 @@ void dotNETstyle::updatePalette( TQToolBar *bar )
void dotNETstyle::updatePalette( TQMenuBar *bar )
{
- TQPalette pal = TQApplication::palette();
+ TQPalette pal = TQApplication::tqpalette();
pal.setColor(TQColorGroup::Button,
pal.active().color(TQColorGroup::Background));
bar->setPalette(pal);
@@ -2046,7 +2046,7 @@ bool dotNETstyle::eventFilter(TQObject *obj, TQEvent *ev)
if (ev->type() == TQEvent::Enter) {
TQWidget *btn = (TQWidget *)obj;
if (btn->isEnabled()) {
- TQPalette pal = btn->palette();
+ TQPalette pal = btn->tqpalette();
pal.setColor(TQColorGroup::Dark,
pal.active().color(TQColorGroup::Highlight).dark());
pal.setColor(TQColorGroup::Midlight,
@@ -2055,7 +2055,7 @@ bool dotNETstyle::eventFilter(TQObject *obj, TQEvent *ev)
}
} else if (ev->type() == TQEvent::Leave) {
TQWidget *btn = (TQWidget *)obj;
- TQPalette pal = btn->palette();
+ TQPalette pal = btn->tqpalette();
pal.setColor(TQColorGroup::Dark,
pal.active().color(TQColorGroup::Base));
pal.setColor(TQColorGroup::Midlight,
@@ -2064,7 +2064,7 @@ bool dotNETstyle::eventFilter(TQObject *obj, TQEvent *ev)
}
} else if (obj->inherits(TQBUTTON_OBJECT_NAME_STRING)) {
TQWidget *btn = (TQWidget *)obj;
- TQPalette pal = btn->palette();
+ TQPalette pal = btn->tqpalette();
pal.setColor(TQColorGroup::Button,
pal.active().color(TQColorGroup::Background));
btn->setPalette(pal);
diff --git a/styles/dotnet/dotnet.h b/styles/dotnet/dotnet.h
index 8225da2..f2dbcf8 100644
--- a/styles/dotnet/dotnet.h
+++ b/styles/dotnet/dotnet.h
@@ -30,11 +30,12 @@
#define l_arrow 0,-3, 0,3,-1,-2,-1,2,-2,-1,-2,1,-3,0
#define r_arrow -2,-3,-2,3,-1,-2, -1,2,0,-1,0,1,1,0
-#define QCOORDARRLEN(x) sizeof(x)/(sizeof(QCOORD)*2)
+#define TQCOORDARRLEN(x) sizeof(x)/(sizeof(TQCOORD)*2)
class dotNETstyle : public KStyle
{
Q_OBJECT
+ TQ_OBJECT
public:
dotNETstyle();
@@ -54,14 +55,14 @@ public:
SFlags flags = Style_Default,
const TQStyleOption& = TQStyleOption::Default ) const;
- void drawPrimitive( PrimitiveElement pe,
+ void tqdrawPrimitive( TQ_PrimitiveElement pe,
TQPainter *p,
const TQRect &r,
const TQColorGroup &cg,
SFlags flags = Style_Default,
const TQStyleOption &opt = TQStyleOption::Default ) const;
- void drawControl( ControlElement element,
+ void tqdrawControl( TQ_ControlElement element,
TQPainter *p,
const TQWidget *widget,
const TQRect &r,
@@ -69,9 +70,9 @@ public:
SFlags flags = Style_Default,
const TQStyleOption& = TQStyleOption::Default ) const;
- void drawControlMask( ControlElement, TQPainter *, const TQWidget *, const TQRect &, const TQStyleOption &) const;
+ void tqdrawControlMask( TQ_ControlElement, TQPainter *, const TQWidget *, const TQRect &, const TQStyleOption &) const;
- void drawComplexControl( ComplexControl control,
+ void tqdrawComplexControl( ComplexControl control,
TQPainter *p,
const TQWidget *widget,
const TQRect &r,
@@ -81,7 +82,7 @@ public:
SCFlags active = SC_None,
const TQStyleOption& = TQStyleOption::Default ) const;
- int pixelMetric( PixelMetric m,
+ int tqpixelMetric( PixelMetric m,
const TQWidget *widget = 0 ) const;
TQRect subRect( SubRect r,
@@ -92,13 +93,13 @@ public:
SubControl subcontrol,
const TQStyleOption &opt = TQStyleOption::Default ) const;
- void drawComplexControlMask(TQStyle::ComplexControl c,
+ void tqdrawComplexControlMask(TQStyle::ComplexControl c,
TQPainter *p,
const TQWidget *w,
const TQRect &r,
const TQStyleOption &o=TQStyleOption::Default) const;
- TQSize sizeFromContents(TQStyle::ContentsType t,
+ TQSize tqsizeFromContents(TQStyle::ContentsType t,
const TQWidget *w,
const TQSize &s,
const TQStyleOption &o) const;
diff --git a/styles/phase/Makefile.am b/styles/phase/Makefile.am
index 47d1557..ae98c9e 100644
--- a/styles/phase/Makefile.am
+++ b/styles/phase/Makefile.am
@@ -15,7 +15,7 @@ noinst_HEADERS = phasestyle.h bitmaps.h
kde_style_LTLIBRARIES = phasestyle.la
phasestyle_la_SOURCES = phasestyle.cpp
-phasestyle_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
+phasestyle_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI) -lkdefx
phasestyle_la_LIBADD = -lkdefx -lkdecore
phasestyle_la_METASOURCES = AUTO
diff --git a/styles/phase/config/Makefile.am b/styles/phase/config/Makefile.am
index 725d15a..1c09e30 100644
--- a/styles/phase/config/Makefile.am
+++ b/styles/phase/config/Makefile.am
@@ -3,7 +3,7 @@ INCLUDES = $(all_includes)
noinst_HEADERS = phasestyleconfig.h
kde_module_LTLIBRARIES = kstyle_phase_config.la
-kstyle_phase_config_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
+kstyle_phase_config_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module $(LIB_QT) $(LIB_KDECORE) $(LIB_KDEUI) -lkdefx
kstyle_phase_config_la_LIBADD = $(LIB_KDEUI)
kstyle_phase_config_la_SOURCES = phasestyleconfig.cpp styledialog.ui
kstyle_phase_config_la_METASOURCES = AUTO
diff --git a/styles/phase/config/phasestyleconfig.cpp b/styles/phase/config/phasestyleconfig.cpp
index 4f7e200..f6e3422 100644
--- a/styles/phase/config/phasestyleconfig.cpp
+++ b/styles/phase/config/phasestyleconfig.cpp
@@ -104,7 +104,7 @@ void PhaseStyleConfig::defaults()
extern "C"
{
KDE_EXPORT TQObject* allocate_kstyle_config(TQWidget* parent) {
- return(new PhaseStyleConfig(parent));
+ return(TQT_TQOBJECT(new PhaseStyleConfig(parent)));
}
}
diff --git a/styles/phase/config/phasestyleconfig.h b/styles/phase/config/phasestyleconfig.h
index f77c5a3..63b3ef1 100644
--- a/styles/phase/config/phasestyleconfig.h
+++ b/styles/phase/config/phasestyleconfig.h
@@ -34,6 +34,7 @@ class KConfig;
class PhaseStyleConfig : public StyleDialog
{
Q_OBJECT
+ TQ_OBJECT
public:
PhaseStyleConfig(TQWidget* parent);
~PhaseStyleConfig();
diff --git a/styles/phase/config/styledialog.ui b/styles/phase/config/styledialog.ui
index 2015003..484de58 100644
--- a/styles/phase/config/styledialog.ui
+++ b/styles/phase/config/styledialog.ui
@@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
<class>StyleDialog</class>
-<widget class="QWidget">
+<widget class="TQWidget">
<property name="name">
<cstring>StyleDialog</cstring>
</property>
@@ -19,7 +19,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QGroupBox">
+ <widget class="TQGroupBox">
<property name="name">
<cstring>stylebox</cstring>
</property>
@@ -36,7 +36,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QCheckBox">
+ <widget class="TQCheckBox">
<property name="name">
<cstring>gradients</cstring>
</property>
@@ -47,7 +47,7 @@
<string>This option will draw buttons and several other widgets using a gradient texture</string>
</property>
</widget>
- <widget class="QCheckBox">
+ <widget class="TQCheckBox">
<property name="name">
<cstring>highlights</cstring>
</property>
diff --git a/styles/phase/phasestyle.cpp b/styles/phase/phasestyle.cpp
index 49fc4e6..dc9a75f 100644
--- a/styles/phase/phasestyle.cpp
+++ b/styles/phase/phasestyle.cpp
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////////////////////////
// phasestyle.cpp
// -------------------
-// Qt/KDE widget style
+// TQt/KDE widget style
// -------------------
// Copyright (c) 2004 David Johnson
// Please see the header file for copyright and license information.
@@ -14,10 +14,10 @@
// overlap to share part of their border.
//
// Menu and toolbars are painted with the background color by default. This
-// differs from the Qt default of giving them PaletteButton backgrounds.
+// differs from the TQt default of giving them PaletteButton backgrounds.
// Menubars have normal gradients, toolbars have reverse.
//
-// Some toolbars are not part of a QMainWindows, such as in a KDE file dialog.
+// Some toolbars are not part of a TQMainWindows, such as in a KDE file dialog.
// In these cases we treat the toolbar as "floating" and paint it flat.
//
//////////////////////////////////////////////////////////////////////////////
@@ -54,8 +54,8 @@
#include "phasestyle.h"
#include "bitmaps.h"
-static const char* QSPLITTERHANDLE = "QSplitterHandle";
-static const char* QTOOLBAREXTENSION = "QToolBarExtensionWidget";
+static const char* TQSPLITTERHANDLE = TQSPLITTERHANDLE_OBJECT_NAME_STRING;
+static const char* TQTOOLBAREXTENSION = "TQToolBarExtensionWidget";
static const char* KTOOLBARWIDGET = "kde toolbar widget";
// some convenient constants
@@ -89,7 +89,7 @@ PhaseStyle::PhaseStyle()
if (gradients_) { // don't bother setting if already false
gradients_ =
settings.readBoolEntry("/phasestyle/Settings/gradients", true);
- contrast = 100 + settings.readNumEntry("/Qt/KDE/contrast", 5);
+ contrast = 100 + settings.readNumEntry("/TQt/KDE/contrast", 5);
}
highlights_ =
settings.readBoolEntry("/phasestyle/Settings/highlights", true);
@@ -148,26 +148,26 @@ void PhaseStyle::polish(TQApplication* app)
void PhaseStyle::polish(TQWidget *widget)
{
- if (::qt_cast<TQMenuBar*>(widget) ||
- ::qt_cast<TQPopupMenu*>(widget)) {
+ if (::tqqt_cast<TQMenuBar*>(widget) ||
+ ::tqqt_cast<TQPopupMenu*>(widget)) {
// anti-flicker optimization
widget->setBackgroundMode(NoBackground);
- } else if (::qt_cast<TQFrame*>(widget) ||
- widget->inherits(QTOOLBAREXTENSION) ||
+ } else if (::tqqt_cast<TQFrame*>(widget) ||
+ widget->inherits(TQTOOLBAREXTENSION) ||
(!qstrcmp(widget->name(), KTOOLBARWIDGET))) {
// needs special handling on paint events
widget->installEventFilter(this);
} else if (highlights_ &&
- (::qt_cast<TQPushButton*>(widget) ||
- ::qt_cast<TQComboBox*>(widget) ||
- ::qt_cast<TQSpinWidget*>(widget) ||
- ::qt_cast<TQCheckBox*>(widget) ||
- ::qt_cast<TQRadioButton*>(widget) ||
- ::qt_cast<TQSlider*>(widget) ||
- widget->inherits(QSPLITTERHANDLE))) {
+ (::tqqt_cast<TQPushButton*>(widget) ||
+ ::tqqt_cast<TQComboBox*>(widget) ||
+ ::tqqt_cast<TQSpinWidget*>(widget) ||
+ ::tqqt_cast<TQCheckBox*>(widget) ||
+ ::tqqt_cast<TQRadioButton*>(widget) ||
+ ::tqqt_cast<TQSlider*>(widget) ||
+ widget->inherits(TQSPLITTERHANDLE))) {
// mouseover highlighting
widget->installEventFilter(this);
- } else if (highlights_ && ::qt_cast<TQTabBar*>(widget)) {
+ } else if (highlights_ && ::tqqt_cast<TQTabBar*>(widget)) {
// highlighting needing mouse tracking
widget->setMouseTracking(true);
widget->installEventFilter(this);
@@ -206,23 +206,23 @@ void PhaseStyle::polish(TQPalette &pal)
void PhaseStyle::unPolish(TQWidget *widget)
{
- if (::qt_cast<TQMenuBar*>(widget) ||
- ::qt_cast<TQPopupMenu*>(widget)) {
+ if (::tqqt_cast<TQMenuBar*>(widget) ||
+ ::tqqt_cast<TQPopupMenu*>(widget)) {
widget->setBackgroundMode(PaletteBackground);
- } else if (::qt_cast<TQFrame*>(widget) ||
- widget->inherits(QTOOLBAREXTENSION) ||
+ } else if (::tqqt_cast<TQFrame*>(widget) ||
+ widget->inherits(TQTOOLBAREXTENSION) ||
(!qstrcmp(widget->name(), KTOOLBARWIDGET))) {
widget->removeEventFilter(this);
} else if (highlights_ && // highlighting
- (::qt_cast<TQPushButton*>(widget) ||
- ::qt_cast<TQComboBox*>(widget) ||
- ::qt_cast<TQSpinWidget*>(widget) ||
- ::qt_cast<TQCheckBox*>(widget) ||
- ::qt_cast<TQRadioButton*>(widget) ||
- ::qt_cast<TQSlider*>(widget) ||
- widget->inherits(QSPLITTERHANDLE))) {
+ (::tqqt_cast<TQPushButton*>(widget) ||
+ ::tqqt_cast<TQComboBox*>(widget) ||
+ ::tqqt_cast<TQSpinWidget*>(widget) ||
+ ::tqqt_cast<TQCheckBox*>(widget) ||
+ ::tqqt_cast<TQRadioButton*>(widget) ||
+ ::tqqt_cast<TQSlider*>(widget) ||
+ widget->inherits(TQSPLITTERHANDLE))) {
widget->removeEventFilter(this);
- } else if (highlights_ && ::qt_cast<TQTabBar*>(widget)) {
+ } else if (highlights_ && ::tqqt_cast<TQTabBar*>(widget)) {
widget->setMouseTracking(false);
widget->removeEventFilter(this);
}
@@ -421,14 +421,14 @@ void PhaseStyle::drawPhaseTab(TQPainter *painter,
edge = false;
}
- switch (TQTabBar::Shape(bar->shape())) {
+ switch (TQTabBar::Shape(bar->tqshape())) {
case TQTabBar::RoundedAbove:
case TQTabBar::TriangularAbove: {
// is there a corner widget?
- tabwidget = ::qt_cast<TQTabWidget*>(bar->parent());
+ tabwidget = ::tqqt_cast<TQTabWidget*>(bar->parent());
if (edge && tabwidget
&& tabwidget->cornerWidget(reverse_ ?
- Qt::TopRight : Qt::TopLeft)) {
+ TQt::TopRight : TQt::TopLeft)) {
edge = false;
}
@@ -436,14 +436,14 @@ void PhaseStyle::drawPhaseTab(TQPainter *painter,
y += 2; h -= 2;
}
if (selected) {
- painter->setPen(Qt::NoPen);
+ painter->setPen(TQt::NoPen);
painter->fillRect(x+1, y+1, w-1, h-1,
group.brush(TQColorGroup::Background));
} else {
drawPhaseGradient(painter, TQRect(x+1, y+1, w-1, h-2),
(flags & Style_MouseOver)
? group.background()
- : group.background().dark(contrast),
+ : TQColor(group.background().dark(contrast)),
false, 0, 0, 0, h*2, false);
}
@@ -504,17 +504,17 @@ void PhaseStyle::drawPhaseTab(TQPainter *painter,
case TQTabBar::RoundedBelow:
case TQTabBar::TriangularBelow: {
// is there a corner widget?
- tabwidget = ::qt_cast<TQTabWidget*>(bar->parent());
+ tabwidget = ::tqqt_cast<TQTabWidget*>(bar->parent());
if (edge && tabwidget
&& tabwidget->cornerWidget(reverse_ ?
- Qt::BottomRight : Qt::BottomLeft)) {
+ TQt::BottomRight : TQt::BottomLeft)) {
edge = false;
}
painter->setBrush((selected || (flags & Style_MouseOver))
? group.background()
- : group.background().dark(contrast));
- painter->setPen(Qt::NoPen);
+ : TQColor(group.background().dark(contrast)));
+ painter->setPen(TQt::NoPen);
painter->fillRect(x+1, y+1, w-1, h-1, painter->brush());
// draw tab
@@ -567,11 +567,11 @@ void PhaseStyle::drawPhaseTab(TQPainter *painter,
}
//////////////////////////////////////////////////////////////////////////////
-// drawPrimitive()
+// tqdrawPrimitive()
// ---------------
// Draw the primitive element
-void PhaseStyle::drawPrimitive(PrimitiveElement element,
+void PhaseStyle::tqdrawPrimitive(TQ_PrimitiveElement element,
TQPainter *painter,
const TQRect &rect,
const TQColorGroup &group,
@@ -605,7 +605,7 @@ void PhaseStyle::drawPrimitive(PrimitiveElement element,
case PE_ButtonCommand:
drawPhaseButton(painter, x, y, w, h, group,
mouseover ?
- group.button().light(contrast) :
+ TQColor(group.button().light(contrast)) :
group.button(), depress);
break;
@@ -625,7 +625,7 @@ void PhaseStyle::drawPrimitive(PrimitiveElement element,
widget =dynamic_cast<TQWidget*>(painter->device());
if (header) {
- horiz = (header->orientation() == Horizontal);
+ horiz = (header->orientation() ==Qt::Horizontal);
} else {
horiz = true;
}
@@ -663,9 +663,9 @@ void PhaseStyle::drawPrimitive(PrimitiveElement element,
case PE_HeaderArrow:
if (flags & Style_Up)
- drawPrimitive(PE_ArrowUp, painter, rect, group, Style_Enabled);
+ tqdrawPrimitive(PE_ArrowUp, painter, rect, group, Style_Enabled);
else
- drawPrimitive(PE_ArrowDown, painter, rect, group, Style_Enabled);
+ tqdrawPrimitive(PE_ArrowDown, painter, rect, group, Style_Enabled);
break;
case PE_ScrollBarAddPage:
@@ -688,7 +688,7 @@ void PhaseStyle::drawPrimitive(PrimitiveElement element,
drawPhaseBevel(painter, x, y, w, h,
group, group.button(), down, !horiz, true);
- PrimitiveElement arrow = ((horiz) ?
+ TQ_PrimitiveElement arrow = ((horiz) ?
((element == PE_ScrollBarAddLine) ?
PE_ArrowRight : PE_ArrowLeft) :
((element == PE_ScrollBarAddLine) ?
@@ -703,7 +703,7 @@ void PhaseStyle::drawPrimitive(PrimitiveElement element,
}
}
- drawPrimitive(arrow, painter, TQRect(x,y,h,w), group, flags);
+ tqdrawPrimitive(arrow, painter, TQRect(x,y,h,w), group, flags);
break;
}
@@ -727,29 +727,29 @@ void PhaseStyle::drawPrimitive(PrimitiveElement element,
case PE_Indicator:
drawPhasePanel(painter, x+1, y+1, w-2, h-2, group, true, enabled ?
- &group.brush(TQColorGroup::Base) :
- &group.brush(TQColorGroup::Background));
+ &group.tqbrush(TQColorGroup::Base) :
+ &group.tqbrush(TQColorGroup::Background));
if (on) {
painter->setPen(mouseover
- ? group.highlight().dark(contrast)
+ ? TQColor(group.highlight().dark(contrast))
: group.dark());
painter->drawRect(x+4, y+4, w-8, h-8);
painter->fillRect(x+5, y+5, w-10, h-10,
- group.brush(TQColorGroup::Highlight));
+ group.tqbrush(TQColorGroup::Highlight));
} else if (mouseover) {
- painter->setPen(group.highlight().dark(contrast));
+ painter->setPen(TQColor(group.highlight().dark(contrast)));
painter->drawRect(x+4, y+4, w-8, h-8);
}
break;
case PE_IndicatorMask:
- painter->fillRect(x+1, y+1, w-2, h-2, Qt::color1);
- painter->setPen(Qt::color0);
+ painter->fillRect(x+1, y+1, w-2, h-2, TQt::color1);
+ painter->setPen(TQt::color0);
break;
case PE_ExclusiveIndicator: {
- // note that this requires an even size from pixelMetric
+ // note that this requires an even size from tqpixelMetric
cx = (x + x2) / 2;
cy = (y + y2) / 2;
@@ -761,31 +761,31 @@ void PhaseStyle::drawPrimitive(PrimitiveElement element,
parray.putPoints(0, 8,
x+1,cy+1, x+1,cy, cx,y+1, cx+1,y+1,
x2-1,cy, x2-1,cy+1, cx+1,y2-1, cx,y2-1);
- painter->drawConvexPolygon(parray, 0, 8);
+ painter->tqdrawConvexPolygon(parray, 0, 8);
painter->setPen(group.mid());
parray.putPoints(0, 4, x,cy, cx,y, cx+1,y, x2,cy);
- painter->drawPolyline(parray, 0, 4);
+ painter->tqdrawPolyline(parray, 0, 4);
painter->setPen(group.midlight());
parray.putPoints(0, 4, x2,cy+1, cx+1,y2, cx,y2, x,cy+1);
- painter->drawPolyline(parray, 0, 4);
+ painter->tqdrawPolyline(parray, 0, 4);
if (on) {
painter->setBrush(group.brush(TQColorGroup::Highlight));
painter->setPen(mouseover
- ? group.highlight().dark(contrast)
+ ? TQColor(group.highlight().dark(contrast))
: group.dark());
parray.putPoints(0, 8,
x+4,cy+1, x+4,cy, cx,y+4, cx+1,y+4,
x2-4,cy, x2-4,cy+1, cx+1,y2-4, cx,y2-4);
- painter->drawConvexPolygon(parray, 0, 8);
+ painter->tqdrawConvexPolygon(parray, 0, 8);
} else if (mouseover) {
- painter->setPen(group.highlight().dark(contrast));
+ painter->setPen(TQColor(group.highlight().dark(contrast)));
parray.putPoints(0, 9,
x+4,cy+1, x+4,cy, cx,y+4, cx+1,y+4,
x2-4,cy, x2-4,cy+1, cx+1,y2-4, cx,y2-4,
x+4,cy+1);
- painter->drawPolyline(parray, 0, 9);
+ painter->tqdrawPolyline(parray, 0, 9);
}
break;
}
@@ -793,25 +793,25 @@ void PhaseStyle::drawPrimitive(PrimitiveElement element,
case PE_ExclusiveIndicatorMask:
cx = (x + x2) / 2;
cy = (y + y2) / 2;
- painter->setBrush(Qt::color1);
- painter->setPen(Qt::color1);
+ painter->setBrush(TQt::color1);
+ painter->setPen(TQt::color1);
parray.putPoints(0, 8,
x,cy+1, x,cy, cx,y, cx+1,y,
x2,cy, x2,cy+1, cx+1,y2, cx,y2);
- painter->drawConvexPolygon(parray, 0, 8);
- painter->setPen(Qt::color0);
+ painter->tqdrawConvexPolygon(parray, 0, 8);
+ painter->setPen(TQt::color0);
break;
case PE_DockWindowResizeHandle:
drawPhasePanel(painter, x, y, w, h, group, false,
- &group.brush(TQColorGroup::Background));
+ &group.tqbrush(TQColorGroup::Background));
break;
case PE_Splitter:
cx = x + w/2 - 2; cy = y + h/2 - 2;
painter->fillRect(rect,
(hover_ == painter->device())
- ? group.background().light(contrast)
+ ? TQColor(group.background().light(contrast))
: group.background());
if (!horiz && (w >=20)) {
@@ -888,9 +888,9 @@ void PhaseStyle::drawPrimitive(PrimitiveElement element,
if (widget && widget->parent() &&
widget->parent()->inherits(TQTOOLBAR_OBJECT_NAME_STRING)) {
- TQToolBar *toolbar = ::qt_cast<TQToolBar*>(widget->parent());
+ TQToolBar *toolbar = ::tqqt_cast<TQToolBar*>(widget->parent());
if (toolbar) {
- // toolbar not floating or in a QMainWindow
+ // toolbar not floating or in a TQMainWindow
flat = flatToolbar(toolbar);
}
}
@@ -922,7 +922,7 @@ void PhaseStyle::drawPrimitive(PrimitiveElement element,
}
case PE_SizeGrip: {
- int sw = QMIN(h, w) - 1;
+ int sw = TQMIN(h, w) - 1;
y = y2 - sw;
if (reverse_) {
@@ -999,7 +999,7 @@ void PhaseStyle::drawPrimitive(PrimitiveElement element,
break;
default:
- KStyle::drawPrimitive(element, painter, rect, group, flags, option);
+ KStyle::tqdrawPrimitive(element, painter, rect, group, flags, option);
}
}
@@ -1084,9 +1084,9 @@ void PhaseStyle::drawKStylePrimitive(KStylePrimitive element,
break;
case KPE_SliderGroove: {
- const TQSlider* slider = ::qt_cast<const TQSlider*>(widget);
+ const TQSlider* slider = ::tqqt_cast<const TQSlider*>(widget);
if (slider) {
- if (slider->orientation() == Horizontal) {
+ if (slider->orientation() ==Qt::Horizontal) {
y = cy - 3;
h = 7;
} else {
@@ -1095,17 +1095,17 @@ void PhaseStyle::drawKStylePrimitive(KStylePrimitive element,
}
}
drawPhasePanel(painter, x, y, w, h, group, true,
- &group.brush(TQColorGroup::Mid));
+ &group.tqbrush(TQColorGroup::Mid));
break;
}
case KPE_SliderHandle: {
- const TQSlider* slider = ::qt_cast<const TQSlider*>(widget);
+ const TQSlider* slider = ::tqqt_cast<const TQSlider*>(widget);
if (slider) {
TQColor color = (widget==hover_)
- ? group.button().light(contrast)
+ ? TQColor(group.button().light(contrast))
: group.button();
- if (slider->orientation() == Horizontal) {
+ if (slider->orientation() ==Qt::Horizontal) {
drawPhaseBevel(painter, cx-5, y, 6, h, group, color,
false, false, false);
drawPhaseBevel(painter, cx, y, 6, h, group, color,
@@ -1127,11 +1127,11 @@ void PhaseStyle::drawKStylePrimitive(KStylePrimitive element,
}
//////////////////////////////////////////////////////////////////////////////
-// drawControl()
+// tqdrawControl()
// -------------
// Draw the control
-void PhaseStyle::drawControl(ControlElement element,
+void PhaseStyle::tqdrawControl(TQ_ControlElement element,
TQPainter *painter,
const TQWidget *widget,
const TQRect &rect,
@@ -1153,25 +1153,25 @@ void PhaseStyle::drawControl(ControlElement element,
switch (element) {
case CE_PushButton: {
depress = flags & (Style_Down | Style_On);
- int bd = pixelMetric(PM_ButtonDefaultIndicator, widget) + 1;
+ int bd = tqpixelMetric(PM_ButtonDefaultIndicator, widget) + 1;
if ((flags & Style_ButtonDefault) && !depress) {
drawPhasePanel(painter, x, y, w, h, group, true,
- &group.brush(TQColorGroup::Mid));
+ &group.tqbrush(TQColorGroup::Mid));
drawPhaseBevel(painter, x+bd, y+bd, w-bd*2, h-bd*2, group,
(widget==hover_)
- ? group.button().light(contrast)
+ ? TQColor(group.button().light(contrast))
: group.button(),
false, false, false);
} else {
drawPhaseButton(painter, x, y, w, h, group,
(widget==hover_)
- ? group.button().light(contrast)
+ ? TQColor(group.button().light(contrast))
: group.button(), depress);
}
if (flags & Style_HasFocus) { // draw focus
- drawPrimitive(PE_FocusRect, painter,
+ tqdrawPrimitive(PE_FocusRect, painter,
subRect(SR_PushButtonFocusRect, widget),
group, flags);
}
@@ -1179,9 +1179,9 @@ void PhaseStyle::drawControl(ControlElement element,
}
case CE_PushButtonLabel: {
- const TQPushButton* button = ::qt_cast<const TQPushButton*>(widget);
+ const TQPushButton* button = ::tqqt_cast<const TQPushButton*>(widget);
if (!button) {
- KStyle::drawControl(element, painter, widget, rect, group,
+ KStyle::tqdrawControl(element, painter, widget, rect, group,
flags, option);
return;
}
@@ -1193,8 +1193,8 @@ void PhaseStyle::drawControl(ControlElement element,
}
if (button->isMenuButton()) { // menu indicator
- int dx = pixelMetric(PM_MenuButtonIndicator, widget);
- drawPrimitive(PE_ArrowDown, painter,
+ int dx = tqpixelMetric(PM_MenuButtonIndicator, widget);
+ tqdrawPrimitive(PE_ArrowDown, painter,
TQRect(x+w-dx-2, y+2, dx, h-4),
group, flags, option);
w -= dx;
@@ -1232,41 +1232,41 @@ void PhaseStyle::drawControl(ControlElement element,
for(int n=0; n<2; n++) {
drawItem(painter, TQRect(x+n, y, w, h),
AlignCenter | ShowPrefix,
- button->colorGroup(),
+ button->tqcolorGroup(),
button->isEnabled(),
button->pixmap(),
button->text(), -1,
(button->isEnabled()) ?
- &button->colorGroup().buttonText() :
- &button->colorGroup().mid());
+ &button->tqcolorGroup().buttonText() :
+ &button->tqcolorGroup().mid());
}
} else { // normal button
drawItem(painter, TQRect(x, y, w, h),
AlignCenter | ShowPrefix,
- button->colorGroup(),
+ button->tqcolorGroup(),
button->isEnabled(),
button->pixmap(),
button->text(), -1,
(button->isEnabled()) ?
- &button->colorGroup().buttonText() :
- &button->colorGroup().mid());
+ &button->tqcolorGroup().buttonText() :
+ &button->tqcolorGroup().mid());
}
break;
}
case CE_CheckBoxLabel:
case CE_RadioButtonLabel: {
- const TQButton *b = ::qt_cast<const TQButton*>(widget);
+ const TQButton *b = ::tqqt_cast<const TQButton*>(widget);
if (!b) return;
- int alignment = reverse_ ? AlignRight : AlignLeft;
- drawItem(painter, rect, alignment | AlignVCenter | ShowPrefix,
+ int tqalignment = reverse_ ? AlignRight : AlignLeft;
+ drawItem(painter, rect, tqalignment | AlignVCenter | ShowPrefix,
group, flags & Style_Enabled, b->pixmap(), b->text());
// only draw focus if content (forms on html won't)
if ((flags & Style_HasFocus) && ((!b->text().isNull()) || b->pixmap())) {
- drawPrimitive(PE_FocusRect, painter,
- visualRect(subRect(SR_RadioButtonFocusRect,
+ tqdrawPrimitive(PE_FocusRect, painter,
+ tqvisualRect(subRect(SR_RadioButtonFocusRect,
widget), widget),
group, flags);
}
@@ -1274,9 +1274,9 @@ void PhaseStyle::drawControl(ControlElement element,
}
case CE_DockWindowEmptyArea: {
- const TQToolBar *tb = ::qt_cast<const TQToolBar*>(widget);
+ const TQToolBar *tb = ::tqqt_cast<const TQToolBar*>(widget);
if (tb) {
- // toolbar not floating or in a QMainWindow
+ // toolbar not floating or in a TQMainWindow
if (flatToolbar(tb)) {
if (tb->backgroundMode() == PaletteButton)
// force default button color to background color
@@ -1294,9 +1294,9 @@ void PhaseStyle::drawControl(ControlElement element,
break;
case CE_MenuBarItem: {
- const TQMenuBar *mbar = ::qt_cast<const TQMenuBar*>(widget);
+ const TQMenuBar *mbar = ::tqqt_cast<const TQMenuBar*>(widget);
if (!mbar) {
- KStyle::drawControl(element, painter, widget, rect, group,
+ KStyle::tqdrawControl(element, painter, widget, rect, group,
flags, option);
return;
}
@@ -1306,7 +1306,7 @@ void PhaseStyle::drawControl(ControlElement element,
if ((flags & Style_Active) && (flags & Style_HasFocus)) {
if (flags & Style_Down) {
drawPhasePanel(painter, x, y, w, h, group, true,
- &group.brush(TQColorGroup::Background));
+ &group.tqbrush(TQColorGroup::Background));
} else {
drawPhaseBevel(painter, x, y, w, h,
group, group.background(),
@@ -1325,9 +1325,9 @@ void PhaseStyle::drawControl(ControlElement element,
}
case CE_PopupMenuItem: {
- const TQPopupMenu *popup = ::qt_cast<const TQPopupMenu*>(widget);
+ const TQPopupMenu *popup = ::tqqt_cast<const TQPopupMenu*>(widget);
if (!popup) {
- KStyle::drawControl(element, painter, widget, rect, group,
+ KStyle::tqdrawControl(element, painter, widget, rect, group,
flags, option);
return;
}
@@ -1341,12 +1341,12 @@ void PhaseStyle::drawControl(ControlElement element,
int tabwidth = option.tabWidth();
int checkwidth = option.maxIconWidth();
bool checkable = popup->isCheckable();
- bool etchtext = styleHint(SH_EtchDisabledText);
+ bool etchtext = tqstyleHint(SH_EtchDisabledText);
active = flags & Style_Active;
enabled = mi->isEnabled();
TQRect vrect;
- if (checkable) checkwidth = QMAX(checkwidth, 20);
+ if (checkable) checkwidth = TQMAX(checkwidth, 20);
// draw background
if (active && enabled) {
@@ -1380,7 +1380,7 @@ void PhaseStyle::drawControl(ControlElement element,
pixmap = mi->iconSet()->pixmap(TQIconSet::Small, mode);
TQRect pmrect(0, 0, pixmap.width(), pixmap.height());
- vrect = visualRect(TQRect(x, y, checkwidth, h), rect);
+ vrect = tqvisualRect(TQRect(x, y, checkwidth, h), rect);
pmrect.moveCenter(vrect.center());
painter->drawPixmap(pmrect.topLeft(), pixmap);
}
@@ -1388,7 +1388,7 @@ void PhaseStyle::drawControl(ControlElement element,
// draw check
if (mi->isChecked()) {
int cx = reverse_ ? x+w - checkwidth : x;
- drawPrimitive(PE_CheckMark, painter,
+ tqdrawPrimitive(PE_CheckMark, painter,
TQRect(cx + ITEMFRAME, y + ITEMFRAME,
checkwidth - ITEMFRAME*2, h - ITEMFRAME*2),
group, Style_Default |
@@ -1464,29 +1464,29 @@ void PhaseStyle::drawControl(ControlElement element,
else if (mi->pixmap()) { // pixmap as label
pixmap = *mi->pixmap();
if (pixmap.depth() == 1)
- painter->setBackgroundMode(OpaqueMode);
+ painter->setBackgroundMode(Qt::OpaqueMode);
dx = ((w - pixmap.width()) / 2) + ((w - pixmap.width()) % 2);
painter->drawPixmap(x+dx, y+ITEMFRAME, pixmap);
if (pixmap.depth() == 1)
- painter->setBackgroundMode(TransparentMode);
+ painter->setBackgroundMode(Qt::TransparentMode);
}
}
if (mi->popup()) { // draw submenu arrow
- PrimitiveElement arrow = reverse_ ? PE_ArrowLeft : PE_ArrowRight;
+ TQ_PrimitiveElement arrow = reverse_ ? PE_ArrowLeft : PE_ArrowRight;
int dim = (h-2*ITEMFRAME) / 2;
- vrect = visualRect(TQRect(x + w - ARROWMARGIN - ITEMFRAME - dim,
+ vrect = tqvisualRect(TQRect(x + w - ARROWMARGIN - ITEMFRAME - dim,
y + h / 2 - dim / 2, dim, dim), rect);
- drawPrimitive(arrow, painter, vrect, group,
+ tqdrawPrimitive(arrow, painter, vrect, group,
enabled ? Style_Enabled : Style_Default);
}
break;
}
case CE_TabBarTab: {
- const TQTabBar* tab = ::qt_cast<const TQTabBar*>(widget);
+ const TQTabBar* tab = ::tqqt_cast<const TQTabBar*>(widget);
if (tab) {
if ((widget == hover_) && (option.tab() == hovertab_)) {
flags |= Style_MouseOver;
@@ -1495,7 +1495,7 @@ void PhaseStyle::drawControl(ControlElement element,
drawPhaseTab(painter, x, y, w, h, group, tab, option,
flags);
} else { // not a tabbar
- KStyle::drawControl(element, painter, widget, rect, group,
+ KStyle::tqdrawControl(element, painter, widget, rect, group,
flags, option);
return;
}
@@ -1504,14 +1504,14 @@ void PhaseStyle::drawControl(ControlElement element,
case CE_ProgressBarGroove: {
drawPhasePanel(painter, x, y, w, h, group, true,
- &group.brush(TQColorGroup::Base));
+ &group.tqbrush(TQColorGroup::Base));
break;
}
case CE_ProgressBarContents: {
- const TQProgressBar* pbar = ::qt_cast<const TQProgressBar*>(widget);
+ const TQProgressBar* pbar = ::tqqt_cast<const TQProgressBar*>(widget);
if (!pbar) {
- KStyle::drawControl(element, painter, widget, rect, group,
+ KStyle::tqdrawControl(element, painter, widget, rect, group,
flags, option);
return;
}
@@ -1522,7 +1522,7 @@ void PhaseStyle::drawControl(ControlElement element,
if (!pbar->totalSteps()) {
// busy indicator
- int bar = pixelMetric(PM_ProgressBarChunkWidth, widget) + 2;
+ int bar = tqpixelMetric(PM_ProgressBarChunkWidth, widget) + 2;
int progress = pbar->progress() % ((w-bar) * 2);
if (progress > (w-bar)) progress = 2 * (w-bar) - progress;
painter->drawRect(x+progress+1, y+1, bar-2, h-2);
@@ -1537,11 +1537,10 @@ void PhaseStyle::drawControl(ControlElement element,
break;
}
-#if (QT_VERSION >= 0x030200)
case CE_ToolBoxTab: {
- const TQToolBox *box = ::qt_cast<const TQToolBox*>(widget);
+ const TQToolBox *box = ::tqqt_cast<const TQToolBox*>(widget);
if (!box) {
- KStyle::drawControl(element, painter, widget, rect, group,
+ KStyle::tqdrawControl(element, painter, widget, rect, group,
flags, option);
return;
}
@@ -1557,7 +1556,7 @@ void PhaseStyle::drawControl(ControlElement element,
if (box->currentItem() && (flags & Style_Selected)) {
painter->setPen(group.dark());
painter->setBrush(box->currentItem()->paletteBackgroundColor());
- painter->drawConvexPolygon(parray, 0, 6);
+ painter->tqdrawConvexPolygon(parray, 0, 6);
painter->setBrush(NoBrush);
} else {
painter->setClipRegion(parray, TQPainter::CoordPainter);
@@ -1565,29 +1564,28 @@ void PhaseStyle::drawControl(ControlElement element,
group.background(),
false, 0, 0, 0, h*2, false);
painter->setClipping(false);
- painter->drawPolyline(parray, 0, 4);
+ painter->tqdrawPolyline(parray, 0, 4);
}
parray.putPoints(0, 4, x,y+1, cx,y+1, rx-2,y2-1, x2,y2-1);
painter->setPen(group.midlight());
- painter->drawPolyline(parray, 0, 4);
+ painter->tqdrawPolyline(parray, 0, 4);
break;
}
-#endif
default:
- KStyle::drawControl(element, painter, widget, rect, group,
+ KStyle::tqdrawControl(element, painter, widget, rect, group,
flags, option);
}
}
//////////////////////////////////////////////////////////////////////////////
-// drawControlMask()
+// tqdrawControlMask()
// -----------------
// Draw a bitmask for the element
-void PhaseStyle::drawControlMask(ControlElement element,
+void PhaseStyle::tqdrawControlMask(TQ_ControlElement element,
TQPainter *painter,
const TQWidget *widget,
const TQRect &rect,
@@ -1595,21 +1593,21 @@ void PhaseStyle::drawControlMask(ControlElement element,
{
switch (element) {
case CE_PushButton:
- painter->fillRect(rect, Qt::color1);
- painter->setPen(Qt::color0);
+ painter->fillRect(rect, TQt::color1);
+ painter->setPen(TQt::color0);
break;
default:
- KStyle::drawControlMask(element, painter, widget, rect, option);
+ KStyle::tqdrawControlMask(element, painter, widget, rect, option);
}
}
//////////////////////////////////////////////////////////////////////////////
-// drawComplexControl()
+// tqdrawComplexControl()
// --------------------
// Draw a complex control
-void PhaseStyle::drawComplexControl(ComplexControl control,
+void PhaseStyle::tqdrawComplexControl(TQ_ComplexControl control,
TQPainter *painter,
const TQWidget *widget,
const TQRect &rect,
@@ -1629,9 +1627,9 @@ void PhaseStyle::drawComplexControl(ComplexControl control,
switch (control) {
case CC_ComboBox: {
- const TQComboBox * combo = ::qt_cast<const TQComboBox*>(widget);
+ const TQComboBox * combo = ::tqqt_cast<const TQComboBox*>(widget);
if (!combo) {
- KStyle::drawComplexControl(control, painter, widget, rect, group,
+ KStyle::tqdrawComplexControl(control, painter, widget, rect, group,
flags, controls, active, option);
return;
}
@@ -1639,24 +1637,24 @@ void PhaseStyle::drawComplexControl(ComplexControl control,
sunken = (active == SC_ComboBoxArrow);
drawPhaseButton(painter, x, y, w, h, group,
(widget==hover_)
- ? group.button().light(contrast)
+ ? TQColor(group.button().light(contrast))
: group.button(), sunken);
if (controls & SC_ComboBoxArrow) { // draw arrow box
- subrect = visualRect(querySubControlMetrics(CC_ComboBox, widget,
+ subrect = tqvisualRect(querySubControlMetrics(CC_ComboBox, widget,
SC_ComboBoxArrow), widget);
subrect.rect(&x, &y, &w, &h);
- int slot = QMAX(h/4, 6) + (h % 2);
+ int slot = TQMAX(h/4, 6) + (h % 2);
drawPhasePanel(painter, x+3, y+(h/2)-(slot/2), w-6,
slot, group, true,
- sunken ? &group.brush(TQColorGroup::Midlight)
- : &group.brush(TQColorGroup::Mid));
+ sunken ? &group.tqbrush(TQColorGroup::Midlight)
+ : &group.tqbrush(TQColorGroup::Mid));
}
if (controls & SC_ComboBoxEditField) { // draw edit box
if (combo->editable()) { // editable box
- subrect = visualRect(querySubControlMetrics(CC_ComboBox,
+ subrect = tqvisualRect(querySubControlMetrics(CC_ComboBox,
widget, SC_ComboBoxEditField), widget);
x2 = subrect.right(); y2 = subrect.bottom();
painter->setPen(group.dark());
@@ -1666,9 +1664,9 @@ void PhaseStyle::drawComplexControl(ComplexControl control,
painter->setPen(group.button());
painter->drawPoint(x2+2, y2);
} else if (combo->hasFocus()) { // non editable box
- subrect = visualRect(subRect(SR_ComboBoxFocusRect,
+ subrect = tqvisualRect(subRect(SR_ComboBoxFocusRect,
combo), widget);
- drawPrimitive(PE_FocusRect, painter, subrect, group,
+ tqdrawPrimitive(PE_FocusRect, painter, subrect, group,
Style_FocusAtBorder,
TQStyleOption(group.highlight()));
}
@@ -1680,9 +1678,9 @@ void PhaseStyle::drawComplexControl(ComplexControl control,
case CC_ScrollBar: {
// always a three button scrollbar
- const TQScrollBar *sb = ::qt_cast<const TQScrollBar*>(widget);
+ const TQScrollBar *sb = ::tqqt_cast<const TQScrollBar*>(widget);
if (!sb) {
- KStyle::drawComplexControl(control, painter, widget, rect, group,
+ KStyle::tqdrawComplexControl(control, painter, widget, rect, group,
flags, controls, active, option);
return;
}
@@ -1699,7 +1697,7 @@ void PhaseStyle::drawComplexControl(ComplexControl control,
srect = querySubControlMetrics(control, widget,
SC_ScrollBarAddLine, option);
if (srect.isValid())
- drawPrimitive(PE_ScrollBarAddLine, painter, srect, group,
+ tqdrawPrimitive(PE_ScrollBarAddLine, painter, srect, group,
scrollflags | ((active == SC_ScrollBarAddLine)
? Style_Down : Style_Default));
}
@@ -1710,7 +1708,7 @@ void PhaseStyle::drawComplexControl(ComplexControl control,
srect = querySubControlMetrics(control, widget,
SC_ScrollBarSubLine, option);
if (srect.isValid())
- drawPrimitive(PE_ScrollBarSubLine, painter, srect, group,
+ tqdrawPrimitive(PE_ScrollBarSubLine, painter, srect, group,
scrollflags | ((active == SC_ScrollBarSubLine)
? Style_Down : Style_Default));
// bottom/right subline
@@ -1719,7 +1717,7 @@ void PhaseStyle::drawComplexControl(ComplexControl control,
if (srect.isValid()) {
if (horizontal) srect.moveBy(-srect.width()+1, 0);
else srect.moveBy(0, -srect.height()+1);
- drawPrimitive(PE_ScrollBarSubLine, painter, srect, group,
+ tqdrawPrimitive(PE_ScrollBarSubLine, painter, srect, group,
scrollflags | ((active == SC_ScrollBarSubLine)
? Style_Down : Style_Default));
}
@@ -1732,7 +1730,7 @@ void PhaseStyle::drawComplexControl(ComplexControl control,
if (srect.isValid()) {
if (horizontal) srect.addCoords(1, 0, 1, 0);
else srect.addCoords(0, 1, 0, 1);
- drawPrimitive(PE_ScrollBarAddPage, painter, srect, group,
+ tqdrawPrimitive(PE_ScrollBarAddPage, painter, srect, group,
scrollflags | ((active == SC_ScrollBarAddPage)
? Style_Down : Style_Default));
}
@@ -1743,7 +1741,7 @@ void PhaseStyle::drawComplexControl(ComplexControl control,
srect = querySubControlMetrics(control, widget,
SC_ScrollBarSubPage, option);
if (srect.isValid()) {
- drawPrimitive(PE_ScrollBarSubPage, painter, srect, group,
+ tqdrawPrimitive(PE_ScrollBarSubPage, painter, srect, group,
scrollflags | ((active == SC_ScrollBarSubPage)
? Style_Down : Style_Default));
}
@@ -1762,13 +1760,13 @@ void PhaseStyle::drawComplexControl(ComplexControl control,
if (srect.isValid()) {
if (horizontal) srect.addCoords(0, 0, 1, 0);
else srect.addCoords(0, 0, 0, 1);
- drawPrimitive(PE_ScrollBarSlider, painter, srect, group,
+ tqdrawPrimitive(PE_ScrollBarSlider, painter, srect, group,
scrollflags | ((active == SC_ScrollBarSlider)
? Style_Down : Style_Default));
// focus
if (sb->hasFocus()) {
srect.addCoords(2, 2, -2, -2);
- drawPrimitive(PE_FocusRect, painter, srect, group,
+ tqdrawPrimitive(PE_FocusRect, painter, srect, group,
Style_Default);
}
}
@@ -1777,14 +1775,14 @@ void PhaseStyle::drawComplexControl(ComplexControl control,
}
case CC_SpinWidget: {
- const TQSpinWidget *spin = ::qt_cast<const TQSpinWidget*>(widget);
+ const TQSpinWidget *spin = ::tqqt_cast<const TQSpinWidget*>(widget);
if (!spin) {
- KStyle::drawComplexControl(control, painter, widget, rect, group,
+ KStyle::tqdrawComplexControl(control, painter, widget, rect, group,
flags, controls, active, option);
return;
}
- PrimitiveElement element;
+ TQ_PrimitiveElement element;
// draw frame
if (controls & SC_SpinWidgetFrame) {
@@ -1800,7 +1798,7 @@ void PhaseStyle::drawComplexControl(ComplexControl control,
drawPhaseBevel(painter, subrect.x(), subrect.y(),
subrect.width(), subrect.height(), group,
(widget==hover_)
- ? group.button().light(contrast)
+ ? TQColor(group.button().light(contrast))
: group.button(), false, false, false);
}
@@ -1814,7 +1812,7 @@ void PhaseStyle::drawComplexControl(ComplexControl control,
else
element = PE_SpinWidgetUp;
- drawPrimitive(element, painter, subrect, group, flags
+ tqdrawPrimitive(element, painter, subrect, group, flags
| ((active == SC_SpinWidgetUp)
? Style_On | Style_Sunken : Style_Raised));
}
@@ -1829,7 +1827,7 @@ void PhaseStyle::drawComplexControl(ComplexControl control,
else
element = PE_SpinWidgetDown;
- drawPrimitive(element, painter, subrect, group, flags
+ tqdrawPrimitive(element, painter, subrect, group, flags
| ((active == SC_SpinWidgetDown)
? Style_On | Style_Sunken : Style_Raised));
}
@@ -1837,9 +1835,9 @@ void PhaseStyle::drawComplexControl(ComplexControl control,
}
case CC_ToolButton: {
- const TQToolButton *btn = ::qt_cast<const TQToolButton*>(widget);
+ const TQToolButton *btn = ::tqqt_cast<const TQToolButton*>(widget);
if (!btn) {
- KStyle::drawComplexControl(control, painter, widget, rect, group,
+ KStyle::tqdrawComplexControl(control, painter, widget, rect, group,
flags, controls, active, option);
return;
}
@@ -1853,12 +1851,12 @@ void PhaseStyle::drawComplexControl(ComplexControl control,
// check for TQToolBar parent
if (btn->parent() && btn->parent()->inherits(TQTOOLBAR_OBJECT_NAME_STRING)) {
- toolbar = ::qt_cast<TQToolBar*>(btn->parent());
+ toolbar = ::tqqt_cast<TQToolBar*>(btn->parent());
if (toolbar) {
horiz = (toolbar->orientation() == Qt::Horizontal);
if (normal) { // draw background
if (flatToolbar(toolbar)) {
- // toolbar not floating or in a QMainWindow
+ // toolbar not floating or in a TQMainWindow
painter->fillRect(rect, group.background());
} else {
drawPhaseGradient(painter, rect, group.background(),
@@ -1875,12 +1873,12 @@ void PhaseStyle::drawComplexControl(ComplexControl control,
}
}
}
- // check for QToolBarExtensionWidget parent
+ // check for TQToolBarExtensionWidget parent
else if (btn->parent() &&
- btn->parent()->inherits(QTOOLBAREXTENSION)) {
+ btn->parent()->inherits(TQTOOLBAREXTENSION)) {
TQWidget *extension;
- if ((extension = ::qt_cast<TQWidget*>(btn->parent()))) {
- toolbar = ::qt_cast<TQToolBar*>(extension->parent());
+ if ((extension = ::tqqt_cast<TQWidget*>(btn->parent()))) {
+ toolbar = ::tqqt_cast<TQToolBar*>(extension->parent());
if (toolbar) {
horiz = (toolbar->orientation() == Qt::Horizontal);
if (normal) { // draw background
@@ -1907,7 +1905,7 @@ void PhaseStyle::drawComplexControl(ComplexControl control,
// now draw active buttons
if (down || on) {
drawPhasePanel(painter, x, y, w, h, group, true,
- &group.brush(TQColorGroup::Button));
+ &group.tqbrush(TQColorGroup::Button));
} else if (raised) {
drawPhaseBevel(painter, x, y, w, h, group, group.button(),
false, !horiz, true);
@@ -1917,18 +1915,18 @@ void PhaseStyle::drawComplexControl(ComplexControl control,
}
default:
- KStyle::drawComplexControl(control, painter, widget, rect, group,
+ KStyle::tqdrawComplexControl(control, painter, widget, rect, group,
flags, controls, active, option);
break;
}
}
//////////////////////////////////////////////////////////////////////////////
-// drawComplexControlMask()
+// tqdrawComplexControlMask()
// ------------------------
// Draw a bitmask for the control
-void PhaseStyle::drawComplexControlMask(ComplexControl control,
+void PhaseStyle::tqdrawComplexControlMask(TQ_ComplexControl control,
TQPainter *painter,
const TQWidget *widget,
const TQRect &rect,
@@ -1937,25 +1935,25 @@ void PhaseStyle::drawComplexControlMask(ComplexControl control,
switch (control) {
case CC_ComboBox:
case CC_ToolButton: {
- painter->fillRect(rect, Qt::color1);
- painter->setPen(Qt::color0);
+ painter->fillRect(rect, TQt::color1);
+ painter->setPen(TQt::color0);
break;
}
default:
- KStyle::drawComplexControlMask(control,painter,widget,rect,option);
+ KStyle::tqdrawComplexControlMask(control,painter,widget,rect,option);
}
}
//////////////////////////////////////////////////////////////////////////////
-// pixelMetric()
+// tqpixelMetric()
// -------------
// Get the pixel metric for metric
-int PhaseStyle::pixelMetric(PixelMetric metric, const TQWidget *widget) const
+int PhaseStyle::tqpixelMetric(PixelMetric metric, const TQWidget *widget) const
{
// not using widget's font, so that all metrics are uniform
- int em = QMAX(TQApplication::fontMetrics().strikeOutPos() * 3, 17);
+ int em = TQMAX(TQApplication::fontMetrics().strikeOutPos() * 3, 17);
switch (metric) {
case PM_DefaultFrameWidth:
@@ -1974,8 +1972,8 @@ int PhaseStyle::pixelMetric(PixelMetric metric, const TQWidget *widget) const
return 24;
case PM_TabBarTabVSpace:
- if (const TQTabBar *tb = ::qt_cast<const TQTabBar*>(widget)) {
- if (tb->shape() == TQTabBar::RoundedAbove) {
+ if (const TQTabBar *tb = ::tqqt_cast<const TQTabBar*>(widget)) {
+ if (tb->tqshape() == TQTabBar::RoundedAbove) {
return 10;
} else {
return 6;
@@ -2002,7 +2000,7 @@ int PhaseStyle::pixelMetric(PixelMetric metric, const TQWidget *widget) const
return em;
default:
- return KStyle::pixelMetric(metric, widget);
+ return KStyle::tqpixelMetric(metric, widget);
}
}
@@ -2031,14 +2029,14 @@ TQRect PhaseStyle::subRect(SubRect rect, const TQWidget *widget) const
// ------------------------
// Get metrics for subcontrols of complex controls
-TQRect PhaseStyle::querySubControlMetrics(ComplexControl control,
+TQRect PhaseStyle::querySubControlMetrics(TQ_ComplexControl control,
const TQWidget *widget,
SubControl subcontrol,
const TQStyleOption &option) const
{
TQRect rect;
- const int fw = pixelMetric(PM_DefaultFrameWidth, widget);
+ const int fw = tqpixelMetric(PM_DefaultFrameWidth, widget);
int w = widget->width(), h = widget->height();
int xc;
@@ -2071,7 +2069,7 @@ TQRect PhaseStyle::querySubControlMetrics(ComplexControl control,
}
case CC_ScrollBar: {
- const TQScrollBar *sb = ::qt_cast<const TQScrollBar*>(widget);
+ const TQScrollBar *sb = ::tqqt_cast<const TQScrollBar*>(widget);
if (!sb) break;
bool horizontal = (sb->orientation() == Qt::Horizontal);
@@ -2126,11 +2124,11 @@ TQRect PhaseStyle::querySubControlMetrics(ComplexControl control,
}
//////////////////////////////////////////////////////////////////////////////
-// sizeFromContents()
+// tqsizeFromContents()
// ------------------
// Returns the size of widget based on the contentsize
-TQSize PhaseStyle::sizeFromContents(ContentsType contents,
+TQSize PhaseStyle::tqsizeFromContents(ContentsType contents,
const TQWidget* widget,
const TQSize &contentsize,
const TQStyleOption &option ) const
@@ -2140,13 +2138,13 @@ TQSize PhaseStyle::sizeFromContents(ContentsType contents,
switch (contents) {
case CT_PushButton: {
- const TQPushButton* button = ::qt_cast<const TQPushButton*>(widget);
+ const TQPushButton* button = ::tqqt_cast<const TQPushButton*>(widget);
if (!button) {
- return KStyle::sizeFromContents(contents, widget, contentsize,
+ return KStyle::tqsizeFromContents(contents, widget, contentsize,
option);
}
- int margin = pixelMetric(PM_ButtonMargin, widget)
- + pixelMetric(PM_DefaultFrameWidth, widget) + 4;
+ int margin = tqpixelMetric(PM_ButtonMargin, widget)
+ + tqpixelMetric(PM_DefaultFrameWidth, widget) + 4;
w += margin + 6; // add room for bold font
h += margin;
@@ -2161,16 +2159,16 @@ TQSize PhaseStyle::sizeFromContents(ContentsType contents,
case CT_PopupMenuItem: {
if (!widget || option.isDefault()) return contentsize;
- const TQPopupMenu *popup = ::qt_cast<const TQPopupMenu*>(widget);
+ const TQPopupMenu *popup = ::tqqt_cast<const TQPopupMenu*>(widget);
if (!popup) {
- return KStyle::sizeFromContents(contents, widget, contentsize,
+ return KStyle::tqsizeFromContents(contents, widget, contentsize,
option);
}
TQMenuItem *item = option.menuItem();
if (item->custom()) {
- w = item->custom()->sizeHint().width();
- h = item->custom()->sizeHint().height();
+ w = item->custom()->tqsizeHint().width();
+ h = item->custom()->tqsizeHint().height();
if (!item->custom()->fullSpan())
h += ITEMVMARGIN*2 + ITEMFRAME*2;
} else if (item->widget()) { // a menu item that is a widget
@@ -2180,14 +2178,14 @@ TQSize PhaseStyle::sizeFromContents(ContentsType contents,
w = h = 3;
} else {
if (item->pixmap()) {
- h = QMAX(h, item->pixmap()->height() + ITEMFRAME*2);
+ h = TQMAX(h, item->pixmap()->height() + ITEMFRAME*2);
} else {
- h = QMAX(h, MINICONSIZE + ITEMFRAME*2);
- h = QMAX(h, popup->fontMetrics().height()
+ h = TQMAX(h, MINICONSIZE + ITEMFRAME*2);
+ h = TQMAX(h, popup->fontMetrics().height()
+ ITEMVMARGIN*2 + ITEMFRAME*2);
}
if (item->iconSet())
- h = QMAX(h, item->iconSet()->
+ h = TQMAX(h, item->iconSet()->
pixmap(TQIconSet::Small, TQIconSet::Normal).height()
+ ITEMFRAME*2);
}
@@ -2198,7 +2196,7 @@ TQSize PhaseStyle::sizeFromContents(ContentsType contents,
w += 2 * ARROWMARGIN;
if (option.maxIconWidth() || popup->isCheckable()) {
- w += QMAX(option.maxIconWidth(),
+ w += TQMAX(option.maxIconWidth(),
TQIconSet::iconSize(TQIconSet::Small).width())
+ ITEMHMARGIN*2;
}
@@ -2207,7 +2205,7 @@ TQSize PhaseStyle::sizeFromContents(ContentsType contents,
}
default:
- return KStyle::sizeFromContents(contents, widget, contentsize,
+ return KStyle::tqsizeFromContents(contents, widget, contentsize,
option);
}
}
@@ -2255,87 +2253,87 @@ bool PhaseStyle::eventFilter(TQObject *object, TQEvent *event)
// KDE Toolbar Widget
// patch by Daniel Brownlees <dbrownlees@paradise.net.nz>
if (object->parent() && !qstrcmp(object->name(), KTOOLBARWIDGET)) {
- if (0 == (widget = ::qt_cast<TQWidget*>(object))) return false;
- TQWidget *parent = ::qt_cast<TQWidget*>(object->parent());
+ if (0 == (widget = ::tqqt_cast<TQWidget*>(object))) return false;
+ TQWidget *parent = ::tqqt_cast<TQWidget*>(object->parent());
int px = widget->x(), py = widget->y();
// find the toolbar
while (parent && parent->parent()
- && !::qt_cast<TQToolBar*>(parent)) {
+ && !::tqqt_cast<TQToolBar*>(parent)) {
px += parent->x();
py += parent->y();
- parent = ::qt_cast<TQWidget*>(parent->parent());
+ parent = ::tqqt_cast<TQWidget*>(parent->parent());
}
if (!parent) return false;
- widget->rect().rect(&x, &y, &w, &h);
+ TQT_TQRECT_OBJECT(widget->rect()).rect(&x, &y, &w, &h);
TQRect prect = parent->rect();
- toolbar = ::qt_cast<TQToolBar*>(parent);
+ toolbar = ::tqqt_cast<TQToolBar*>(parent);
horiz = (toolbar) ? (toolbar->orientation() == Qt::Horizontal)
: (prect.height() < prect.width());
TQPainter painter(widget);
if (flatToolbar(toolbar)) {
painter.fillRect(widget->rect(),
- parent->colorGroup().background());
+ parent->tqcolorGroup().background());
} else {
drawPhaseGradient(&painter, widget->rect(),
- parent->colorGroup().background(),
+ parent->tqcolorGroup().background(),
!horiz, px, py,
prect.width(), prect.height(), true);
if (horiz && (h==prect.height()-2)) {
- painter.setPen(parent->colorGroup().mid());
+ painter.setPen(parent->tqcolorGroup().mid());
painter.drawLine(x, h-1, w-1, h-1);
} else if (!horiz && (w==prect.width()-2)) {
- painter.setPen(parent->colorGroup().mid());
+ painter.setPen(parent->tqcolorGroup().mid());
painter.drawLine(w-1, y, w-1, h-1);
}
}
}
- // QToolBarExtensionWidget
+ // TQToolBarExtensionWidget
else if (object && object->isWidgetType() && object->parent() &&
- (toolbar = ::qt_cast<TQToolBar*>(object->parent()))) {
- if (0 == (widget = ::qt_cast<TQWidget*>(object))) return false;
+ (toolbar = ::tqqt_cast<TQToolBar*>(object->parent()))) {
+ if (0 == (widget = ::tqqt_cast<TQWidget*>(object))) return false;
horiz = (toolbar->orientation() == Qt::Horizontal);
TQPainter painter(widget);
- widget->rect().rect(&x, &y, &w, &h);
+ TQT_TQRECT_OBJECT(widget->rect()).rect(&x, &y, &w, &h);
// draw the extension
drawPhaseGradient(&painter, widget->rect(),
- toolbar->colorGroup().background(),
+ toolbar->tqcolorGroup().background(),
!horiz, x, y, w-1, h-1, true);
if (horiz) {
- painter.setPen(toolbar->colorGroup().dark());
+ painter.setPen(toolbar->tqcolorGroup().dark());
painter.drawLine(w-1, 0, w-1, h-1);
- painter.setPen(toolbar->colorGroup().mid());
+ painter.setPen(toolbar->tqcolorGroup().mid());
painter.drawLine(w-2, 0, w-2, h-2);
painter.drawLine(x, h-1, w-2, h-1);
painter.drawLine(x, y, x, h-2);
- painter.setPen(toolbar->colorGroup().midlight());
+ painter.setPen(toolbar->tqcolorGroup().midlight());
painter.drawLine(x+1, y, x+1, h-2);
} else {
- painter.setPen(toolbar->colorGroup().dark());
+ painter.setPen(toolbar->tqcolorGroup().dark());
painter.drawLine(0, h-1, w-1, h-1);
- painter.setPen(toolbar->colorGroup().mid());
+ painter.setPen(toolbar->tqcolorGroup().mid());
painter.drawLine(0, h-2, w-2, h-2);
painter.drawLine(w-1, y, w-1, h-2);
painter.drawLine(x, y, w-2, y);
- painter.setPen(toolbar->colorGroup().midlight());
+ painter.setPen(toolbar->tqcolorGroup().midlight());
painter.drawLine(x, y+1, w-2, y+1);
}
}
// TQFrame lines (do this guy last)
- else if (0 != (frame = ::qt_cast<TQFrame*>(object))) {
- TQFrame::Shape shape = frame->frameShape();
- switch (shape) {
+ else if (0 != (frame = ::tqqt_cast<TQFrame*>(object))) {
+ TQFrame::Shape tqshape = frame->frameShape();
+ switch (tqshape) {
case TQFrame::HLine:
case TQFrame::VLine: {
// NOTE: assuming lines have no content
TQPainter painter(frame);
- frame->rect().rect(&x, &y, &w, &h);
- painter.setPen(frame->colorGroup().dark());
- if (shape == TQFrame::HLine) {
+ TQT_TQRECT_OBJECT(frame->rect()).rect(&x, &y, &w, &h);
+ painter.setPen(frame->tqcolorGroup().dark());
+ if (tqshape == TQFrame::HLine) {
painter.drawLine(0, h/2, w, h/2);
- } else if (shape == TQFrame::VLine) {
+ } else if (tqshape == TQFrame::VLine) {
painter.drawLine(w/2, 0, w/2, h);
}
return true;
@@ -2346,48 +2344,48 @@ bool PhaseStyle::eventFilter(TQObject *object, TQEvent *event)
}
} else if (highlights_) { // "mouseover" events
- if (::qt_cast<TQPushButton*>(object) ||
- ::qt_cast<TQComboBox*>(object) ||
- ::qt_cast<TQSpinWidget*>(object) ||
- ::qt_cast<TQCheckBox*>(object) ||
- ::qt_cast<TQRadioButton*>(object) ||
- ::qt_cast<TQSlider*>(object) ||
- object->inherits(QSPLITTERHANDLE)) {
+ if (::tqqt_cast<TQPushButton*>(object) ||
+ ::tqqt_cast<TQComboBox*>(object) ||
+ ::tqqt_cast<TQSpinWidget*>(object) ||
+ ::tqqt_cast<TQCheckBox*>(object) ||
+ ::tqqt_cast<TQRadioButton*>(object) ||
+ ::tqqt_cast<TQSlider*>(object) ||
+ object->inherits(TQSPLITTERHANDLE)) {
if (event->type() == TQEvent::Enter) {
- if (0 != (widget = ::qt_cast<TQWidget*>(object)) &&
+ if (0 != (widget = ::tqqt_cast<TQWidget*>(object)) &&
widget->isEnabled()) {
hover_ = widget;
- widget->repaint(false);
+ widget->tqrepaint(false);
}
} else if (event->type() == TQEvent::Leave) {
- if (0 != (widget = ::qt_cast<TQWidget*>(object))) {
+ if (0 != (widget = ::tqqt_cast<TQWidget*>(object))) {
hover_ = 0;
- widget->repaint(false);
+ widget->tqrepaint(false);
}
}
- } else if (::qt_cast<TQTabBar*>(object)) { // special case for qtabbar
+ } else if (::tqqt_cast<TQTabBar*>(object)) { // special case for qtabbar
if (event->type() == TQEvent::Enter) {
- if (0 != (widget = ::qt_cast<TQWidget*>(object)) &&
+ if (0 != (widget = ::tqqt_cast<TQWidget*>(object)) &&
widget->isEnabled()) {
hover_ = widget;
hovertab_ = 0;;
- widget->repaint(false);
+ widget->tqrepaint(false);
}
} else if (event->type() == TQEvent::Leave) {
- if (0 != (widget = ::qt_cast<TQWidget*>(object))) {
+ if (0 != (widget = ::tqqt_cast<TQWidget*>(object))) {
hover_ = 0;
hovertab_ = 0;;
- widget->repaint(false);
+ widget->tqrepaint(false);
}
} else if (event->type() == TQEvent::MouseMove) {
TQTabBar *tabbar;
- if (0 != (tabbar = ::qt_cast<TQTabBar*>(object))) {
+ if (0 != (tabbar = ::tqqt_cast<TQTabBar*>(object))) {
TQMouseEvent *me;
if (0 != (me = dynamic_cast<TQMouseEvent*>(event))) {
TQTab *tab = tabbar->selectTab(me->pos());
if (hovertab_ != tab) {
hovertab_ = tab;
- tabbar->repaint(false);
+ tabbar->tqrepaint(false);
}
}
}
@@ -2485,7 +2483,7 @@ KPixmap* GradientSet::gradient(bool horizontal, bool reverse)
// Plugin Stuff //
//////////////////////////////////////////////////////////////////////////////
-class PhaseStylePlugin : public QStylePlugin
+class PhaseStylePlugin : public TQStylePlugin
{
public:
PhaseStylePlugin();
diff --git a/styles/phase/phasestyle.h b/styles/phase/phasestyle.h
index 5c44c74..9d81264 100644
--- a/styles/phase/phasestyle.h
+++ b/styles/phase/phasestyle.h
@@ -1,7 +1,7 @@
//////////////////////////////////////////////////////////////////////////////
// phasestyle.h
// -------------------
-// Qt/KDE widget style
+// TQt/KDE widget style
// -------------------
// Copyright (c) 2004 David Johnson <david@usermode.org>
//
@@ -57,6 +57,7 @@ private:
class PhaseStyle : public KStyle
{
Q_OBJECT
+ TQ_OBJECT
public:
PhaseStyle();
virtual ~PhaseStyle();
@@ -66,7 +67,7 @@ public:
void polish(TQPalette &pal);
void unPolish(TQWidget *widget);
- void drawPrimitive(PrimitiveElement element,
+ void tqdrawPrimitive(TQ_PrimitiveElement element,
TQPainter *painter,
const TQRect &rect,
const TQColorGroup &group,
@@ -81,7 +82,7 @@ public:
SFlags flags = Style_Default,
const TQStyleOption &option = TQStyleOption::Default) const;
- void drawControl(ControlElement element,
+ void tqdrawControl(TQ_ControlElement element,
TQPainter *painter,
const TQWidget *widget,
const TQRect &rect,
@@ -89,13 +90,13 @@ public:
SFlags flags = Style_Default,
const TQStyleOption &option = TQStyleOption::Default) const;
- void drawControlMask(ControlElement element,
+ void tqdrawControlMask(TQ_ControlElement element,
TQPainter *painter,
const TQWidget *widget,
const TQRect &rect,
const TQStyleOption &option = TQStyleOption::Default) const;
- void drawComplexControl(ComplexControl control,
+ void tqdrawComplexControl(TQ_ComplexControl control,
TQPainter *painter,
const TQWidget *widget,
const TQRect &rect,
@@ -105,23 +106,23 @@ public:
SCFlags active = SC_None,
const TQStyleOption &option = TQStyleOption::Default) const;
- void drawComplexControlMask(ComplexControl control,
+ void tqdrawComplexControlMask(TQ_ComplexControl control,
TQPainter *painter,
const TQWidget *widget,
const TQRect &rect,
const TQStyleOption &option = TQStyleOption::Default) const;
- int pixelMetric(PixelMetric metric,
+ int tqpixelMetric(PixelMetric metric,
const TQWidget *widget = 0) const;
TQRect subRect(SubRect rect, const TQWidget *widget) const;
- TQRect querySubControlMetrics(ComplexControl control,
+ TQRect querySubControlMetrics(TQ_ComplexControl control,
const TQWidget *widget,
SubControl subcontrol,
const TQStyleOption &option = TQStyleOption::Default) const;
- TQSize sizeFromContents(ContentsType contents,
+ TQSize tqsizeFromContents(ContentsType contents,
const TQWidget *widget,
const TQSize &contentsize,
const TQStyleOption& option = TQStyleOption::Default) const;