Conversion Qt3→TQt

Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
pull/1/head
Mavridis Philippe 3 years ago
parent d5914d4d32
commit a26e231b46
No known key found for this signature in database
GPG Key ID: F8D2D7E2F989A494

@ -1060,7 +1060,7 @@ elif test "$kde_use_qt_emb" = "yes"; then
x_includes="" x_includes=""
x_libraries="" x_libraries=""
elif test "$kde_use_qt_mac" = "yes"; then elif test "$kde_use_qt_mac" = "yes"; then
dnl We're using QT/Mac (I use QT_MAC so that qglobal.h doesn't *have* to dnl We're using QT/Mac (I use QT_MAC so that ntqglobal.h doesn't *have* to
dnl be included to get the information) --Sam dnl be included to get the information) --Sam
CXXFLAGS="$CXXFLAGS -DQT_MAC -no-cpp-precomp" CXXFLAGS="$CXXFLAGS -DQT_MAC -no-cpp-precomp"
CFLAGS="$CFLAGS -DQT_MAC -no-cpp-precomp" CFLAGS="$CFLAGS -DQT_MAC -no-cpp-precomp"
@ -1092,19 +1092,19 @@ AC_DEFUN([KDE_PRINT_QT_PROGRAM],
AC_REQUIRE([KDE_USE_QT]) AC_REQUIRE([KDE_USE_QT])
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#include "confdefs.h" #include "confdefs.h"
#include <qglobal.h> #include <tqglobal.h>
#include <qapplication.h> #include <tqapplication.h>
EOF EOF
if test "$kde_qtver" = "2"; then if test "$kde_qtver" = "2"; then
cat >> conftest.$ac_ext <<EOF cat >> conftest.$ac_ext <<EOF
#include <qevent.h> #include <tqevent.h>
#include <qstring.h> #include <tqstring.h>
#include <qstyle.h> #include <tqstyle.h>
EOF EOF
if test $kde_qtsubver -gt 0; then if test $kde_qtsubver -gt 0; then
cat >> conftest.$ac_ext <<EOF cat >> conftest.$ac_ext <<EOF
#if QT_VERSION < 210 #if TQT_VERSION < 210
#error 1 #error 1
#endif #endif
EOF EOF
@ -1113,8 +1113,8 @@ fi
if test "$kde_qtver" = "3"; then if test "$kde_qtver" = "3"; then
cat >> conftest.$ac_ext <<EOF cat >> conftest.$ac_ext <<EOF
#include <qcursor.h> #include <tqcursor.h>
#include <qstylefactory.h> #include <tqstylefactory.h>
#include <private/qucomextra_p.h> #include <private/qucomextra_p.h>
EOF EOF
fi fi
@ -1201,22 +1201,22 @@ fi
if test -z "$3"; then if test -z "$3"; then
if test $kde_qtver = 3; then if test $kde_qtver = 3; then
if test $kde_qtsubver -gt 0; then if test $kde_qtsubver -gt 0; then
kde_qt_verstring="QT_VERSION >= 0x03@VER@00 && QT_VERSION < 0x040000" kde_qt_verstring="TQT_VERSION >= 0x03@VER@00 && TQT_VERSION < 0x040000"
qtsubver=`echo "00$kde_qtsubver" | sed -e 's,.*\(..\)$,\1,'` qtsubver=`echo "00$kde_qtsubver" | sed -e 's,.*\(..\)$,\1,'`
kde_qt_verstring=`echo $kde_qt_verstring | sed -e "s,@VER@,$qtsubver,"` kde_qt_verstring=`echo $kde_qt_verstring | sed -e "s,@VER@,$qtsubver,"`
else else
kde_qt_verstring="QT_VERSION >= 300 && QT_VERSION < 0x040000" kde_qt_verstring="TQT_VERSION >= 300 && TQT_VERSION < 0x040000"
fi fi
fi fi
if test $kde_qtver = 2; then if test $kde_qtver = 2; then
if test $kde_qtsubver -gt 0; then if test $kde_qtsubver -gt 0; then
kde_qt_verstring="QT_VERSION >= 222" kde_qt_verstring="TQT_VERSION >= 222"
else else
kde_qt_verstring="QT_VERSION >= 200" kde_qt_verstring="TQT_VERSION >= 200"
fi fi
fi fi
if test $kde_qtver = 1; then if test $kde_qtver = 1; then
kde_qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200" kde_qt_verstring="TQT_VERSION >= 142 && TQT_VERSION < 200"
fi fi
else else
kde_qt_verstring="$3" kde_qt_verstring="$3"
@ -1325,7 +1325,7 @@ AC_ARG_ENABLE(
USING_QT_MT="" USING_QT_MT=""
dnl ------------------------------------------------------------------------ dnl ------------------------------------------------------------------------
dnl If we not get --disable-qt-mt then adjust some vars for the host. dnl If we not get --disable-tqt-mt then adjust some vars for the host.
dnl ------------------------------------------------------------------------ dnl ------------------------------------------------------------------------
KDE_MT_LDFLAGS= KDE_MT_LDFLAGS=
@ -1383,7 +1383,7 @@ dnl ------------------------------------------------------------
fi fi
dnl ------------------------------------------------------------------------ dnl ------------------------------------------------------------------------
dnl If we got --enable-qt-mt then adjust the Qt library name for the host. dnl If we got --enable-tqt-mt then adjust the Qt library name for the host.
dnl ------------------------------------------------------------------------ dnl ------------------------------------------------------------------------
if test "x$kde_use_qt_mt" = "xyes"; then if test "x$kde_use_qt_mt" = "xyes"; then
@ -1449,9 +1449,9 @@ if test ! "$ac_qt_includes" = "NO"; then
fi fi
if test "$kde_qtver" != "1"; then if test "$kde_qtver" != "1"; then
kde_qt_header=qstyle.h kde_qt_header=ntqstyle.h
else else
kde_qt_header=qglobal.h kde_qt_header=ntqglobal.h
fi fi
AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir) AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir)
@ -2034,7 +2034,7 @@ AC_CACHE_VAL(kde_cv_have_kdeqtaddon,
LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS" LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS"
AC_TRY_LINK([ AC_TRY_LINK([
#include <qdom.h> #include <tqdom.h>
], ],
[ [
QDomDocument doc; QDomDocument doc;
@ -2595,7 +2595,7 @@ LIBS=`echo $LIBS | sed "s/$LIBJPEG//"`
ac_save_CXXFLAGS="$CXXFLAGS" ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES" CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
AC_TRY_LINK( AC_TRY_LINK(
[#include <qapplication.h>], [#include <tqapplication.h>],
[ [
int argc; int argc;
char** argv; char** argv;
@ -3439,7 +3439,7 @@ AC_DEFUN([KDE_ENABLE_HIDDEN_VISIBILITY],
AC_TRY_COMPILE( AC_TRY_COMPILE(
[ [
#include <qglobal.h> #include <tqglobal.h>
#if Q_EXPORT - 0 != 0 #if Q_EXPORT - 0 != 0
/* if this compiles, then Q_EXPORT is undefined */ /* if this compiles, then Q_EXPORT is undefined */
/* if Q_EXPORT is nonempty, this will break compilation */ /* if Q_EXPORT is nonempty, this will break compilation */
@ -4689,7 +4689,7 @@ CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
AC_TRY_RUN(dnl AC_TRY_RUN(dnl
[ [
#include <qimageio.h> #include <qimageio.h>
#include <qstring.h> #include <tqstring.h>
int main() { int main() {
QString t = "hallo"; QString t = "hallo";
t.fill('t'); t.fill('t');
@ -5534,7 +5534,7 @@ if test "${with_qt_dir+set}" = set; then
kde_qtdir="$with_qt_dir" kde_qtdir="$with_qt_dir"
fi fi
AC_FIND_FILE(qsql.html, [ $kde_qtdir/doc/html $QTDIR/doc/html /usr/share/doc/packages/qt3/html /usr/lib/qt/doc /usr/lib/qt3/doc /usr/lib/qt3/doc/html /usr/doc/qt3/html /usr/doc/qt3 /usr/share/doc/qt3-doc /usr/share/qt3/doc/html /usr/X11R6/share/doc/qt/html ], QTDOCDIR) AC_FIND_FILE(ntqsql.html, [ $kde_qtdir/doc/html $QTDIR/doc/html /usr/share/doc/packages/qt3/html /usr/lib/qt/doc /usr/lib/qt3/doc /usr/lib/qt3/doc/html /usr/doc/qt3/html /usr/doc/qt3 /usr/share/doc/qt3-doc /usr/share/qt3/doc/html /usr/X11R6/share/doc/qt/html ], QTDOCDIR)
AC_MSG_RESULT($QTDOCDIR) AC_MSG_RESULT($QTDOCDIR)
AC_SUBST(QTDOCDIR) AC_SUBST(QTDOCDIR)
@ -5555,7 +5555,7 @@ AC_SUBST(DOXYGEN_PROJECT_NAME)
AC_SUBST(DOXYGEN_PROJECT_NUMBER) AC_SUBST(DOXYGEN_PROJECT_NUMBER)
KDE_HAS_DOXYGEN=no KDE_HAS_DOXYGEN=no
if test -n "$DOXYGEN" && test -x "$DOXYGEN" && test -f $QTDOCDIR/qsql.html; then if test -n "$DOXYGEN" && test -x "$DOXYGEN" && test -f $QTDOCDIR/ntqsql.html; then
KDE_HAS_DOXYGEN=yes KDE_HAS_DOXYGEN=yes
fi fi
AC_SUBST(KDE_HAS_DOXYGEN) AC_SUBST(KDE_HAS_DOXYGEN)

54
configure vendored

@ -1283,7 +1283,7 @@ do
-psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
psdir=$ac_optarg ;; psdir=$ac_optarg ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \ -q | -quiet | --quiet | --tquie | --tqui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil) | -silent | --silent | --silen | --sile | --sil)
silent=yes ;; silent=yes ;;
@ -1799,7 +1799,7 @@ do
do do
case $ac_arg in case $ac_arg in
-no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \ -q | -quiet | --quiet | --tquie | --tqui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil) | -silent | --silent | --silen | --sile | --sil)
continue ;; continue ;;
*\'*) *\'*)
@ -23966,22 +23966,22 @@ fi
if test -z ""; then if test -z ""; then
if test $kde_qtver = 3; then if test $kde_qtver = 3; then
if test $kde_qtsubver -gt 0; then if test $kde_qtsubver -gt 0; then
kde_qt_verstring="QT_VERSION >= 0x03@VER@00 && QT_VERSION < 0x040000" kde_qt_verstring="TQT_VERSION >= 0x03@VER@00 && TQT_VERSION < 0x040000"
qtsubver=`echo "00$kde_qtsubver" | sed -e 's,.*\(..\)$,\1,'` qtsubver=`echo "00$kde_qtsubver" | sed -e 's,.*\(..\)$,\1,'`
kde_qt_verstring=`echo $kde_qt_verstring | sed -e "s,@VER@,$qtsubver,"` kde_qt_verstring=`echo $kde_qt_verstring | sed -e "s,@VER@,$qtsubver,"`
else else
kde_qt_verstring="QT_VERSION >= 300 && QT_VERSION < 0x040000" kde_qt_verstring="TQT_VERSION >= 300 && TQT_VERSION < 0x040000"
fi fi
fi fi
if test $kde_qtver = 2; then if test $kde_qtver = 2; then
if test $kde_qtsubver -gt 0; then if test $kde_qtsubver -gt 0; then
kde_qt_verstring="QT_VERSION >= 222" kde_qt_verstring="TQT_VERSION >= 222"
else else
kde_qt_verstring="QT_VERSION >= 200" kde_qt_verstring="TQT_VERSION >= 200"
fi fi
fi fi
if test $kde_qtver = 1; then if test $kde_qtver = 1; then
kde_qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200" kde_qt_verstring="TQT_VERSION >= 142 && TQT_VERSION < 200"
fi fi
else else
kde_qt_verstring="" kde_qt_verstring=""
@ -32945,9 +32945,9 @@ if test ! "$ac_qt_includes" = "NO"; then
fi fi
if test "$kde_qtver" != "1"; then if test "$kde_qtver" != "1"; then
kde_qt_header=qstyle.h kde_qt_header=ntqstyle.h
else else
kde_qt_header=qglobal.h kde_qt_header=ntqglobal.h
fi fi
@ -33015,19 +33015,19 @@ LIBS="$LIBS $LIBQT $KDE_MT_LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#include "confdefs.h" #include "confdefs.h"
#include <qglobal.h> #include <tqglobal.h>
#include <qapplication.h> #include <tqapplication.h>
EOF EOF
if test "$kde_qtver" = "2"; then if test "$kde_qtver" = "2"; then
cat >> conftest.$ac_ext <<EOF cat >> conftest.$ac_ext <<EOF
#include <qevent.h> #include <tqevent.h>
#include <qstring.h> #include <tqstring.h>
#include <qstyle.h> #include <tqstyle.h>
EOF EOF
if test $kde_qtsubver -gt 0; then if test $kde_qtsubver -gt 0; then
cat >> conftest.$ac_ext <<EOF cat >> conftest.$ac_ext <<EOF
#if QT_VERSION < 210 #if TQT_VERSION < 210
#error 1 #error 1
#endif #endif
EOF EOF
@ -33036,8 +33036,8 @@ fi
if test "$kde_qtver" = "3"; then if test "$kde_qtver" = "3"; then
cat >> conftest.$ac_ext <<EOF cat >> conftest.$ac_ext <<EOF
#include <qcursor.h> #include <tqcursor.h>
#include <qstylefactory.h> #include <tqstylefactory.h>
#include <private/qucomextra_p.h> #include <private/qucomextra_p.h>
EOF EOF
fi fi
@ -33183,19 +33183,19 @@ export LIBRARY_PATH
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#include "confdefs.h" #include "confdefs.h"
#include <qglobal.h> #include <tqglobal.h>
#include <qapplication.h> #include <tqapplication.h>
EOF EOF
if test "$kde_qtver" = "2"; then if test "$kde_qtver" = "2"; then
cat >> conftest.$ac_ext <<EOF cat >> conftest.$ac_ext <<EOF
#include <qevent.h> #include <tqevent.h>
#include <qstring.h> #include <tqstring.h>
#include <qstyle.h> #include <tqstyle.h>
EOF EOF
if test $kde_qtsubver -gt 0; then if test $kde_qtsubver -gt 0; then
cat >> conftest.$ac_ext <<EOF cat >> conftest.$ac_ext <<EOF
#if QT_VERSION < 210 #if TQT_VERSION < 210
#error 1 #error 1
#endif #endif
EOF EOF
@ -33204,8 +33204,8 @@ fi
if test "$kde_qtver" = "3"; then if test "$kde_qtver" = "3"; then
cat >> conftest.$ac_ext <<EOF cat >> conftest.$ac_ext <<EOF
#include <qcursor.h> #include <tqcursor.h>
#include <qstylefactory.h> #include <tqstylefactory.h>
#include <private/qucomextra_p.h> #include <private/qucomextra_p.h>
EOF EOF
fi fi
@ -33609,7 +33609,7 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */ /* end confdefs.h. */
#include <qapplication.h> #include <tqapplication.h>
int int
main () main ()
{ {
@ -36632,7 +36632,7 @@ Try \`$0 --help' for more information." >&2
{ (exit 1); exit 1; }; };; { (exit 1); exit 1; }; };;
--help | --hel | -h ) --help | --hel | -h )
echo "$ac_cs_usage"; exit ;; echo "$ac_cs_usage"; exit ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \ -q | -quiet | --quiet | --tquie | --tqui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil | --si | --s) | -silent | --silent | --silen | --sile | --sil | --si | --s)
ac_cs_silent=: ;; ac_cs_silent=: ;;

@ -39,13 +39,13 @@ msgstr "Alineación del título"
#: rc.cpp:12 config/configdialog.cpp:291 #: rc.cpp:12 config/configdialog.cpp:291
#, no-c-format #, no-c-format
msgid "&Left" msgid "&Left"
msgstr "I&zquierda" msgstr "I&ztquierda"
#. i18n: file config/configdialog.ui line 59 #. i18n: file config/configdialog.ui line 59
#: rc.cpp:15 config/configdialog.cpp:292 #: rc.cpp:15 config/configdialog.cpp:292
#, no-c-format #, no-c-format
msgid "Align the title left." msgid "Align the title left."
msgstr "Alinea el título a la izquierda." msgstr "Alinea el título a la iztquierda."
#. i18n: file config/configdialog.ui line 67 #. i18n: file config/configdialog.ui line 67
#: rc.cpp:18 config/configdialog.cpp:293 #: rc.cpp:18 config/configdialog.cpp:293
@ -75,7 +75,7 @@ msgstr "Alinea el título a la derecha."
#: rc.cpp:30 config/configdialog.cpp:297 #: rc.cpp:30 config/configdialog.cpp:297
#, fuzzy, no-c-format #, fuzzy, no-c-format
msgid "Rounded Top Corners" msgid "Rounded Top Corners"
msgstr "Redondear esquinas superiores" msgstr "Redondear estquinas superiores"
#. i18n: file config/configdialog.ui line 102 #. i18n: file config/configdialog.ui line 102
#: rc.cpp:33 config/configdialog.cpp:298 #: rc.cpp:33 config/configdialog.cpp:298
@ -93,7 +93,7 @@ msgstr "Alt+M"
#: rc.cpp:39 config/configdialog.cpp:300 #: rc.cpp:39 config/configdialog.cpp:300
#, fuzzy, no-c-format #, fuzzy, no-c-format
msgid "Always draw rounded window top corners." msgid "Always draw rounded window top corners."
msgstr "Redondea siempre las esquinas superiores de la ventana." msgstr "Redondea siempre las estquinas superiores de la ventana."
#. i18n: file config/configdialog.ui line 116 #. i18n: file config/configdialog.ui line 116
#: rc.cpp:42 config/configdialog.cpp:301 #: rc.cpp:42 config/configdialog.cpp:301
@ -111,7 +111,7 @@ msgstr "Alt+X"
#: rc.cpp:48 config/configdialog.cpp:303 #: rc.cpp:48 config/configdialog.cpp:303
#, fuzzy, no-c-format #, fuzzy, no-c-format
msgid "Draw rounded top corners if the window is not maximized." msgid "Draw rounded top corners if the window is not maximized."
msgstr "Redondea las esquina superiores si la ventana no está maximizada." msgstr "Redondea las estquina superiores si la ventana no está maximizada."
#. i18n: file config/configdialog.ui line 130 #. i18n: file config/configdialog.ui line 130
#: rc.cpp:51 config/configdialog.cpp:304 #: rc.cpp:51 config/configdialog.cpp:304
@ -129,7 +129,7 @@ msgstr "Alt+N"
#: rc.cpp:57 config/configdialog.cpp:306 #: rc.cpp:57 config/configdialog.cpp:306
#, fuzzy, no-c-format #, fuzzy, no-c-format
msgid "Never draw rounded window top corners." msgid "Never draw rounded window top corners."
msgstr "No redondea nunca las esquinas superiores de la ventana." msgstr "No redondea nunca las estquinas superiores de la ventana."
#. i18n: file config/configdialog.ui line 146 #. i18n: file config/configdialog.ui line 146
#: rc.cpp:60 config/configdialog.cpp:307 #: rc.cpp:60 config/configdialog.cpp:307

@ -271,7 +271,7 @@ msgid ""
"buttonbackground from the colorscheme are used then." "buttonbackground from the colorscheme are used then."
msgstr "" msgstr ""
"Consente di utilizzare colori personalizzati per lo sfondo dei pulsanti. " "Consente di utilizzare colori personalizzati per lo sfondo dei pulsanti. "
"Verranno quindi utilizzati i colori della combinazione colori." "Verranno tquindi utilizzati i colori della combinazione colori."
#. i18n: file config/configdialog.ui line 403 #. i18n: file config/configdialog.ui line 403
#: rc.cpp:123 config/configdialog.cpp:330 #: rc.cpp:123 config/configdialog.cpp:330

@ -177,7 +177,7 @@ msgstr " px"
#, no-c-format #, no-c-format
msgid "Here you can set some additional space for the titlebar height." msgid "Here you can set some additional space for the titlebar height."
msgstr "" msgstr ""
"Aqui é possível definir espaço adicional para a altura da barra de título." "Atqui é possível definir espaço adicional para a altura da barra de título."
#. i18n: file config/configdialog.ui line 198 #. i18n: file config/configdialog.ui line 198
#: rc.cpp:78 config/configdialog.cpp:313 #: rc.cpp:78 config/configdialog.cpp:313
@ -324,7 +324,7 @@ msgstr " %"
msgid "" msgid ""
"Here you can set the size of the button icons relative to the button size." "Here you can set the size of the button icons relative to the button size."
msgstr "" msgstr ""
"Aqui você pode definir o tamanho dos ícones de botões em relação ao tamanho " "Atqui você pode definir o tamanho dos ícones de botões em relação ao tamanho "
"do botão." "do botão."
#. i18n: file config/configdialog.ui line 485 #. i18n: file config/configdialog.ui line 485

@ -24,8 +24,8 @@
//#include <kdebug.h> //#include <kdebug.h>
#include <qpainter.h> #include <tqpainter.h>
#include <qbitmap.h> #include <tqbitmap.h>
#include <kconfig.h> #include <kconfig.h>
#include <klocale.h> #include <klocale.h>
@ -45,7 +45,7 @@ namespace KWinSUSE2
SUSE2Handler::SUSE2Handler() SUSE2Handler::SUSE2Handler()
{ {
memset(m_pixmaps, 0, sizeof(QPixmap *) * NumButtonStatus * NumButtonIcons); // set elements to 0 memset(m_pixmaps, 0, sizeof(TQPixmap *) * NumButtonStatus * NumButtonIcons); // set elements to 0
KGlobal::locale()->insertCatalogue("kwin_clients"); KGlobal::locale()->insertCatalogue("kwin_clients");
KGlobal::locale()->insertCatalogue("kwin_SUSE2"); KGlobal::locale()->insertCatalogue("kwin_SUSE2");
@ -92,7 +92,7 @@ bool SUSE2Handler::reset(unsigned long /*changed*/)
} }
// check if we are in reverse layout mode // check if we are in reverse layout mode
m_reverse = QApplication::reverseLayout(); m_reverse = TQApplication::reverseLayout();
// read in the configuration // read in the configuration
readConfig(); readConfig();
@ -144,12 +144,12 @@ void SUSE2Handler::readConfig()
config.setGroup("General"); config.setGroup("General");
// grab settings // grab settings
QString alignValue = config.readEntry("TitleAlignment", "AlignLeft"); TQString alignValue = config.readEntry("TitleAlignment", "AlignLeft");
if (alignValue == "AlignLeft") m_titleAlign = Qt::AlignLeft; if (alignValue == "AlignLeft") m_titleAlign = TQt::AlignLeft;
else if (alignValue == "AlignHCenter") m_titleAlign = Qt::AlignHCenter; else if (alignValue == "AlignHCenter") m_titleAlign = TQt::AlignHCenter;
else if (alignValue == "AlignRight") m_titleAlign = Qt::AlignRight; else if (alignValue == "AlignRight") m_titleAlign = TQt::AlignRight;
QString roundValue = config.readEntry("RoundCorners", "NotMaximized"); TQString roundValue = config.readEntry("RoundCorners", "NotMaximized");
if (roundValue == "RoundAlways") m_roundCorners = 1; if (roundValue == "RoundAlways") m_roundCorners = 1;
else if (roundValue == "NotMaximized") m_roundCorners = 2; else if (roundValue == "NotMaximized") m_roundCorners = 2;
else if (roundValue == "RoundNever") m_roundCorners = 3; else if (roundValue == "RoundNever") m_roundCorners = 3;
@ -157,13 +157,13 @@ void SUSE2Handler::readConfig()
m_menuClose = config.readBoolEntry("CloseOnMenuDoubleClick", true); m_menuClose = config.readBoolEntry("CloseOnMenuDoubleClick", true);
m_titleShadow = config.readBoolEntry("TitleShadow", true); m_titleShadow = config.readBoolEntry("TitleShadow", true);
QFontMetrics fm(m_titleFont); // active font = inactive font TQFontMetrics fm(m_titleFont); // active font = inactive font
int addSpace = config.readNumEntry("AddSpace", 4); int addSpace = config.readNumEntry("AddSpace", 4);
// The title should stretch with bigger font sizes! // The title should stretch with bigger font sizes!
m_titleHeight = QMAX(16, fm.height() + addSpace); m_titleHeight = TQMAX(16, fm.height() + addSpace);
fm = QFontMetrics(m_titleFontTool); // active font = inactive font fm = TQFontMetrics(m_titleFontTool); // active font = inactive font
m_titleHeightTool = QMAX(13, fm.height() ); // don't care about the shadow etc. m_titleHeightTool = TQMAX(13, fm.height() ); // don't care about the shadow etc.
m_titlebarStyle = config.readNumEntry("TitleBarStyle", 0); m_titlebarStyle = config.readNumEntry("TitleBarStyle", 0);
@ -174,13 +174,13 @@ void SUSE2Handler::readConfig()
m_redCloseButton = config.readBoolEntry("RedCloseButton", false); m_redCloseButton = config.readBoolEntry("RedCloseButton", false);
m_iconSize = (config.readNumEntry("IconSize", 45))/100.0; m_iconSize = (config.readNumEntry("IconSize", 45))/100.0;
m_customIconColors = config.readBoolEntry("CustomIconColors", false); m_customIconColors = config.readBoolEntry("CustomIconColors", false);
QColor afgcolor = QColor(10, 20, 40); TQColor afgcolor = TQColor(10, 20, 40);
m_aFgColor = config.readColorEntry("AFgColor", &afgcolor); m_aFgColor = config.readColorEntry("AFgColor", &afgcolor);
QColor abgcolor = QColor(210, 220, 240); TQColor abgcolor = TQColor(210, 220, 240);
m_aBgColor = config.readColorEntry("ABgColor", &abgcolor); m_aBgColor = config.readColorEntry("ABgColor", &abgcolor);
QColor ifgcolor = QColor(40, 40, 40); TQColor ifgcolor = TQColor(40, 40, 40);
m_iFgColor = config.readColorEntry("IFgColor", &ifgcolor); m_iFgColor = config.readColorEntry("IFgColor", &ifgcolor);
QColor ibgcolor = QColor(240, 240, 240); TQColor ibgcolor = TQColor(240, 240, 240);
m_iBgColor = config.readColorEntry("IBgColor", &ibgcolor); m_iBgColor = config.readColorEntry("IBgColor", &ibgcolor);
m_iconShadow = config.readBoolEntry("IconShadow", false); m_iconShadow = config.readBoolEntry("IconShadow", false);
@ -189,7 +189,7 @@ void SUSE2Handler::readConfig()
m_titleLogoURL = config.readEntry("TitleBarLogoURL", locate("data", "kwin/pics/titlebar_decor.png")); m_titleLogoURL = config.readEntry("TitleBarLogoURL", locate("data", "kwin/pics/titlebar_decor.png"));
} }
QColor SUSE2Handler::getColor(KWinSUSE2::ColorType type, const bool active) const TQColor SUSE2Handler::getColor(KWinSUSE2::ColorType type, const bool active) const
{ {
switch (type) { switch (type) {
case TitleGradientFrom: case TitleGradientFrom:
@ -209,16 +209,16 @@ QColor SUSE2Handler::getColor(KWinSUSE2::ColorType type, const bool active) cons
return KDecoration::options()->color(ColorButtonBg, active); return KDecoration::options()->color(ColorButtonBg, active);
break; break;
default: default:
return Qt::black; return TQt::black;
} }
} }
const KPixmap &SUSE2Handler::buttonPixmap(ButtonIcon type, int size, ButtonStatus status) const KPixmap &SUSE2Handler::buttonPixmap(ButtonIcon type, int size, ButtonStatus status)
{ {
if (m_pixmaps[status][type]) { if (m_pixmaps[status][type]) {
if (status != Shadow && m_pixmaps[status][type]->size() == QSize(size, size)) if (status != Shadow && m_pixmaps[status][type]->size() == TQSize(size, size))
return *m_pixmaps[status][type]; return *m_pixmaps[status][type];
else if (status == Shadow && m_pixmaps[status][type]->size() == QSize(size+4, size+4)) else if (status == Shadow && m_pixmaps[status][type]->size() == TQSize(size+4, size+4))
return *m_pixmaps[status][type]; return *m_pixmaps[status][type];
} }
@ -227,10 +227,10 @@ const KPixmap &SUSE2Handler::buttonPixmap(ButtonIcon type, int size, ButtonStatu
delete m_pixmaps[status][type]; delete m_pixmaps[status][type];
m_pixmaps[status][type] = 0; m_pixmaps[status][type] = 0;
QColor aDecoFgDark = alphaBlendColors(getColor(TitleGradientTo, true), Qt::black, 50); TQColor aDecoFgDark = alphaBlendColors(getColor(TitleGradientTo, true), TQt::black, 50);
QColor aDecoFgLight = alphaBlendColors(getColor(TitleGradientTo, true), Qt::white, 50); TQColor aDecoFgLight = alphaBlendColors(getColor(TitleGradientTo, true), TQt::white, 50);
QColor iDecoFgDark = alphaBlendColors(getColor(TitleGradientTo, false), Qt::black, 50); TQColor iDecoFgDark = alphaBlendColors(getColor(TitleGradientTo, false), TQt::black, 50);
QColor iDecoFgLight = alphaBlendColors(getColor(TitleGradientTo, false), Qt::white, 50); TQColor iDecoFgLight = alphaBlendColors(getColor(TitleGradientTo, false), TQt::white, 50);
if (m_customIconColors && !m_useTitleProps) { if (m_customIconColors && !m_useTitleProps) {
aDecoFgDark = m_aFgColor; aDecoFgDark = m_aFgColor;
@ -240,12 +240,12 @@ const KPixmap &SUSE2Handler::buttonPixmap(ButtonIcon type, int size, ButtonStatu
} }
KPixmap icon = IconEngine::icon(type, size); KPixmap icon = IconEngine::icon(type, size);
QImage img = icon.convertToImage(); TQImage img = icon.convertToImage();
KPixmap *pixmap; KPixmap *pixmap;
QImage tmpImage; TQImage tmpImage;
ShadowEngine se; ShadowEngine se;
QPainter painter; TQPainter painter;
KPixmap tmpShadow; KPixmap tmpShadow;
switch (status) { switch (status) {
case ActiveUp: case ActiveUp:
@ -282,14 +282,14 @@ const KPixmap &SUSE2Handler::buttonPixmap(ButtonIcon type, int size, ButtonStatu
break; break;
case Shadow: case Shadow:
// prepare shadow // prepare shadow
tmpShadow = QPixmap(icon.width()+4, icon.height()+4); tmpShadow = TQPixmap(icon.width()+4, icon.height()+4);
tmpShadow.fill(QColor(0,0,0)); tmpShadow.fill(TQColor(0,0,0));
tmpShadow.setMask(tmpShadow.createHeuristicMask(true)); tmpShadow.setMask(tmpShadow.createHeuristicMask(true));
painter.begin(&tmpShadow); painter.begin(&tmpShadow);
painter.setPen(white); painter.setPen(white);
painter.drawPixmap(0,0, icon); painter.drawPixmap(0,0, icon);
painter.end(); painter.end();
tmpImage = se.makeShadow(tmpShadow, QColor(0, 0, 0)); tmpImage = se.makeShadow(tmpShadow, TQColor(0, 0, 0));
pixmap = new KPixmap(tmpImage); pixmap = new KPixmap(tmpImage);
break; break;
default: default:
@ -300,11 +300,11 @@ const KPixmap &SUSE2Handler::buttonPixmap(ButtonIcon type, int size, ButtonStatu
return *pixmap; return *pixmap;
} }
QValueList< SUSE2Handler::BorderSize > TQValueList< SUSE2Handler::BorderSize >
SUSE2Handler::borderSizes() const SUSE2Handler::borderSizes() const
{ {
// the list must be sorted // the list must be sorted
return QValueList< BorderSize >() << BorderTiny << BorderNormal << return TQValueList< BorderSize >() << BorderTiny << BorderNormal <<
BorderLarge << BorderVeryLarge << BorderHuge << BorderLarge << BorderVeryLarge << BorderHuge <<
BorderVeryHuge << BorderOversized; BorderVeryHuge << BorderOversized;
} }

@ -24,7 +24,7 @@
#ifndef SUSE2_H #ifndef SUSE2_H
#define SUSE2_H #define SUSE2_H
#include <qfont.h> #include <tqfont.h>
#include <kdecoration.h> #include <kdecoration.h>
#include <kdecorationfactory.h> #include <kdecorationfactory.h>
@ -66,7 +66,7 @@ enum ColorType {
BtnBg BtnBg
}; };
class SUSE2Handler: public QObject, public KDecorationFactory class SUSE2Handler: public TQObject, public KDecorationFactory
{ {
Q_OBJECT Q_OBJECT
public: public:
@ -81,11 +81,11 @@ public:
int titleHeight() const { return m_titleHeight; } int titleHeight() const { return m_titleHeight; }
int titleHeightTool() const { return m_titleHeightTool; } int titleHeightTool() const { return m_titleHeightTool; }
QFont titleFont() const { return m_titleFont; } TQFont titleFont() const { return m_titleFont; }
QFont titleFontTool() const { return m_titleFontTool; } TQFont titleFontTool() const { return m_titleFontTool; }
bool titleLogo() const { return m_titleLogo; } bool titleLogo() const { return m_titleLogo; }
int titleLogoOffset() const { return m_titleLogoOffset; } int titleLogoOffset() const { return m_titleLogoOffset; }
QString titleLogoURL() const { return m_titleLogoURL; } TQString titleLogoURL() const { return m_titleLogoURL; }
bool titleShadow() const { return m_titleShadow; } bool titleShadow() const { return m_titleShadow; }
int borderSize() const { return m_borderSize; } int borderSize() const { return m_borderSize; }
int titlebarStyle() const { return m_titlebarStyle; } int titlebarStyle() const { return m_titlebarStyle; }
@ -97,11 +97,11 @@ public:
float iconSize() const { return m_iconSize; } float iconSize() const { return m_iconSize; }
bool iconShadow() const { return m_iconShadow; } bool iconShadow() const { return m_iconShadow; }
bool menuClose() const { return m_menuClose; } bool menuClose() const { return m_menuClose; }
Qt::AlignmentFlags titleAlign() const { return m_titleAlign; } TQt::AlignmentFlags titleAlign() const { return m_titleAlign; }
int roundCorners() const { return m_roundCorners; } int roundCorners() const { return m_roundCorners; }
bool reverseLayout() const { return m_reverse; } bool reverseLayout() const { return m_reverse; }
QColor getColor(KWinSUSE2::ColorType type, const bool active = true) const; TQColor getColor(KWinSUSE2::ColorType type, const bool active = true) const;
QValueList< SUSE2Handler::BorderSize > borderSizes() const; TQValueList< SUSE2Handler::BorderSize > borderSizes() const;
private: private:
void readConfig(); void readConfig();
@ -114,10 +114,10 @@ private:
float m_iconSize; float m_iconSize;
int m_titlebarStyle; int m_titlebarStyle;
bool m_customIconColors; bool m_customIconColors;
QColor m_aFgColor; TQColor m_aFgColor;
QColor m_aBgColor; TQColor m_aBgColor;
QColor m_iFgColor; TQColor m_iFgColor;
QColor m_iBgColor; TQColor m_iBgColor;
bool m_iconShadow; bool m_iconShadow;
bool m_animateButtons; bool m_animateButtons;
bool m_redCloseButton; bool m_redCloseButton;
@ -126,12 +126,12 @@ private:
int m_borderSize; int m_borderSize;
int m_titleHeight; int m_titleHeight;
int m_titleHeightTool; int m_titleHeightTool;
QFont m_titleFont; TQFont m_titleFont;
QFont m_titleFontTool; TQFont m_titleFontTool;
Qt::AlignmentFlags m_titleAlign; TQt::AlignmentFlags m_titleAlign;
int m_roundCorners; int m_roundCorners;
int m_titleLogoOffset; int m_titleLogoOffset;
QString m_titleLogoURL; TQString m_titleLogoURL;
bool m_useTitleProps; bool m_useTitleProps;
KPixmap *m_pixmaps[NumButtonStatus][NumButtonIcons]; KPixmap *m_pixmaps[NumButtonStatus][NumButtonIcons];

@ -26,13 +26,13 @@
#include <math.h> #include <math.h>
#include <qbitmap.h> #include <tqbitmap.h>
#include <qcursor.h> #include <tqcursor.h>
#include <qimage.h> #include <tqimage.h>
#include <qpainter.h> #include <tqpainter.h>
#include <qpixmap.h> #include <tqpixmap.h>
#include <qtooltip.h> #include <tqtooltip.h>
#include <qtimer.h> #include <tqtimer.h>
#include <kpixmap.h> #include <kpixmap.h>
#include <kpixmapeffect.h> #include <kpixmapeffect.h>
@ -59,11 +59,11 @@ SUSE2Button::SUSE2Button(ButtonType type, SUSE2Client *parent, const char *name)
m_iconType(NumButtonIcons), m_iconType(NumButtonIcons),
hover(false) hover(false)
{ {
memset(lipstikCache, 0, sizeof(QPixmap*)*(8 + 3*(ANIMATIONSTEPS+1))*2); // set elements to 0 memset(lipstikCache, 0, sizeof(TQPixmap*)*(8 + 3*(ANIMATIONSTEPS+1))*2); // set elements to 0
setBackgroundMode(NoBackground); setBackgroundMode(NoBackground);
animTmr = new QTimer(this); animTmr = new TQTimer(this);
connect(animTmr, SIGNAL(timeout() ), this, SLOT(animate() ) ); connect(animTmr, SIGNAL(timeout() ), this, SLOT(animate() ) );
animProgress = 0; animProgress = 0;
} }
@ -168,25 +168,25 @@ void SUSE2Button::animate()
repaint(false); repaint(false);
} }
void SUSE2Button::enterEvent(QEvent *e) void SUSE2Button::enterEvent(TQEvent *e)
{ {
QButton::enterEvent(e); TQButton::enterEvent(e);
hover = true; hover = true;
animate(); animate();
// repaint(false); // repaint(false);
} }
void SUSE2Button::leaveEvent(QEvent *e) void SUSE2Button::leaveEvent(TQEvent *e)
{ {
QButton::leaveEvent(e); TQButton::leaveEvent(e);
hover = false; hover = false;
animate(); animate();
// repaint(false); // repaint(false);
} }
void SUSE2Button::drawButton(QPainter *painter) void SUSE2Button::drawButton(TQPainter *painter)
{ {
int type = Handler()->buttonType(); int type = Handler()->buttonType();
@ -206,42 +206,42 @@ void SUSE2Button::drawButton(QPainter *painter)
} }
} }
void SUSE2Button::drawPlastikBtn(QPainter *painter) void SUSE2Button::drawPlastikBtn(TQPainter *painter)
{ {
QRect r(0, 0, width(), height()); TQRect r(0, 0, width(), height());
bool active = m_client->isActive(); bool active = m_client->isActive();
bool down = isDown(); bool down = isDown();
KPixmap backgroundTile = m_client->getTitleBarTile(active); KPixmap backgroundTile = m_client->getTitleBarTile(active);
KPixmap tempKPixmap; KPixmap tempKPixmap;
QColor highlightColor; TQColor highlightColor;
if(type() == CloseButton) { if(type() == CloseButton) {
highlightColor = QColor(255,64,0); highlightColor = TQColor(255,64,0);
} else { } else {
highlightColor = Qt::white; highlightColor = TQt::white;
} }
QColor contourTop = alphaBlendColors(Handler()->getColor(TitleGradientFrom, active), TQColor contourTop = alphaBlendColors(Handler()->getColor(TitleGradientFrom, active),
Qt::black, 220); TQt::black, 220);
QColor contourBottom = alphaBlendColors(Handler()->getColor(TitleGradientTo, active), TQColor contourBottom = alphaBlendColors(Handler()->getColor(TitleGradientTo, active),
Qt::black, 220); TQt::black, 220);
QColor surfaceTop = alphaBlendColors(Handler()->getColor(TitleGradientFrom, active), TQColor surfaceTop = alphaBlendColors(Handler()->getColor(TitleGradientFrom, active),
Qt::white, 220); TQt::white, 220);
QColor surfaceBottom = alphaBlendColors(Handler()->getColor(TitleGradientTo, active), TQColor surfaceBottom = alphaBlendColors(Handler()->getColor(TitleGradientTo, active),
Qt::white, 220); TQt::white, 220);
if (type() == CloseButton && active && Handler()->redCloseButton()) { if (type() == CloseButton && active && Handler()->redCloseButton()) {
contourTop = QColor(170,70,70); contourTop = TQColor(170,70,70);
contourBottom = QColor(120,50,50); contourBottom = TQColor(120,50,50);
surfaceTop = QColor(255,70,70); surfaceTop = TQColor(255,70,70);
surfaceBottom = QColor(170,50,50); surfaceBottom = TQColor(170,50,50);
highlightColor = QColor(140,10,10); highlightColor = TQColor(140,10,10);
} else if (Handler()->customColors()) { } else if (Handler()->customColors()) {
contourTop = alphaBlendColors(Handler()->getColor(BtnBg, active), Qt::black, 185); contourTop = alphaBlendColors(Handler()->getColor(BtnBg, active), TQt::black, 185);
contourBottom = alphaBlendColors(Handler()->getColor(BtnBg, active), Qt::black, 135); contourBottom = alphaBlendColors(Handler()->getColor(BtnBg, active), TQt::black, 135);
surfaceTop = Handler()->getColor(BtnBg, active); surfaceTop = Handler()->getColor(BtnBg, active);
surfaceBottom = alphaBlendColors(Handler()->getColor(BtnBg, active), Qt::black, 185); surfaceBottom = alphaBlendColors(Handler()->getColor(BtnBg, active), TQt::black, 185);
} }
@ -253,26 +253,26 @@ void SUSE2Button::drawPlastikBtn(QPainter *painter)
surfaceBottom = alphaBlendColors(surfaceBottom, highlightColor, highlightAlpha); surfaceBottom = alphaBlendColors(surfaceBottom, highlightColor, highlightAlpha);
if (down) { if (down) {
contourTop = alphaBlendColors(contourTop, Qt::black, 200); contourTop = alphaBlendColors(contourTop, TQt::black, 200);
contourBottom = alphaBlendColors(contourBottom, Qt::black, 200); contourBottom = alphaBlendColors(contourBottom, TQt::black, 200);
surfaceTop = alphaBlendColors(surfaceTop, Qt::black, 200); surfaceTop = alphaBlendColors(surfaceTop, TQt::black, 200);
surfaceBottom = alphaBlendColors(surfaceBottom, Qt::black, 200); surfaceBottom = alphaBlendColors(surfaceBottom, TQt::black, 200);
} }
KPixmap buffer; KPixmap buffer;
buffer.resize(width(), height()); buffer.resize(width(), height());
QPainter bP(&buffer); TQPainter bP(&buffer);
// fill with the titlebar background // fill with the titlebar background
bP.drawTiledPixmap(0, 0, width(), width(), backgroundTile, 0, TOPMARGIN); bP.drawTiledPixmap(0, 0, width(), width(), backgroundTile, 0, TOPMARGIN);
if (type() == MenuButton) { if (type() == MenuButton) {
KPixmap menuIcon(m_client->icon().pixmap( QIconSet::Small, QIconSet::Normal)); KPixmap menuIcon(m_client->icon().pixmap( TQIconSet::Small, TQIconSet::Normal));
if (width() < menuIcon.width() || height() < menuIcon.height() ) { if (width() < menuIcon.width() || height() < menuIcon.height() ) {
menuIcon.convertFromImage( menuIcon.convertToImage().smoothScale(width(), height())); menuIcon.convertFromImage( menuIcon.convertToImage().smoothScale(width(), height()));
} }
double fade = animProgress * 0.09; double fade = animProgress * 0.09;
KPixmapEffect::fade(menuIcon, fade, QColor(240, 240, 240)); KPixmapEffect::fade(menuIcon, fade, TQColor(240, 240, 240));
bP.drawPixmap((width()-menuIcon.width())/2, (height()-menuIcon.height())/2, menuIcon); bP.drawPixmap((width()-menuIcon.width())/2, (height()-menuIcon.height())/2, menuIcon);
} else { } else {
// contour // contour
@ -368,9 +368,9 @@ void SUSE2Button::drawPlastikBtn(QPainter *painter)
painter->drawPixmap(0, 0, buffer); painter->drawPixmap(0, 0, buffer);
} }
void SUSE2Button::drawLipstikBtn(QPainter *painter) void SUSE2Button::drawLipstikBtn(TQPainter *painter)
{ {
QRect r(0, 0, width(), height()); TQRect r(0, 0, width(), height());
bool active = m_client->isActive(); bool active = m_client->isActive();
bool down = isDown(); bool down = isDown();
@ -378,30 +378,30 @@ void SUSE2Button::drawLipstikBtn(QPainter *painter)
KPixmap buffer; KPixmap buffer;
buffer.resize(width(), height()); buffer.resize(width(), height());
QPainter bP(&buffer); TQPainter bP(&buffer);
// fill with the titlebar background // fill with the titlebar background
bP.drawTiledPixmap(0, 0, width(), width(), backgroundTile, 0, TOPMARGIN); bP.drawTiledPixmap(0, 0, width(), width(), backgroundTile, 0, TOPMARGIN);
if (type() == MenuButton) if (type() == MenuButton)
{ {
KPixmap menuIcon(m_client->icon().pixmap( QIconSet::Small, QIconSet::Normal)); KPixmap menuIcon(m_client->icon().pixmap( TQIconSet::Small, TQIconSet::Normal));
if (width() < menuIcon.width() || height() < menuIcon.height() ) { if (width() < menuIcon.width() || height() < menuIcon.height() ) {
menuIcon.convertFromImage( menuIcon.convertToImage().smoothScale(width(), height())); menuIcon.convertFromImage( menuIcon.convertToImage().smoothScale(width(), height()));
} }
double fade = animProgress * 0.09; double fade = animProgress * 0.09;
KPixmapEffect::fade(menuIcon, fade, QColor(240, 240, 240)); KPixmapEffect::fade(menuIcon, fade, TQColor(240, 240, 240));
bP.drawPixmap((width()-menuIcon.width())/2, (height()-menuIcon.height())/2, menuIcon); bP.drawPixmap((width()-menuIcon.width())/2, (height()-menuIcon.height())/2, menuIcon);
} else { } else {
renderBtnContour(&bP, r); renderBtnContour(&bP, r);
if (down) { if (down) {
QColor downColor; TQColor downColor;
if (type() == CloseButton && active && Handler()->redCloseButton()) { if (type() == CloseButton && active && Handler()->redCloseButton()) {
downColor = QColor(220,65,65).dark(115); downColor = TQColor(220,65,65).dark(115);
} else if (Handler()->customColors()) { } else if (Handler()->customColors()) {
downColor = Handler()->getColor(BtnBg, active).dark(115); downColor = Handler()->getColor(BtnBg, active).dark(115);
} else { } else {
downColor = alphaBlendColors(Handler()->getColor(TitleGradientFrom, active), Qt::black, 220).dark(115); downColor = alphaBlendColors(Handler()->getColor(TitleGradientFrom, active), TQt::black, 220).dark(115);
} }
bP.fillRect(r.left()+1, r.top()+2, r.width()-2, r.height()-4, downColor); bP.fillRect(r.left()+1, r.top()+2, r.width()-2, r.height()-4, downColor);
bP.setPen(downColor); bP.setPen(downColor);
@ -412,7 +412,7 @@ void SUSE2Button::drawLipstikBtn(QPainter *painter)
bP.drawLine(r.left()+2, r.bottom()-1, r.right()-2, r.bottom()-1); bP.drawLine(r.left()+2, r.bottom()-1, r.right()-2, r.bottom()-1);
bP.drawLine(r.right()-1, r.top()+2, r.right()-1, r.bottom()-2); bP.drawLine(r.right()-1, r.top()+2, r.right()-1, r.bottom()-2);
} else { } else {
renderBtnSurface(&bP, QRect(r.left()+1, r.top()+1, r.width()-2, r.height()-2)); renderBtnSurface(&bP, TQRect(r.left()+1, r.top()+1, r.width()-2, r.height()-2));
} }
int dX,dY; int dX,dY;
@ -444,23 +444,23 @@ void SUSE2Button::drawLipstikBtn(QPainter *painter)
painter->drawPixmap(0, 0, buffer); painter->drawPixmap(0, 0, buffer);
} }
void SUSE2Button::renderBtnContour(QPainter *p, const QRect &r) void SUSE2Button::renderBtnContour(TQPainter *p, const TQRect &r)
{ {
if((r.width() <= 0)||(r.height() <= 0)) if((r.width() <= 0)||(r.height() <= 0))
return; return;
bool active = m_client->isActive(); bool active = m_client->isActive();
QColor backgroundColor; TQColor backgroundColor;
if (type() == CloseButton && active && Handler()->redCloseButton()) { if (type() == CloseButton && active && Handler()->redCloseButton()) {
backgroundColor = QColor(220,65,65); backgroundColor = TQColor(220,65,65);
} else if (Handler()->customColors()) { } else if (Handler()->customColors()) {
backgroundColor = Handler()->getColor(BtnBg, active); backgroundColor = Handler()->getColor(BtnBg, active);
} else { } else {
backgroundColor = alphaBlendColors(Handler()->getColor(TitleGradientFrom, active), Qt::black, 220); backgroundColor = alphaBlendColors(Handler()->getColor(TitleGradientFrom, active), TQt::black, 220);
} }
QColor contourColor = backgroundColor.dark(135); TQColor contourColor = backgroundColor.dark(135);
// sides // sides
p->setPen(contourColor); p->setPen(contourColor);
@ -484,26 +484,26 @@ void SUSE2Button::renderBtnContour(QPainter *p, const QRect &r)
// third part... anti-aliasing... // third part... anti-aliasing...
int intActive = active ? 0 : 1; int intActive = active ? 0 : 1;
renderPixel(p,QPoint(r.left()+1,r.top()),alphaAA,contourColor, 0, intActive); renderPixel(p,TQPoint(r.left()+1,r.top()),alphaAA,contourColor, 0, intActive);
renderPixel(p,QPoint(r.left(),r.top()+1),alphaAA,contourColor, 1, intActive); renderPixel(p,TQPoint(r.left(),r.top()+1),alphaAA,contourColor, 1, intActive);
renderPixel(p,QPoint(r.left()+1,r.bottom()),alphaAA,contourColor, 2, intActive); renderPixel(p,TQPoint(r.left()+1,r.bottom()),alphaAA,contourColor, 2, intActive);
renderPixel(p,QPoint(r.left(),r.bottom()-1),alphaAA,contourColor, 3, intActive); renderPixel(p,TQPoint(r.left(),r.bottom()-1),alphaAA,contourColor, 3, intActive);
renderPixel(p,QPoint(r.right()-1,r.top()),alphaAA,contourColor, 4, intActive); renderPixel(p,TQPoint(r.right()-1,r.top()),alphaAA,contourColor, 4, intActive);
renderPixel(p,QPoint(r.right(),r.top()+1),alphaAA,contourColor, 5, intActive); renderPixel(p,TQPoint(r.right(),r.top()+1),alphaAA,contourColor, 5, intActive);
renderPixel(p,QPoint(r.right()-1,r.bottom()),alphaAA,contourColor, 6, intActive); renderPixel(p,TQPoint(r.right()-1,r.bottom()),alphaAA,contourColor, 6, intActive);
renderPixel(p,QPoint(r.right(),r.bottom()-1),alphaAA,contourColor, 7, intActive); renderPixel(p,TQPoint(r.right(),r.bottom()-1),alphaAA,contourColor, 7, intActive);
} }
void SUSE2Button::renderBtnSurface(QPainter *p, const QRect &r) void SUSE2Button::renderBtnSurface(TQPainter *p, const TQRect &r)
{ {
if((r.width() <= 0)||(r.height() <= 0)) if((r.width() <= 0)||(r.height() <= 0))
return; return;
bool active = m_client->isActive(); bool active = m_client->isActive();
QColor backgroundColor; TQColor backgroundColor;
if (type() == CloseButton && active && Handler()->redCloseButton()) { if (type() == CloseButton && active && Handler()->redCloseButton()) {
backgroundColor = QColor(220,65,65); backgroundColor = TQColor(220,65,65);
} else if (Handler()->customColors()) { } else if (Handler()->customColors()) {
backgroundColor = Handler()->getColor(BtnBg, active); backgroundColor = Handler()->getColor(BtnBg, active);
} else { } else {
@ -511,20 +511,20 @@ void SUSE2Button::renderBtnSurface(QPainter *p, const QRect &r)
if (!active) if (!active)
backgroundColor = alphaBlendColors(backgroundColor, backgroundColor = alphaBlendColors(backgroundColor,
Handler()->getColor(TitleGradientTo, active), 128); Handler()->getColor(TitleGradientTo, active), 128);
backgroundColor = alphaBlendColors(backgroundColor, Qt::black, 220); backgroundColor = alphaBlendColors(backgroundColor, TQt::black, 220);
} }
QColor highlightColor; TQColor highlightColor;
if(type() == CloseButton) { if(type() == CloseButton) {
highlightColor = QColor(255,0,0); highlightColor = TQColor(255,0,0);
} else { } else {
highlightColor = Qt::white; highlightColor = TQt::white;
} }
int highlightAlpha = static_cast<int>(255-((60/static_cast<double>(ANIMATIONSTEPS)) * int highlightAlpha = static_cast<int>(255-((60/static_cast<double>(ANIMATIONSTEPS)) *
static_cast<double>(animProgress) ) ); static_cast<double>(animProgress) ) );
QColor buttonColor, bottomColor, topLineColor, bottomLineColor; TQColor buttonColor, bottomColor, topLineColor, bottomLineColor;
if (Handler()->buttonType() == LIPSTIK_3D) { // Lipstik if (Handler()->buttonType() == LIPSTIK_3D) { // Lipstik
buttonColor = backgroundColor; buttonColor = backgroundColor;
@ -547,9 +547,9 @@ void SUSE2Button::renderBtnSurface(QPainter *p, const QRect &r)
// sides,left // sides,left
int height = r.height() - 2; int height = r.height() - 2;
renderGradient(p, QRect(r.left(), r.top()+1, 1, height), bottomColor, buttonColor, 8+animProgress, intActive); renderGradient(p, TQRect(r.left(), r.top()+1, 1, height), bottomColor, buttonColor, 8+animProgress, intActive);
//right //right
renderGradient(p, QRect(r.right(), r.top()+1, 1, height), bottomColor, buttonColor, 9+ANIMATIONSTEPS+animProgress, intActive); renderGradient(p, TQRect(r.right(), r.top()+1, 1, height), bottomColor, buttonColor, 9+ANIMATIONSTEPS+animProgress, intActive);
//top //top
p->setPen(topLineColor); p->setPen(topLineColor);
p->drawLine(r.left()+1, r.top(), r.right()-1, r.top() ); p->drawLine(r.left()+1, r.top(), r.right()-1, r.top() );
@ -562,21 +562,21 @@ void SUSE2Button::renderBtnSurface(QPainter *p, const QRect &r)
height = r.height(); height = r.height();
width-=2; width-=2;
height-=2; height-=2;
renderGradient(p, QRect(r.left()+1, r.top()+1, width, height), bottomColor, buttonColor, renderGradient(p, TQRect(r.left()+1, r.top()+1, width, height), bottomColor, buttonColor,
10 + 2 * ANIMATIONSTEPS+animProgress, intActive); 10 + 2 * ANIMATIONSTEPS+animProgress, intActive);
} }
void SUSE2Button::renderPixel(QPainter *p, const QPoint &pos, const int alpha, const QColor &color, void SUSE2Button::renderPixel(TQPainter *p, const TQPoint &pos, const int alpha, const TQColor &color,
const int pixelPos, const int active) const int pixelPos, const int active)
{ {
if (lipstikCache[pixelPos][active]) { if (lipstikCache[pixelPos][active]) {
p->drawPixmap(pos, *(lipstikCache[pixelPos][active])); p->drawPixmap(pos, *(lipstikCache[pixelPos][active]));
} else { } else {
QRgb rgb = color.rgb(); TQRgb rgb = color.rgb();
QImage aImg(1,1,32); // 1x1 TQImage aImg(1,1,32); // 1x1
aImg.setAlphaBuffer(true); aImg.setAlphaBuffer(true);
aImg.setPixel(0,0,qRgba(qRed(rgb),qGreen(rgb),qBlue(rgb),alpha)); aImg.setPixel(0,0,tqRgba(tqRed(rgb),tqGreen(rgb),tqBlue(rgb),alpha));
QPixmap *result = new QPixmap(aImg); TQPixmap *result = new TQPixmap(aImg);
p->drawPixmap(pos, *result); p->drawPixmap(pos, *result);
@ -585,7 +585,7 @@ void SUSE2Button::renderPixel(QPainter *p, const QPoint &pos, const int alpha, c
} }
} }
void SUSE2Button::renderGradient(QPainter *painter, const QRect &rect, const QColor &c1, const QColor &c2, void SUSE2Button::renderGradient(TQPainter *painter, const TQRect &rect, const TQColor &c1, const TQColor &c2,
const int gradient, const int active) const int gradient, const int active)
{ {
if((rect.width() <= 0)||(rect.height() <= 0)) if((rect.width() <= 0)||(rect.height() <= 0))
@ -595,8 +595,8 @@ void SUSE2Button::renderGradient(QPainter *painter, const QRect &rect, const QCo
painter->drawTiledPixmap(rect, *(lipstikCache[gradient][active])); painter->drawTiledPixmap(rect, *(lipstikCache[gradient][active]));
} else { } else {
// there wasn't anything matching in the cache, create the pixmap now... // there wasn't anything matching in the cache, create the pixmap now...
QPixmap *result = new QPixmap(10, rect.height()); TQPixmap *result = new TQPixmap(10, rect.height());
QPainter p(result); TQPainter p(result);
int r_h = result->rect().height(); int r_h = result->rect().height();
int r_x, r_y, r_x2, r_y2; int r_x, r_y, r_x2, r_y2;
@ -626,7 +626,7 @@ void SUSE2Button::renderGradient(QPainter *painter, const QRect &rect, const QCo
gl += gdelta; gl += gdelta;
bl += bdelta; bl += bdelta;
p.setPen(QColor(rl>>16, gl>>16, bl>>16)); p.setPen(TQColor(rl>>16, gl>>16, bl>>16));
p.drawLine(r_x, r_y+y, r_x2, r_y+y); p.drawLine(r_x, r_y+y, r_x2, r_y+y);
} }
@ -640,15 +640,15 @@ void SUSE2Button::renderGradient(QPainter *painter, const QRect &rect, const QCo
} }
} }
QBitmap IconEngine::icon(ButtonIcon icon, int size) TQBitmap IconEngine::icon(ButtonIcon icon, int size)
{ {
QBitmap bitmap(size,size); TQBitmap bitmap(size,size);
bitmap.fill(Qt::color0); bitmap.fill(TQt::color0);
QPainter p(&bitmap); TQPainter p(&bitmap);
p.setPen(Qt::color1); p.setPen(TQt::color1);
QRect r = bitmap.rect(); TQRect r = bitmap.rect();
// line widths // line widths
int lwTitleBar = 1; int lwTitleBar = 1;
@ -883,7 +883,7 @@ QBitmap IconEngine::icon(ButtonIcon icon, int size)
lw2 = 1; lw2 = 1;
} }
int h = QMAX( (r.width()/2), (lw1+2*lw2) ); int h = TQMAX( (r.width()/2), (lw1+2*lw2) );
// horizontal bars // horizontal bars
drawObject(p, HorizontalLine, r.x(), r.y(), r.width(), lw1); drawObject(p, HorizontalLine, r.x(), r.y(), r.width(), lw1);
@ -906,7 +906,7 @@ QBitmap IconEngine::icon(ButtonIcon icon, int size)
return bitmap; return bitmap;
} }
void IconEngine::drawObject(QPainter &p, Object object, int x, int y, int length, int lineWidth) void IconEngine::drawObject(TQPainter &p, Object object, int x, int y, int length, int lineWidth)
{ {
switch(object) { switch(object) {
case DiagonalLine: case DiagonalLine:

@ -24,14 +24,14 @@
#ifndef SUSE2BUTTON_H #ifndef SUSE2BUTTON_H
#define SUSE2BUTTON_H #define SUSE2BUTTON_H
#include <qbutton.h> #include <tqbutton.h>
#include <qpixmap.h> #include <tqpixmap.h>
#include <kcommondecoration.h> #include <kcommondecoration.h>
#include "SUSE2.h" #include "SUSE2.h"
class QTimer; class TQTimer;
namespace KWinSUSE2 { namespace KWinSUSE2 {
@ -54,16 +54,16 @@ protected slots:
void animate(); void animate();
private: private:
void enterEvent(QEvent *e); void enterEvent(TQEvent *e);
void leaveEvent(QEvent *e); void leaveEvent(TQEvent *e);
void drawButton(QPainter *painter); void drawButton(TQPainter *painter);
void drawPlastikBtn(QPainter *painter); void drawPlastikBtn(TQPainter *painter);
void drawLipstikBtn(QPainter *painter); void drawLipstikBtn(TQPainter *painter);
void renderBtnContour(QPainter *p, const QRect &r); void renderBtnContour(TQPainter *p, const TQRect &r);
void renderBtnSurface(QPainter *p, const QRect &r); void renderBtnSurface(TQPainter *p, const TQRect &r);
void renderPixel(QPainter *p, const QPoint &pos, const int alpha, const QColor &color, void renderPixel(TQPainter *p, const TQPoint &pos, const int alpha, const TQColor &color,
const int pixelPos, const int active); const int pixelPos, const int active);
void renderGradient(QPainter *p, const QRect &r, const QColor &c1, const QColor &c2, void renderGradient(TQPainter *p, const TQRect &r, const TQColor &c1, const TQColor &c2,
const int gradient, const int active); const int gradient, const int active);
@ -73,23 +73,23 @@ private:
ButtonIcon m_iconType; ButtonIcon m_iconType;
bool hover; bool hover;
QTimer *animTmr; TQTimer *animTmr;
uint animProgress; uint animProgress;
QPixmap *lipstikCache[8+3*(ANIMATIONSTEPS+1)][2]; TQPixmap *lipstikCache[8+3*(ANIMATIONSTEPS+1)][2];
}; };
/** /**
* This class creates bitmaps which can be used as icons on buttons. The icons * This class creates bitmaps which can be used as icons on buttons. The icons
* are "hardcoded". * are "hardcoded".
* Over the previous "Gimp->xpm->QImage->recolor->SmoothScale->QPixmap" solution * Over the previous "Gimp->xpm->TQImage->recolor->SmoothScale->TQPixmap" solution
* it has the important advantage that icons are more scalable and at the same * it has the important advantage that icons are more scalable and at the same
* time sharp and not blurred. * time sharp and not blurred.
*/ */
class IconEngine class IconEngine
{ {
public: public:
static QBitmap icon(ButtonIcon icon, int size); static TQBitmap icon(ButtonIcon icon, int size);
private: private:
enum Object { enum Object {
@ -99,7 +99,7 @@ class IconEngine
CrossDiagonalLine CrossDiagonalLine
}; };
static void drawObject(QPainter &p, Object object, int x, int y, int length, int lineWidth); static void drawObject(TQPainter &p, Object object, int x, int y, int length, int lineWidth);
}; };
} // namespace KWinSUSE2 } // namespace KWinSUSE2

@ -29,15 +29,15 @@
#include <kstandarddirs.h> #include <kstandarddirs.h>
#include <kdecoration.h> #include <kdecoration.h>
#include <qbitmap.h> #include <tqbitmap.h>
#include <qdatetime.h> #include <tqdatetime.h>
#include <qfontmetrics.h> #include <tqfontmetrics.h>
#include <qimage.h> #include <tqimage.h>
#include <qlabel.h> #include <tqlabel.h>
#include <qlayout.h> #include <tqlayout.h>
#include <qpainter.h> #include <tqpainter.h>
#include <qpixmap.h> #include <tqpixmap.h>
#include <qimage.h> #include <tqimage.h>
#include "SUSE2client.h" #include "SUSE2client.h"
#include "SUSE2button.h" #include "SUSE2button.h"
@ -52,7 +52,7 @@ SUSE2Client::SUSE2Client(KDecorationBridge* bridge, KDecorationFactory* factory)
aTitleBarTile(0), iTitleBarTile(0), aTitleBarTile(0), iTitleBarTile(0),
pixmaps_created(false), pixmaps_created(false),
captionBufferDirty(true), captionBufferDirty(true),
s_titleFont(QFont()) s_titleFont(TQFont())
{} {}
SUSE2Client::~SUSE2Client() SUSE2Client::~SUSE2Client()
@ -64,17 +64,17 @@ SUSE2Client::~SUSE2Client()
} }
// pure virtual methods from KCommonDecoration // pure virtual methods from KCommonDecoration
QString SUSE2Client::visibleName() const TQString SUSE2Client::visibleName() const
{ {
return i18n("SUSE2 (Version %1)").arg("0.4.1"); return i18n("SUSE2 (Version %1)").arg("0.4.1");
} }
QString SUSE2Client::defaultButtonsLeft() const TQString SUSE2Client::defaultButtonsLeft() const
{ {
return "M"; return "M";
} }
QString SUSE2Client::defaultButtonsRight() const TQString SUSE2Client::defaultButtonsRight() const
{ {
return "HIA___X"; return "HIA___X";
} }
@ -197,14 +197,14 @@ void SUSE2Client::init()
create_pixmaps(); create_pixmaps();
aCaptionBuffer = new QPixmap(); aCaptionBuffer = new TQPixmap();
iCaptionBuffer = new QPixmap(); iCaptionBuffer = new TQPixmap();
captionBufferDirty = true; captionBufferDirty = true;
KCommonDecoration::init(); KCommonDecoration::init();
} }
QRegion SUSE2Client::cornerShape(WindowCorner corner) TQRegion SUSE2Client::cornerShape(WindowCorner corner)
{ {
int w = widget()->width(); int w = widget()->width();
int h = widget()->height(); int h = widget()->height();
@ -214,58 +214,58 @@ QRegion SUSE2Client::cornerShape(WindowCorner corner)
if (layoutMetric(LM_TitleEdgeLeft) > 0 && if (layoutMetric(LM_TitleEdgeLeft) > 0 &&
(Handler()->roundCorners() == 1 || (Handler()->roundCorners() == 1 ||
(Handler()->roundCorners() == 2 && maximizeMode() != MaximizeFull))) { (Handler()->roundCorners() == 2 && maximizeMode() != MaximizeFull))) {
return QRegion(0, 0, 1, 5) + QRegion(0, 0, 2, 3) + QRegion(0, 0, 3, 2) + QRegion(0, 0, 5, 1); return TQRegion(0, 0, 1, 5) + TQRegion(0, 0, 2, 3) + TQRegion(0, 0, 3, 2) + TQRegion(0, 0, 5, 1);
} else { } else {
return QRegion(0, 0, 1, 1); return TQRegion(0, 0, 1, 1);
} }
case WC_TopRight: case WC_TopRight:
if (layoutMetric(LM_TitleEdgeRight) > 0 && if (layoutMetric(LM_TitleEdgeRight) > 0 &&
(Handler()->roundCorners() == 1 || (Handler()->roundCorners() == 1 ||
(Handler()->roundCorners() == 2 && maximizeMode() != MaximizeFull))) { (Handler()->roundCorners() == 2 && maximizeMode() != MaximizeFull))) {
return QRegion(w-1, 0, 1, 5) + QRegion(w-2, 0, 2, 3) + QRegion(w-3, 0, 3, 2) + QRegion(w-5, 0, 5, 1); return TQRegion(w-1, 0, 1, 5) + TQRegion(w-2, 0, 2, 3) + TQRegion(w-3, 0, 3, 2) + TQRegion(w-5, 0, 5, 1);
} else { } else {
return QRegion(w-1, 0, 1, 1); return TQRegion(w-1, 0, 1, 1);
} }
case WC_BottomLeft: case WC_BottomLeft:
if (layoutMetric(LM_BorderLeft) > 0) if (layoutMetric(LM_BorderLeft) > 0)
return QRegion(0, h-1, 1, 1); return TQRegion(0, h-1, 1, 1);
else else
return QRegion(); return TQRegion();
case WC_BottomRight: case WC_BottomRight:
if (layoutMetric(LM_BorderRight) > 0) if (layoutMetric(LM_BorderRight) > 0)
return QRegion(w-1, h-1, 1, 1); return TQRegion(w-1, h-1, 1, 1);
else else
return QRegion(); return TQRegion();
default: default:
return QRegion(); return TQRegion();
} }
} }
void SUSE2Client::paintEvent(QPaintEvent *e) void SUSE2Client::paintEvent(TQPaintEvent *e)
{ {
QRegion region = e->region(); TQRegion region = e->region();
if (captionBufferDirty) update_captionBuffer(); if (captionBufferDirty) update_captionBuffer();
bool active = isActive(); bool active = isActive();
QPainter painter(widget()); TQPainter painter(widget());
// colors... // colors...
const QColor windowContour = Handler()->getColor(WindowContour, active); const TQColor windowContour = Handler()->getColor(WindowContour, active);
const QColor innerWindowContour = Handler()->getColor(TitleGradientTo, active); const TQColor innerWindowContour = Handler()->getColor(TitleGradientTo, active);
const QColor deco = Handler()->getColor(TitleGradientTo, active); const TQColor deco = Handler()->getColor(TitleGradientTo, active);
const QColor aBorder = Handler()->getColor(Border, active); const TQColor aBorder = Handler()->getColor(Border, active);
const QColor darkAntiAlias = alphaBlendColors(innerWindowContour, active ? aAntialiasBase : iAntialiasBase, 140); const TQColor darkAntiAlias = alphaBlendColors(innerWindowContour, active ? aAntialiasBase : iAntialiasBase, 140);
const QColor midAntiAlias = alphaBlendColors(innerWindowContour, active ? aAntialiasBase : iAntialiasBase, 120); const TQColor midAntiAlias = alphaBlendColors(innerWindowContour, active ? aAntialiasBase : iAntialiasBase, 120);
const QColor brightAntiAlias = alphaBlendColors(innerWindowContour, active ? aAntialiasBase : iAntialiasBase, 80); const TQColor brightAntiAlias = alphaBlendColors(innerWindowContour, active ? aAntialiasBase : iAntialiasBase, 80);
const QColor innerAntiAlias = alphaBlendColors(innerWindowContour, active ? aAntialiasBase : iAntialiasBase, 170); const TQColor innerAntiAlias = alphaBlendColors(innerWindowContour, active ? aAntialiasBase : iAntialiasBase, 170);
QRect r = widget()->rect(); TQRect r = widget()->rect();
int r_w = r.width(); int r_w = r.width();
int r_x, r_y, r_x2, r_y2; int r_x, r_y, r_x2, r_y2;
@ -299,11 +299,11 @@ void SUSE2Client::paintEvent(QPaintEvent *e)
active ? *aTitleBarTile : *iTitleBarTile); active ? *aTitleBarTile : *iTitleBarTile);
} }
QRect Rtitle = QRect(r_x+titleEdgeLeft+buttonsLeftWidth(), r_y+titleEdgeTop, TQRect Rtitle = TQRect(r_x+titleEdgeLeft+buttonsLeftWidth(), r_y+titleEdgeTop,
r_x2-titleEdgeRight-buttonsRightWidth()-(r_x+titleEdgeLeft+buttonsLeftWidth()), r_x2-titleEdgeRight-buttonsRightWidth()-(r_x+titleEdgeLeft+buttonsLeftWidth()),
titleEdgeBottomBottom-(r_y+titleEdgeTop) ); titleEdgeBottomBottom-(r_y+titleEdgeTop) );
QRect tmpRect; TQRect tmpRect;
// topSpacer // topSpacer
if(titleEdgeTop > 0) { if(titleEdgeTop > 0) {
@ -419,13 +419,13 @@ void SUSE2Client::paintEvent(QPaintEvent *e)
} }
// titleSpacer // titleSpacer
QPixmap *titleBfrPtr = active ? aCaptionBuffer : iCaptionBuffer; TQPixmap *titleBfrPtr = active ? aCaptionBuffer : iCaptionBuffer;
if (Rtitle.width() > 0 && titleBfrPtr != 0) { if (Rtitle.width() > 0 && titleBfrPtr != 0) {
int tX, tW; int tX, tW;
switch (Handler()->titleAlign()) { switch (Handler()->titleAlign()) {
// AlignCenter // AlignCenter
case Qt::AlignHCenter: case TQt::AlignHCenter:
tX = (titleBfrPtr->width() > Rtitle.width()-2 * titleMargin) ? tX = (titleBfrPtr->width() > Rtitle.width()-2 * titleMargin) ?
(Rtitle.left()+titleMargin) (Rtitle.left()+titleMargin)
: Rtitle.left()+(Rtitle.width()- titleBfrPtr->width())/2; : Rtitle.left()+(Rtitle.width()- titleBfrPtr->width())/2;
@ -434,7 +434,7 @@ void SUSE2Client::paintEvent(QPaintEvent *e)
: titleBfrPtr->width(); : titleBfrPtr->width();
break; break;
// AlignRight // AlignRight
case Qt::AlignRight: case TQt::AlignRight:
tX = (titleBfrPtr->width() > Rtitle.width()-2 * titleMargin) ? tX = (titleBfrPtr->width() > Rtitle.width()-2 * titleMargin) ?
(Rtitle.left()+titleMargin) (Rtitle.left()+titleMargin)
: Rtitle.right()-titleMargin-titleBfrPtr->width(); : Rtitle.right()-titleMargin-titleBfrPtr->width();
@ -452,13 +452,13 @@ void SUSE2Client::paintEvent(QPaintEvent *e)
if(tW > 0) { if(tW > 0) {
if (titleBfrPtr->width()+2*titleMargin > Rtitle.width()) { if (titleBfrPtr->width()+2*titleMargin > Rtitle.width()) {
QPixmap *tmp = new QPixmap(30, Rtitle.height()); TQPixmap *tmp = new TQPixmap(30, Rtitle.height());
QPainter fade; TQPainter fade;
fade.begin(tmp); fade.begin(tmp);
fade.drawPixmap(0, 0, *titleBfrPtr, Rtitle.right()-30-2*titleMargin-Rtitle.left(), 0); fade.drawPixmap(0, 0, *titleBfrPtr, Rtitle.right()-30-2*titleMargin-Rtitle.left(), 0);
QImage background = (active ? *aTitleBarTile : *iTitleBarTile).convertToImage(); TQImage background = (active ? *aTitleBarTile : *iTitleBarTile).convertToImage();
QImage tmpImg = tmp->convertToImage(); TQImage tmpImg = tmp->convertToImage();
QImage blended = KImageEffect::blend(tmpImg, background, gradient, KImageEffect::Red); TQImage blended = KImageEffect::blend(tmpImg, background, gradient, KImageEffect::Red);
painter.drawPixmap(tX, Rtitle.top() - TOPMARGIN + btnMarginTop+2, *titleBfrPtr, painter.drawPixmap(tX, Rtitle.top() - TOPMARGIN + btnMarginTop+2, *titleBfrPtr,
0, 2, tW - 2* titleMargin, -1); 0, 2, tW - 2* titleMargin, -1);
@ -562,7 +562,7 @@ void SUSE2Client::updateCaption()
const int marginLeft = layoutMetric(LM_TitleBorderLeft); const int marginLeft = layoutMetric(LM_TitleBorderLeft);
const int marginRight = layoutMetric(LM_TitleBorderRight); const int marginRight = layoutMetric(LM_TitleBorderRight);
QRect g = QRect(titleEdgeLeft, titleEdgeTop, (widget()->rect()).width()-marginLeft-marginRight, titleHeight + titleEdgeBottom); TQRect g = TQRect(titleEdgeLeft, titleEdgeTop, (widget()->rect()).width()-marginLeft-marginRight, titleHeight + titleEdgeBottom);
widget()->update(g); widget()->update(g);
} }
@ -597,7 +597,7 @@ void SUSE2Client::create_pixmaps()
return; return;
KPixmap tempPixmap; KPixmap tempPixmap;
QPainter painter; TQPainter painter;
const int titleHeight = layoutMetric(LM_TitleHeight); const int titleHeight = layoutMetric(LM_TitleHeight);
@ -607,32 +607,32 @@ void SUSE2Client::create_pixmaps()
Handler()->getColor(TitleGradientFrom, true), Handler()->getColor(TitleGradientFrom, true),
Handler()->getColor(TitleGradientTo, true), Handler()->getColor(TitleGradientTo, true),
KPixmapEffect::VerticalGradient); KPixmapEffect::VerticalGradient);
aTitleBarTile = new QPixmap(30, titleHeight + TOPMARGIN + DECOHEIGHT); aTitleBarTile = new TQPixmap(30, titleHeight + TOPMARGIN + DECOHEIGHT);
painter.begin(aTitleBarTile); painter.begin(aTitleBarTile);
painter.drawPixmap(0, 0, tempPixmap); painter.drawPixmap(0, 0, tempPixmap);
QImage t; TQImage t;
if (Handler()->titlebarStyle() == 0) { // new, Toplight if (Handler()->titlebarStyle() == 0) { // new, Toplight
t = QImage(30, (titleHeight + TOPMARGIN + DECOHEIGHT)/3 + 1, 32 ); t = TQImage(30, (titleHeight + TOPMARGIN + DECOHEIGHT)/3 + 1, 32 );
t = KImageEffect::gradient(QSize(30, t.height()), t = KImageEffect::gradient(TQSize(30, t.height()),
Handler()->getColor(TitleGradientFrom, true).light(130), Handler()->getColor(TitleGradientFrom, true).light(130),
Handler()->getColor(TitleGradientTo, true), Handler()->getColor(TitleGradientTo, true),
KImageEffect::VerticalGradient/*, 100, 100*/); KImageEffect::VerticalGradient/*, 100, 100*/);
painter.drawImage(0, 2, t, 0, 0, -1, tempPixmap.height()-2); painter.drawImage(0, 2, t, 0, 0, -1, tempPixmap.height()-2);
t.create(t.width(), t.height()*2, t.depth()); t.create(t.width(), t.height()*2, t.depth());
t = KImageEffect::unbalancedGradient(QSize(30, t.height()), t = KImageEffect::unbalancedGradient(TQSize(30, t.height()),
Handler()->getColor(TitleGradientTo, true), Handler()->getColor(TitleGradientTo, true),
Handler()->getColor(TitleGradientFrom, true), Handler()->getColor(TitleGradientFrom, true),
KImageEffect::VerticalGradient, 100, 100); KImageEffect::VerticalGradient, 100, 100);
painter.drawImage(0, t.height()/2, t, 0, 0, -1, t.height()); painter.drawImage(0, t.height()/2, t, 0, 0, -1, t.height());
} else { // older, Balanced } else { // older, Balanced
t = QImage(30, (titleHeight + TOPMARGIN + DECOHEIGHT)/2 + 1, 32 ); t = TQImage(30, (titleHeight + TOPMARGIN + DECOHEIGHT)/2 + 1, 32 );
t = KImageEffect::gradient(QSize(30, t.height()), t = KImageEffect::gradient(TQSize(30, t.height()),
Handler()->getColor(TitleGradientFrom, true).light(150), Handler()->getColor(TitleGradientFrom, true).light(150),
Handler()->getColor(TitleGradientTo, true).light(110), Handler()->getColor(TitleGradientTo, true).light(110),
KImageEffect::VerticalGradient); KImageEffect::VerticalGradient);
painter.drawImage(0, 2, t, 0, 0, -1, tempPixmap.height()-2); painter.drawImage(0, 2, t, 0, 0, -1, tempPixmap.height()-2);
t = KImageEffect::gradient(QSize(30, t.height()), t = KImageEffect::gradient(TQSize(30, t.height()),
Handler()->getColor(TitleGradientTo, true), Handler()->getColor(TitleGradientTo, true),
Handler()->getColor(TitleGradientFrom, true), Handler()->getColor(TitleGradientFrom, true),
KImageEffect::VerticalGradient); KImageEffect::VerticalGradient);
@ -647,22 +647,22 @@ void SUSE2Client::create_pixmaps()
Handler()->getColor(TitleGradientFrom, false), Handler()->getColor(TitleGradientFrom, false),
Handler()->getColor(TitleGradientTo, false), Handler()->getColor(TitleGradientTo, false),
KPixmapEffect::VerticalGradient); KPixmapEffect::VerticalGradient);
iTitleBarTile = new QPixmap(30, titleHeight + TOPMARGIN + DECOHEIGHT); iTitleBarTile = new TQPixmap(30, titleHeight + TOPMARGIN + DECOHEIGHT);
painter.begin(iTitleBarTile); painter.begin(iTitleBarTile);
painter.drawPixmap(0, 0, tempPixmap); painter.drawPixmap(0, 0, tempPixmap);
painter.end(); painter.end();
QImage aTempImage = aTitleBarTile->convertToImage(); TQImage aTempImage = aTitleBarTile->convertToImage();
aGradientBottom = QColor::QColor(aTempImage.pixel(0, aTempImage.height()-1)); aGradientBottom = TQColor::TQColor(aTempImage.pixel(0, aTempImage.height()-1));
aAntialiasBase = QColor::QColor(aTempImage.pixel(0, 2)); aAntialiasBase = TQColor::TQColor(aTempImage.pixel(0, 2));
QImage iTempImage = iTitleBarTile->convertToImage(); TQImage iTempImage = iTitleBarTile->convertToImage();
iGradientBottom = QColor::QColor(iTempImage.pixel(0, iTempImage.height()-1)); iGradientBottom = TQColor::TQColor(iTempImage.pixel(0, iTempImage.height()-1));
iAntialiasBase = QColor::QColor(iTempImage.pixel(0, 2)); iAntialiasBase = TQColor::TQColor(iTempImage.pixel(0, 2));
// the gradient for the fade out effect // the gradient for the fade out effect
gradient = KImageEffect::gradient(QSize(30, titleHeight + TOPMARGIN + DECOHEIGHT), gradient = KImageEffect::gradient(TQSize(30, titleHeight + TOPMARGIN + DECOHEIGHT),
QColor(255,255,255), TQColor(255,255,255),
QColor(0,0,0), TQColor(0,0,0),
KImageEffect::HorizontalGradient); KImageEffect::HorizontalGradient);
pixmaps_created = true; pixmaps_created = true;
@ -682,16 +682,16 @@ void SUSE2Client::delete_pixmaps()
void SUSE2Client::update_captionBuffer() void SUSE2Client::update_captionBuffer()
{ {
const uint maxCaptionLength = 110; // truncate captions longer than this! const uint maxCaptionLength = 110; // truncate captions longer than this!
QString c(caption()); TQString c(caption());
if (c.length() > maxCaptionLength) { if (c.length() > maxCaptionLength) {
QString tmpLeft = c.left(50); TQString tmpLeft = c.left(50);
QString tmpRight = c.right(50); TQString tmpRight = c.right(50);
c = tmpLeft + QString::fromUtf8("[...]") + tmpRight; c = tmpLeft + TQString::fromUtf8("[...]") + tmpRight;
} }
QImage logo(Handler()->titleLogoURL()); TQImage logo(Handler()->titleLogoURL());
int logoOffset = Handler()->titleLogoOffset(); int logoOffset = Handler()->titleLogoOffset();
QFontMetrics fm(s_titleFont); TQFontMetrics fm(s_titleFont);
int captionWidth = fm.width(c); int captionWidth = fm.width(c);
int logoWidth = 0; int logoWidth = 0;
@ -705,12 +705,12 @@ void SUSE2Client::update_captionBuffer()
const int titleEdgeTop = layoutMetric(LM_TitleEdgeTop); const int titleEdgeTop = layoutMetric(LM_TitleEdgeTop);
const int titleEdgeBottom = layoutMetric(LM_TitleEdgeBottom); const int titleEdgeBottom = layoutMetric(LM_TitleEdgeBottom);
const int titleHeight = layoutMetric(LM_TitleHeight); const int titleHeight = layoutMetric(LM_TitleHeight);
QPixmap textPixmap; TQPixmap textPixmap;
QPainter painter; TQPainter painter;
if(Handler()->titleShadow()) { if(Handler()->titleShadow()) {
// prepare the shadow // prepare the shadow
textPixmap = QPixmap(captionWidth+4, titleHeight + TOPMARGIN + DECOHEIGHT); // 4 px shadow space textPixmap = TQPixmap(captionWidth+4, titleHeight + TOPMARGIN + DECOHEIGHT); // 4 px shadow space
textPixmap.fill(QColor(0,0,0)); textPixmap.fill(TQColor(0,0,0));
textPixmap.setMask(textPixmap.createHeuristicMask(true)); textPixmap.setMask(textPixmap.createHeuristicMask(true));
painter.begin(&textPixmap); painter.begin(&textPixmap);
painter.setFont(s_titleFont); painter.setFont(s_titleFont);
@ -728,7 +728,7 @@ void SUSE2Client::update_captionBuffer()
painter.end(); painter.end();
} }
QImage shadow; TQImage shadow;
ShadowEngine se; ShadowEngine se;
// active // active
@ -736,7 +736,7 @@ void SUSE2Client::update_captionBuffer()
painter.begin(aCaptionBuffer); painter.begin(aCaptionBuffer);
painter.drawTiledPixmap(aCaptionBuffer->rect(), *aTitleBarTile); painter.drawTiledPixmap(aCaptionBuffer->rect(), *aTitleBarTile);
if(Handler()->titleShadow()) { if(Handler()->titleShadow()) {
shadow = se.makeShadow(textPixmap, QColor(0, 0, 0)); shadow = se.makeShadow(textPixmap, TQColor(0, 0, 0));
painter.drawImage(1, 1, shadow); painter.drawImage(1, 1, shadow);
} }
painter.setFont(s_titleFont); painter.setFont(s_titleFont);

@ -44,34 +44,34 @@ public:
~SUSE2Client(); ~SUSE2Client();
// pure virtual methods from KCommonDecoration // pure virtual methods from KCommonDecoration
virtual QString visibleName() const; virtual TQString visibleName() const;
virtual QString defaultButtonsLeft() const; virtual TQString defaultButtonsLeft() const;
virtual QString defaultButtonsRight() const; virtual TQString defaultButtonsRight() const;
virtual KCommonDecorationButton *createButton(ButtonType type); virtual KCommonDecorationButton *createButton(ButtonType type);
virtual bool decorationBehaviour(DecorationBehaviour behaviour) const; virtual bool decorationBehaviour(DecorationBehaviour behaviour) const;
virtual int layoutMetric(LayoutMetric lm, bool respectWindowState = true, const KCommonDecorationButton * = 0) const; virtual int layoutMetric(LayoutMetric lm, bool respectWindowState = true, const KCommonDecorationButton * = 0) const;
virtual QRegion cornerShape(WindowCorner corner); virtual TQRegion cornerShape(WindowCorner corner);
virtual void updateCaption(); virtual void updateCaption();
virtual void init(); virtual void init();
const QPixmap &getTitleBarTile(bool active) const const TQPixmap &getTitleBarTile(bool active) const
{ {
return active ? *aTitleBarTile : *iTitleBarTile; return active ? *aTitleBarTile : *iTitleBarTile;
} }
protected: protected:
virtual void paintEvent(QPaintEvent *e); virtual void paintEvent(TQPaintEvent *e);
virtual void reset(unsigned long changed); virtual void reset(unsigned long changed);
private: private:
QPixmap *aCaptionBuffer, *iCaptionBuffer; TQPixmap *aCaptionBuffer, *iCaptionBuffer;
void update_captionBuffer(); void update_captionBuffer();
QPixmap *aTitleBarTile, *iTitleBarTile; TQPixmap *aTitleBarTile, *iTitleBarTile;
QImage gradient; TQImage gradient;
QColor aGradientBottom, iGradientBottom, aAntialiasBase, iAntialiasBase; TQColor aGradientBottom, iGradientBottom, aAntialiasBase, iAntialiasBase;
bool pixmaps_created; bool pixmaps_created;
void create_pixmaps(); void create_pixmaps();
void delete_pixmaps(); void delete_pixmaps();
@ -79,7 +79,7 @@ private:
bool captionBufferDirty; bool captionBufferDirty;
// settings... // settings...
QFont s_titleFont; TQFont s_titleFont;
}; };
} // KWinSUSE2 } // KWinSUSE2

@ -778,6 +778,6 @@ configdialog.cpp: $(srcdir)/configdialog.ui configdialog.h configdialog.moc
configdialog.h: $(srcdir)/configdialog.ui configdialog.h: $(srcdir)/configdialog.ui
rm -rf configdialog.h; rm -rf configdialog.h;
$(UIC) $(srcdir)/configdialog.ui | $(PERL) -pi -e "s,public QWizard,public KWizard,g; s,#include <qwizard.h>,#include <kwizard.h>,g" >> configdialog.h ; $(UIC) $(srcdir)/configdialog.ui | $(PERL) -pi -e "s,public QWizard,public KWizard,g; s,#include <tqwizard.h>,#include <kwizard.h>,g" >> configdialog.h ;
configdialog.moc: configdialog.h configdialog.moc: configdialog.h
$(MOC) configdialog.h -o configdialog.moc $(MOC) configdialog.h -o configdialog.moc

@ -25,15 +25,15 @@
//#include <kdebug.h> //#include <kdebug.h>
#include <qbuttongroup.h> #include <tqbuttongroup.h>
#include <qcheckbox.h> #include <tqcheckbox.h>
#include <qradiobutton.h> #include <tqradiobutton.h>
#include <qslider.h> #include <tqslider.h>
#include <qspinbox.h> #include <tqspinbox.h>
#include <qwhatsthis.h> #include <tqwhatsthis.h>
#include <qimage.h> #include <tqimage.h>
#include <qlabel.h> #include <tqlabel.h>
#include <qcombobox.h> #include <tqcombobox.h>
#include <kdeversion.h> #include <kdeversion.h>
#include <kconfig.h> #include <kconfig.h>
@ -50,8 +50,8 @@
#include "config.h" #include "config.h"
#include "configdialog.h" #include "configdialog.h"
SUSE2Config::SUSE2Config(KConfig *config, QWidget *parent) SUSE2Config::SUSE2Config(KConfig *config, TQWidget *parent)
: QObject(parent), m_config(0), m_dialog(0) : TQObject(parent), m_config(0), m_dialog(0)
{ {
m_parent = parent; m_parent = parent;
// create the configuration object // create the configuration object
@ -83,10 +83,10 @@ SUSE2Config::SUSE2Config(KConfig *config, QWidget *parent)
connect(m_dialog->redCloseButton, SIGNAL(toggled(bool)), SIGNAL(changed())); connect(m_dialog->redCloseButton, SIGNAL(toggled(bool)), SIGNAL(changed()));
connect(m_dialog->iconSize, SIGNAL(valueChanged(int)), SIGNAL(changed())); connect(m_dialog->iconSize, SIGNAL(valueChanged(int)), SIGNAL(changed()));
connect(m_dialog->customIconColors, SIGNAL(toggled(bool)), SIGNAL(changed())); connect(m_dialog->customIconColors, SIGNAL(toggled(bool)), SIGNAL(changed()));
connect(m_dialog->activeFgColor, SIGNAL(changed(const QColor &)), SIGNAL(changed())); connect(m_dialog->activeFgColor, SIGNAL(changed(const TQColor &)), SIGNAL(changed()));
connect(m_dialog->activeBgColor, SIGNAL(changed(const QColor &)), SIGNAL(changed())); connect(m_dialog->activeBgColor, SIGNAL(changed(const TQColor &)), SIGNAL(changed()));
connect(m_dialog->inactiveFgColor, SIGNAL(changed(const QColor &)), SIGNAL(changed())); connect(m_dialog->inactiveFgColor, SIGNAL(changed(const TQColor &)), SIGNAL(changed()));
connect(m_dialog->inactiveBgColor, SIGNAL(changed(const QColor &)), SIGNAL(changed())); connect(m_dialog->inactiveBgColor, SIGNAL(changed(const TQColor &)), SIGNAL(changed()));
connect(m_dialog->iconShadow, SIGNAL(toggled(bool)), SIGNAL(changed())); connect(m_dialog->iconShadow, SIGNAL(toggled(bool)), SIGNAL(changed()));
connect(m_dialog->titleBarLogo, SIGNAL(toggled(bool)), SIGNAL(changed())); connect(m_dialog->titleBarLogo, SIGNAL(toggled(bool)), SIGNAL(changed()));
@ -106,12 +106,12 @@ void SUSE2Config::load(KConfig *)
{ {
m_config->setGroup("General"); m_config->setGroup("General");
QString alignValue = m_config->readEntry("TitleAlignment", "AlignLeft"); TQString alignValue = m_config->readEntry("TitleAlignment", "AlignLeft");
QRadioButton *alignButton = (QRadioButton*)m_dialog->titleAlign->child(alignValue.latin1()); TQRadioButton *alignButton = (TQRadioButton*)m_dialog->titleAlign->child(alignValue.latin1());
if (alignButton) alignButton->setChecked(true); if (alignButton) alignButton->setChecked(true);
QString roundValue = m_config->readEntry("RoundCorners", "NotMaximized"); TQString roundValue = m_config->readEntry("RoundCorners", "NotMaximized");
QRadioButton *roundButton = (QRadioButton*)m_dialog->roundCorners->child(roundValue.latin1()); TQRadioButton *roundButton = (TQRadioButton*)m_dialog->roundCorners->child(roundValue.latin1());
if (roundButton) roundButton->setChecked(true); if (roundButton) roundButton->setChecked(true);
bool menuClose = m_config->readBoolEntry("CloseOnMenuDoubleClick", false); bool menuClose = m_config->readBoolEntry("CloseOnMenuDoubleClick", false);
@ -147,20 +147,20 @@ void SUSE2Config::load(KConfig *)
bool customIconColors = m_config->readBoolEntry("CustomIconColors", false); bool customIconColors = m_config->readBoolEntry("CustomIconColors", false);
m_dialog->customIconColors->setChecked(customIconColors); m_dialog->customIconColors->setChecked(customIconColors);
QColor afgcolor = QColor(10, 20, 40); TQColor afgcolor = TQColor(10, 20, 40);
QColor aFgColor = m_config->readColorEntry("AFgColor", &afgcolor); TQColor aFgColor = m_config->readColorEntry("AFgColor", &afgcolor);
m_dialog->activeFgColor->setColor(aFgColor); m_dialog->activeFgColor->setColor(aFgColor);
QColor abgcolor = QColor(210, 220, 240); TQColor abgcolor = TQColor(210, 220, 240);
QColor aBgColor = m_config->readColorEntry("ABgColor", &abgcolor); TQColor aBgColor = m_config->readColorEntry("ABgColor", &abgcolor);
m_dialog->activeBgColor->setColor(aBgColor); m_dialog->activeBgColor->setColor(aBgColor);
QColor ifgcolor = QColor(40, 40, 40); TQColor ifgcolor = TQColor(40, 40, 40);
QColor iFgColor = m_config->readColorEntry("IFgColor", &ifgcolor); TQColor iFgColor = m_config->readColorEntry("IFgColor", &ifgcolor);
m_dialog->inactiveFgColor->setColor(iFgColor); m_dialog->inactiveFgColor->setColor(iFgColor);
QColor ibgcolor = QColor(240, 240, 240); TQColor ibgcolor = TQColor(240, 240, 240);
QColor iBgColor = m_config->readColorEntry("AFgColor", &ibgcolor); TQColor iBgColor = m_config->readColorEntry("AFgColor", &ibgcolor);
m_dialog->inactiveBgColor->setColor(iBgColor); m_dialog->inactiveBgColor->setColor(iBgColor);
bool iconShadow = m_config->readBoolEntry("IconShadow", true); bool iconShadow = m_config->readBoolEntry("IconShadow", true);
@ -172,10 +172,10 @@ void SUSE2Config::load(KConfig *)
int titleBarLogoOffset = m_config->readNumEntry("TitleBarLogoOffset", 3); int titleBarLogoOffset = m_config->readNumEntry("TitleBarLogoOffset", 3);
m_dialog->titleBarLogoOffset->setValue(titleBarLogoOffset); m_dialog->titleBarLogoOffset->setValue(titleBarLogoOffset);
QString titleBarImage = locate("data", "kwin/pics/titlebar_decor.png"); TQString titleBarImage = locate("data", "kwin/pics/titlebar_decor.png");
titlebarLogoURL = m_config->readEntry("TitleBarLogoURL", titleBarImage); titlebarLogoURL = m_config->readEntry("TitleBarLogoURL", titleBarImage);
QImage tmpLogo = QImage::QImage(titlebarLogoURL); TQImage tmpLogo = TQImage::TQImage(titlebarLogoURL);
m_dialog->logoImage->setPixmap(QPixmap(tmpLogo.smoothScale(120, 20, QImage::ScaleMin))); m_dialog->logoImage->setPixmap(TQPixmap(tmpLogo.smoothScale(120, 20, TQImage::ScaleMin)));
} }
@ -183,10 +183,10 @@ void SUSE2Config::save(KConfig *) const
{ {
m_config->setGroup("General"); m_config->setGroup("General");
QRadioButton *alignButton = (QRadioButton*)m_dialog->titleAlign->selected(); TQRadioButton *alignButton = (TQRadioButton*)m_dialog->titleAlign->selected();
if (alignButton) m_config->writeEntry("TitleAlignment", QString(alignButton->name())); if (alignButton) m_config->writeEntry("TitleAlignment", TQString(alignButton->name()));
QRadioButton *roundButton = (QRadioButton*)m_dialog->roundCorners->selected(); TQRadioButton *roundButton = (TQRadioButton*)m_dialog->roundCorners->selected();
if (roundButton) m_config->writeEntry("RoundCorners", QString(roundButton->name())); if (roundButton) m_config->writeEntry("RoundCorners", TQString(roundButton->name()));
m_config->writeEntry("CloseOnMenuDoubleClick", m_dialog->menuClose->isChecked()); m_config->writeEntry("CloseOnMenuDoubleClick", m_dialog->menuClose->isChecked());
m_config->writeEntry("TitleShadow", m_dialog->titleShadow->isChecked()); m_config->writeEntry("TitleShadow", m_dialog->titleShadow->isChecked());
m_config->writeEntry("AddSpace", m_dialog->addSpace->value()); m_config->writeEntry("AddSpace", m_dialog->addSpace->value());
@ -207,15 +207,15 @@ void SUSE2Config::save(KConfig *) const
m_config->writeEntry("TitleBarLogo", m_dialog->titleBarLogo->isChecked()); m_config->writeEntry("TitleBarLogo", m_dialog->titleBarLogo->isChecked());
m_config->writeEntry("TitleBarLogoOffset", m_dialog->titleBarLogoOffset->value()); m_config->writeEntry("TitleBarLogoOffset", m_dialog->titleBarLogoOffset->value());
m_config->writeEntry("TitleBarLogoURL", QString(titlebarLogoURL)); m_config->writeEntry("TitleBarLogoURL", TQString(titlebarLogoURL));
m_config->sync(); m_config->sync();
} }
void SUSE2Config::defaults() void SUSE2Config::defaults()
{ {
QRadioButton *alignButton = (QRadioButton*)m_dialog->titleAlign->child("AlignLeft"); TQRadioButton *alignButton = (TQRadioButton*)m_dialog->titleAlign->child("AlignLeft");
if (alignButton) alignButton->setChecked(true); if (alignButton) alignButton->setChecked(true);
QRadioButton *roundButton = (QRadioButton*)m_dialog->roundCorners->child("NotMaximized"); TQRadioButton *roundButton = (TQRadioButton*)m_dialog->roundCorners->child("NotMaximized");
if (roundButton) roundButton->setChecked(true); if (roundButton) roundButton->setChecked(true);
m_dialog->menuClose->setChecked(false); m_dialog->menuClose->setChecked(false);
m_dialog->titleShadow->setChecked(true); m_dialog->titleShadow->setChecked(true);
@ -229,17 +229,17 @@ void SUSE2Config::defaults()
m_dialog->redCloseButton->setChecked(false); m_dialog->redCloseButton->setChecked(false);
m_dialog->iconSize->setValue(45); m_dialog->iconSize->setValue(45);
m_dialog->customIconColors->setChecked(false); m_dialog->customIconColors->setChecked(false);
m_dialog->activeFgColor->setColor(QColor(10, 20, 40)); m_dialog->activeFgColor->setColor(TQColor(10, 20, 40));
m_dialog->activeBgColor->setColor(QColor(210, 220, 240)); m_dialog->activeBgColor->setColor(TQColor(210, 220, 240));
m_dialog->inactiveFgColor->setColor(QColor(40, 40, 40)); m_dialog->inactiveFgColor->setColor(TQColor(40, 40, 40));
m_dialog->inactiveBgColor->setColor(QColor(240, 240, 240)); m_dialog->inactiveBgColor->setColor(TQColor(240, 240, 240));
m_dialog->iconShadow->setChecked(true); m_dialog->iconShadow->setChecked(true);
m_dialog->titleBarLogo->setChecked(false); m_dialog->titleBarLogo->setChecked(false);
m_dialog->titleBarLogoOffset->setValue(3); m_dialog->titleBarLogoOffset->setValue(3);
titlebarLogoURL = locate("data", "kwin/pics/titlebar_decor.png"); titlebarLogoURL = locate("data", "kwin/pics/titlebar_decor.png");
QImage tmpLogo = QImage::QImage(titlebarLogoURL); TQImage tmpLogo = TQImage::TQImage(titlebarLogoURL);
m_dialog->logoImage->setPixmap(QPixmap(tmpLogo.smoothScale(120, 20, QImage::ScaleMin))); m_dialog->logoImage->setPixmap(TQPixmap(tmpLogo.smoothScale(120, 20, TQImage::ScaleMin)));
} }
void SUSE2Config::toggleIconSettings(bool checked) const void SUSE2Config::toggleIconSettings(bool checked) const
@ -262,8 +262,8 @@ void SUSE2Config::selectImage()
KFileItem tmpFileItem = KFileItem(KFileItem::Unknown, KFileItem::Unknown, logoURL); KFileItem tmpFileItem = KFileItem(KFileItem::Unknown, KFileItem::Unknown, logoURL);
if (!logoURL.isEmpty() && tmpFileItem.isFile() && tmpFileItem.isReadable()) { if (!logoURL.isEmpty() && tmpFileItem.isFile() && tmpFileItem.isReadable()) {
titlebarLogoURL = logoURL.path(); titlebarLogoURL = logoURL.path();
QImage tmpLogo = QImage::QImage(titlebarLogoURL); TQImage tmpLogo = TQImage::TQImage(titlebarLogoURL);
m_dialog->logoImage->setPixmap(QPixmap(tmpLogo.smoothScale(120, 20, QImage::ScaleMin))); m_dialog->logoImage->setPixmap(TQPixmap(tmpLogo.smoothScale(120, 20, TQImage::ScaleMin)));
emit changed(); emit changed();
} }
} }
@ -274,7 +274,7 @@ void SUSE2Config::selectImage()
extern "C" extern "C"
{ {
KDE_EXPORT QObject *allocate_config(KConfig *config, QWidget *parent) { KDE_EXPORT TQObject *allocate_config(KConfig *config, TQWidget *parent) {
return (new SUSE2Config(config, parent)); return (new SUSE2Config(config, parent));
} }
} }

@ -24,19 +24,19 @@
#ifndef CONFIG_H #ifndef CONFIG_H
#define CONFIG_H #define CONFIG_H
#include <qobject.h> #include <tqobject.h>
class QButtonGroup; class TQButtonGroup;
class QGroupBox; class TQGroupBox;
class KConfig; class KConfig;
class ConfigDialog; class ConfigDialog;
class SUSE2Config : public QObject class SUSE2Config : public TQObject
{ {
Q_OBJECT Q_OBJECT
public: public:
SUSE2Config(KConfig *config, QWidget *parent); SUSE2Config(KConfig *config, TQWidget *parent);
~SUSE2Config(); ~SUSE2Config();
signals: signals:
@ -48,10 +48,10 @@ public slots:
void defaults(); void defaults();
private: private:
QWidget *m_parent; TQWidget *m_parent;
KConfig *m_config; KConfig *m_config;
ConfigDialog *m_dialog; ConfigDialog *m_dialog;
QString titlebarLogoURL; TQString titlebarLogoURL;
private slots: private slots:
void toggleIconSettings(bool) const; void toggleIconSettings(bool) const;

@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>ConfigDialog</class> <class>ConfigDialog</class>
<widget class="QWidget"> <widget class="TQWidget">
<property name="name"> <property name="name">
<cstring>ConfigDialog</cstring> <cstring>ConfigDialog</cstring>
</property> </property>
@ -22,11 +22,11 @@
<property name="margin"> <property name="margin">
<number>0</number> <number>0</number>
</property> </property>
<widget class="QTabWidget" row="0" column="0"> <widget class="TQTabWidget" row="0" column="0">
<property name="name"> <property name="name">
<cstring>tabWidget2</cstring> <cstring>tabWidget2</cstring>
</property> </property>
<widget class="QWidget"> <widget class="TQWidget">
<property name="name"> <property name="name">
<cstring>tab</cstring> <cstring>tab</cstring>
</property> </property>
@ -37,7 +37,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QButtonGroup" row="0" column="0"> <widget class="TQButtonGroup" row="0" column="0">
<property name="name"> <property name="name">
<cstring>titleAlign</cstring> <cstring>titleAlign</cstring>
</property> </property>
@ -48,7 +48,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QRadioButton"> <widget class="TQRadioButton">
<property name="name"> <property name="name">
<cstring>AlignLeft</cstring> <cstring>AlignLeft</cstring>
</property> </property>
@ -59,7 +59,7 @@
<string>Align the title left.</string> <string>Align the title left.</string>
</property> </property>
</widget> </widget>
<widget class="QRadioButton"> <widget class="TQRadioButton">
<property name="name"> <property name="name">
<cstring>AlignHCenter</cstring> <cstring>AlignHCenter</cstring>
</property> </property>
@ -70,7 +70,7 @@
<string>Center the title.</string> <string>Center the title.</string>
</property> </property>
</widget> </widget>
<widget class="QRadioButton"> <widget class="TQRadioButton">
<property name="name"> <property name="name">
<cstring>AlignRight</cstring> <cstring>AlignRight</cstring>
</property> </property>
@ -83,7 +83,7 @@
</widget> </widget>
</hbox> </hbox>
</widget> </widget>
<widget class="QButtonGroup" row="1" column="0"> <widget class="TQButtonGroup" row="1" column="0">
<property name="name"> <property name="name">
<cstring>roundCorners</cstring> <cstring>roundCorners</cstring>
</property> </property>
@ -94,7 +94,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QRadioButton"> <widget class="TQRadioButton">
<property name="name"> <property name="name">
<cstring>RoundAlways</cstring> <cstring>RoundAlways</cstring>
</property> </property>
@ -108,7 +108,7 @@
<string>Always draw rounded window top corners.</string> <string>Always draw rounded window top corners.</string>
</property> </property>
</widget> </widget>
<widget class="QRadioButton"> <widget class="TQRadioButton">
<property name="name"> <property name="name">
<cstring>NotMaximized</cstring> <cstring>NotMaximized</cstring>
</property> </property>
@ -122,7 +122,7 @@
<string>Draw rounded top corners if the window is not maximized.</string> <string>Draw rounded top corners if the window is not maximized.</string>
</property> </property>
</widget> </widget>
<widget class="QRadioButton"> <widget class="TQRadioButton">
<property name="name"> <property name="name">
<cstring>RoundNever</cstring> <cstring>RoundNever</cstring>
</property> </property>
@ -138,7 +138,7 @@
</widget> </widget>
</hbox> </hbox>
</widget> </widget>
<widget class="QCheckBox" row="2" column="0"> <widget class="TQCheckBox" row="2" column="0">
<property name="name"> <property name="name">
<cstring>menuClose</cstring> <cstring>menuClose</cstring>
</property> </property>
@ -149,7 +149,7 @@
<string>Check this option if you want windows to be closed when you double click the menu button, similar to Microsoft Windows.</string> <string>Check this option if you want windows to be closed when you double click the menu button, similar to Microsoft Windows.</string>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" row="3" column="0"> <widget class="TQCheckBox" row="3" column="0">
<property name="name"> <property name="name">
<cstring>titleShadow</cstring> <cstring>titleShadow</cstring>
</property> </property>
@ -160,7 +160,7 @@
<string>Check this option if you want the titlebar text to have a 3D look with a shadow behind it.</string> <string>Check this option if you want the titlebar text to have a 3D look with a shadow behind it.</string>
</property> </property>
</widget> </widget>
<widget class="QLayoutWidget" row="4" column="0"> <widget class="TQLayoutWidget" row="4" column="0">
<property name="name"> <property name="name">
<cstring>layout6</cstring> <cstring>layout6</cstring>
</property> </property>
@ -182,7 +182,7 @@
<string>Here you can set some additional space for the titlebar height.</string> <string>Here you can set some additional space for the titlebar height.</string>
</property> </property>
</widget> </widget>
<widget class="QLabel"> <widget class="TQLabel">
<property name="name"> <property name="name">
<cstring>textLabel1_4</cstring> <cstring>textLabel1_4</cstring>
</property> </property>
@ -217,7 +217,7 @@
</spacer> </spacer>
</hbox> </hbox>
</widget> </widget>
<widget class="QLayoutWidget" row="5" column="0"> <widget class="TQLayoutWidget" row="5" column="0">
<property name="name"> <property name="name">
<cstring>layout7</cstring> <cstring>layout7</cstring>
</property> </property>
@ -225,7 +225,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QLabel"> <widget class="TQLabel">
<property name="name"> <property name="name">
<cstring>textLabel1_5</cstring> <cstring>textLabel1_5</cstring>
</property> </property>
@ -241,7 +241,7 @@
<string>Titlebarstyle:</string> <string>Titlebarstyle:</string>
</property> </property>
</widget> </widget>
<widget class="QComboBox"> <widget class="TQComboBox">
<item> <item>
<property name="text"> <property name="text">
<string>Toplight</string> <string>Toplight</string>
@ -280,7 +280,7 @@
</widget> </widget>
</grid> </grid>
</widget> </widget>
<widget class="QWidget"> <widget class="TQWidget">
<property name="name"> <property name="name">
<cstring>tab</cstring> <cstring>tab</cstring>
</property> </property>
@ -291,7 +291,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QLayoutWidget" row="0" column="0"> <widget class="TQLayoutWidget" row="0" column="0">
<property name="name"> <property name="name">
<cstring>layout5</cstring> <cstring>layout5</cstring>
</property> </property>
@ -299,7 +299,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QLabel"> <widget class="TQLabel">
<property name="name"> <property name="name">
<cstring>textLabel1_2</cstring> <cstring>textLabel1_2</cstring>
</property> </property>
@ -315,7 +315,7 @@
<string>Buttontype:</string> <string>Buttontype:</string>
</property> </property>
</widget> </widget>
<widget class="QComboBox"> <widget class="TQComboBox">
<item> <item>
<property name="text"> <property name="text">
<string>Plastik flat</string> <string>Plastik flat</string>
@ -384,7 +384,7 @@
</size> </size>
</property> </property>
</spacer> </spacer>
<widget class="QCheckBox" row="1" column="0"> <widget class="TQCheckBox" row="1" column="0">
<property name="name"> <property name="name">
<cstring>customColors</cstring> <cstring>customColors</cstring>
</property> </property>
@ -395,7 +395,7 @@
<string>Allow custom colors for the button background. The colors for the buttonbackground from the colorscheme are used then.</string> <string>Allow custom colors for the button background. The colors for the buttonbackground from the colorscheme are used then.</string>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" row="2" column="0"> <widget class="TQCheckBox" row="2" column="0">
<property name="name"> <property name="name">
<cstring>useTitleProps</cstring> <cstring>useTitleProps</cstring>
</property> </property>
@ -406,7 +406,7 @@
<string>Use the titlefont settings (color, shadow) for the button icons. Overrides the custom color settings.</string> <string>Use the titlefont settings (color, shadow) for the button icons. Overrides the custom color settings.</string>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" row="3" column="0"> <widget class="TQCheckBox" row="3" column="0">
<property name="name"> <property name="name">
<cstring>animateButtons</cstring> <cstring>animateButtons</cstring>
</property> </property>
@ -417,7 +417,7 @@
<string>Check this option if you want the buttons to fade in when the mouse pointer hovers over them and fade out again when it moves away.</string> <string>Check this option if you want the buttons to fade in when the mouse pointer hovers over them and fade out again when it moves away.</string>
</property> </property>
</widget> </widget>
<widget class="QLayoutWidget" row="5" column="0"> <widget class="TQLayoutWidget" row="5" column="0">
<property name="name"> <property name="name">
<cstring>layout5</cstring> <cstring>layout5</cstring>
</property> </property>
@ -425,7 +425,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QLabel"> <widget class="TQLabel">
<property name="name"> <property name="name">
<cstring>textLabel1_3</cstring> <cstring>textLabel1_3</cstring>
</property> </property>
@ -477,7 +477,7 @@
</spacer> </spacer>
</hbox> </hbox>
</widget> </widget>
<widget class="QCheckBox" row="4" column="0"> <widget class="TQCheckBox" row="4" column="0">
<property name="name"> <property name="name">
<cstring>redCloseButton</cstring> <cstring>redCloseButton</cstring>
</property> </property>
@ -488,7 +488,7 @@
<string>Paint the icon of the closebutton in red (this overrides all other colorsettings).</string> <string>Paint the icon of the closebutton in red (this overrides all other colorsettings).</string>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" row="0" column="1"> <widget class="TQCheckBox" row="0" column="1">
<property name="name"> <property name="name">
<cstring>customIconColors</cstring> <cstring>customIconColors</cstring>
</property> </property>
@ -516,7 +516,7 @@
</size> </size>
</property> </property>
</spacer> </spacer>
<widget class="QLayoutWidget" row="1" column="1" rowspan="4" colspan="1"> <widget class="TQLayoutWidget" row="1" column="1" rowspan="4" colspan="1">
<property name="name"> <property name="name">
<cstring>layout13</cstring> <cstring>layout13</cstring>
</property> </property>
@ -524,7 +524,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QLayoutWidget"> <widget class="TQLayoutWidget">
<property name="name"> <property name="name">
<cstring>layout11</cstring> <cstring>layout11</cstring>
</property> </property>
@ -532,7 +532,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QLabel"> <widget class="TQLabel">
<property name="name"> <property name="name">
<cstring>activeLbl</cstring> <cstring>activeLbl</cstring>
</property> </property>
@ -540,7 +540,7 @@
<string>Active:</string> <string>Active:</string>
</property> </property>
</widget> </widget>
<widget class="QLabel"> <widget class="TQLabel">
<property name="name"> <property name="name">
<cstring>activeDownLbl</cstring> <cstring>activeDownLbl</cstring>
</property> </property>
@ -548,7 +548,7 @@
<string>Active down:</string> <string>Active down:</string>
</property> </property>
</widget> </widget>
<widget class="QLabel"> <widget class="TQLabel">
<property name="name"> <property name="name">
<cstring>inactiveLbl</cstring> <cstring>inactiveLbl</cstring>
</property> </property>
@ -556,7 +556,7 @@
<string>Inactive:</string> <string>Inactive:</string>
</property> </property>
</widget> </widget>
<widget class="QLabel"> <widget class="TQLabel">
<property name="name"> <property name="name">
<cstring>inactiveDownLbl</cstring> <cstring>inactiveDownLbl</cstring>
</property> </property>
@ -566,7 +566,7 @@
</widget> </widget>
</vbox> </vbox>
</widget> </widget>
<widget class="QLayoutWidget"> <widget class="TQLayoutWidget">
<property name="name"> <property name="name">
<cstring>layout12</cstring> <cstring>layout12</cstring>
</property> </property>
@ -622,7 +622,7 @@
</widget> </widget>
</hbox> </hbox>
</widget> </widget>
<widget class="QCheckBox" row="5" column="1"> <widget class="TQCheckBox" row="5" column="1">
<property name="name"> <property name="name">
<cstring>iconShadow</cstring> <cstring>iconShadow</cstring>
</property> </property>
@ -635,7 +635,7 @@
</widget> </widget>
</grid> </grid>
</widget> </widget>
<widget class="QWidget"> <widget class="TQWidget">
<property name="name"> <property name="name">
<cstring>TabPage</cstring> <cstring>TabPage</cstring>
</property> </property>
@ -663,7 +663,7 @@
</size> </size>
</property> </property>
</spacer> </spacer>
<widget class="QLabel" row="2" column="0"> <widget class="TQLabel" row="2" column="0">
<property name="name"> <property name="name">
<cstring>textLabel1</cstring> <cstring>textLabel1</cstring>
</property> </property>
@ -679,7 +679,7 @@
<string>Logo preview:</string> <string>Logo preview:</string>
</property> </property>
</widget> </widget>
<widget class="QLabel" row="2" column="1" rowspan="1" colspan="2"> <widget class="TQLabel" row="2" column="1" rowspan="1" colspan="2">
<property name="name"> <property name="name">
<cstring>logoImage</cstring> <cstring>logoImage</cstring>
</property> </property>
@ -713,7 +713,7 @@
<string></string> <string></string>
</property> </property>
</widget> </widget>
<widget class="QLabel" row="1" column="0" rowspan="1" colspan="2"> <widget class="TQLabel" row="1" column="0" rowspan="1" colspan="2">
<property name="name"> <property name="name">
<cstring>textLabel2</cstring> <cstring>textLabel2</cstring>
</property> </property>
@ -768,7 +768,7 @@
</size> </size>
</property> </property>
</spacer> </spacer>
<widget class="QPushButton" row="2" column="3"> <widget class="TQPushButton" row="2" column="3">
<property name="name"> <property name="name">
<cstring>selectButton</cstring> <cstring>selectButton</cstring>
</property> </property>
@ -796,7 +796,7 @@
</size> </size>
</property> </property>
</spacer> </spacer>
<widget class="QCheckBox" row="0" column="0" rowspan="1" colspan="5"> <widget class="TQCheckBox" row="0" column="0" rowspan="1" colspan="5">
<property name="name"> <property name="name">
<cstring>titleBarLogo</cstring> <cstring>titleBarLogo</cstring>
</property> </property>

@ -24,13 +24,13 @@
#include <kpixmap.h> #include <kpixmap.h>
#include <kpixmapeffect.h> #include <kpixmapeffect.h>
#include <qcolor.h> #include <tqcolor.h>
#include <qimage.h> #include <tqimage.h>
#include <qpainter.h> #include <tqpainter.h>
#include "misc.h" #include "misc.h"
QColor hsvRelative(QColor& baseColor, int relativeH, int relativeS, int relativeV) TQColor hsvRelative(TQColor& baseColor, int relativeH, int relativeS, int relativeV)
{ {
int h, s, v; int h, s, v;
baseColor.hsv(&h, &s, &v); baseColor.hsv(&h, &s, &v);
@ -46,38 +46,38 @@ QColor hsvRelative(QColor& baseColor, int relativeH, int relativeS, int relative
if(v < 0) { v = 0; } if(v < 0) { v = 0; }
else if(v > 255) { v = 255; } else if(v > 255) { v = 255; }
QColor c; TQColor c;
c.setHsv( h, s, v ); c.setHsv( h, s, v );
return c; return c;
} }
QColor alphaBlendColors(const QColor &bgColor, const QColor &fgColor, const int a) TQColor alphaBlendColors(const TQColor &bgColor, const TQColor &fgColor, const int a)
{ {
// normal button... // normal button...
QRgb rgb = bgColor.rgb(); TQRgb rgb = bgColor.rgb();
QRgb rgb_b = fgColor.rgb(); TQRgb rgb_b = fgColor.rgb();
int alpha = a; int alpha = a;
if(alpha>255) alpha = 255; if(alpha>255) alpha = 255;
if(alpha<0) alpha = 0; if(alpha<0) alpha = 0;
int inv_alpha = 255 - alpha; int inv_alpha = 255 - alpha;
QColor result = QColor( qRgb(qRed(rgb_b)*inv_alpha/255 + qRed(rgb)*alpha/255, TQColor result = TQColor( tqRgb(tqRed(rgb_b)*inv_alpha/255 + tqRed(rgb)*alpha/255,
qGreen(rgb_b)*inv_alpha/255 + qGreen(rgb)*alpha/255, tqGreen(rgb_b)*inv_alpha/255 + tqGreen(rgb)*alpha/255,
qBlue(rgb_b)*inv_alpha/255 + qBlue(rgb)*alpha/255) ); tqBlue(rgb_b)*inv_alpha/255 + tqBlue(rgb)*alpha/255) );
return result; return result;
} }
QImage recolorImage(QImage *img, QColor color) { TQImage recolorImage(TQImage *img, TQColor color) {
QImage destImg(img->width(),img->height(),32); TQImage destImg(img->width(),img->height(),32);
destImg.setAlphaBuffer(true); destImg.setAlphaBuffer(true);
for (int x = 0; x < img->width(); x++) { for (int x = 0; x < img->width(); x++) {
for (int y = 0; y < img->height(); y++) { for (int y = 0; y < img->height(); y++) {
if(img->pixel(x,y) == qRgb(0,0,0)) { if(img->pixel(x,y) == tqRgb(0,0,0)) {
destImg.setPixel(x,y,color.rgb() ); // set to the new color destImg.setPixel(x,y,color.rgb() ); // set to the new color
} else { } else {
destImg.setPixel(x,y,qRgba(0,0,0,0) ); // set transparent... destImg.setPixel(x,y,tqRgba(0,0,0,0) ); // set transparent...
} }
} }
} }

@ -23,8 +23,8 @@
#ifndef MISC_H #ifndef MISC_H
#define MISC_H #define MISC_H
QColor hsvRelative(QColor& baseColor, int relativeH, int relativeS = 0, int relativeV = 0); TQColor hsvRelative(TQColor& baseColor, int relativeH, int relativeS = 0, int relativeV = 0);
QColor alphaBlendColors(const QColor &backgroundColor, const QColor &foregroundColor, const int alpha); TQColor alphaBlendColors(const TQColor &backgroundColor, const TQColor &foregroundColor, const int alpha);
QImage recolorImage(QImage *img, QColor color); TQImage recolorImage(TQImage *img, TQColor color);
#endif // MISC_H #endif // MISC_H

@ -28,7 +28,7 @@
*/ */
#include "shadow.h" #include "shadow.h"
#include <qcolor.h> #include <tqcolor.h>
ShadowEngine::ShadowEngine() ShadowEngine::ShadowEngine()
{ {
@ -40,9 +40,9 @@ ShadowEngine::~ShadowEngine()
{ {
} }
QImage ShadowEngine::makeShadow(const QPixmap& textPixmap, const QColor &bgColor) TQImage ShadowEngine::makeShadow(const TQPixmap& textPixmap, const TQColor &bgColor)
{ {
QImage result; TQImage result;
// create a new image for for the shaddow // create a new image for for the shaddow
int w = textPixmap.width(); int w = textPixmap.width();
@ -58,7 +58,7 @@ QImage ShadowEngine::makeShadow(const QPixmap& textPixmap, const QColor &bgColor
/* /*
* This is the source pixmap * This is the source pixmap
*/ */
QImage img = textPixmap.convertToImage().convertDepth(32); TQImage img = textPixmap.convertToImage().convertDepth(32);
/* /*
* Resize the image if necessary * Resize the image if necessary
@ -78,14 +78,14 @@ QImage ShadowEngine::makeShadow(const QPixmap& textPixmap, const QColor &bgColor
alphaShadow = decay(img, i, j); alphaShadow = decay(img, i, j);
alphaShadow = (alphaShadow > 180.0) ? 180.0 : alphaShadow; alphaShadow = (alphaShadow > 180.0) ? 180.0 : alphaShadow;
// update the shadow's i,j pixel. // update the shadow's i,j pixel.
result.setPixel(i,j, qRgba(bgRed, bgGreen , bgBlue, (int) alphaShadow)); result.setPixel(i,j, tqRgba(bgRed, bgGreen , bgBlue, (int) alphaShadow));
} }
} }
return result; return result;
} }
float ShadowEngine::decay(QImage& source, int i, int j) float ShadowEngine::decay(TQImage& source, int i, int j)
{ {
// create a new image for the shadow // create a new image for the shadow
int w = source.width(); int w = source.width();
@ -117,7 +117,7 @@ float ShadowEngine::decay(QImage& source, int i, int j)
else else
sy = j + m; sy = j + m;
opacity += qGray(source.pixel(sx, sy)); opacity += tqGray(source.pixel(sx, sy));
} }
} }
alphaShadow += opacity / multiplicationFactor_; alphaShadow += opacity / multiplicationFactor_;

@ -30,9 +30,9 @@
#ifndef __FX_SHADOW #ifndef __FX_SHADOW
#define __FX_SHADOW #define __FX_SHADOW
#include <qpixmap.h> #include <tqpixmap.h>
#include <qimage.h> #include <tqimage.h>
#include <qcolor.h> #include <tqcolor.h>
class ShadowEngine class ShadowEngine
{ {
@ -41,9 +41,9 @@ class ShadowEngine
~ShadowEngine(); ~ShadowEngine();
void setThickness(int thickness) { thickness_ = thickness; } void setThickness(int thickness) { thickness_ = thickness; }
void setMultiplicationFactor(float factor) { multiplicationFactor_ = factor; } void setMultiplicationFactor(float factor) { multiplicationFactor_ = factor; }
QImage makeShadow(const QPixmap& textPixmap, const QColor &bgColor); TQImage makeShadow(const TQPixmap& textPixmap, const TQColor &bgColor);
private: private:
float decay(QImage& source, int x, int y); float decay(TQImage& source, int x, int y);
int thickness_; int thickness_;
float multiplicationFactor_; float multiplicationFactor_;

Loading…
Cancel
Save