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/CMakeLists.txt | 2 +- tqt3integration/Makefile.am | 2 +- tqt3integration/README | 4 +- tqt3integration/configure.in.in | 10 +- tqt3integration/libtqtkde/CMakeLists.txt | 34 ----- tqt3integration/libtqtkde/Makefile.am | 15 --- tqt3integration/libtqtkde/tqtkde.cpp | 147 --------------------- tqt3integration/libtqtkde/tqtkde.h | 35 ----- tqt3integration/libtqttde/CMakeLists.txt | 34 +++++ tqt3integration/libtqttde/Makefile.am | 15 +++ tqt3integration/libtqttde/tqttde.cpp | 147 +++++++++++++++++++++ tqt3integration/libtqttde/tqttde.h | 35 +++++ tqt3integration/module/CMakeLists.txt | 6 +- tqt3integration/module/Makefile.am | 12 +- tqt3integration/module/kdeintegration.desktop | 13 -- tqt3integration/module/module.cpp | 8 +- tqt3integration/module/module.h | 2 +- tqt3integration/module/tdeintegration.desktop | 13 ++ tqt3integration/utils/CMakeLists.txt | 10 +- tqt3integration/utils/Makefile.am | 10 +- tqt3integration/utils/gen.cpp | 60 ++++----- tqt3integration/utils/tqt/Makefile.am | 2 +- 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 ++++ 33 files changed, 527 insertions(+), 527 deletions(-) delete mode 100644 tqt3integration/libtqtkde/CMakeLists.txt delete mode 100644 tqt3integration/libtqtkde/Makefile.am delete mode 100644 tqt3integration/libtqtkde/tqtkde.cpp delete mode 100644 tqt3integration/libtqtkde/tqtkde.h create mode 100644 tqt3integration/libtqttde/CMakeLists.txt create mode 100644 tqt3integration/libtqttde/Makefile.am create mode 100644 tqt3integration/libtqttde/tqttde.cpp create mode 100644 tqt3integration/libtqttde/tqttde.h delete mode 100644 tqt3integration/module/kdeintegration.desktop create mode 100644 tqt3integration/module/tdeintegration.desktop 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 diff --git a/tqt3integration/CMakeLists.txt b/tqt3integration/CMakeLists.txt index 4ecacf158..75120af20 100644 --- a/tqt3integration/CMakeLists.txt +++ b/tqt3integration/CMakeLists.txt @@ -17,6 +17,6 @@ include( ConfigureChecks.cmake ) ##### subdirectories ############################ -add_subdirectory( libtqtkde ) +add_subdirectory( libtqttde ) add_subdirectory( module ) add_subdirectory( utils ) diff --git a/tqt3integration/Makefile.am b/tqt3integration/Makefile.am index 6d657bd40..fe6a0e795 100644 --- a/tqt3integration/Makefile.am +++ b/tqt3integration/Makefile.am @@ -1 +1 @@ -SUBDIRS = libtqtkde module utils +SUBDIRS = libtqttde module utils diff --git a/tqt3integration/README b/tqt3integration/README index 47edd1440..1af1034a8 100644 --- a/tqt3integration/README +++ b/tqt3integration/README @@ -1,5 +1,5 @@ -TQt/KDE UI integration. Makes TQt-only apps use several KDE dialogs without any modifications -to these applications. Can be turned off by setting $TQT_NO_KDE_INTEGRATION. +TQt/TDE UI integration. Makes TQt-only apps use several TDE dialogs without any modifications +to these applications. Can be turned off by setting $TQT_NO_TDE_INTEGRATION. Installation: Just plain make && make install. diff --git a/tqt3integration/configure.in.in b/tqt3integration/configure.in.in index b2c264dea..46ca8fb42 100644 --- a/tqt3integration/configure.in.in +++ b/tqt3integration/configure.in.in @@ -1,5 +1,5 @@ -tqtkdelibdir="\${kde_moduledir}/plugins/integration" -KDE_EXPAND_MAKEVAR(ac_tqtkdelibdir,tqtkdelibdir) -AC_SUBST(tqtkdelibdir) -AC_SUBST(ac_tqtkdelibdir) -dnl AC_OUTPUT(tqtkdeintegration/utils/tqt/in/tqtkdeintegration_x11_0.cpp) +tqttdelibdir="\${kde_moduledir}/plugins/integration" +KDE_EXPAND_MAKEVAR(ac_tqttdelibdir,tqttdelibdir) +AC_SUBST(tqttdelibdir) +AC_SUBST(ac_tqttdelibdir) +dnl AC_OUTPUT(tqttdeintegration/utils/tqt/in/tqttdeintegration_x11_0.cpp) diff --git a/tqt3integration/libtqtkde/CMakeLists.txt b/tqt3integration/libtqtkde/CMakeLists.txt deleted file mode 100644 index dbfb65ef5..000000000 --- a/tqt3integration/libtqtkde/CMakeLists.txt +++ /dev/null @@ -1,34 +0,0 @@ -################################################# -# -# (C) 2011 Timothy Pearson -# kb9vqf (AT) pearsoncomputing.net -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -include_directories( - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_BINARY_DIR} - ${CMAKE_BINARY_DIR}/tqt3integration/utils/ - ${TDE_INCLUDE_DIR} - ${TQT_INCLUDE_DIRS} -) - -link_directories( - ${TQT_LIBRARY_DIRS} -) - - -##### libtqtkde (shared) #################### - -tde_add_library( tqtkde SHARED AUTOMOC - SOURCES tqtkde.cpp - VERSION 0.0.0 - LINK tdeui-shared - DEPENDENCIES generate_tqt3_bindings - DESTINATION "${TQT_PLUGINS_DIR}/integration/" -) diff --git a/tqt3integration/libtqtkde/Makefile.am b/tqt3integration/libtqtkde/Makefile.am deleted file mode 100644 index 8f239fe8a..000000000 --- a/tqt3integration/libtqtkde/Makefile.am +++ /dev/null @@ -1,15 +0,0 @@ -tqtkdelib_LTLIBRARIES = libtqtkde.la - -libtqtkde_la_SOURCES = tqtkde.cpp -libtqtkde_la_LIBADD = -lDCOP -libtqtkde_la_LDFLAGS = $(all_libraries) -module -no-undefined -avoid-version - -CLEANFILES = tqtkde_functions.cpp - -INCLUDES = $(all_includes) -METASOURCES = AUTO - -tqtkde.lo : tqtkde_functions.cpp - -tqtkde_functions.cpp : ../utils/tqtkde_functions.cpp - cp -f ../utils/tqtkde_functions.cpp . || exit 1 diff --git a/tqt3integration/libtqtkde/tqtkde.cpp b/tqt3integration/libtqtkde/tqtkde.cpp deleted file mode 100644 index ced1c338e..000000000 --- a/tqt3integration/libtqtkde/tqtkde.cpp +++ /dev/null @@ -1,147 +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 "tqtkde.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -extern Time tqt_x_time; - -static TQString convertFileFilter( const TQString& filter ) - { - if( filter.isEmpty()) - return filter; - TQString f2 = filter; - f2.replace( '\n', ";;" ); // TQt says separator is ";;", but it also silently accepts newline - f2.replace( '/', "\\/" ); // escape /'s for KFileDialog - TQStringList items = TQStringList::split( ";;", f2 ); - TQRegExp reg( "\\((.*)\\)" ); - for( TQStringList::Iterator it = items.begin(); - it != items.end(); - ++it ) - { - if( reg.search( *it )) - *it = reg.cap( 1 ) + '|' + *it; - } - return items.join( "\n" ); - } - -static TQString convertBackFileFilter( const TQString& filter ) - { - if( filter.isEmpty()) - return filter; - TQStringList items = TQStringList::split( "\n", filter ); - for( TQStringList::Iterator it = items.begin(); - it != items.end(); - ++it ) - { - int pos = (*it).find( '|' ); - if( pos >= 0 ) - (*it) = (*it).mid( pos + 1 ); - } - return items.join( ";;" ); - } - -static DCOPClient* dcopClient() - { - DCOPClient* dcop = DCOPClient::mainClient(); - if( dcop == NULL ) - { - static DCOPClient* dcop_private; - if( dcop_private == NULL ) - { - dcop_private = new DCOPClient; - dcop_private->attach(); - } - dcop = dcop_private; - } - static bool prepared = false; - if( !prepared ) - { - assert( tqApp != NULL ); // TODO - prepared = true; - dcop->bindToApp(); - if( !tqApp->inherits( "TDEApplication" )) // KApp takes care of input blocking - { - static tqtkde_EventLoop* loop = new tqtkde_EventLoop; - TQObject::connect( dcop, TQT_SIGNAL( blockUserInput( bool )), loop, TQT_SLOT( block( bool ))); - } - } - return dcop; - } - -// defined in qapplication_x11.cpp -typedef int (*QX11EventFilter) (XEvent*); -extern QX11EventFilter tqt_set_x11_event_filter (QX11EventFilter filter); - -static QX11EventFilter old_filter; - -static int input_filter( XEvent* e ) - { - switch( e->type ) - { - case ButtonPress: - case ButtonRelease: - case KeyPress: - case KeyRelease: - case MotionNotify: - case EnterNotify: - case LeaveNotify: - return true; - default: - break; - } - if( old_filter != NULL ) - return old_filter( e ); - return false; - } - -void tqtkde_EventLoop::block( bool b ) - { - if( b ) - old_filter = tqt_set_x11_event_filter( input_filter ); - else - tqt_set_x11_event_filter( old_filter ); - } - -// duped in kded module -static TQString getHostname() - { - char hostname[ 256 ]; - if( gethostname( hostname, 255 ) == 0 ) - { - hostname[ 255 ] = '\0'; - return hostname; - } - return ""; - } - -#include "tqtkde_functions.cpp" - -#include "tqtkde.moc" diff --git a/tqt3integration/libtqtkde/tqtkde.h b/tqt3integration/libtqtkde/tqtkde.h deleted file mode 100644 index 426221eba..000000000 --- a/tqt3integration/libtqtkde/tqtkde.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 _TQTKDE_H -#define _TQTKDE_H - -#include - -class tqtkde_EventLoop - : public TQObject - { - Q_OBJECT - - public slots: - void block( bool ); - }; - -#endif diff --git a/tqt3integration/libtqttde/CMakeLists.txt b/tqt3integration/libtqttde/CMakeLists.txt new file mode 100644 index 000000000..fc1e54e81 --- /dev/null +++ b/tqt3integration/libtqttde/CMakeLists.txt @@ -0,0 +1,34 @@ +################################################# +# +# (C) 2011 Timothy Pearson +# kb9vqf (AT) pearsoncomputing.net +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include_directories( + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_BINARY_DIR} + ${CMAKE_BINARY_DIR}/tqt3integration/utils/ + ${TDE_INCLUDE_DIR} + ${TQT_INCLUDE_DIRS} +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + + +##### libtqttde (shared) #################### + +tde_add_library( tqttde SHARED AUTOMOC + SOURCES tqttde.cpp + VERSION 0.0.0 + LINK tdeui-shared + DEPENDENCIES generate_tqt3_bindings + DESTINATION "${TQT_PLUGINS_DIR}/integration/" +) diff --git a/tqt3integration/libtqttde/Makefile.am b/tqt3integration/libtqttde/Makefile.am new file mode 100644 index 000000000..aa143fec5 --- /dev/null +++ b/tqt3integration/libtqttde/Makefile.am @@ -0,0 +1,15 @@ +tqttdelib_LTLIBRARIES = libtqttde.la + +libtqttde_la_SOURCES = tqttde.cpp +libtqttde_la_LIBADD = -lDCOP +libtqttde_la_LDFLAGS = $(all_libraries) -module -no-undefined -avoid-version + +CLEANFILES = tqttde_functions.cpp + +INCLUDES = $(all_includes) +METASOURCES = AUTO + +tqttde.lo : tqttde_functions.cpp + +tqttde_functions.cpp : ../utils/tqttde_functions.cpp + cp -f ../utils/tqttde_functions.cpp . || exit 1 diff --git a/tqt3integration/libtqttde/tqttde.cpp b/tqt3integration/libtqttde/tqttde.cpp new file mode 100644 index 000000000..3647db8a2 --- /dev/null +++ b/tqt3integration/libtqttde/tqttde.cpp @@ -0,0 +1,147 @@ + /* + * 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 "tqttde.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +extern Time tqt_x_time; + +static TQString convertFileFilter( const TQString& filter ) + { + if( filter.isEmpty()) + return filter; + TQString f2 = filter; + f2.replace( '\n', ";;" ); // TQt says separator is ";;", but it also silently accepts newline + f2.replace( '/', "\\/" ); // escape /'s for KFileDialog + TQStringList items = TQStringList::split( ";;", f2 ); + TQRegExp reg( "\\((.*)\\)" ); + for( TQStringList::Iterator it = items.begin(); + it != items.end(); + ++it ) + { + if( reg.search( *it )) + *it = reg.cap( 1 ) + '|' + *it; + } + return items.join( "\n" ); + } + +static TQString convertBackFileFilter( const TQString& filter ) + { + if( filter.isEmpty()) + return filter; + TQStringList items = TQStringList::split( "\n", filter ); + for( TQStringList::Iterator it = items.begin(); + it != items.end(); + ++it ) + { + int pos = (*it).find( '|' ); + if( pos >= 0 ) + (*it) = (*it).mid( pos + 1 ); + } + return items.join( ";;" ); + } + +static DCOPClient* dcopClient() + { + DCOPClient* dcop = DCOPClient::mainClient(); + if( dcop == NULL ) + { + static DCOPClient* dcop_private; + if( dcop_private == NULL ) + { + dcop_private = new DCOPClient; + dcop_private->attach(); + } + dcop = dcop_private; + } + static bool prepared = false; + if( !prepared ) + { + assert( tqApp != NULL ); // TODO + prepared = true; + dcop->bindToApp(); + if( !tqApp->inherits( "TDEApplication" )) // KApp takes care of input blocking + { + static tqttde_EventLoop* loop = new tqttde_EventLoop; + TQObject::connect( dcop, TQT_SIGNAL( blockUserInput( bool )), loop, TQT_SLOT( block( bool ))); + } + } + return dcop; + } + +// defined in qapplication_x11.cpp +typedef int (*QX11EventFilter) (XEvent*); +extern QX11EventFilter tqt_set_x11_event_filter (QX11EventFilter filter); + +static QX11EventFilter old_filter; + +static int input_filter( XEvent* e ) + { + switch( e->type ) + { + case ButtonPress: + case ButtonRelease: + case KeyPress: + case KeyRelease: + case MotionNotify: + case EnterNotify: + case LeaveNotify: + return true; + default: + break; + } + if( old_filter != NULL ) + return old_filter( e ); + return false; + } + +void tqttde_EventLoop::block( bool b ) + { + if( b ) + old_filter = tqt_set_x11_event_filter( input_filter ); + else + tqt_set_x11_event_filter( old_filter ); + } + +// duped in kded module +static TQString getHostname() + { + char hostname[ 256 ]; + if( gethostname( hostname, 255 ) == 0 ) + { + hostname[ 255 ] = '\0'; + return hostname; + } + return ""; + } + +#include "tqttde_functions.cpp" + +#include "tqttde.moc" diff --git a/tqt3integration/libtqttde/tqttde.h b/tqt3integration/libtqttde/tqttde.h new file mode 100644 index 000000000..2d634df07 --- /dev/null +++ b/tqt3integration/libtqttde/tqttde.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 _TQTTDE_H +#define _TQTTDE_H + +#include + +class tqttde_EventLoop + : public TQObject + { + Q_OBJECT + + public slots: + void block( bool ); + }; + +#endif diff --git a/tqt3integration/module/CMakeLists.txt b/tqt3integration/module/CMakeLists.txt index 93c059405..1457020af 100644 --- a/tqt3integration/module/CMakeLists.txt +++ b/tqt3integration/module/CMakeLists.txt @@ -25,12 +25,12 @@ link_directories( ##### service desktop file(s) ########################## -install( FILES kdeintegration.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kded ) +install( FILES tdeintegration.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kded ) -##### kded_kdeintegration (module) ##################### +##### kded_tdeintegration (module) ##################### -set( target kded_kdeintegration ) +set( target kded_tdeintegration ) set( ${target}_SRCS module.cpp diff --git a/tqt3integration/module/Makefile.am b/tqt3integration/module/Makefile.am index 1012d5e7a..99f3a3b2b 100644 --- a/tqt3integration/module/Makefile.am +++ b/tqt3integration/module/Makefile.am @@ -1,16 +1,16 @@ INCLUDES= $(all_includes) -kde_module_LTLIBRARIES = kded_kdeintegration.la +kde_module_LTLIBRARIES = kded_tdeintegration.la -kded_kdeintegration_la_SOURCES = module.cpp -kded_kdeintegration_la_METASOURCES = AUTO -kded_kdeintegration_la_LDFLAGS = $(all_libraries) -module -avoid-version -kded_kdeintegration_la_LIBADD = $(LIB_TDEIO) +kded_tdeintegration_la_SOURCES = module.cpp +kded_tdeintegration_la_METASOURCES = AUTO +kded_tdeintegration_la_LDFLAGS = $(all_libraries) -module -avoid-version +kded_tdeintegration_la_LIBADD = $(LIB_TDEIO) CLEANFILES = module_functions.cpp module_functions.h servicesdir = $(kde_servicesdir)/kded -services_DATA = kdeintegration.desktop +services_DATA = tdeintegration.desktop module.lo : module_functions.cpp module_functions.h diff --git a/tqt3integration/module/kdeintegration.desktop b/tqt3integration/module/kdeintegration.desktop deleted file mode 100644 index 406c1fd39..000000000 --- a/tqt3integration/module/kdeintegration.desktop +++ /dev/null @@ -1,13 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Type=Service - -X-TDE-ServiceTypes=KDEDModule -X-TDE-ModuleType=Library -X-TDE-Library=kdeintegration -X-TDE-Factory=kdeintegration -X-TDE-Kded-autoload=false -X-TDE-Kded-load-on-demand=true - -Name=TDE Integration Module -Comment=Module for integrating UI of non-TDE applications diff --git a/tqt3integration/module/module.cpp b/tqt3integration/module/module.cpp index a0be507b0..e397105b1 100644 --- a/tqt3integration/module/module.cpp +++ b/tqt3integration/module/module.cpp @@ -38,13 +38,13 @@ extern "C" { - KDE_EXPORT KDEDModule *create_kdeintegration( const TQCString& obj ) + KDE_EXPORT KDEDModule *create_tdeintegration( const TQCString& obj ) { - return new KDEIntegration::Module( obj ); + return new TDEIntegration::Module( obj ); } }; -namespace KDEIntegration +namespace TDEIntegration { static void prepareDialog( TQWidget* w, long parent, const TQCString& wmclass1, const TQCString& wmclass2 ) @@ -61,7 +61,7 @@ static void prepareDialog( TQWidget* w, long parent, const TQCString& wmclass1, info.geometry().y() + ( info.geometry().height()- w->height())/2 ); } -// duped in tqtkde +// duped in tqttde static TQString getHostname() { char hostname[ 256 ]; diff --git a/tqt3integration/module/module.h b/tqt3integration/module/module.h index 1d805bcc7..cf136aa8c 100644 --- a/tqt3integration/module/module.h +++ b/tqt3integration/module/module.h @@ -30,7 +30,7 @@ class DCOPClientTransaction; -namespace KDEIntegration +namespace TDEIntegration { class Module diff --git a/tqt3integration/module/tdeintegration.desktop b/tqt3integration/module/tdeintegration.desktop new file mode 100644 index 000000000..9a9b940d1 --- /dev/null +++ b/tqt3integration/module/tdeintegration.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Encoding=UTF-8 +Type=Service + +X-TDE-ServiceTypes=KDEDModule +X-TDE-ModuleType=Library +X-TDE-Library=tdeintegration +X-TDE-Factory=tdeintegration +X-TDE-Kded-autoload=false +X-TDE-Kded-load-on-demand=true + +Name=TDE Integration Module +Comment=Module for integrating UI of non-TDE applications diff --git a/tqt3integration/utils/CMakeLists.txt b/tqt3integration/utils/CMakeLists.txt index ffdd72739..c75567af5 100644 --- a/tqt3integration/utils/CMakeLists.txt +++ b/tqt3integration/utils/CMakeLists.txt @@ -33,17 +33,17 @@ tde_add_executable( gen AUTOMOC ADD_CUSTOM_COMMAND( OUTPUT - ${CMAKE_CURRENT_BINARY_DIR}/tqtkde_functions.cpp + ${CMAKE_CURRENT_BINARY_DIR}/tqttde_functions.cpp ${CMAKE_CURRENT_BINARY_DIR}/module_functions.cpp ${CMAKE_CURRENT_BINARY_DIR}/module_functions.h COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/tqt COMMAND ${CMAKE_CURRENT_BINARY_DIR}/gen ${CMAKE_CURRENT_SOURCE_DIR}/gen.txt - COMMAND cat ${CMAKE_CURRENT_BINARY_DIR}/tqt/in/tqtkdeintegration_x11_0.cpp ${CMAKE_CURRENT_SOURCE_DIR}/tqt/in/tqtkdeintegration_x11_1.cpp ${CMAKE_CURRENT_BINARY_DIR}/tqtkdeintegration_x11.cpp.gen ${CMAKE_CURRENT_SOURCE_DIR}/tqt/in/tqtkdeintegration_x11_2.cpp > ${CMAKE_CURRENT_BINARY_DIR}/tqt/tqtkdeintegration_x11.cpp - COMMAND cat ${CMAKE_CURRENT_SOURCE_DIR}/tqt/in/tqtkdeintegration_x11_p_1.h ${CMAKE_CURRENT_BINARY_DIR}/tqtkdeintegration_x11_p.h.gen ${CMAKE_CURRENT_SOURCE_DIR}/tqt/in/tqtkdeintegration_x11_p_2.h > ${CMAKE_CURRENT_BINARY_DIR}/tqt/tqtkdeintegration_x11_p.h - COMMAND rm -f ${CMAKE_CURRENT_BINARY_DIR}/tqtkdeintegration_x11.cpp.gen ${CMAKE_CURRENT_BINARY_DIR}/tqtkdeintegration_x11_p.h.gen + COMMAND cat ${CMAKE_CURRENT_BINARY_DIR}/tqt/in/tqttdeintegration_x11_0.cpp ${CMAKE_CURRENT_SOURCE_DIR}/tqt/in/tqttdeintegration_x11_1.cpp ${CMAKE_CURRENT_BINARY_DIR}/tqttdeintegration_x11.cpp.gen ${CMAKE_CURRENT_SOURCE_DIR}/tqt/in/tqttdeintegration_x11_2.cpp > ${CMAKE_CURRENT_BINARY_DIR}/tqt/tqttdeintegration_x11.cpp + COMMAND cat ${CMAKE_CURRENT_SOURCE_DIR}/tqt/in/tqttdeintegration_x11_p_1.h ${CMAKE_CURRENT_BINARY_DIR}/tqttdeintegration_x11_p.h.gen ${CMAKE_CURRENT_SOURCE_DIR}/tqt/in/tqttdeintegration_x11_p_2.h > ${CMAKE_CURRENT_BINARY_DIR}/tqt/tqttdeintegration_x11_p.h + COMMAND rm -f ${CMAKE_CURRENT_BINARY_DIR}/tqttdeintegration_x11.cpp.gen ${CMAKE_CURRENT_BINARY_DIR}/tqttdeintegration_x11_p.h.gen DEPENDS gen ) ADD_CUSTOM_TARGET( generate_tqt3_bindings - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/tqtkde_functions.cpp + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/tqttde_functions.cpp ) diff --git a/tqt3integration/utils/Makefile.am b/tqt3integration/utils/Makefile.am index 88f92b52a..033e78b4a 100644 --- a/tqt3integration/utils/Makefile.am +++ b/tqt3integration/utils/Makefile.am @@ -3,16 +3,16 @@ gen_SOURCES = gen.cpp gen_LDADD = $(LIB_TDECORE) gen_LDFLAGS = $(all_libraries) INCLUDES = $(all_includes) -CLEANFILES = tqtkde_functions.cpp module_functions.cpp module_functions.h generated +CLEANFILES = tqttde_functions.cpp module_functions.cpp module_functions.h generated SUBDIRS = tqt generate: generated generated: gen gen.txt ./gen || exit 1 - cat tqt/in/tqtkdeintegration_x11_0.cpp tqt/in/tqtkdeintegration_x11_1.cpp tqtkdeintegration_x11.cpp.gen tqt/in/tqtkdeintegration_x11_2.cpp >tqt/tqtkdeintegration_x11.cpp - cat tqt/in/tqtkdeintegration_x11_p_1.h tqtkdeintegration_x11_p.h.gen tqt/in/tqtkdeintegration_x11_p_2.h >tqt/tqtkdeintegration_x11_p.h - rm -f tqtkdeintegration_x11.cpp.gen tqtkdeintegration_x11_p.h.gen + cat tqt/in/tqttdeintegration_x11_0.cpp tqt/in/tqttdeintegration_x11_1.cpp tqttdeintegration_x11.cpp.gen tqt/in/tqttdeintegration_x11_2.cpp >tqt/tqttdeintegration_x11.cpp + cat tqt/in/tqttdeintegration_x11_p_1.h tqttdeintegration_x11_p.h.gen tqt/in/tqttdeintegration_x11_p_2.h >tqt/tqttdeintegration_x11_p.h + rm -f tqttdeintegration_x11.cpp.gen tqttdeintegration_x11_p.h.gen touch generated -tqtkde_functions.cpp module_functions.cpp module_functions.h : generated +tqttde_functions.cpp module_functions.cpp module_functions.h : generated diff --git a/tqt3integration/utils/gen.cpp b/tqt3integration/utils/gen.cpp index 754aa9305..03a2bf422 100644 --- a/tqt3integration/utils/gen.cpp +++ b/tqt3integration/utils/gen.cpp @@ -44,7 +44,7 @@ FUNCTION OUT_ARGUMENT CONVERSION BACK_CONVERSION - for out arguments - CREATE - doesn't exist in TQt, create in tqtkde using function + CREATE - doesn't exist in TQt, create in tqttde using function PARENT - the argument is a parent window to be used for windows ENDARG ENDFUNCTION @@ -366,7 +366,7 @@ void generateFunction( TQTextStream& stream, const Function& function, const TQS void generateTQtH() { - TQFile file( "tqtkdeintegration_x11_p.h.gen" ); + TQFile file( "tqttdeintegration_x11_p.h.gen" ); if( !file.open( IO_WriteOnly )) error(); TQTextStream stream( &file ); @@ -386,7 +386,7 @@ void generateTQtH() void generateTQtCpp() { - TQFile file( "tqtkdeintegration_x11.cpp.gen" ); + TQFile file( "tqttdeintegration_x11.cpp.gen" ); if( !file.open( IO_WriteOnly )) error(); TQTextStream stream( &file ); @@ -398,13 +398,13 @@ void generateTQtCpp() if( f.only_tqt ) continue; f.stripCreatedArguments(); - generateFunction( stream, f, "(*tqtkde_" + f.name + ")", 0, + generateFunction( stream, f, "(*tqttde_" + f.name + ")", 0, true /*static*/, false /*orig type*/, false /*ignore deref*/, 0 /*ignore level*/ ); stream << ";\n"; } stream << "\n" -"void TQKDEIntegration::initLibrary()\n" +"void TQTDEIntegration::initLibrary()\n" " {\n" " if( !inited )\n" " {\n" @@ -424,17 +424,17 @@ void generateTQtCpp() Function function = *it; if( function.only_tqt ) continue; - stream << makeIndent( 8 ) + "tqtkde_" + function.name + " = (\n"; + stream << makeIndent( 8 ) + "tqttde_" + function.name + " = (\n"; function.stripCreatedArguments(); generateFunction( stream, function, "(*)", 12, false /*static*/, false /*orig type*/, false /*ignore deref*/, 0 /*ignore level*/ ); stream << "\n" + makeIndent( 12 ) + ")\n"; stream << makeIndent( 12 ) + "lib.resolve(\"" + (*it).name + "\");\n"; - stream << makeIndent( 8 ) + "if( tqtkde_" + (*it).name + " == NULL )\n"; + stream << makeIndent( 8 ) + "if( tqttde_" + (*it).name + " == NULL )\n"; stream << makeIndent( 12 ) + "return;\n"; } stream << -" enable = tqtkde_initializeIntegration();\n" +" enable = tqttde_initializeIntegration();\n" " }\n" " }\n" "\n"; @@ -446,11 +446,11 @@ void generateTQtCpp() if( function.skip_tqt || function.only_tqt ) continue; function.stripCreatedArguments(); - generateFunction( stream, function, "QKDEIntegration::" + function.name, 0, + generateFunction( stream, function, "TQTDEIntegration::" + function.name, 0, false /*static*/, true /*orig type*/, false /*ignore deref*/, 0 /*ignore level*/ ); stream << "\n"; stream << makeIndent( 4 ) + "{\n"; - stream << makeIndent( 4 ) + "return tqtkde_" + function.name + "(\n"; + stream << makeIndent( 4 ) + "return tqttde_" + function.name + "(\n"; stream << makeIndent( 8 ); bool need_comma = false; for( TQValueList< Arg >::ConstIterator it2 = function.args.begin(); @@ -479,9 +479,9 @@ void generateTQt() generateTQtCpp(); } -void generateTQtKde() +void generateTQtTDE() { - TQFile file( "tqtkde_functions.cpp" ); + TQFile file( "tqttde_functions.cpp" ); if( !file.open( IO_WriteOnly )) error(); TQTextStream stream( &file ); @@ -552,7 +552,7 @@ void generateTQtKde() } stream << ";\n"; } - stream << " if( !dcopClient()->call( \"kded\", \"kdeintegration\",\"" + function.name + "("; + stream << " if( !dcopClient()->call( \"kded\", \"tdeintegration\",\"" + function.name + "("; bool need_comma = false; for( TQValueList< Arg >::ConstIterator it2 = function.args.begin(); it2 != function.args.end(); @@ -640,7 +640,7 @@ void generateTQtKde() } } -void generateKdeDcop( TQTextStream& stream ) +void genarateTDEDcop( TQTextStream& stream ) { stream << "bool Module::process(const TQCString &fun, const TQByteArray &data,\n" @@ -717,13 +717,13 @@ void generateKdeDcop( TQTextStream& stream ) "QCStringList Module::interfaces()\n" " {\n" " QCStringList ifaces = KDEDModule::interfaces();\n" -" ifaces << \"KDEIntegration\";\n" +" ifaces << \"TDEIntegration\";\n" " return ifaces;\n" " }\n" "\n"; } -void generateKdePreStub( TQTextStream& stream ) +void genarateTDEPreStub( TQTextStream& stream ) { for( TQValueList< Function >::ConstIterator it1 = functions.begin(); it1 != functions.end(); @@ -796,7 +796,7 @@ void generateKdePreStub( TQTextStream& stream ) } } -void generateKdePostStub( TQTextStream& stream ) +void genarateTDEPostStub( TQTextStream& stream ) { for( TQValueList< Function >::ConstIterator it1 = functions.begin(); it1 != functions.end(); @@ -842,7 +842,7 @@ void generateKdePostStub( TQTextStream& stream ) stream << " JobData job = jobs[ handle ];\n"; stream << " jobs.remove( handle );\n"; stream << " TQByteArray replyData;\n"; - stream << " TQCString replyType = \"tqtkde\";\n"; + stream << " TQCString replyType = \"tqttde\";\n"; } bool return_data = false; for( TQValueList< Arg >::ConstIterator it2 = function.args.begin(); @@ -876,24 +876,24 @@ void generateKdePostStub( TQTextStream& stream ) } } -void generateKdeStubs( TQTextStream& stream ) +void genarateTDEStubs( TQTextStream& stream ) { - generateKdePreStub( stream ); - generateKdePostStub( stream ); + genarateTDEPreStub( stream ); + genarateTDEPostStub( stream ); // TODO udelat i predbezne deklarace pro skutecne funkce? } -void generateKdeCpp() +void genarateTDECpp() { TQFile file( "module_functions.cpp" ); if( !file.open( IO_WriteOnly )) error(); TQTextStream stream( &file ); - generateKdeDcop( stream ); - generateKdeStubs( stream ); + genarateTDEDcop( stream ); + genarateTDEStubs( stream ); } -void generateKdeH() +void genarateTDEH() { TQFile file( "module_functions.h" ); if( !file.open( IO_WriteOnly )) @@ -944,17 +944,17 @@ void generateKdeH() } } -void generateKde() +void genarateTDE() { - generateKdeCpp(); - generateKdeH(); + genarateTDECpp(); + genarateTDEH(); } void generate() { generateTQt(); - generateTQtKde(); - generateKde(); + generateTQtTDE(); + genarateTDE(); } int main (int argc, char *argv[]) diff --git a/tqt3integration/utils/tqt/Makefile.am b/tqt3integration/utils/tqt/Makefile.am index 5d77e5d2b..f247852bb 100644 --- a/tqt3integration/utils/tqt/Makefile.am +++ b/tqt3integration/utils/tqt/Makefile.am @@ -1 +1 @@ -CLEANFILES = tqtkdeintegration_x11.cpp tqtkdeintegration_x11_p.h +CLEANFILES = tqttdeintegration_x11.cpp tqttdeintegration_x11_p.h 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