Qt3->TQt conversion

Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
pull/2/head
Mavridis Philippe 2 years ago
parent 47d22fa476
commit e49c3e89f8
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 <ntqglobal.h>
#include <qapplication.h> #include <ntqapplication.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 <ntqevent.h>
#include <qstring.h> #include <ntqstring.h>
#include <qstyle.h> #include <ntqstyle.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 <ntqcursor.h>
#include <qstylefactory.h> #include <ntqstylefactory.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 <ntqdom.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 <ntqapplication.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 <ntqglobal.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 */
@ -4691,7 +4691,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 <ntqstring.h>
int main() { int main() {
QString t = "hallo"; QString t = "hallo";
t.fill('t'); t.fill('t');
@ -5536,7 +5536,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)
@ -5557,7 +5557,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)

@ -129,7 +129,7 @@ ENABLE_PREPROCESSING = YES
SEARCH_INCLUDES = YES SEARCH_INCLUDES = YES
INCLUDE_PATH = INCLUDE_PATH =
INCLUDE_FILE_PATTERNS = INCLUDE_FILE_PATTERNS =
PREDEFINED = QT_VERSION=320 \ PREDEFINED = TQT_VERSION=320 \
__cplusplus \ __cplusplus \
Q_WS_X11 Q_WS_X11
EXPAND_AS_DEFINED = EXPAND_AS_DEFINED =

@ -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 <ntqglobal.h>
#include <qapplication.h> #include <ntqapplication.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 <ntqevent.h>
#include <qstring.h> #include <ntqstring.h>
#include <qstyle.h> #include <ntqstyle.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 <ntqcursor.h>
#include <qstylefactory.h> #include <ntqstylefactory.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 <ntqdom.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 <ntqapplication.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 <ntqglobal.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 */
@ -4691,7 +4691,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 <ntqstring.h>
int main() { int main() {
QString t = "hallo"; QString t = "hallo";
t.fill('t'); t.fill('t');
@ -5536,7 +5536,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)
@ -5557,7 +5557,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)

@ -1375,7 +1375,7 @@ sub tag_UIFILES ()
$dep_lines .= "$source.h: $sourcedir$source.ui\n"; $dep_lines .= "$source.h: $sourcedir$source.ui\n";
$dep_lines .= "\trm -rf $source.h;\n"; $dep_lines .= "\trm -rf $source.h;\n";
if (!$kdeopts{"qtonly"}) { if (!$kdeopts{"qtonly"}) {
$dep_lines .= "\t\$(UIC) $sourcedir$source.ui | \$(PERL) -pi -e \"s,public QWizard,public KWizard,g; s,#include <qwizard.h>,#include <kwizard.h>,g\" >> $source.h ;\n"; $dep_lines .= "\t\$(UIC) $sourcedir$source.ui | \$(PERL) -pi -e \"s,public QWizard,public KWizard,g; s,#include <ntqwizard.h>,#include <kwizard.h>,g\" >> $source.h ;\n";
} else { } else {
$dep_lines .= "\t\$(UIC) -o $source.h $sourcedir$source.ui\n"; $dep_lines .= "\t\$(UIC) -o $source.h $sourcedir$source.ui\n";
} }

54
configure vendored

