diff options
author | Mavridis Philippe <mavridisf@gmail.com> | 2022-10-15 19:07:17 +0300 |
---|---|---|
committer | Mavridis Philippe <mavridisf@gmail.com> | 2022-10-15 19:07:17 +0300 |
commit | e49c3e89f8017d07357ad146c76e5e3f64d9b4f1 (patch) | |
tree | 5c4efea399718fcc8c8837daa7fd566b1865d69a | |
parent | 47d22fa476f71a0e29649c2342fe11b04f079386 (diff) | |
download | twin-style-machbunt-e49c3e89f8017d07357ad146c76e5e3f64d9b4f1.tar.gz twin-style-machbunt-e49c3e89f8017d07357ad146c76e5e3f64d9b4f1.zip |
Qt3->TQt conversion
Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
-rw-r--r-- | acinclude.m4 | 48 | ||||
-rwxr-xr-x | admin/Doxyfile.global | 2 | ||||
-rw-r--r-- | admin/acinclude.m4.in | 48 | ||||
-rw-r--r-- | admin/am_edit | 2 | ||||
-rwxr-xr-x | configure | 54 | ||||
-rw-r--r-- | src/.MachBuntButton.cpp.swp | bin | 16384 -> 16428 bytes | |||
-rw-r--r-- | src/MachBunt.cpp | 260 | ||||
-rw-r--r-- | src/MachBunt.h | 88 | ||||
-rw-r--r-- | src/MachBuntButton.cpp | 70 |
9 files changed, 286 insertions, 286 deletions
diff --git a/acinclude.m4 b/acinclude.m4 index 70ed44c..0c8bd1f 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1060,7 +1060,7 @@ elif test "$kde_use_qt_emb" = "yes"; then x_includes="" x_libraries="" 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 CXXFLAGS="$CXXFLAGS -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]) cat > conftest.$ac_ext <<EOF #include "confdefs.h" -#include <qglobal.h> -#include <qapplication.h> +#include <ntqglobal.h> +#include <ntqapplication.h> EOF if test "$kde_qtver" = "2"; then cat >> conftest.$ac_ext <<EOF -#include <qevent.h> -#include <qstring.h> -#include <qstyle.h> +#include <ntqevent.h> +#include <ntqstring.h> +#include <ntqstyle.h> EOF if test $kde_qtsubver -gt 0; then cat >> conftest.$ac_ext <<EOF -#if QT_VERSION < 210 +#if TQT_VERSION < 210 #error 1 #endif EOF @@ -1113,8 +1113,8 @@ fi if test "$kde_qtver" = "3"; then cat >> conftest.$ac_ext <<EOF -#include <qcursor.h> -#include <qstylefactory.h> +#include <ntqcursor.h> +#include <ntqstylefactory.h> #include <private/qucomextra_p.h> EOF fi @@ -1201,22 +1201,22 @@ fi if test -z "$3"; then if test $kde_qtver = 3; 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,'` kde_qt_verstring=`echo $kde_qt_verstring | sed -e "s,@VER@,$qtsubver,"` else - kde_qt_verstring="QT_VERSION >= 300 && QT_VERSION < 0x040000" + kde_qt_verstring="TQT_VERSION >= 300 && TQT_VERSION < 0x040000" fi fi if test $kde_qtver = 2; then if test $kde_qtsubver -gt 0; then - kde_qt_verstring="QT_VERSION >= 222" + kde_qt_verstring="TQT_VERSION >= 222" else - kde_qt_verstring="QT_VERSION >= 200" + kde_qt_verstring="TQT_VERSION >= 200" fi fi 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 else kde_qt_verstring="$3" @@ -1325,7 +1325,7 @@ AC_ARG_ENABLE( USING_QT_MT="" 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 ------------------------------------------------------------------------ KDE_MT_LDFLAGS= @@ -1383,7 +1383,7 @@ dnl ------------------------------------------------------------ fi 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 ------------------------------------------------------------------------ if test "x$kde_use_qt_mt" = "xyes"; then @@ -1449,9 +1449,9 @@ if test ! "$ac_qt_includes" = "NO"; then fi if test "$kde_qtver" != "1"; then - kde_qt_header=qstyle.h + kde_qt_header=ntqstyle.h else - kde_qt_header=qglobal.h + kde_qt_header=ntqglobal.h fi 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" AC_TRY_LINK([ - #include <qdom.h> + #include <ntqdom.h> ], [ QDomDocument doc; @@ -2595,7 +2595,7 @@ LIBS=`echo $LIBS | sed "s/$LIBJPEG//"` ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES" AC_TRY_LINK( -[#include <qapplication.h>], +[#include <ntqapplication.h>], [ int argc; char** argv; @@ -3439,7 +3439,7 @@ AC_DEFUN([KDE_ENABLE_HIDDEN_VISIBILITY], AC_TRY_COMPILE( [ -#include <qglobal.h> +#include <ntqglobal.h> #if Q_EXPORT - 0 != 0 /* if this compiles, then Q_EXPORT is undefined */ /* if Q_EXPORT is nonempty, this will break compilation */ @@ -4691,7 +4691,7 @@ CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes" AC_TRY_RUN(dnl [ #include <qimageio.h> -#include <qstring.h> +#include <ntqstring.h> int main() { QString t = "hallo"; t.fill('t'); @@ -5536,7 +5536,7 @@ if test "${with_qt_dir+set}" = set; then kde_qtdir="$with_qt_dir" 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_SUBST(QTDOCDIR) @@ -5557,7 +5557,7 @@ AC_SUBST(DOXYGEN_PROJECT_NAME) AC_SUBST(DOXYGEN_PROJECT_NUMBER) 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 fi AC_SUBST(KDE_HAS_DOXYGEN) diff --git a/admin/Doxyfile.global b/admin/Doxyfile.global index 1b9f560..d8b577d 100755 --- a/admin/Doxyfile.global +++ b/admin/Doxyfile.global @@ -129,7 +129,7 @@ ENABLE_PREPROCESSING = YES SEARCH_INCLUDES = YES INCLUDE_PATH = INCLUDE_FILE_PATTERNS = -PREDEFINED = QT_VERSION=320 \ +PREDEFINED = TQT_VERSION=320 \ __cplusplus \ Q_WS_X11 EXPAND_AS_DEFINED = diff --git a/admin/acinclude.m4.in b/admin/acinclude.m4.in index 181f960..7408ff4 100644 --- a/admin/acinclude.m4.in +++ b/admin/acinclude.m4.in @@ -1060,7 +1060,7 @@ elif test "$kde_use_qt_emb" = "yes"; then x_includes="" x_libraries="" 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 CXXFLAGS="$CXXFLAGS -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]) cat > conftest.$ac_ext <<EOF #include "confdefs.h" -#include <qglobal.h> -#include <qapplication.h> +#include <ntqglobal.h> +#include <ntqapplication.h> EOF if test "$kde_qtver" = "2"; then cat >> conftest.$ac_ext <<EOF -#include <qevent.h> -#include <qstring.h> -#include <qstyle.h> +#include <ntqevent.h> +#include <ntqstring.h> +#include <ntqstyle.h> EOF if test $kde_qtsubver -gt 0; then cat >> conftest.$ac_ext <<EOF -#if QT_VERSION < 210 +#if TQT_VERSION < 210 #error 1 #endif EOF @@ -1113,8 +1113,8 @@ fi if test "$kde_qtver" = "3"; then cat >> conftest.$ac_ext <<EOF -#include <qcursor.h> -#include <qstylefactory.h> +#include <ntqcursor.h> +#include <ntqstylefactory.h> #include <private/qucomextra_p.h> EOF fi @@ -1201,22 +1201,22 @@ fi if test -z "$3"; then if test $kde_qtver = 3; 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,'` kde_qt_verstring=`echo $kde_qt_verstring | sed -e "s,@VER@,$qtsubver,"` else - kde_qt_verstring="QT_VERSION >= 300 && QT_VERSION < 0x040000" + kde_qt_verstring="TQT_VERSION >= 300 && TQT_VERSION < 0x040000" fi fi if test $kde_qtver = 2; then if test $kde_qtsubver -gt 0; then - kde_qt_verstring="QT_VERSION >= 222" + kde_qt_verstring="TQT_VERSION >= 222" else - kde_qt_verstring="QT_VERSION >= 200" + kde_qt_verstring="TQT_VERSION >= 200" fi fi 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 else kde_qt_verstring="$3" @@ -1325,7 +1325,7 @@ AC_ARG_ENABLE( USING_QT_MT="" 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 ------------------------------------------------------------------------ KDE_MT_LDFLAGS= @@ -1383,7 +1383,7 @@ dnl ------------------------------------------------------------ fi 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 ------------------------------------------------------------------------ if test "x$kde_use_qt_mt" = "xyes"; then @@ -1449,9 +1449,9 @@ if test ! "$ac_qt_includes" = "NO"; then fi if test "$kde_qtver" != "1"; then - kde_qt_header=qstyle.h + kde_qt_header=ntqstyle.h else - kde_qt_header=qglobal.h + kde_qt_header=ntqglobal.h fi 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" AC_TRY_LINK([ - #include <qdom.h> + #include <ntqdom.h> ], [ QDomDocument doc; @@ -2595,7 +2595,7 @@ LIBS=`echo $LIBS | sed "s/$LIBJPEG//"` ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES" AC_TRY_LINK( -[#include <qapplication.h>], +[#include <ntqapplication.h>], [ int argc; char** argv; @@ -3439,7 +3439,7 @@ AC_DEFUN([KDE_ENABLE_HIDDEN_VISIBILITY], AC_TRY_COMPILE( [ -#include <qglobal.h> +#include <ntqglobal.h> #if Q_EXPORT - 0 != 0 /* if this compiles, then Q_EXPORT is undefined */ /* if Q_EXPORT is nonempty, this will break compilation */ @@ -4691,7 +4691,7 @@ CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes" AC_TRY_RUN(dnl [ #include <qimageio.h> -#include <qstring.h> +#include <ntqstring.h> int main() { QString t = "hallo"; t.fill('t'); @@ -5536,7 +5536,7 @@ if test "${with_qt_dir+set}" = set; then kde_qtdir="$with_qt_dir" 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_SUBST(QTDOCDIR) @@ -5557,7 +5557,7 @@ AC_SUBST(DOXYGEN_PROJECT_NAME) AC_SUBST(DOXYGEN_PROJECT_NUMBER) 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 fi AC_SUBST(KDE_HAS_DOXYGEN) diff --git a/admin/am_edit b/admin/am_edit index 108eb67..c641a37 100644 --- a/admin/am_edit +++ b/admin/am_edit @@ -1375,7 +1375,7 @@ sub tag_UIFILES () $dep_lines .= "$source.h: $sourcedir$source.ui\n"; $dep_lines .= "\trm -rf $source.h;\n"; 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 { $dep_lines .= "\t\$(UIC) -o $source.h $sourcedir$source.ui\n"; } @@ -689,7 +689,7 @@ do | --progr-tra=* | --program-tr=* | --program-t=*) 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=yes ;; @@ -1266,7 +1266,7 @@ do do case $ac_arg in -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) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) @@ -22150,22 +22150,22 @@ fi if test -z ""; then if test $kde_qtver = 3; 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,'` kde_qt_verstring=`echo $kde_qt_verstring | sed -e "s,@VER@,$qtsubver,"` else - kde_qt_verstring="QT_VERSION >= 300 && QT_VERSION < 0x040000" + kde_qt_verstring="TQT_VERSION >= 300 && TQT_VERSION < 0x040000" fi fi if test $kde_qtver = 2; then if test $kde_qtsubver -gt 0; then - kde_qt_verstring="QT_VERSION >= 222" + kde_qt_verstring="TQT_VERSION >= 222" else - kde_qt_verstring="QT_VERSION >= 200" + kde_qt_verstring="TQT_VERSION >= 200" fi fi 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 else kde_qt_verstring="" @@ -29989,9 +29989,9 @@ if test ! "$ac_qt_includes" = "NO"; then fi if test "$kde_qtver" != "1"; then - kde_qt_header=qstyle.h + kde_qt_header=ntqstyle.h else - kde_qt_header=qglobal.h + kde_qt_header=ntqglobal.h fi @@ -30060,19 +30060,19 @@ LIBS="$LIBS $LIBQT $KDE_MT_LIBS" cat > conftest.$ac_ext <<EOF #include "confdefs.h" -#include <qglobal.h> -#include <qapplication.h> +#include <ntqglobal.h> +#include <ntqapplication.h> EOF if test "$kde_qtver" = "2"; then cat >> conftest.$ac_ext <<EOF -#include <qevent.h> -#include <qstring.h> -#include <qstyle.h> +#include <ntqevent.h> +#include <ntqstring.h> +#include <ntqstyle.h> EOF if test $kde_qtsubver -gt 0; then cat >> conftest.$ac_ext <<EOF -#if QT_VERSION < 210 +#if TQT_VERSION < 210 #error 1 #endif EOF @@ -30081,8 +30081,8 @@ fi if test "$kde_qtver" = "3"; then cat >> conftest.$ac_ext <<EOF -#include <qcursor.h> -#include <qstylefactory.h> +#include <ntqcursor.h> +#include <ntqstylefactory.h> #include <private/qucomextra_p.h> EOF fi @@ -30229,19 +30229,19 @@ export LIBRARY_PATH cat > conftest.$ac_ext <<EOF #include "confdefs.h" -#include <qglobal.h> -#include <qapplication.h> +#include <ntqglobal.h> +#include <ntqapplication.h> EOF if test "$kde_qtver" = "2"; then cat >> conftest.$ac_ext <<EOF -#include <qevent.h> -#include <qstring.h> -#include <qstyle.h> +#include <ntqevent.h> +#include <ntqstring.h> +#include <ntqstyle.h> EOF if test $kde_qtsubver -gt 0; then cat >> conftest.$ac_ext <<EOF -#if QT_VERSION < 210 +#if TQT_VERSION < 210 #error 1 #endif EOF @@ -30250,8 +30250,8 @@ fi if test "$kde_qtver" = "3"; then cat >> conftest.$ac_ext <<EOF -#include <qcursor.h> -#include <qstylefactory.h> +#include <ntqcursor.h> +#include <ntqstylefactory.h> #include <private/qucomextra_p.h> EOF fi @@ -30656,7 +30656,7 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <qapplication.h> +#include <ntqapplication.h> int main () { @@ -33421,7 +33421,7 @@ Try \`$0 --help' for more information." >&2;} $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" 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) ac_cs_silent=: ;; diff --git a/src/.MachBuntButton.cpp.swp b/src/.MachBuntButton.cpp.swp Binary files differindex 5c21b2a..9a1389b 100644 --- a/src/.MachBuntButton.cpp.swp +++ b/src/.MachBuntButton.cpp.swp diff --git a/src/MachBunt.cpp b/src/MachBunt.cpp index b20706b..a23ea3d 100644 --- a/src/MachBunt.cpp +++ b/src/MachBunt.cpp @@ -15,13 +15,13 @@ #include <kconfig.h> #include <kstandarddirs.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qdrawutil.h> -#include <qdatetime.h> -#include <qcursor.h> -#include <qbitmap.h> -#include <qimage.h> +#include <ntqlabel.h> +#include <ntqlayout.h> +#include <ntqdrawutil.h> +#include <ntqdatetime.h> +#include <ntqcursor.h> +#include <ntqbitmap.h> +#include <ntqimage.h> extern "C" { @@ -43,20 +43,20 @@ bool titlebarResize, titlebarPlain, double titlebarLenseButtonFlare; static bool pixmaps_created = false; -static QImage left_img[2][2]; -static QImage middle_img[2][2]; -static QImage right_img[2][2]; -static QImage text_img[2][2]; -static QImage bar_img[2][2]; -static QImage kroete_img[2][2]; -static QImage button_img[2][2]; -static QImage button_l_img[2][2]; -static QImage button_r_img[2][2]; +static TQImage left_img[2][2]; +static TQImage middle_img[2][2]; +static TQImage right_img[2][2]; +static TQImage text_img[2][2]; +static TQImage bar_img[2][2]; +static TQImage kroete_img[2][2]; +static TQImage button_img[2][2]; +static TQImage button_l_img[2][2]; +static TQImage button_r_img[2][2]; -extern QColor *btnForeground; -extern QPixmap *defaultPixmap; +extern TQColor *btnForeground; +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 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++) { - val = static_cast<int>(qBlue(data[i]) * contrast); - val2 = static_cast<int>(qGreen(data[i]) * contrast); + val = static_cast<int>(tqBlue(data[i]) * contrast); + val2 = static_cast<int>(tqGreen(data[i]) * contrast); rval = static_cast<int>( (val2*255*3 + (255-val2)*col2.red())/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 ); bval = static_cast<int>( (val *bval + (255-val)*col1.blue())/255 ); - if ( 255 < rval+qRed(data[i]) ) rval = 255; - else rval += qRed(data[i]); - if ( 255 < gval+qRed(data[i]) ) gval = 255; - else gval += qRed(data[i]); - if ( 255 < bval+qRed(data[i]) ) bval = 255; - else bval += qRed(data[i]); + if ( 255 < rval+tqRed(data[i]) ) rval = 255; + else rval += tqRed(data[i]); + if ( 255 < gval+tqRed(data[i]) ) gval = 255; + else gval += tqRed(data[i]); + if ( 255 < bval+tqRed(data[i]) ) bval = 255; + else bval += tqRed(data[i]); 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); } - data[i] = qRgba(rval, gval, bval, qAlpha(data[i])); + data[i] = tqRgba(rval, gval, bval, tqAlpha(data[i])); } 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; - KPixmap _p(QPixmap(x,y)); - QPixmap t, pix; - QPainter p; + TQImage i; + KPixmap _p(TQPixmap(x,y)); + TQPixmap t, pix; + TQPainter p; if ( _pix.isNull() ) - pix = QPixmap(kdelogo); + pix = TQPixmap(kdelogo); else 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 i=_p; 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 - _p.convertFromImage(KImageEffect::blend(Qt::black, i, 0.25 )); + _p.convertFromImage(KImageEffect::blend(TQt::black, i, 0.25 )); } if ( mouse == 2 ) { // pressed @@ -139,9 +139,9 @@ KPixmap create_buttonPixmap( int x, int y, QPixmap _pix, QPixmap bg, int active, return _p; } -QImage image_convert( const char **b, int h){ - QPixmap p(b); - QImage i; +TQImage image_convert( const char **b, int h){ + TQPixmap p(b); + TQImage i; i = p.convertToImage(); if ( 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 i=0; i<2; i++){ - QColor ctb = KDecoration::options()->color(KDecoration::ColorTitleBar,i); - QColor ctbB = KDecoration::options()->color(KDecoration::ColorTitleBlend,i); + TQColor ctb = KDecoration::options()->color(KDecoration::ColorTitleBar,i); + TQColor ctbB = KDecoration::options()->color(KDecoration::ColorTitleBlend,i); left_img[i][m] = colorize(image_convert(left_xpm, m ? 12 : PIX_HEIGHT) , ctb, ctbB, 0.75 , 0.75 ); 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<3; M++ ) 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[1][a][M][m] = create_buttonPixmap( m ? 12 : PIX_HEIGHT, m ? 12 : PIX_HEIGHT, QPixmap(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[3][a][M][m] = create_buttonPixmap( m ? 12 : PIX_HEIGHT, m ? 12 : PIX_HEIGHT, QPixmap(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 ); - QPixmap i(button_img[a][m]); - QPainter p(&i); + 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, TQPixmap(sticky_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, TQPixmap(iconify_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 ); + TQPixmap i(button_img[a][m]); + TQPainter p(&i); p.drawPixmap(button_img[a][m].width()-right_img[a][m].width()+BORDER_RIGHT, 0, right_img[a][m]); 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. - if(qGray(KDecoration::options()->color(KDecoration::ColorTitleBar,true).rgb()) > 127) - btnForeground = new QColor(Qt::black); + if(tqGray(KDecoration::options()->color(KDecoration::ColorTitleBar,true).rgb()) > 127) + btnForeground = new TQColor(TQt::black); else - btnForeground = new QColor(Qt::white); + btnForeground = new TQColor(TQt::white); } void delete_pixmaps() @@ -246,7 +246,7 @@ void MachBunt::init() titlebarNoPlainButtons = c.readBoolEntry("TitleBarNoPlainButtons", false); titlebarSidebar = c.readBoolEntry("TitleBarSideBar", false); titlebarLenseButtonFlare = c.readDoubleNumEntry("titlebarLenseButtonFlare", 1.7); - defaultPixmap = new QPixmap(kdelogo); + defaultPixmap = new TQPixmap(kdelogo); create_pixmaps(); createButtons(); @@ -278,7 +278,7 @@ void MachBunt::createButtons() connect( button[i], SIGNAL(shapeMe(int)),this, SLOT(doShape(int))); connect( button[i], SIGNAL(pressed()),this, SLOT(buttonPressed())); 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() )); @@ -306,7 +306,7 @@ void MachBunt::reset( unsigned long changed ) widget()->repaint(); } -int MachBunt::mapButton( const QChar &c) +int MachBunt::mapButton( const TQChar &c) { switch (c.latin1()) { @@ -324,7 +324,7 @@ int MachBunt::mapButton( const QChar &c) return BtnClose; } // something went wrong - qDebug("unknown Button to map \"%c\"", c.latin1() ); + tqDebug("unknown Button to map \"%c\"", c.latin1() ); return -1; } @@ -332,17 +332,17 @@ void MachBunt::doLayout() { delete windowLayout; - windowLayout = new QVBoxLayout(widget(), 0, 0); - titlebar = new QSpacerItem ( 0, titleHeight, QSizePolicy::Expanding, - QSizePolicy::Fixed); - QBoxLayout *topLayout = new QBoxLayout(windowLayout, QBoxLayout::LeftToRight, 0, 0); + windowLayout = new TQVBoxLayout(widget(), 0, 0); + titlebar = new TQSpacerItem ( 0, titleHeight, TQSizePolicy::Expanding, + TQSizePolicy::Fixed); + TQBoxLayout *topLayout = new TQBoxLayout(windowLayout, TQBoxLayout::LeftToRight, 0, 0); #if 0 bool first_left = true; for ( unsigned int i = 0; i <options()->titleButtonsLeft().length(); i++) { int b = mapButton(options()->titleButtonsLeft()[i]); if ( b>=0 ){ - topLayout->addWidget(button[b], Qt::AlignVCenter); + topLayout->addWidget(button[b], TQt::AlignVCenter); topLayout->setStretchFactor(button[b], 0); button[b]->setFixedSize(titleHeight, titleHeight); if( first_left ) @@ -356,26 +356,26 @@ void MachBunt::doLayout() topLayout->addItem(titlebar); #else - topLayout->addWidget(button[BtnMenu], Qt::AlignVCenter); + topLayout->addWidget(button[BtnMenu], TQt::AlignVCenter); topLayout->setStretchFactor(button[BtnMenu], 0); button[BtnMenu]->setFixedSize(titleHeight, titleHeight); button[BtnMenu]->setPosition( ButtonLeft ); topLayout->addItem(titlebar); - topLayout->addWidget(button[BtnHelp], Qt::AlignVCenter); + topLayout->addWidget(button[BtnHelp], TQt::AlignVCenter); topLayout->setStretchFactor(button[BtnHelp], 0); button[BtnHelp]->setFixedSize(titleHeight, titleHeight); - topLayout->addWidget(button[BtnIconify], Qt::AlignVCenter); + topLayout->addWidget(button[BtnIconify], TQt::AlignVCenter); topLayout->setStretchFactor(button[BtnIconify], 0); button[BtnIconify]->setFixedSize(titleHeight, titleHeight); - topLayout->addWidget(button[BtnMax], Qt::AlignVCenter); + topLayout->addWidget(button[BtnMax], TQt::AlignVCenter); topLayout->setStretchFactor(button[BtnMax], 0); button[BtnMax]->setFixedSize(titleHeight, titleHeight); - topLayout->addWidget(button[BtnClose], Qt::AlignVCenter); + topLayout->addWidget(button[BtnClose], TQt::AlignVCenter); topLayout->setStretchFactor(button[BtnClose], 0); button[BtnClose]->setFixedSize(titleHeight, titleHeight); button[BtnClose]->setPosition( ButtonRight ); @@ -391,7 +391,7 @@ void MachBunt::doLayout() { int b = mapButton(options()->titleButtonsRight()[i]); if ( b>=0 ){ - topLayout->addWidget(button[b], Qt::AlignVCenter); + topLayout->addWidget(button[b], TQt::AlignVCenter); topLayout->setStretchFactor(button[b], 0); button[b]->setFixedSize(titleHeight, titleHeight); last_right = button[b]; @@ -401,12 +401,12 @@ void MachBunt::doLayout() last_right->setPosition( ButtonRight ); #endif - QHBoxLayout * midLayout = new QHBoxLayout(windowLayout, 0, 0); + TQHBoxLayout * midLayout = new TQHBoxLayout(windowLayout, 0, 0); midLayout->addSpacing(BORDER_LEFT); 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 - 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); windowLayout->addSpacing(BORDER_BOTTOM); @@ -422,18 +422,18 @@ void MachBunt::borders(int& left, int& right, int& top, int& bottom) const bottom = BORDER_BOTTOM; } -void MachBunt::mouseMoveOnButtonPressed( QMouseEvent *e ) +void MachBunt::mouseMoveOnButtonPressed( TQMouseEvent *e ) { #if 0 if ( buttonPressedPosition.x() >= 0 ){ - QPoint p( buttonPressedPosition.x() - geometry().x(), + TQPoint p( buttonPressedPosition.x() - geometry().x(), buttonPressedPosition.y() - geometry().y()); if ( mousePosition(p) == KDecoration::TopLeft || mousePosition(p) == KDecoration::TopRight ) - performMouseCommand(Options::MouseResize, QCursor::pos()); + performMouseCommand(Options::MouseResize, TQCursor::pos()); 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 ); } buttonPressedPosition.setX( -1 ); @@ -445,13 +445,13 @@ void MachBunt::mouseMoveOnButtonPressed( QMouseEvent *e ) void MachBunt::buttonPressed() { - QPoint p( QCursor::pos().x() - geometry().x(), - QCursor::pos().y() - geometry().y()); + TQPoint p( TQCursor::pos().x() - geometry().x(), + TQCursor::pos().y() - geometry().y()); if ( mousePosition(p) == KDecorationDefines::PositionTopLeft || mousePosition(p) == KDecorationDefines::PositionTopRight || mousePosition(p) == KDecorationDefines::PositionTop ) - buttonPressedPosition = QCursor::pos(); + buttonPressedPosition = TQCursor::pos(); } void MachBunt::buttonReleased() @@ -461,7 +461,7 @@ void MachBunt::buttonReleased() } KDecoration::Position -MachBunt::mousePosition(const QPoint & p) const +MachBunt::mousePosition(const TQPoint & p) const { int x = p.x(); int y = p.y(); @@ -496,14 +496,14 @@ void MachBunt::slotMaximize() maximize(maximizeMode() == MaximizeFull ? MaximizeRestore : MaximizeFull); } -void MachBunt::resize( const QSize& s ) +void MachBunt::resize( const TQSize& 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 @@ -516,23 +516,23 @@ bool MachBunt::isTool() 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()) return false; switch( e->type()) { - case QEvent::Resize: - resizeEvent(static_cast< QResizeEvent* >( e ) ); + case TQEvent::Resize: + resizeEvent(static_cast< TQResizeEvent* >( e ) ); return true; - case QEvent::Paint: - paintEvent(static_cast< QPaintEvent* >( e ) ); + case TQEvent::Paint: + paintEvent(static_cast< TQPaintEvent* >( e ) ); return true; - case QEvent::MouseButtonDblClick: - mouseDoubleClickEvent(static_cast< QMouseEvent* >( e ) ); + case TQEvent::MouseButtonDblClick: + mouseDoubleClickEvent(static_cast< TQMouseEvent* >( e ) ); return true; - case QEvent::MouseButtonPress: - processMousePressEvent(static_cast< QMouseEvent* >( e ) ); + case TQEvent::MouseButtonPress: + processMousePressEvent(static_cast< TQMouseEvent* >( e ) ); return true; default: 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 - return QValueList< BorderSize >() << BorderNormal; + return TQValueList< BorderSize >() << BorderNormal; // TODO << BorderLarge << BorderVeryLarge << BorderHuge << BorderVeryHuge << BorderOversized; } -void MachBunt::resizeEvent( QResizeEvent*) +void MachBunt::resizeEvent( TQResizeEvent*) { doShape(); @@ -596,10 +596,10 @@ void MachBunt::resizeEvent( QResizeEvent*) int dy = 0; if ( e->oldSize().width() != width() ) - dx = 32 + QABS( e->oldSize().width() - width() ); + dx = 32 + TQABS( e->oldSize().width() - width() ); if ( e->oldSize().height() != height() ) - dy = 8 + QABS( e->oldSize().height() - height() ); + dy = 8 + TQABS( e->oldSize().height() - height() ); if ( dy ) update( 0, height() - dy + 1, width(), dy ); @@ -607,10 +607,10 @@ void MachBunt::resizeEvent( QResizeEvent*) if ( dx ) { update( width() - dx + 1, 0, dx, height() ); - update( QRect( QPoint(4,4), titlebar->geometry().bottomLeft() - QPoint(1,0) ) ); - update( QRect( titlebar->geometry().topRight(), QPoint( width() - 4, titlebar->geometry().bottom() ) ) ); + update( TQRect( TQPoint(4,4), titlebar->geometry().bottomLeft() - TQPoint(1,0) ) ); + update( TQRect( titlebar->geometry().topRight(), TQPoint( width() - 4, titlebar->geometry().bottom() ) ) ); // Titlebar needs no paint event - QApplication::postEvent( widget(), new QPaintEvent( titlebar->geometry(), FALSE ) ); + TQApplication::postEvent( widget(), new TQPaintEvent( titlebar->geometry(), FALSE ) ); } } #endif @@ -624,23 +624,23 @@ void MachBunt::captionChange() 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()) 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; - QPainter p(widget()); + TQPainter p(widget()); p.setClipRegion(pe->region()); // Obtain widget bounds. - QRect r(widget()->rect()); + TQRect r(widget()->rect()); int i; int x = r.x(); int y = r.y(); @@ -649,7 +649,7 @@ void MachBunt::paintEvent( QPaintEvent *pe ) int w = r.width(); 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() ); // the dark outer drawings @@ -676,7 +676,7 @@ void MachBunt::paintEvent( QPaintEvent *pe ) // draw the title bar. r = titlebar->geometry(); -// QFontMetrics fm(options()->font(true)); +// TQFontMetrics fm(options()->font(true)); KPixmap titleBuffer; if ( titlebarSidebar ) @@ -685,7 +685,7 @@ void MachBunt::paintEvent( QPaintEvent *pe ) titleBuffer.resize(w, titleHeight); 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( 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); // Reduce the font size and weight for toolwindows. - QFont font = options()->font(true); + TQFont font = options()->font(true); if ( smallButtons ) { font.setPointSize( font.pointSize() - 2 ); - font.setWeight( QFont::Normal ); + font.setWeight( TQFont::Normal ); fontoffset = 0; } p2.setFont( font ); @@ -731,13 +731,13 @@ void MachBunt::paintEvent( QPaintEvent *pe ) p.drawPixmap( 0, 0, titleBuffer ); } -void MachBunt::showEvent(QShowEvent *) +void MachBunt::showEvent(TQShowEvent *) { doShape(); widget()->repaint(); } -void MachBunt::mouseDoubleClickEvent( QMouseEvent * e ) +void MachBunt::mouseDoubleClickEvent( TQMouseEvent * e ) { if (titlebar->geometry().contains( e->pos() ) ) titlebarDblClickOperation(); @@ -821,7 +821,7 @@ void MachBunt::calcHiddenButtons() void MachBunt::menuButtonPressed() { // 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 ); KDecorationFactory* f = factory(); showWindowMenu( button[BtnMenu]->mapToGlobal( menupoint )); @@ -832,7 +832,7 @@ void MachBunt::menuButtonPressed() void MachBunt::doShape(int x) { - QRegion mask(0, 0, width(), height()); + TQRegion mask(0, 0, width(), height()); int bWidth = smallButtons ? 12 : PIX_HEIGHT; int i, bl=0, br=0, p=0; @@ -845,40 +845,40 @@ void MachBunt::doShape(int x) p=2; } - mask -= QRegion(0, 0, bl+3, 1); - mask -= QRegion(0, 1, bl+1, 1); + mask -= TQRegion(0, 0, bl+3, 1); + mask -= TQRegion(0, 1, bl+1, 1); // Remove top-right corner. if ( smallButtons ){ - mask -= QRegion(r-3-br, 0, 3+br, 1+p); - mask -= QRegion(r-2-br, 1, 2+br, 1+p); - mask -= QRegion(r-1-br, 2, 1+br, 1+p); + mask -= TQRegion(r-3-br, 0, 3+br, 1+p); + mask -= TQRegion(r-2-br, 1, 2+br, 1+p); + mask -= TQRegion(r-1-br, 2, 1+br, 1+p); }else{ - mask -= QRegion(r-7-br, 0, 7+br, 1+p); - mask -= QRegion(r-5-br, 1, 5+br, 1+p); - mask -= QRegion(r-4-br, 2, 4+br, 1+p); - mask -= QRegion(r-3-br, 3, 3+br, 1+p); - mask -= QRegion(r-2-br, 4, 2+br, 1+p); - mask -= QRegion(r-1-br, 5, 1+br, 2+p); + mask -= TQRegion(r-7-br, 0, 7+br, 1+p); + mask -= TQRegion(r-5-br, 1, 5+br, 1+p); + mask -= TQRegion(r-4-br, 2, 4+br, 1+p); + mask -= TQRegion(r-3-br, 3, 3+br, 1+p); + mask -= TQRegion(r-2-br, 4, 2+br, 1+p); + mask -= TQRegion(r-1-br, 5, 1+br, 2+p); } 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 for ( i=0; i<BtnCount; i++){ if ( button[i] && button[i]->isShown() ){ // top left corner of this button and right part of the button before - mask -= QRegion( button[i]->x() - 3, 0, 4, 1 ); - mask -= QRegion( button[i]->x() - 1, 0, 1, 2 ); + mask -= TQRegion( button[i]->x() - 3, 0, 4, 1 ); + mask -= TQRegion( button[i]->x() - 1, 0, 1, 2 ); } } // the pressed button if ( x != 0 ){ - mask -= QRegion( x, 0, bWidth, 2 ); - mask -= QRegion( x, 0, 1, 3 ); - mask -= QRegion( x + bWidth -3 , 0, 3, 3 ); - mask -= QRegion( x + bWidth -1 , 0, 1, 4 ); + mask -= TQRegion( x, 0, bWidth, 2 ); + mask -= TQRegion( x, 0, 1, 3 ); + mask -= TQRegion( x + bWidth -3 , 0, 3, 3 ); + mask -= TQRegion( x + bWidth -1 , 0, 1, 4 ); } setMask(mask); diff --git a/src/MachBunt.h b/src/MachBunt.h index fa60f54..0859903 100644 --- a/src/MachBunt.h +++ b/src/MachBunt.h @@ -6,17 +6,17 @@ #ifndef __KDE_SuSE_H #define __KDE_SuSE_H -#include <qvariant.h> -#include <qlayout.h> -#include <qbutton.h> -#include <qbitmap.h> -#include <qimage.h> +#include <ntqvariant.h> +#include <ntqlayout.h> +#include <ntqbutton.h> +#include <ntqbitmap.h> +#include <ntqimage.h> #include <kpixmap.h> #include <kdecoration.h> #include <kdecorationfactory.h> -class QLabel; -class QSpacerItem; -class QHBoxLayout; +class TQLabel; +class TQSpacerItem; +class TQHBoxLayout; #define USE_BUT 1 #define PIX_HEIGHT 24 @@ -42,48 +42,48 @@ extern KPixmap buttonPixmap[BtnCount][2][3][2]; extern bool titlebarResize, titlebarPlain, titlebarLogo, titlebarSidebar, titlebarNoPlainButtons; 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 MachBuntButton : public QButton +class MachBuntButton : public TQButton { Q_OBJECT public: MachBuntButton(MachBunt *client, const char *name, - int button, QPixmap bgI, QPixmap bgA, bool isMini=false, - const QString& tip=NULL); + int button, TQPixmap bgI, TQPixmap bgA, bool isMini=false, + const TQString& tip=NULL); virtual ~MachBuntButton(); virtual void reset( unsigned long changed ); void setBitmap(const unsigned char *bitmap); - void setPixmap(const QPixmap &p); - void setTipText(const QString &tip); + void setPixmap(const TQPixmap &p); + void setTipText(const TQString &tip); void setPosition(ButtonPos pos); - virtual QSize sizeHint() const; + virtual TQSize sizeHint() const; int last_button; KPixmap menuButtonPixmap[BtnCount][2][3][2]; signals: void shapeMe(int); - void mousePressedMove(QMouseEvent*); + void mousePressedMove(TQMouseEvent*); protected: - void mousePressEvent(QMouseEvent* e); - void mouseReleaseEvent(QMouseEvent* e); - virtual void drawButton(QPainter *p); - void drawButtonLabel(QPainter *){;} - void enterEvent(QEvent *); - void leaveEvent(QEvent *); - void mouseMoveEvent( QMouseEvent *e ); + void mousePressEvent(TQMouseEvent* e); + void mouseReleaseEvent(TQMouseEvent* e); + virtual void drawButton(TQPainter *p); + void drawButtonLabel(TQPainter *){;} + void enterEvent(TQEvent *); + void leaveEvent(TQEvent *); + void mouseMoveEvent( TQMouseEvent *e ); - bool resizePosition( QPoint pos ); + bool resizePosition( TQPoint pos ); - QBitmap deco; - QPixmap pix; - QPixmap menuPixmap; - QPixmap bg[2]; + TQBitmap deco; + TQPixmap pix; + TQPixmap menuPixmap; + TQPixmap bg[2]; bool menuBtn; bool miniBtn; bool pressed; @@ -103,16 +103,16 @@ class MachBunt : public KDecoration MachBunt(KDecorationBridge* bridge, KDecorationFactory* factory); virtual ~MachBunt(); virtual void init(); - virtual void resize(const QSize&); - virtual bool eventFilter( QObject* o, QEvent* e ); + virtual void resize(const TQSize&); + virtual bool eventFilter( TQObject* o, TQEvent* e ); protected: virtual void reset( unsigned long changed ); - virtual void resizeEvent( QResizeEvent* ); - virtual void paintEvent( QPaintEvent* ); - virtual void showEvent( QShowEvent* ); - virtual void mouseDoubleClickEvent( QMouseEvent * ); - virtual Position mousePosition( const QPoint& ) const; + virtual void resizeEvent( TQResizeEvent* ); + virtual void paintEvent( TQPaintEvent* ); + virtual void showEvent( TQShowEvent* ); + virtual void mouseDoubleClickEvent( TQMouseEvent * ); + virtual Position mousePosition( const TQPoint& ) const; virtual void captionChange(); virtual void desktopChange(); virtual void shadeChange() {}; @@ -121,8 +121,8 @@ class MachBunt : public KDecoration virtual void iconChange(); virtual void calcHiddenButtons(); virtual void borders(int&, int&, int&, int&) const; - virtual QSize minimumSize() const; - virtual int mapButton( const QChar &c ); + virtual TQSize minimumSize() const; + virtual int mapButton( const TQChar &c ); virtual void doLayout(); virtual void createButtons(); @@ -136,25 +136,25 @@ class MachBunt : public KDecoration void slotMaximize(); void menuButtonPressed(); void doShape(int x=0); - void mouseMoveOnButtonPressed(QMouseEvent*); + void mouseMoveOnButtonPressed(TQMouseEvent*); private: bool isTool(); MachBuntButton* button[ BtnCount ]; - QPoint buttonPressedPosition; + TQPoint buttonPressedPosition; int lastButtonWidth; int titleHeight; - QSpacerItem* titlebar; + TQSpacerItem* titlebar; bool hiddenItems; - QVBoxLayout* windowLayout; - QBoxLayout* topLayout; + TQVBoxLayout* windowLayout; + TQBoxLayout* topLayout; bool smallButtons; bool mouseOverButton; }; -class BuntFactory : public QObject, public KDecorationFactory +class BuntFactory : public TQObject, public KDecorationFactory { Q_OBJECT @@ -164,7 +164,7 @@ class BuntFactory : public QObject, public KDecorationFactory virtual ~BuntFactory() {}; virtual KDecoration* createDecoration( KDecorationBridge* ); virtual bool reset( unsigned long changed ); - virtual QValueList< BorderSize > borderSizes() const; + virtual TQValueList< BorderSize > borderSizes() const; }; }; diff --git a/src/MachBuntButton.cpp b/src/MachBuntButton.cpp index 82f1b14..6ae0146 100644 --- a/src/MachBuntButton.cpp +++ b/src/MachBuntButton.cpp @@ -10,34 +10,34 @@ #include <kdrawutil.h> #include <klocale.h> -#include <qlayout.h> -#include <qdrawutil.h> -#include <qtooltip.h> -#include <qdatetime.h> -#include <qbitmap.h> -#include <qimage.h> -#include <qcursor.h> +#include <ntqlayout.h> +#include <ntqdrawutil.h> +#include <ntqtooltip.h> +#include <ntqdatetime.h> +#include <ntqbitmap.h> +#include <ntqimage.h> +#include <ntqcursor.h> namespace SuSEMachBunt { // the titlebar buttons extern bool pixmaps_created; -QPixmap *defaultPixmap; -QColor *btnForeground; +TQPixmap *defaultPixmap; +TQColor *btnForeground; MachBuntButton::MachBuntButton(MachBunt * c, const char *name, - int _button, QPixmap bgI, QPixmap bgA, + int _button, TQPixmap bgI, TQPixmap bgA, bool isMini, - const QString &tip) - : QButton (c->widget(), name), position( ButtonMiddle ), client( c ) + const TQString &tip) + : TQButton (c->widget(), name), position( ButtonMiddle ), client( c ) { setTipText(tip); setMouseTracking( true ); setCursor( arrowCursor ); // Eliminate background flicker - setBackgroundMode( QWidget::NoBackground ); + setBackgroundMode( TQWidget::NoBackground ); menuBtn = _button == BtnMenu; miniBtn = isMini; @@ -61,12 +61,12 @@ MachBuntButton::~MachBuntButton() { }; -QSize MachBuntButton::sizeHint() const +TQSize MachBuntButton::sizeHint() const { if ( miniBtn ) - return(QSize(12, 12)); + return(TQSize(12, 12)); 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() ) p = *defaultPixmap; @@ -113,7 +113,7 @@ void MachBuntButton::setPixmap( const QPixmap &_p ) repaint( false ); } -void MachBuntButton::enterEvent( QEvent *e ) +void MachBuntButton::enterEvent( TQEvent *e ) { if (pressed){ state = 2; @@ -121,16 +121,16 @@ void MachBuntButton::enterEvent( QEvent *e ) }else state = 1; repaint(); - QButton::enterEvent(e); + TQButton::enterEvent(e); } -void MachBuntButton::leaveEvent( QEvent *e ) +void MachBuntButton::leaveEvent( TQEvent *e ) { if (pressed) emit ( shapeMe(0) ); state = 0; repaint(); - QButton::leaveEvent(e); + TQButton::leaveEvent(e); } void MachBuntButton::setPosition( ButtonPos pos ) @@ -138,7 +138,7 @@ void MachBuntButton::setPosition( ButtonPos pos ) position = pos; } -bool MachBuntButton::resizePosition( QPoint pos ) +bool MachBuntButton::resizePosition( TQPoint pos ) { if( pos.y() < BUTTON_RESIZE_SIZE ) return true; @@ -149,7 +149,7 @@ bool MachBuntButton::resizePosition( QPoint pos ) return false; } -void MachBuntButton::mouseMoveEvent( QMouseEvent* e ) +void MachBuntButton::mouseMoveEvent( TQMouseEvent* e ) { if( resizePosition( e->pos())) { @@ -163,7 +163,7 @@ void MachBuntButton::mouseMoveEvent( QMouseEvent* e ) setCursor( arrowCursor ); } -void MachBuntButton::mousePressEvent( QMouseEvent* e ) +void MachBuntButton::mousePressEvent( TQMouseEvent* e ) { if( resizePosition( e->pos())) { @@ -177,12 +177,12 @@ void MachBuntButton::mousePressEvent( QMouseEvent* e ) } last_button = e->button(); - QMouseEvent me ( e->type(), e->pos(), e->globalPos(), + TQMouseEvent me ( e->type(), e->pos(), e->globalPos(), LeftButton, e->state() ); - QButton::mousePressEvent( &me ); + TQButton::mousePressEvent( &me ); } -void MachBuntButton::mouseReleaseEvent( QMouseEvent* e ) +void MachBuntButton::mouseReleaseEvent( TQMouseEvent* e ) { if (!menuBtn){ emit ( shapeMe(0) ); @@ -196,15 +196,15 @@ void MachBuntButton::mouseReleaseEvent( QMouseEvent* e ) return; } last_button = e->button(); - QMouseEvent me ( e->type(), e->pos(), e->globalPos(), + TQMouseEvent me ( e->type(), e->pos(), e->globalPos(), LeftButton, e->state() ); - QButton::mouseReleaseEvent( &me ); + TQButton::mouseReleaseEvent( &me ); } -void MachBuntButton::drawButton(QPainter *p) +void MachBuntButton::drawButton(TQPainter *p) { bool a = client->isActive(); - QPixmap *P; + TQPixmap *P; if (menuBtn) P = &menuButtonPixmap[button][a][state][miniBtn]; else @@ -216,10 +216,10 @@ void MachBuntButton::drawButton(QPainter *p) p->drawPixmap( 0, 0, *P ); } -void MachBuntButton::setTipText(const QString &tip) { +void MachBuntButton::setTipText(const TQString &tip) { if(KDecoration::options()->showTooltips()) { - QToolTip::remove(this ); - QToolTip::add(this, tip ); + TQToolTip::remove(this ); + TQToolTip::add(this, tip ); } } |