From 1cf8018d1c583e13baf269078de99690c4457933 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Tue, 4 Jun 2019 12:34:32 +0200 Subject: Rename tqt-kde integration to tqt-tde. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- tqt3integration/utils/tqt/in/CMakeLists.txt | 2 +- .../utils/tqt/in/tqtkdeintegration_x11_0.cpp.cmake | 1 - .../utils/tqt/in/tqtkdeintegration_x11_1.cpp | 73 ------------------- .../utils/tqt/in/tqtkdeintegration_x11_2.cpp | 81 ---------------------- .../utils/tqt/in/tqtkdeintegration_x11_p_1.h | 35 ---------- .../utils/tqt/in/tqtkdeintegration_x11_p_2.h | 28 -------- .../utils/tqt/in/tqttdeintegration_x11_0.cpp.cmake | 1 + .../utils/tqt/in/tqttdeintegration_x11_1.cpp | 73 +++++++++++++++++++ .../utils/tqt/in/tqttdeintegration_x11_2.cpp | 81 ++++++++++++++++++++++ .../utils/tqt/in/tqttdeintegration_x11_p_1.h | 35 ++++++++++ .../utils/tqt/in/tqttdeintegration_x11_p_2.h | 28 ++++++++ 11 files changed, 219 insertions(+), 219 deletions(-) delete mode 100644 tqt3integration/utils/tqt/in/tqtkdeintegration_x11_0.cpp.cmake delete mode 100644 tqt3integration/utils/tqt/in/tqtkdeintegration_x11_1.cpp delete mode 100644 tqt3integration/utils/tqt/in/tqtkdeintegration_x11_2.cpp delete mode 100644 tqt3integration/utils/tqt/in/tqtkdeintegration_x11_p_1.h delete mode 100644 tqt3integration/utils/tqt/in/tqtkdeintegration_x11_p_2.h create mode 100644 tqt3integration/utils/tqt/in/tqttdeintegration_x11_0.cpp.cmake create mode 100644 tqt3integration/utils/tqt/in/tqttdeintegration_x11_1.cpp create mode 100644 tqt3integration/utils/tqt/in/tqttdeintegration_x11_2.cpp create mode 100644 tqt3integration/utils/tqt/in/tqttdeintegration_x11_p_1.h create mode 100644 tqt3integration/utils/tqt/in/tqttdeintegration_x11_p_2.h (limited to 'tqt3integration/utils/tqt/in') diff --git a/tqt3integration/utils/tqt/in/CMakeLists.txt b/tqt3integration/utils/tqt/in/CMakeLists.txt index c9bc36f92..000fde3ba 100644 --- a/tqt3integration/utils/tqt/in/CMakeLists.txt +++ b/tqt3integration/utils/tqt/in/CMakeLists.txt @@ -9,4 +9,4 @@ # ################################################# -configure_file( tqtkdeintegration_x11_0.cpp.cmake tqtkdeintegration_x11_0.cpp @ONLY ) +configure_file( tqttdeintegration_x11_0.cpp.cmake tqttdeintegration_x11_0.cpp @ONLY ) diff --git a/tqt3integration/utils/tqt/in/tqtkdeintegration_x11_0.cpp.cmake b/tqt3integration/utils/tqt/in/tqtkdeintegration_x11_0.cpp.cmake deleted file mode 100644 index bc6d9fda6..000000000 --- a/tqt3integration/utils/tqt/in/tqtkdeintegration_x11_0.cpp.cmake +++ /dev/null @@ -1 +0,0 @@ -#define TQTKDELIBDIR @TQT_PLUGINS_DIR@/integration diff --git a/tqt3integration/utils/tqt/in/tqtkdeintegration_x11_1.cpp b/tqt3integration/utils/tqt/in/tqtkdeintegration_x11_1.cpp deleted file mode 100644 index 36d4e075c..000000000 --- a/tqt3integration/utils/tqt/in/tqtkdeintegration_x11_1.cpp +++ /dev/null @@ -1,73 +0,0 @@ - /* - * This file is part of the Trinity Desktop Environment - * - * Original file taken from the OpenSUSE tdebase builds - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include "tqtkdeintegration_x11_p.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -bool TQKDEIntegration::inited = false; -bool TQKDEIntegration::enable = false; - -bool TQKDEIntegration::enabled() - { - if( !inited ) - initLibrary(); - return enable; - } - -static TQCString findLibrary() - { - if( getenv( "TDE_FULL_SESSION" ) == NULL ) - return ""; - if( getenv( "TDE_FULL_SESSION" )[ 0 ] != 't' && getenv( "TDE_FULL_SESSION" )[ 0 ] != '1' ) - return ""; - if( getenv( "TQT_NO_KDE_INTEGRATION" ) == NULL - || getenv( "TQT_NO_KDE_INTEGRATION" )[ 0 ] == '0' ) - { - return TQCString( TQTKDELIBDIR ) + "/libtqtkde"; - } - return ""; - } - -static long parentToWinId( const TQWidget* w ) - { - if( w != NULL ) - return w->topLevelWidget()->winId(); - // try to find some usable parent - if( tqApp->activeWindow() && w != tqApp->activeWindow()) - return tqApp->activeWindow()->winId(); - if( tqApp->mainWidget() && w != tqApp->mainWidget()) - return tqApp->mainWidget()->winId(); - return 0; - } - -inline static TQFont fontPtrToFontRef( const TQFont* f ) - { - return f != NULL ? *f : TQFont(); - } - -// --- diff --git a/tqt3integration/utils/tqt/in/tqtkdeintegration_x11_2.cpp b/tqt3integration/utils/tqt/in/tqtkdeintegration_x11_2.cpp deleted file mode 100644 index f9ab72d70..000000000 --- a/tqt3integration/utils/tqt/in/tqtkdeintegration_x11_2.cpp +++ /dev/null @@ -1,81 +0,0 @@ - /* - * This file is part of the Trinity Desktop Environment - * - * Original file taken from the OpenSUSE tdebase builds - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -// --- - -int TQKDEIntegration::information( TQWidget* parent, const TQString& caption, - const TQString& text, int button0, int button1, int button2 ) - { - return tqtkde_messageBox1( - TQMessageBox::Information, parentToWinId( parent ), caption, text, button0, button1, button2 ); - } - -int TQKDEIntegration::question( TQWidget* parent, const TQString& caption, - const TQString& text, int button0, int button1, int button2 ) - { - return tqtkde_messageBox1( - TQMessageBox::Question, parentToWinId( parent ), caption, text, button0, button1, button2 ); - } - -int TQKDEIntegration::warning( TQWidget* parent, const TQString& caption, - const TQString& text, int button0, int button1, int button2 ) - { - return tqtkde_messageBox1( - TQMessageBox::Warning, parentToWinId( parent ), caption, text, button0, button1, button2 ); - } - -int TQKDEIntegration::critical( TQWidget* parent, const TQString& caption, - const TQString& text, int button0, int button1, int button2 ) - { - return tqtkde_messageBox1( - TQMessageBox::Critical, parentToWinId( parent ), caption, text, button0, button1, button2 ); - } - -int TQKDEIntegration::information( TQWidget* parent, const TQString& caption, - const TQString& text, const TQString& button0Text, const TQString& button1Text, const TQString& button2Text, - int defaultButton, int escapeButton ) - { - return tqtkde_messageBox2( - TQMessageBox::Information, parentToWinId( parent ), caption, text, button0Text, button1Text, button2Text, defaultButton, escapeButton ); - } - -int TQKDEIntegration::question( TQWidget* parent, const TQString& caption, - const TQString& text, const TQString& button0Text, const TQString& button1Text, const TQString& button2Text, - int defaultButton, int escapeButton ) - { - return tqtkde_messageBox2( - TQMessageBox::Question, parentToWinId( parent ), caption, text, button0Text, button1Text, button2Text, defaultButton, escapeButton ); - } - -int TQKDEIntegration::warning( TQWidget* parent, const TQString& caption, - const TQString& text, const TQString& button0Text, const TQString& button1Text, const TQString& button2Text, - int defaultButton, int escapeButton ) - { - return tqtkde_messageBox2( - TQMessageBox::Warning, parentToWinId( parent ), caption, text, button0Text, button1Text, button2Text, defaultButton, escapeButton ); - } - -int TQKDEIntegration::critical( TQWidget* parent, const TQString& caption, - const TQString& text, const TQString& button0Text, const TQString& button1Text, const TQString& button2Text, - int defaultButton, int escapeButton ) - { - return tqtkde_messageBox2( - TQMessageBox::Critical, parentToWinId( parent ), caption, text, button0Text, button1Text, button2Text, defaultButton, escapeButton ); - } diff --git a/tqt3integration/utils/tqt/in/tqtkdeintegration_x11_p_1.h b/tqt3integration/utils/tqt/in/tqtkdeintegration_x11_p_1.h deleted file mode 100644 index 59a0127b9..000000000 --- a/tqt3integration/utils/tqt/in/tqtkdeintegration_x11_p_1.h +++ /dev/null @@ -1,35 +0,0 @@ - /* - * This file is part of the Trinity Desktop Environment - * - * Original file taken from the OpenSUSE tdebase builds - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef TQKDEINTEGRATION_H -#define TQKDEINTEGRATION_H - -#include - -class TQLibrary; -class TQWidget; -class TQColor; -class TQFont; - -class TQKDEIntegration - { - public: - static bool enabled(); -// --- diff --git a/tqt3integration/utils/tqt/in/tqtkdeintegration_x11_p_2.h b/tqt3integration/utils/tqt/in/tqtkdeintegration_x11_p_2.h deleted file mode 100644 index 63d569fc0..000000000 --- a/tqt3integration/utils/tqt/in/tqtkdeintegration_x11_p_2.h +++ /dev/null @@ -1,28 +0,0 @@ - /* - * This file is part of the Trinity Desktop Environment - * - * Original file taken from the OpenSUSE tdebase builds - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -// --- - private: - static void initLibrary(); - static bool inited; - static bool enable; - }; - -#endif diff --git a/tqt3integration/utils/tqt/in/tqttdeintegration_x11_0.cpp.cmake b/tqt3integration/utils/tqt/in/tqttdeintegration_x11_0.cpp.cmake new file mode 100644 index 000000000..00b0dc3de --- /dev/null +++ b/tqt3integration/utils/tqt/in/tqttdeintegration_x11_0.cpp.cmake @@ -0,0 +1 @@ +#define TQTTDELIBDIR @TQT_PLUGINS_DIR@/integration diff --git a/tqt3integration/utils/tqt/in/tqttdeintegration_x11_1.cpp b/tqt3integration/utils/tqt/in/tqttdeintegration_x11_1.cpp new file mode 100644 index 000000000..fc849142b --- /dev/null +++ b/tqt3integration/utils/tqt/in/tqttdeintegration_x11_1.cpp @@ -0,0 +1,73 @@ + /* + * This file is part of the Trinity Desktop Environment + * + * Original file taken from the OpenSUSE tdebase builds + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "tqttdeintegration_x11_p.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +bool TQTDEIntegration::inited = false; +bool TQTDEIntegration::enable = false; + +bool TQTDEIntegration::enabled() + { + if( !inited ) + initLibrary(); + return enable; + } + +static TQCString findLibrary() + { + if( getenv( "TDE_FULL_SESSION" ) == NULL ) + return ""; + if( getenv( "TDE_FULL_SESSION" )[ 0 ] != 't' && getenv( "TDE_FULL_SESSION" )[ 0 ] != '1' ) + return ""; + if( getenv( "TQT_NO_TDE_INTEGRATION" ) == NULL + || getenv( "TQT_NO_TDE_INTEGRATION" )[ 0 ] == '0' ) + { + return TQCString( TQTTDELIBDIR ) + "/libtqttde"; + } + return ""; + } + +static long parentToWinId( const TQWidget* w ) + { + if( w != NULL ) + return w->topLevelWidget()->winId(); + // try to find some usable parent + if( tqApp->activeWindow() && w != tqApp->activeWindow()) + return tqApp->activeWindow()->winId(); + if( tqApp->mainWidget() && w != tqApp->mainWidget()) + return tqApp->mainWidget()->winId(); + return 0; + } + +inline static TQFont fontPtrToFontRef( const TQFont* f ) + { + return f != NULL ? *f : TQFont(); + } + +// --- diff --git a/tqt3integration/utils/tqt/in/tqttdeintegration_x11_2.cpp b/tqt3integration/utils/tqt/in/tqttdeintegration_x11_2.cpp new file mode 100644 index 000000000..ba365f7db --- /dev/null +++ b/tqt3integration/utils/tqt/in/tqttdeintegration_x11_2.cpp @@ -0,0 +1,81 @@ + /* + * This file is part of the Trinity Desktop Environment + * + * Original file taken from the OpenSUSE tdebase builds + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +// --- + +int TQTDEIntegration::information( TQWidget* parent, const TQString& caption, + const TQString& text, int button0, int button1, int button2 ) + { + return tqttde_messageBox1( + TQMessageBox::Information, parentToWinId( parent ), caption, text, button0, button1, button2 ); + } + +int TQTDEIntegration::question( TQWidget* parent, const TQString& caption, + const TQString& text, int button0, int button1, int button2 ) + { + return tqttde_messageBox1( + TQMessageBox::Question, parentToWinId( parent ), caption, text, button0, button1, button2 ); + } + +int TQTDEIntegration::warning( TQWidget* parent, const TQString& caption, + const TQString& text, int button0, int button1, int button2 ) + { + return tqttde_messageBox1( + TQMessageBox::Warning, parentToWinId( parent ), caption, text, button0, button1, button2 ); + } + +int TQTDEIntegration::critical( TQWidget* parent, const TQString& caption, + const TQString& text, int button0, int button1, int button2 ) + { + return tqttde_messageBox1( + TQMessageBox::Critical, parentToWinId( parent ), caption, text, button0, button1, button2 ); + } + +int TQTDEIntegration::information( TQWidget* parent, const TQString& caption, + const TQString& text, const TQString& button0Text, const TQString& button1Text, const TQString& button2Text, + int defaultButton, int escapeButton ) + { + return tqttde_messageBox2( + TQMessageBox::Information, parentToWinId( parent ), caption, text, button0Text, button1Text, button2Text, defaultButton, escapeButton ); + } + +int TQTDEIntegration::question( TQWidget* parent, const TQString& caption, + const TQString& text, const TQString& button0Text, const TQString& button1Text, const TQString& button2Text, + int defaultButton, int escapeButton ) + { + return tqttde_messageBox2( + TQMessageBox::Question, parentToWinId( parent ), caption, text, button0Text, button1Text, button2Text, defaultButton, escapeButton ); + } + +int TQTDEIntegration::warning( TQWidget* parent, const TQString& caption, + const TQString& text, const TQString& button0Text, const TQString& button1Text, const TQString& button2Text, + int defaultButton, int escapeButton ) + { + return tqttde_messageBox2( + TQMessageBox::Warning, parentToWinId( parent ), caption, text, button0Text, button1Text, button2Text, defaultButton, escapeButton ); + } + +int TQTDEIntegration::critical( TQWidget* parent, const TQString& caption, + const TQString& text, const TQString& button0Text, const TQString& button1Text, const TQString& button2Text, + int defaultButton, int escapeButton ) + { + return tqttde_messageBox2( + TQMessageBox::Critical, parentToWinId( parent ), caption, text, button0Text, button1Text, button2Text, defaultButton, escapeButton ); + } diff --git a/tqt3integration/utils/tqt/in/tqttdeintegration_x11_p_1.h b/tqt3integration/utils/tqt/in/tqttdeintegration_x11_p_1.h new file mode 100644 index 000000000..53990697a --- /dev/null +++ b/tqt3integration/utils/tqt/in/tqttdeintegration_x11_p_1.h @@ -0,0 +1,35 @@ + /* + * This file is part of the Trinity Desktop Environment + * + * Original file taken from the OpenSUSE tdebase builds + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef TQTDEINTEGRATION_H +#define TQTDEINTEGRATION_H + +#include + +class TQLibrary; +class TQWidget; +class TQColor; +class TQFont; + +class TQTDEIntegration + { + public: + static bool enabled(); +// --- diff --git a/tqt3integration/utils/tqt/in/tqttdeintegration_x11_p_2.h b/tqt3integration/utils/tqt/in/tqttdeintegration_x11_p_2.h new file mode 100644 index 000000000..63d569fc0 --- /dev/null +++ b/tqt3integration/utils/tqt/in/tqttdeintegration_x11_p_2.h @@ -0,0 +1,28 @@ + /* + * This file is part of the Trinity Desktop Environment + * + * Original file taken from the OpenSUSE tdebase builds + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +// --- + private: + static void initLibrary(); + static bool inited; + static bool enable; + }; + +#endif -- cgit v1.2.1