@ -689,7 +689,7 @@ do
| --progr-tra=* | --program-tr=* | --program-t=*) | --progr-tra=* | --program-tr=* | --program-t=*)
program_transform_name=$ac_optarg ;; program_transform_name=$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 ;;
@ -1266,7 +1266,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 ;;
*" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
@ -22150,22 +22150,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=""
@ -29989,9 +29989,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
@ -30060,19 +30060,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 <ntqglobal.h>
#include <qapplication.h> #include <ntqapplication.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 <ntqevent.h>
#include <qstring.h> #include <ntqstring.h>
#include <qstyle.h> #include <ntqstyle.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
@ -30081,8 +30081,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 <ntqcursor.h>
#include <qstylefactory.h> #include <ntqstylefactory.h>
#include <private/qucomextra_p.h> #include <private/qucomextra_p.h>
EOF EOF
fi fi
@ -30229,19 +30229,19 @@ export LIBRARY_PATH
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#include "confdefs.h" #include "confdefs.h"
#include <qglobal.h> #include <ntqglobal.h>
#include <qapplication.h> #include <ntqapplication.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 <ntqevent.h>
#include <qstring.h> #include <ntqstring.h>
#include <qstyle.h> #include <ntqstyle.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
@ -30250,8 +30250,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 <ntqcursor.h>
#include <qstylefactory.h> #include <ntqstylefactory.h>
#include <private/qucomextra_p.h> #include <private/qucomextra_p.h>
EOF EOF
fi fi
@ -30656,7 +30656,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 <ntqapplication.h>
int int
main () main ()
{ {
@ -33421,7 +33421,7 @@ Try \`$0 --help' for more information." >&2;}
$ac_shift $ac_shift
CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
ac_need_defaults=false;; ac_need_defaults=false;;
-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=: ;;

Binary file not shown.

@ -15,13 +15,13 @@
#include <kconfig.h> #include <kconfig.h>
#include <kstandarddirs.h> #include <kstandarddirs.h>
#include <qlabel.h> #include <ntqlabel.h>
#include <qlayout.h> #include <ntqlayout.h>
#include <qdrawutil.h> #include <ntqdrawutil.h>
#include <qdatetime.h> #include <ntqdatetime.h>
#include <qcursor.h> #include <ntqcursor.h>
#include <qbitmap.h> #include <ntqbitmap.h>
#include <qimage.h> #include <ntqimage.h>
extern "C" extern "C"
{ {
@ -43,20 +43,20 @@ bool titlebarResize, titlebarPlain,
double titlebarLenseButtonFlare; double titlebarLenseButtonFlare;
static bool pixmaps_created = false; static bool pixmaps_created = false;
static QImage left_img[2][2]; static TQImage left_img[2][2];
static QImage middle_img[2][2]; static TQImage middle_img[2][2];
static QImage right_img[2][2]; static TQImage right_img[2][2];
static QImage text_img[2][2]; static TQImage text_img[2][2];
static QImage bar_img[2][2]; static TQImage bar_img[2][2];
static QImage kroete_img[2][2]; static TQImage kroete_img[2][2];
static QImage button_img[2][2]; static TQImage button_img[2][2];
static QImage button_l_img[2][2]; static TQImage button_l_img[2][2];
static QImage button_r_img[2][2]; static TQImage button_r_img[2][2];
extern QColor *btnForeground; extern TQColor *btnForeground;
extern QPixmap *defaultPixmap; extern TQPixmap *defaultPixmap;
static QImage colorize(QImage img, const QColor &col1, const QColor &col2, float bright, float contrast ) static TQImage colorize(TQImage img, const TQColor &col1, const TQColor &col2, float bright, float contrast )
{ {
int rval, gval, bval, val, val2, i; int rval, gval, bval, val, val2, i;
int pixels = (img.depth() > 8) ? img.width()*img.height() int pixels = (img.depth() > 8) ? img.width()*img.height()
@ -66,8 +66,8 @@ static QImage colorize(QImage img, const QColor &col1, const QColor &col2, float
for (i=0; i<pixels; i++) for (i=0; i<pixels; i++)
{ {
val = static_cast<int>(qBlue(data[i]) * contrast); val = static_cast<int>(tqBlue(data[i]) * contrast);
val2 = static_cast<int>(qGreen(data[i]) * contrast); val2 = static_cast<int>(tqGreen(data[i]) * contrast);
rval = static_cast<int>( (val2*255*3 + (255-val2)*col2.red())/255 ); rval = static_cast<int>( (val2*255*3 + (255-val2)*col2.red())/255 );
gval = static_cast<int>( (val2*255*3 + (255-val2)*col2.green())/255 ); gval = static_cast<int>( (val2*255*3 + (255-val2)*col2.green())/255 );
@ -76,12 +76,12 @@ static QImage colorize(QImage img, const QColor &col1, const QColor &col2, float
gval = static_cast<int>( (val *gval + (255-val)*col1.green())/255 ); gval = static_cast<int>( (val *gval + (255-val)*col1.green())/255 );
bval = static_cast<int>( (val *bval + (255-val)*col1.blue())/255 ); bval = static_cast<int>( (val *bval + (255-val)*col1.blue())/255 );
if ( 255 < rval+qRed(data[i]) ) rval = 255; if ( 255 < rval+tqRed(data[i]) ) rval = 255;
else rval += qRed(data[i]); else rval += tqRed(data[i]);
if ( 255 < gval+qRed(data[i]) ) gval = 255; if ( 255 < gval+tqRed(data[i]) ) gval = 255;
else gval += qRed(data[i]); else gval += tqRed(data[i]);
if ( 255 < bval+qRed(data[i]) ) bval = 255; if ( 255 < bval+tqRed(data[i]) ) bval = 255;
else bval += qRed(data[i]); else bval += tqRed(data[i]);
if (bright != 1.0) if (bright != 1.0)
{ {
@ -90,21 +90,21 @@ static QImage colorize(QImage img, const QColor &col1, const QColor &col2, float
bval = static_cast<int>(bright*bval); bval = static_cast<int>(bright*bval);
} }
data[i] = qRgba(rval, gval, bval, qAlpha(data[i])); data[i] = tqRgba(rval, gval, bval, tqAlpha(data[i]));
} }
return img; return img;
} }
KPixmap create_buttonPixmap( int x, int y, QPixmap _pix, QPixmap bg, int active, int mouse ) KPixmap create_buttonPixmap( int x, int y, TQPixmap _pix, TQPixmap bg, int active, int mouse )
{ {
QImage i; TQImage i;
KPixmap _p(QPixmap(x,y)); KPixmap _p(TQPixmap(x,y));
QPixmap t, pix; TQPixmap t, pix;
QPainter p; TQPainter p;
if ( _pix.isNull() ) if ( _pix.isNull() )
pix = QPixmap(kdelogo); pix = TQPixmap(kdelogo);
else else
pix = _pix; pix = _pix;
@ -123,9 +123,9 @@ KPixmap create_buttonPixmap( int x, int y, QPixmap _pix, QPixmap bg, int active,
if ( !(mouse == 1 && titlebarPlain) && !(mouse == 0 && !titlebarPlain) ){ // not standard if ( !(mouse == 1 && titlebarPlain) && !(mouse == 0 && !titlebarPlain) ){ // not standard
i=_p; i=_p;
if ( (mouse == 0 && titlebarPlain) || (mouse == 1 && !titlebarPlain) ){ // mouse over if ( (mouse == 0 && titlebarPlain) || (mouse == 1 && !titlebarPlain) ){ // mouse over
_p.convertFromImage(KImageEffect::blend(Qt::white, i, 0.25 )); _p.convertFromImage(KImageEffect::blend(TQt::white, i, 0.25 ));
}else{ // pressed }else{ // pressed
_p.convertFromImage(KImageEffect::blend(Qt::black, i, 0.25 )); _p.convertFromImage(KImageEffect::blend(TQt::black, i, 0.25 ));
} }
if ( mouse == 2 ) { // pressed if ( mouse == 2 ) { // pressed
@ -139,9 +139,9 @@ KPixmap create_buttonPixmap( int x, int y, QPixmap _pix, QPixmap bg, int active,
return _p; return _p;
} }
QImage image_convert( const char **b, int h){ TQImage image_convert( const char **b, int h){
QPixmap p(b); TQPixmap p(b);
QImage i; TQImage i;
i = p.convertToImage(); i = p.convertToImage();
if ( p.height()!=h ) if ( p.height()!=h )
i = i.smoothScale((p.width()*h)/p.height(),h); i = i.smoothScale((p.width()*h)/p.height(),h);
@ -157,8 +157,8 @@ static void create_pixmaps( )
for ( int m=0; m<2; m++ ) for ( int m=0; m<2; m++ )
for ( int i=0; i<2; i++){ for ( int i=0; i<2; i++){
QColor ctb = KDecoration::options()->color(KDecoration::ColorTitleBar,i); TQColor ctb = KDecoration::options()->color(KDecoration::ColorTitleBar,i);
QColor ctbB = KDecoration::options()->color(KDecoration::ColorTitleBlend,i); TQColor ctbB = KDecoration::options()->color(KDecoration::ColorTitleBlend,i);
left_img[i][m] = colorize(image_convert(left_xpm, m ? 12 : PIX_HEIGHT) , ctb, left_img[i][m] = colorize(image_convert(left_xpm, m ? 12 : PIX_HEIGHT) , ctb,
ctbB, 0.75 , 0.75 ); ctbB, 0.75 , 0.75 );
right_img[i][m] = colorize(image_convert(right_xpm, m ? 12 : PIX_HEIGHT) , ctb, right_img[i][m] = colorize(image_convert(right_xpm, m ? 12 : PIX_HEIGHT) , ctb,
@ -182,23 +182,23 @@ static void create_pixmaps( )
for ( int m=0; m<2; m++ ) for ( int m=0; m<2; m++ )
for ( int M=0; M<3; M++ ) for ( int M=0; M<3; M++ )
for ( int a=0; a<2; a++ ){ for ( int a=0; a<2; a++ ){
buttonPixmap[0][a][M][m] = create_buttonPixmap( m ? 12 : PIX_HEIGHT, m ? 12 : PIX_HEIGHT, QPixmap(kdelogo), button_img[a][m], a, M ); buttonPixmap[0][a][M][m] = create_buttonPixmap( m ? 12 : PIX_HEIGHT, m ? 12 : PIX_HEIGHT, TQPixmap(kdelogo), button_img[a][m], a, M );
buttonPixmap[1][a][M][m] = create_buttonPixmap( m ? 12 : PIX_HEIGHT, m ? 12 : PIX_HEIGHT, QPixmap(sticky_xpm), button_img[a][m], a, M ); buttonPixmap[1][a][M][m] = create_buttonPixmap( m ? 12 : PIX_HEIGHT, m ? 12 : PIX_HEIGHT, TQPixmap(sticky_xpm), button_img[a][m], a, M );
buttonPixmap[2][a][M][m] = create_buttonPixmap( m ? 12 : PIX_HEIGHT, m ? 12 : PIX_HEIGHT, QPixmap(question_xpm), button_img[a][m], a, M ); buttonPixmap[2][a][M][m] = create_buttonPixmap( m ? 12 : PIX_HEIGHT, m ? 12 : PIX_HEIGHT, TQPixmap(question_xpm), button_img[a][m], a, M );
buttonPixmap[3][a][M][m] = create_buttonPixmap( m ? 12 : PIX_HEIGHT, m ? 12 : PIX_HEIGHT, QPixmap(iconify_xpm), button_img[a][m], a, M ); buttonPixmap[3][a][M][m] = create_buttonPixmap( m ? 12 : PIX_HEIGHT, m ? 12 : PIX_HEIGHT, TQPixmap(iconify_xpm), button_img[a][m], a, M );
buttonPixmap[4][a][M][m] = create_buttonPixmap( m ? 12 : PIX_HEIGHT, m ? 12 : PIX_HEIGHT, QPixmap(maximze_xpm), button_img[a][m], a, M ); buttonPixmap[4][a][M][m] = create_buttonPixmap( m ? 12 : PIX_HEIGHT, m ? 12 : PIX_HEIGHT, TQPixmap(maximze_xpm), button_img[a][m], a, M );
QPixmap i(button_img[a][m]); TQPixmap i(button_img[a][m]);
QPainter p(&i); TQPainter p(&i);
p.drawPixmap(button_img[a][m].width()-right_img[a][m].width()+BORDER_RIGHT, 0, right_img[a][m]); p.drawPixmap(button_img[a][m].width()-right_img[a][m].width()+BORDER_RIGHT, 0, right_img[a][m]);
p.end(); p.end();
buttonPixmap[5][a][M][m] = create_buttonPixmap( m ? 12 : PIX_HEIGHT, m ? 12 : PIX_HEIGHT, QPixmap(close_xpm), i, a, M ); buttonPixmap[5][a][M][m] = create_buttonPixmap( m ? 12 : PIX_HEIGHT, m ? 12 : PIX_HEIGHT, TQPixmap(close_xpm), i, a, M );
} }
// Make sure button pixmaps contrast with the current colour scheme. // Make sure button pixmaps contrast with the current colour scheme.
if(qGray(KDecoration::options()->color(KDecoration::ColorTitleBar,true).rgb()) > 127) if(tqGray(KDecoration::options()->color(KDecoration::ColorTitleBar,true).rgb()) > 127)
btnForeground = new QColor(Qt::black); btnForeground = new TQColor(TQt::black);
else else
btnForeground = new QColor(Qt::white); btnForeground = new TQColor(TQt::white);
} }
void delete_pixmaps() void delete_pixmaps()
@ -246,7 +246,7 @@ void MachBunt::init()
titlebarNoPlainButtons = c.readBoolEntry("TitleBarNoPlainButtons", false); titlebarNoPlainButtons = c.readBoolEntry("TitleBarNoPlainButtons", false);
titlebarSidebar = c.readBoolEntry("TitleBarSideBar", false); titlebarSidebar = c.readBoolEntry("TitleBarSideBar", false);
titlebarLenseButtonFlare = c.readDoubleNumEntry("titlebarLenseButtonFlare", 1.7); titlebarLenseButtonFlare = c.readDoubleNumEntry("titlebarLenseButtonFlare", 1.7);
defaultPixmap = new QPixmap(kdelogo); defaultPixmap = new TQPixmap(kdelogo);
create_pixmaps(); create_pixmaps();
createButtons(); createButtons();
@ -278,7 +278,7 @@ void MachBunt::createButtons()
connect( button[i], SIGNAL(shapeMe(int)),this, SLOT(doShape(int))); connect( button[i], SIGNAL(shapeMe(int)),this, SLOT(doShape(int)));
connect( button[i], SIGNAL(pressed()),this, SLOT(buttonPressed())); connect( button[i], SIGNAL(pressed()),this, SLOT(buttonPressed()));
connect( button[i], SIGNAL(released()),this, SLOT(buttonReleased())); connect( button[i], SIGNAL(released()),this, SLOT(buttonReleased()));
connect( button[i], SIGNAL(mousePressedMove(QMouseEvent*)),this, SLOT(mouseMoveOnButtonPressed(QMouseEvent*))); connect( button[i], SIGNAL(mousePressedMove(TQMouseEvent*)),this, SLOT(mouseMoveOnButtonPressed(TQMouseEvent*)));
} }
connect( button[BtnHelp], SIGNAL( clicked() ), this, SLOT( showContextHelp() )); connect( button[BtnHelp], SIGNAL( clicked() ), this, SLOT( showContextHelp() ));
@ -306,7 +306,7 @@ void MachBunt::reset( unsigned long changed )
widget()->repaint(); widget()->repaint();
} }
int MachBunt::mapButton( const QChar &c) int MachBunt::mapButton( const TQChar &c)
{ {
switch (c.latin1()) switch (c.latin1())
{ {
@ -324,7 +324,7 @@ int MachBunt::mapButton( const QChar &c)
return BtnClose; return BtnClose;
} }
// something went wrong // something went wrong
qDebug("unknown Button to map \"%c\"", c.latin1() ); tqDebug("unknown Button to map \"%c\"", c.latin1() );
return -1; return -1;
} }
@ -332,17 +332,17 @@ void MachBunt::doLayout()
{ {
delete windowLayout; delete windowLayout;
windowLayout = new QVBoxLayout(widget(), 0, 0); windowLayout = new TQVBoxLayout(widget(), 0, 0);
titlebar = new QSpacerItem ( 0, titleHeight, QSizePolicy::Expanding, titlebar = new TQSpacerItem ( 0, titleHeight, TQSizePolicy::Expanding,
QSizePolicy::Fixed); TQSizePolicy::Fixed);
QBoxLayout *topLayout = new QBoxLayout(windowLayout, QBoxLayout::LeftToRight, 0, 0); TQBoxLayout *topLayout = new TQBoxLayout(windowLayout, TQBoxLayout::LeftToRight, 0, 0);
#if 0 #if 0
bool first_left = true; bool first_left = true;
for ( unsigned int i = 0; i <options()->titleButtonsLeft().length(); i++) for ( unsigned int i = 0; i <options()->titleButtonsLeft().length(); i++)
{ {
int b = mapButton(options()->titleButtonsLeft()[i]); int b = mapButton(options()->titleButtonsLeft()[i]);
if ( b>=0 ){ if ( b>=0 ){
topLayout->addWidget(button[b], Qt::AlignVCenter); topLayout->addWidget(button[b], TQt::AlignVCenter);
topLayout->setStretchFactor(button[b], 0); topLayout->setStretchFactor(button[b], 0);
button[b]->setFixedSize(titleHeight, titleHeight); button[b]->setFixedSize(titleHeight, titleHeight);
if( first_left ) if( first_left )
@ -356,26 +356,26 @@ void MachBunt::doLayout()
topLayout->addItem(titlebar); topLayout->addItem(titlebar);
#else #else
topLayout->addWidget(button[BtnMenu], Qt::AlignVCenter); topLayout->addWidget(button[BtnMenu], TQt::AlignVCenter);
topLayout->setStretchFactor(button[BtnMenu], 0); topLayout->setStretchFactor(button[BtnMenu], 0);
button[BtnMenu]->setFixedSize(titleHeight, titleHeight); button[BtnMenu]->setFixedSize(titleHeight, titleHeight);
button[BtnMenu]->setPosition( ButtonLeft ); button[BtnMenu]->setPosition( ButtonLeft );
topLayout->addItem(titlebar); topLayout->addItem(titlebar);
topLayout->addWidget(button[BtnHelp], Qt::AlignVCenter); topLayout->addWidget(button[BtnHelp], TQt::AlignVCenter);
topLayout->setStretchFactor(button[BtnHelp], 0); topLayout->setStretchFactor(button[BtnHelp], 0);
button[BtnHelp]->setFixedSize(titleHeight, titleHeight); button[BtnHelp]->setFixedSize(titleHeight, titleHeight);
topLayout->addWidget(button[BtnIconify], Qt::AlignVCenter); topLayout->addWidget(button[BtnIconify], TQt::AlignVCenter);
topLayout->setStretchFactor(button[BtnIconify], 0); topLayout->setStretchFactor(button[BtnIconify], 0);
button[BtnIconify]->setFixedSize(titleHeight, titleHeight); button[BtnIconify]->setFixedSize(titleHeight, titleHeight);
topLayout->addWidget(button[BtnMax], Qt::AlignVCenter); topLayout->addWidget(button[BtnMax], TQt::AlignVCenter);
topLayout->setStretchFactor(button[BtnMax], 0); topLayout->setStretchFactor(button[BtnMax], 0);
button[BtnMax]->setFixedSize(titleHeight, titleHeight); button[BtnMax]->setFixedSize(titleHeight, titleHeight);
topLayout->addWidget(button[BtnClose], Qt::AlignVCenter); topLayout->addWidget(button[BtnClose], TQt::AlignVCenter);
topLayout->setStretchFactor(button[BtnClose], 0); topLayout->setStretchFactor(button[BtnClose], 0);
button[BtnClose]->setFixedSize(titleHeight, titleHeight); button[BtnClose]->setFixedSize(titleHeight, titleHeight);
button[BtnClose]->setPosition( ButtonRight ); button[BtnClose]->setPosition( ButtonRight );
@ -391,7 +391,7 @@ void MachBunt::doLayout()
{ {
int b = mapButton(options()->titleButtonsRight()[i]); int b = mapButton(options()->titleButtonsRight()[i]);
if ( b>=0 ){ if ( b>=0 ){
topLayout->addWidget(button[b], Qt::AlignVCenter); topLayout->addWidget(button[b], TQt::AlignVCenter);
topLayout->setStretchFactor(button[b], 0); topLayout->setStretchFactor(button[b], 0);
button[b]->setFixedSize(titleHeight, titleHeight); button[b]->setFixedSize(titleHeight, titleHeight);
last_right = button[b]; last_right = button[b];
@ -401,12 +401,12 @@ void MachBunt::doLayout()
last_right->setPosition( ButtonRight ); last_right->setPosition( ButtonRight );
#endif #endif
QHBoxLayout * midLayout = new QHBoxLayout(windowLayout, 0, 0); TQHBoxLayout * midLayout = new TQHBoxLayout(windowLayout, 0, 0);
midLayout->addSpacing(BORDER_LEFT); midLayout->addSpacing(BORDER_LEFT);
if( isPreview()) if( isPreview())
midLayout->addWidget(new QLabel( i18n( "<center><b>MachBunt</b></center>" ), widget())); midLayout->addWidget(new TQLabel( i18n( "<center><b>MachBunt</b></center>" ), widget()));
else else
midLayout->addItem( new QSpacerItem( 0, 0 )); // no widget in the middle midLayout->addItem( new TQSpacerItem( 0, 0 )); // no widget in the middle
midLayout->addSpacing(BORDER_RIGHT); midLayout->addSpacing(BORDER_RIGHT);
windowLayout->addSpacing(BORDER_BOTTOM); windowLayout->addSpacing(BORDER_BOTTOM);
@ -422,18 +422,18 @@ void MachBunt::borders(int& left, int& right, int& top, int& bottom) const
bottom = BORDER_BOTTOM; bottom = BORDER_BOTTOM;
} }
void MachBunt::mouseMoveOnButtonPressed( QMouseEvent *e ) void MachBunt::mouseMoveOnButtonPressed( TQMouseEvent *e )
{ {
#if 0 #if 0
if ( buttonPressedPosition.x() >= 0 ){ if ( buttonPressedPosition.x() >= 0 ){
QPoint p( buttonPressedPosition.x() - geometry().x(), TQPoint p( buttonPressedPosition.x() - geometry().x(),
buttonPressedPosition.y() - geometry().y()); buttonPressedPosition.y() - geometry().y());
if ( mousePosition(p) == KDecoration::TopLeft || if ( mousePosition(p) == KDecoration::TopLeft ||
mousePosition(p) == KDecoration::TopRight ) mousePosition(p) == KDecoration::TopRight )
performMouseCommand(Options::MouseResize, QCursor::pos()); performMouseCommand(Options::MouseResize, TQCursor::pos());
else if ( mousePosition(p) == KDecoration::Top ){ else if ( mousePosition(p) == KDecoration::Top ){
QPoint m(geometry().x()+geometry().width()/2, geometry().y()); TQPoint m(geometry().x()+geometry().width()/2, geometry().y());
performMouseCommand(Options::MouseResize, m ); performMouseCommand(Options::MouseResize, m );
} }
buttonPressedPosition.setX( -1 ); buttonPressedPosition.setX( -1 );
@ -445,13 +445,13 @@ void MachBunt::mouseMoveOnButtonPressed( QMouseEvent *e )
void MachBunt::buttonPressed() void MachBunt::buttonPressed()
{ {
QPoint p( QCursor::pos().x() - geometry().x(), TQPoint p( TQCursor::pos().x() - geometry().x(),
QCursor::pos().y() - geometry().y()); TQCursor::pos().y() - geometry().y());
if ( mousePosition(p) == KDecorationDefines::PositionTopLeft || if ( mousePosition(p) == KDecorationDefines::PositionTopLeft ||
mousePosition(p) == KDecorationDefines::PositionTopRight || mousePosition(p) == KDecorationDefines::PositionTopRight ||
mousePosition(p) == KDecorationDefines::PositionTop ) mousePosition(p) == KDecorationDefines::PositionTop )
buttonPressedPosition = QCursor::pos(); buttonPressedPosition = TQCursor::pos();
} }
void MachBunt::buttonReleased() void MachBunt::buttonReleased()
@ -461,7 +461,7 @@ void MachBunt::buttonReleased()
} }
KDecoration::Position KDecoration::Position
MachBunt::mousePosition(const QPoint & p) const MachBunt::mousePosition(const TQPoint & p) const
{ {
int x = p.x(); int x = p.x();
int y = p.y(); int y = p.y();
@ -496,14 +496,14 @@ void MachBunt::slotMaximize()
maximize(maximizeMode() == MaximizeFull ? MaximizeRestore : MaximizeFull); maximize(maximizeMode() == MaximizeFull ? MaximizeRestore : MaximizeFull);
} }
void MachBunt::resize( const QSize& s ) void MachBunt::resize( const TQSize& s )
{ {
widget()->resize( s ); widget()->resize( s );
} }
QSize MachBunt::minimumSize() const TQSize MachBunt::minimumSize() const
{ {
return QSize( 200, 50 ); return TQSize( 200, 50 );
} }
const int SUPPORTED_WINDOW_TYPES_MASK = NET::NormalMask | NET::DesktopMask | NET::DockMask const int SUPPORTED_WINDOW_TYPES_MASK = NET::NormalMask | NET::DesktopMask | NET::DockMask
@ -516,23 +516,23 @@ bool MachBunt::isTool()
return ((type==NET::Toolbar)||(type==NET::NET::Utility)||(type==NET::Menu)); return ((type==NET::Toolbar)||(type==NET::NET::Utility)||(type==NET::Menu));
} }
bool MachBunt::eventFilter( QObject* o, QEvent* e ) bool MachBunt::eventFilter( TQObject* o, TQEvent* e )
{ {
if( o != widget()) if( o != widget())
return false; return false;
switch( e->type()) switch( e->type())
{ {
case QEvent::Resize: case TQEvent::Resize:
resizeEvent(static_cast< QResizeEvent* >( e ) ); resizeEvent(static_cast< TQResizeEvent* >( e ) );
return true; return true;
case QEvent::Paint: case TQEvent::Paint:
paintEvent(static_cast< QPaintEvent* >( e ) ); paintEvent(static_cast< TQPaintEvent* >( e ) );
return true; return true;
case QEvent::MouseButtonDblClick: case TQEvent::MouseButtonDblClick:
mouseDoubleClickEvent(static_cast< QMouseEvent* >( e ) ); mouseDoubleClickEvent(static_cast< TQMouseEvent* >( e ) );
return true; return true;
case QEvent::MouseButtonPress: case TQEvent::MouseButtonPress:
processMousePressEvent(static_cast< QMouseEvent* >( e ) ); processMousePressEvent(static_cast< TQMouseEvent* >( e ) );
return true; return true;
default: default:
break; break;
@ -572,13 +572,13 @@ bool BuntFactory::reset(unsigned long changed)
} }
} }
QValueList< BuntFactory::BorderSize > BuntFactory::borderSizes() const TQValueList< BuntFactory::BorderSize > BuntFactory::borderSizes() const
{ // the list must be sorted { // the list must be sorted
return QValueList< BorderSize >() << BorderNormal; return TQValueList< BorderSize >() << BorderNormal;
// TODO << BorderLarge << BorderVeryLarge << BorderHuge << BorderVeryHuge << BorderOversized; // TODO << BorderLarge << BorderVeryLarge << BorderHuge << BorderVeryHuge << BorderOversized;
} }
void MachBunt::resizeEvent( QResizeEvent*) void MachBunt::resizeEvent( TQResizeEvent*)
{ {
doShape(); doShape();
@ -596,10 +596,10 @@ void MachBunt::resizeEvent( QResizeEvent*)
int dy = 0; int dy = 0;
if ( e->oldSize().width() != width() ) if ( e->oldSize().width() != width() )
dx = 32 + QABS( e->oldSize().width() - width() ); dx = 32 + TQABS( e->oldSize().width() - width() );
if ( e->oldSize().height() != height() ) if ( e->oldSize().height() != height() )
dy = 8 + QABS( e->oldSize().height() - height() ); dy = 8 + TQABS( e->oldSize().height() - height() );
if ( dy ) if ( dy )
update( 0, height() - dy + 1, width(), dy ); update( 0, height() - dy + 1, width(), dy );
@ -607,10 +607,10 @@ void MachBunt::resizeEvent( QResizeEvent*)
if ( dx ) if ( dx )
{ {
update( width() - dx + 1, 0, dx, height() ); update( width() - dx + 1, 0, dx, height() );
update( QRect( QPoint(4,4), titlebar->geometry().bottomLeft() - QPoint(1,0) ) ); update( TQRect( TQPoint(4,4), titlebar->geometry().bottomLeft() - TQPoint(1,0) ) );
update( QRect( titlebar->geometry().topRight(), QPoint( width() - 4, titlebar->geometry().bottom() ) ) ); update( TQRect( titlebar->geometry().topRight(), TQPoint( width() - 4, titlebar->geometry().bottom() ) ) );
// Titlebar needs no paint event // Titlebar needs no paint event
QApplication::postEvent( widget(), new QPaintEvent( titlebar->geometry(), FALSE ) ); TQApplication::postEvent( widget(), new TQPaintEvent( titlebar->geometry(), FALSE ) );
} }
} }
#endif #endif
@ -624,23 +624,23 @@ void MachBunt::captionChange()
void MachBunt::iconChange() void MachBunt::iconChange()
{ {
button[BtnMenu]->setPixmap( icon().pixmap( QIconSet::Small, QIconSet::Normal )); button[BtnMenu]->setPixmap( icon().pixmap( TQIconSet::Small, TQIconSet::Normal ));
if (button[BtnMenu]->isVisible()) if (button[BtnMenu]->isVisible())
button[BtnMenu]->repaint(false); button[BtnMenu]->repaint(false);
} }
void MachBunt::paintEvent( QPaintEvent *pe ) void MachBunt::paintEvent( TQPaintEvent *pe )
{ {
// bool hicolor = QPixmap::defaultDepth() > 8; // bool hicolor = TQPixmap::defaultDepth() > 8;
int fontoffset = 1; int fontoffset = 1;
QPainter p(widget()); TQPainter p(widget());
p.setClipRegion(pe->region()); p.setClipRegion(pe->region());
// Obtain widget bounds. // Obtain widget bounds.
QRect r(widget()->rect()); TQRect r(widget()->rect());
int i; int i;
int x = r.x(); int x = r.x();
int y = r.y(); int y = r.y();
@ -649,7 +649,7 @@ void MachBunt::paintEvent( QPaintEvent *pe )
int w = r.width(); int w = r.width();
int ps = smallButtons ? PIX_SIDE/2 : PIX_SIDE; int ps = smallButtons ? PIX_SIDE/2 : PIX_SIDE;
QColorGroup g = options()->colorGroup(KDecorationDefines::ColorFrame, isActive()); TQColorGroup g = options()->colorGroup(KDecorationDefines::ColorFrame, isActive());
p.setPen( g.dark() ); p.setPen( g.dark() );
// the dark outer drawings // the dark outer drawings
@ -676,7 +676,7 @@ void MachBunt::paintEvent( QPaintEvent *pe )
// draw the title bar. // draw the title bar.
r = titlebar->geometry(); r = titlebar->geometry();
// QFontMetrics fm(options()->font(true)); // TQFontMetrics fm(options()->font(true));
KPixmap titleBuffer; KPixmap titleBuffer;
if ( titlebarSidebar ) if ( titlebarSidebar )
@ -685,7 +685,7 @@ void MachBunt::paintEvent( QPaintEvent *pe )
titleBuffer.resize(w, titleHeight); titleBuffer.resize(w, titleHeight);
KIconEffect kie; KIconEffect kie;
QPainter p2( &titleBuffer, widget()); TQPainter p2( &titleBuffer, widget());
p2.drawTiledPixmap( ps, 0, titleBuffer.width()-2*ps, titleHeight, middle_img[isActive()][smallButtons]); p2.drawTiledPixmap( ps, 0, titleBuffer.width()-2*ps, titleHeight, middle_img[isActive()][smallButtons]);
p2.drawTiledPixmap( 0, 0, ps, titleHeight, left_img[isActive()][smallButtons]); p2.drawTiledPixmap( 0, 0, ps, titleHeight, left_img[isActive()][smallButtons]);
@ -706,11 +706,11 @@ void MachBunt::paintEvent( QPaintEvent *pe )
p2.drawTiledPixmap(l-titleHeight/2, 0, titleHeight-(titleHeight/2), titleHeight, button_img[isActive()][smallButtons], titleHeight/2, 0); p2.drawTiledPixmap(l-titleHeight/2, 0, titleHeight-(titleHeight/2), titleHeight, button_img[isActive()][smallButtons], titleHeight/2, 0);
// Reduce the font size and weight for toolwindows. // Reduce the font size and weight for toolwindows.
QFont font = options()->font(true); TQFont font = options()->font(true);
if ( smallButtons ) if ( smallButtons )
{ {
font.setPointSize( font.pointSize() - 2 ); font.setPointSize( font.pointSize() - 2 );
font.setWeight( QFont::Normal ); font.setWeight( TQFont::Normal );
fontoffset = 0; fontoffset = 0;
} }
p2.setFont( font ); p2.setFont( font );
@ -731,13 +731,13 @@ void MachBunt::paintEvent( QPaintEvent *pe )
p.drawPixmap( 0, 0, titleBuffer ); p.drawPixmap( 0, 0, titleBuffer );
} }
void MachBunt::showEvent(QShowEvent *) void MachBunt::showEvent(TQShowEvent *)
{ {
doShape(); doShape();
widget()->repaint(); widget()->repaint();
} }
void MachBunt::mouseDoubleClickEvent( QMouseEvent * e ) void MachBunt::mouseDoubleClickEvent( TQMouseEvent * e )
{ {
if (titlebar->geometry().contains( e->pos() ) ) if (titlebar->geometry().contains( e->pos() ) )
titlebarDblClickOperation(); titlebarDblClickOperation();
@ -821,7 +821,7 @@ void MachBunt::calcHiddenButtons()
void MachBunt::menuButtonPressed() void MachBunt::menuButtonPressed()
{ {
// KS - move the menu left by 3 pixels, and down 2 pixels. // KS - move the menu left by 3 pixels, and down 2 pixels.
QPoint menupoint ( button[BtnMenu]->rect().bottomLeft().x()-3, TQPoint menupoint ( button[BtnMenu]->rect().bottomLeft().x()-3,
button[BtnMenu]->rect().bottomLeft().y()+2 ); button[BtnMenu]->rect().bottomLeft().y()+2 );
KDecorationFactory* f = factory(); KDecorationFactory* f = factory();
showWindowMenu( button[BtnMenu]->mapToGlobal( menupoint )); showWindowMenu( button[BtnMenu]->mapToGlobal( menupoint ));
@ -832,7 +832,7 @@ void MachBunt::menuButtonPressed()
void MachBunt::doShape(int x) void MachBunt::doShape(int x)
{ {
QRegion mask(0, 0, width(), height()); TQRegion mask(0, 0, width(), height());
int bWidth = smallButtons ? 12 : PIX_HEIGHT; int bWidth = smallButtons ? 12 : PIX_HEIGHT;
int i, bl=0, br=0, p=0; int i, bl=0, br=0, p=0;
@ -845,40 +845,40 @@ void MachBunt::doShape(int x)
p=2; p=2;
} }
mask -= QRegion(0, 0, bl+3, 1); mask -= TQRegion(0, 0, bl+3, 1);
mask -= QRegion(0, 1, bl+1, 1); mask -= TQRegion(0, 1, bl+1, 1);
// Remove top-right corner. // Remove top-right corner.
if ( smallButtons ){ if ( smallButtons ){
mask -= QRegion(r-3-br, 0, 3+br, 1+p); mask -= TQRegion(r-3-br, 0, 3+br, 1+p);
mask -= QRegion(r-2-br, 1, 2+br, 1+p); mask -= TQRegion(r-2-br, 1, 2+br, 1+p);
mask -= QRegion(r-1-br, 2, 1+br, 1+p); mask -= TQRegion(r-1-br, 2, 1+br, 1+p);
}else{ }else{
mask -= QRegion(r-7-br, 0, 7+br, 1+p); mask -= TQRegion(r-7-br, 0, 7+br, 1+p);
mask -= QRegion(r-5-br, 1, 5+br, 1+p); mask -= TQRegion(r-5-br, 1, 5+br, 1+p);
mask -= QRegion(r-4-br, 2, 4+br, 1+p); mask -= TQRegion(r-4-br, 2, 4+br, 1+p);
mask -= QRegion(r-3-br, 3, 3+br, 1+p); mask -= TQRegion(r-3-br, 3, 3+br, 1+p);
mask -= QRegion(r-2-br, 4, 2+br, 1+p); mask -= TQRegion(r-2-br, 4, 2+br, 1+p);
mask -= QRegion(r-1-br, 5, 1+br, 2+p); mask -= TQRegion(r-1-br, 5, 1+br, 2+p);
} }
for ( i=0; i<br; i++) for ( i=0; i<br; i++)
mask -= QRegion(r-i-1, 0, 1, PIX_CORNER_RADIUS+bl+br-i); mask -= TQRegion(r-i-1, 0, 1, PIX_CORNER_RADIUS+bl+br-i);
// the buttons // the buttons
for ( i=0; i<BtnCount; i++){ for ( i=0; i<BtnCount; i++){
if ( button[i] && button[i]->isShown() ){ if ( button[i] && button[i]->isShown() ){
// top left corner of this button and right part of the button before // top left corner of this button and right part of the button before
mask -= QRegion( button[i]->x() - 3, 0, 4, 1 ); mask -= TQRegion( button[i]->x() - 3, 0, 4, 1 );
mask -= QRegion( button[i]->x() - 1, 0, 1, 2 ); mask -= TQRegion( button[i]->x() - 1, 0, 1, 2 );
} }
} }
// the pressed button // the pressed button
if ( x != 0 ){ if ( x != 0 ){
mask -= QRegion( x, 0, bWidth, 2 ); mask -= TQRegion( x, 0, bWidth, 2 );
mask -= QRegion( x, 0, 1, 3 ); mask -= TQRegion( x, 0, 1, 3 );
mask -= QRegion( x + bWidth -3 , 0, 3, 3 ); mask -= TQRegion( x + bWidth -3 , 0, 3, 3 );
mask -= QRegion( x + bWidth -1 , 0, 1, 4 ); mask -= TQRegion( x + bWidth -1 , 0, 1, 4 );
} }
setMask(mask); setMask(mask);

@ -6,17 +6,17 @@
#ifndef __KDE_SuSE_H #ifndef __KDE_SuSE_H
#define __KDE_SuSE_H #define __KDE_SuSE_H
#include <qvariant.h> #include <ntqvariant.h>
#include <qlayout.h> #include <ntqlayout.h>
#include <qbutton.h> #include <ntqbutton.h>
#include <qbitmap.h> #include <ntqbitmap.h>
#include <qimage.h> #include <ntqimage.h>
#include <kpixmap.h> #include <kpixmap.h>
#include <kdecoration.h> #include <kdecoration.h>
#include <kdecorationfactory.h> #include <kdecorationfactory.h>
class QLabel; class TQLabel;
class QSpacerItem; class TQSpacerItem;
class QHBoxLayout; class TQHBoxLayout;
#define USE_BUT 1 #define USE_BUT 1
#define PIX_HEIGHT 24 #define PIX_HEIGHT 24
@ -42,48 +42,48 @@ extern KPixmap buttonPixmap[BtnCount][2][3][2];
extern bool titlebarResize, titlebarPlain, titlebarLogo, titlebarSidebar, titlebarNoPlainButtons; extern bool titlebarResize, titlebarPlain, titlebarLogo, titlebarSidebar, titlebarNoPlainButtons;
extern double titlebarLenseButtonFlare; extern double titlebarLenseButtonFlare;
KPixmap create_buttonPixmap( int x, int y, QPixmap pix, QPixmap bg, int active, int mouse ); KPixmap create_buttonPixmap( int x, int y, TQPixmap pix, TQPixmap bg, int active, int mouse );
class MachBunt; class MachBunt;
class MachBuntButton : public QButton class MachBuntButton : public TQButton
{ {
Q_OBJECT Q_OBJECT
public: public:
MachBuntButton(MachBunt *client, const char *name, MachBuntButton(MachBunt *client, const char *name,
int button, QPixmap bgI, QPixmap bgA, bool isMini=false, int button, TQPixmap bgI, TQPixmap bgA, bool isMini=false,
const QString& tip=NULL); const TQString& tip=NULL);
virtual ~MachBuntButton(); virtual ~MachBuntButton();
virtual void reset( unsigned long changed ); virtual void reset( unsigned long changed );
void setBitmap(const unsigned char *bitmap); void setBitmap(const unsigned char *bitmap);
void setPixmap(const QPixmap &p); void setPixmap(const TQPixmap &p);
void setTipText(const QString &tip); void setTipText(const TQString &tip);
void setPosition(ButtonPos pos); void setPosition(ButtonPos pos);
virtual QSize sizeHint() const; virtual TQSize sizeHint() const;
int last_button; int last_button;
KPixmap menuButtonPixmap[BtnCount][2][3][2]; KPixmap menuButtonPixmap[BtnCount][2][3][2];
signals: signals:
void shapeMe(int); void shapeMe(int);
void mousePressedMove(QMouseEvent*); void mousePressedMove(TQMouseEvent*);
protected: protected:
void mousePressEvent(QMouseEvent* e); void mousePressEvent(TQMouseEvent* e);
void mouseReleaseEvent(QMouseEvent* e); void mouseReleaseEvent(TQMouseEvent* e);
virtual void drawButton(QPainter *p); virtual void drawButton(TQPainter *p);
void drawButtonLabel(QPainter *){;} void drawButtonLabel(TQPainter *){;}
void enterEvent(QEvent *); void enterEvent(TQEvent *);
void leaveEvent(QEvent *); void leaveEvent(TQEvent *);
void mouseMoveEvent( QMouseEvent *e ); void mouseMoveEvent( TQMouseEvent *e );
bool resizePosition( QPoint pos ); bool resizePosition( TQPoint pos );
QBitmap deco; TQBitmap deco;
QPixmap pix; TQPixmap pix;
QPixmap menuPixmap; TQPixmap menuPixmap;
QPixmap bg[2]; TQPixmap bg[2];
bool menuBtn; bool menuBtn;
bool miniBtn; bool miniBtn;
bool pressed; bool pressed;
@ -103,16 +103,16 @@ class MachBunt : public KDecoration
MachBunt(KDecorationBridge* bridge, KDecorationFactory* factory); MachBunt(KDecorationBridge* bridge, KDecorationFactory* factory);
virtual ~MachBunt(); virtual ~MachBunt();
virtual void init(); virtual void init();
virtual void resize(const QSize&); virtual void resize(const TQSize&);
virtual bool eventFilter( QObject* o, QEvent* e ); virtual bool eventFilter( TQObject* o, TQEvent* e );
protected: protected:
virtual void reset( unsigned long changed ); virtual void reset( unsigned long changed );
virtual void resizeEvent( QResizeEvent* ); virtual void resizeEvent( TQResizeEvent* );
virtual void paintEvent( QPaintEvent* ); virtual void paintEvent( TQPaintEvent* );
virtual void showEvent( QShowEvent* ); virtual void showEvent( TQShowEvent* );
virtual void mouseDoubleClickEvent( QMouseEvent * ); virtual void mouseDoubleClickEvent( TQMouseEvent * );
virtual Position mousePosition( const QPoint& ) const; virtual Position mousePosition( const TQPoint& ) const;
virtual void captionChange(); virtual void captionChange();
virtual void desktopChange(); virtual void desktopChange();
virtual void shadeChange() {}; virtual void shadeChange() {};
@ -121,8 +121,8 @@ class MachBunt : public KDecoration
virtual void iconChange(); virtual void iconChange();
virtual void calcHiddenButtons(); virtual void calcHiddenButtons();
virtual void borders(int&, int&, int&, int&) const; virtual void borders(int&, int&, int&, int&) const;
virtual QSize minimumSize() const; virtual TQSize minimumSize() const;
virtual int mapButton( const QChar &c ); virtual int mapButton( const TQChar &c );
virtual void doLayout(); virtual void doLayout();
virtual void createButtons(); virtual void createButtons();
@ -136,25 +136,25 @@ class MachBunt : public KDecoration
void slotMaximize(); void slotMaximize();
void menuButtonPressed(); void menuButtonPressed();
void doShape(int x=0); void doShape(int x=0);
void mouseMoveOnButtonPressed(QMouseEvent*); void mouseMoveOnButtonPressed(TQMouseEvent*);
private: private:
bool isTool(); bool isTool();
MachBuntButton* button[ BtnCount ]; MachBuntButton* button[ BtnCount ];
QPoint buttonPressedPosition; TQPoint buttonPressedPosition;
int lastButtonWidth; int lastButtonWidth;
int titleHeight; int titleHeight;
QSpacerItem* titlebar; TQSpacerItem* titlebar;
bool hiddenItems; bool hiddenItems;
QVBoxLayout* windowLayout; TQVBoxLayout* windowLayout;
QBoxLayout* topLayout; TQBoxLayout* topLayout;
bool smallButtons; bool smallButtons;
bool mouseOverButton; bool mouseOverButton;
}; };
class BuntFactory : public QObject, public KDecorationFactory class BuntFactory : public TQObject, public KDecorationFactory
{ {
Q_OBJECT Q_OBJECT
@ -164,7 +164,7 @@ class BuntFactory : public QObject, public KDecorationFactory
virtual ~BuntFactory() {}; virtual ~BuntFactory() {};
virtual KDecoration* createDecoration( KDecorationBridge* ); virtual KDecoration* createDecoration( KDecorationBridge* );
virtual bool reset( unsigned long changed ); virtual bool reset( unsigned long changed );
virtual QValueList< BorderSize > borderSizes() const; virtual TQValueList< BorderSize > borderSizes() const;
}; };
}; };

@ -10,34 +10,34 @@
#include <kdrawutil.h> #include <kdrawutil.h>
#include <klocale.h> #include <klocale.h>
#include <qlayout.h> #include <ntqlayout.h>
#include <qdrawutil.h> #include <ntqdrawutil.h>
#include <qtooltip.h> #include <ntqtooltip.h>
#include <qdatetime.h> #include <ntqdatetime.h>
#include <qbitmap.h> #include <ntqbitmap.h>
#include <qimage.h> #include <ntqimage.h>
#include <qcursor.h> #include <ntqcursor.h>
namespace SuSEMachBunt { namespace SuSEMachBunt {
// the titlebar buttons // the titlebar buttons
extern bool pixmaps_created; extern bool pixmaps_created;
QPixmap *defaultPixmap; TQPixmap *defaultPixmap;
QColor *btnForeground; TQColor *btnForeground;
MachBuntButton::MachBuntButton(MachBunt * c, const char *name, MachBuntButton::MachBuntButton(MachBunt * c, const char *name,
int _button, QPixmap bgI, QPixmap bgA, int _button, TQPixmap bgI, TQPixmap bgA,
bool isMini, bool isMini,
const QString &tip) const TQString &tip)
: QButton (c->widget(), name), position( ButtonMiddle ), client( c ) : TQButton (c->widget(), name), position( ButtonMiddle ), client( c )
{ {
setTipText(tip); setTipText(tip);
setMouseTracking( true ); setMouseTracking( true );
setCursor( arrowCursor ); setCursor( arrowCursor );
// Eliminate background flicker // Eliminate background flicker
setBackgroundMode( QWidget::NoBackground ); setBackgroundMode( TQWidget::NoBackground );
menuBtn = _button == BtnMenu; menuBtn = _button == BtnMenu;
miniBtn = isMini; miniBtn = isMini;
@ -61,12 +61,12 @@ MachBuntButton::~MachBuntButton()
{ {
}; };
QSize MachBuntButton::sizeHint() const TQSize MachBuntButton::sizeHint() const
{ {
if ( miniBtn ) if ( miniBtn )
return(QSize(12, 12)); return(TQSize(12, 12));
else else
return(QSize(PIX_HEIGHT, PIX_HEIGHT)); return(TQSize(PIX_HEIGHT, PIX_HEIGHT));
} }
@ -87,9 +87,9 @@ void MachBuntButton::setBitmap(const unsigned char *bitmap)
} }
void MachBuntButton::setPixmap( const QPixmap &_p ) void MachBuntButton::setPixmap( const TQPixmap &_p )
{ {
QPixmap p; TQPixmap p;
if ( _p.isNull() ) if ( _p.isNull() )
p = *defaultPixmap; p = *defaultPixmap;
@ -113,7 +113,7 @@ void MachBuntButton::setPixmap( const QPixmap &_p )
repaint( false ); repaint( false );
} }
void MachBuntButton::enterEvent( QEvent *e ) void MachBuntButton::enterEvent( TQEvent *e )
{ {
if (pressed){ if (pressed){
state = 2; state = 2;
@ -121,16 +121,16 @@ void MachBuntButton::enterEvent( QEvent *e )
}else }else
state = 1; state = 1;
repaint(); repaint();
QButton::enterEvent(e); TQButton::enterEvent(e);
} }
void MachBuntButton::leaveEvent( QEvent *e ) void MachBuntButton::leaveEvent( TQEvent *e )
{ {
if (pressed) if (pressed)
emit ( shapeMe(0) ); emit ( shapeMe(0) );
state = 0; state = 0;
repaint(); repaint();
QButton::leaveEvent(e); TQButton::leaveEvent(e);
} }
void MachBuntButton::setPosition( ButtonPos pos ) void MachBuntButton::setPosition( ButtonPos pos )
@ -138,7 +138,7 @@ void MachBuntButton::setPosition( ButtonPos pos )
position = pos; position = pos;
} }
bool MachBuntButton::resizePosition( QPoint pos ) bool MachBuntButton::resizePosition( TQPoint pos )
{ {
if( pos.y() < BUTTON_RESIZE_SIZE ) if( pos.y() < BUTTON_RESIZE_SIZE )
return true; return true;
@ -149,7 +149,7 @@ bool MachBuntButton::resizePosition( QPoint pos )
return false; return false;
} }
void MachBuntButton::mouseMoveEvent( QMouseEvent* e ) void MachBuntButton::mouseMoveEvent( TQMouseEvent* e )
{ {
if( resizePosition( e->pos())) if( resizePosition( e->pos()))
{ {
@ -163,7 +163,7 @@ void MachBuntButton::mouseMoveEvent( QMouseEvent* e )
setCursor( arrowCursor ); setCursor( arrowCursor );
} }
void MachBuntButton::mousePressEvent( QMouseEvent* e ) void MachBuntButton::mousePressEvent( TQMouseEvent* e )
{ {
if( resizePosition( e->pos())) if( resizePosition( e->pos()))
{ {
@ -177,12 +177,12 @@ void MachBuntButton::mousePressEvent( QMouseEvent* e )
} }
last_button = e->button(); last_button = e->button();
QMouseEvent me ( e->type(), e->pos(), e->globalPos(), TQMouseEvent me ( e->type(), e->pos(), e->globalPos(),
LeftButton, e->state() ); LeftButton, e->state() );
QButton::mousePressEvent( &me ); TQButton::mousePressEvent( &me );
} }
void MachBuntButton::mouseReleaseEvent( QMouseEvent* e ) void MachBuntButton::mouseReleaseEvent( TQMouseEvent* e )
{ {
if (!menuBtn){ if (!menuBtn){
emit ( shapeMe(0) ); emit ( shapeMe(0) );
@ -196,15 +196,15 @@ void MachBuntButton::mouseReleaseEvent( QMouseEvent* e )
return; return;
} }
last_button = e->button(); last_button = e->button();
QMouseEvent me ( e->type(), e->pos(), e->globalPos(), TQMouseEvent me ( e->type(), e->pos(), e->globalPos(),
LeftButton, e->state() ); LeftButton, e->state() );
QButton::mouseReleaseEvent( &me ); TQButton::mouseReleaseEvent( &me );
} }
void MachBuntButton::drawButton(QPainter *p) void MachBuntButton::drawButton(TQPainter *p)
{ {
bool a = client->isActive(); bool a = client->isActive();
QPixmap *P; TQPixmap *P;
if (menuBtn) if (menuBtn)
P = &menuButtonPixmap[button][a][state][miniBtn]; P = &menuButtonPixmap[button][a][state][miniBtn];
else else
@ -216,10 +216,10 @@ void MachBuntButton::drawButton(QPainter *p)
p->drawPixmap( 0, 0, *P ); p->drawPixmap( 0, 0, *P );
} }
void MachBuntButton::setTipText(const QString &tip) { void MachBuntButton::setTipText(const TQString &tip) {
if(KDecoration::options()->showTooltips()) { if(KDecoration::options()->showTooltips()) {
QToolTip::remove(this ); TQToolTip::remove(this );
QToolTip::add(this, tip ); TQToolTip::add(this, tip );
} }
} }

Loading…
Cancel
Save