diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:46:43 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:46:43 +0000 |
commit | ffe8a83e053396df448e9413828527613ca3bd46 (patch) | |
tree | a73d4169e02df4a50f9a12cb165fcd0ab5bac7c6 /kdecore/kwinmodule.cpp | |
parent | 682bf3bfdcbcbb1fca85e8a36ed03e062e0555d5 (diff) | |
download | tdelibs-ffe8a83e053396df448e9413828527613ca3bd46.tar.gz tdelibs-ffe8a83e053396df448e9413828527613ca3bd46.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1157647 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdecore/kwinmodule.cpp')
-rw-r--r-- | kdecore/kwinmodule.cpp | 134 |
1 files changed, 67 insertions, 67 deletions
diff --git a/kdecore/kwinmodule.cpp b/kdecore/kwinmodule.cpp index 9e3532b0f..7e4d4f773 100644 --- a/kdecore/kwinmodule.cpp +++ b/kdecore/kwinmodule.cpp @@ -21,15 +21,15 @@ Boston, MA 02110-1301, USA. */ -#include <qwidget.h> +#include <tqwidget.h> #ifdef Q_WS_X11 //FIXME #include "kwinmodule.h" #include "kwin.h" #include <X11/Xatom.h> #include "kapplication.h" #include "kdebug.h" -#include <qtl.h> -#include <qptrlist.h> +#include <tqtl.h> +#include <tqptrlist.h> #include <klocale.h> #include <dcopclient.h> #include "netwm.h" @@ -58,11 +58,11 @@ static unsigned long desktop_properties[ 2 ] = { NET::KDESystemTrayWindows, NET::WM2ShowingDesktop }; -class KWinModulePrivate : public QWidget, public NETRootInfo4 +class KWinModulePrivate : public TQWidget, public NETRootInfo4 { public: KWinModulePrivate(int _what) - : QWidget(0,0), NETRootInfo4( qt_xdisplay(), + : TQWidget(0,0), NETRootInfo4( qt_xdisplay(), _what >= KWinModule::INFO_WINDOWS ? windows_properties : desktop_properties, 2, @@ -79,23 +79,23 @@ public: ~KWinModulePrivate() { } - QPtrList<KWinModule> modules; + TQPtrList<KWinModule> modules; - QValueList<WId> windows; - QValueList<WId> stackingOrder; - QValueList<WId> systemTrayWindows; + TQValueList<WId> windows; + TQValueList<WId> stackingOrder; + TQValueList<WId> systemTrayWindows; struct StrutData { StrutData( WId window_, const NETStrut& strut_, int desktop_ ) : window( window_ ), strut( strut_ ), desktop( desktop_ ) {}; - StrutData() {}; // for QValueList to be happy + StrutData() {}; // for TQValueList to be happy WId window; NETStrut strut; int desktop; }; - QValueList<StrutData> strutWindows; - QValueList<WId> possibleStrutWindows; + TQValueList<StrutData> strutWindows; + TQValueList<WId> possibleStrutWindows; bool strutSignalConnected; int what; @@ -109,18 +109,18 @@ public: void updateStackingOrder(); bool removeStrutWindow( WId ); - QSize numberOfViewports(int desktop) const; - QPoint currentViewport(int desktop) const; + TQSize numberOfViewports(int desktop) const; + TQPoint currentViewport(int desktop) const; }; -KWinModule::KWinModule( QObject* parent ) - : QObject( parent, "kwin_module" ) +KWinModule::KWinModule( TQObject* parent ) + : TQObject( parent, "kwin_module" ) { init(INFO_ALL); } -KWinModule::KWinModule( QObject* parent, int what ) - : QObject( parent, "kwin_module" ) +KWinModule::KWinModule( TQObject* parent, int what ) + : TQObject( parent, "kwin_module" ) { init(what); } @@ -138,11 +138,11 @@ void KWinModule::init(int what) } else if (static_d->what < what) { - QPtrList<KWinModule> modules = static_d->modules; + TQPtrList<KWinModule> modules = static_d->modules; delete static_d; static_d = new KWinModulePrivate(what); static_d->modules = modules; - for ( QPtrListIterator<KWinModule> mit( modules ); mit.current(); ++mit ) + for ( TQPtrListIterator<KWinModule> mit( modules ); mit.current(); ++mit ) (*mit)->d = static_d; } @@ -159,12 +159,12 @@ KWinModule::~KWinModule() } } -const QValueList<WId>& KWinModule::windows() const +const TQValueList<WId>& KWinModule::windows() const { return d->windows; } -const QValueList<WId>& KWinModule::stackingOrder() const +const TQValueList<WId>& KWinModule::stackingOrder() const { return d->stackingOrder; } @@ -175,16 +175,16 @@ bool KWinModule::hasWId(WId w) const return d->windows.findIndex( w ) != -1; } -const QValueList<WId>& KWinModule::systemTrayWindows() const +const TQValueList<WId>& KWinModule::systemTrayWindows() const { return d->systemTrayWindows; } -QSize KWinModulePrivate::numberOfViewports(int desktop) const +TQSize KWinModulePrivate::numberOfViewports(int desktop) const { NETSize netdesktop = desktopGeometry(desktop); - QSize s(netdesktop.width / QApplication::desktop()->width(), - netdesktop.height / QApplication::desktop()->height()); + TQSize s(netdesktop.width / TQApplication::desktop()->width(), + netdesktop.height / TQApplication::desktop()->height()); // workaround some kwin bugs if (s.width() < 1) s.setWidth(1); @@ -192,12 +192,12 @@ QSize KWinModulePrivate::numberOfViewports(int desktop) const return s; } -QPoint KWinModulePrivate::currentViewport(int desktop) const +TQPoint KWinModulePrivate::currentViewport(int desktop) const { NETPoint netviewport = desktopViewport(desktop); - return QPoint(1+(netviewport.x / QApplication::desktop()->width()), - 1+(netviewport.y / QApplication::desktop()->height())); + return TQPoint(1+(netviewport.x / TQApplication::desktop()->width()), + 1+(netviewport.y / TQApplication::desktop()->height())); } bool KWinModulePrivate::x11Event( XEvent * ev ) @@ -211,36 +211,36 @@ bool KWinModulePrivate::x11Event( XEvent * ev ) NETRootInfo::event( ev, m, 5 ); if (( m[ PROTOCOLS ] & CurrentDesktop ) && currentDesktop() != old_current_desktop ) - for ( QPtrListIterator<KWinModule> mit( modules ); mit.current(); ++mit ) + for ( TQPtrListIterator<KWinModule> mit( modules ); mit.current(); ++mit ) emit (*mit)->currentDesktopChanged( currentDesktop() ); if (( m[ PROTOCOLS ] & ActiveWindow ) && activeWindow() != old_active_window ) - for ( QPtrListIterator<KWinModule> mit( modules ); mit.current(); ++mit ) + for ( TQPtrListIterator<KWinModule> mit( modules ); mit.current(); ++mit ) emit (*mit)->activeWindowChanged( activeWindow() ); if ( m[ PROTOCOLS ] & DesktopViewport ) { - for ( QPtrListIterator<KWinModule> mit( modules ); mit.current(); ++mit ) + for ( TQPtrListIterator<KWinModule> mit( modules ); mit.current(); ++mit ) emit (*mit)->currentDesktopViewportChanged(currentDesktop(), currentViewport(currentDesktop())); } if ( m[ PROTOCOLS ] & DesktopGeometry ) { - for ( QPtrListIterator<KWinModule> mit( modules ); mit.current(); ++mit ) + for ( TQPtrListIterator<KWinModule> mit( modules ); mit.current(); ++mit ) emit (*mit)->desktopGeometryChanged(currentDesktop()); } if ( m[ PROTOCOLS ] & DesktopNames ) - for ( QPtrListIterator<KWinModule> mit( modules ); mit.current(); ++mit ) + for ( TQPtrListIterator<KWinModule> mit( modules ); mit.current(); ++mit ) emit (*mit)->desktopNamesChanged(); if (( m[ PROTOCOLS ] & NumberOfDesktops ) && numberOfDesktops() != old_number_of_desktops ) - for ( QPtrListIterator<KWinModule> mit( modules ); mit.current(); ++mit ) + for ( TQPtrListIterator<KWinModule> mit( modules ); mit.current(); ++mit ) emit (*mit)->numberOfDesktopsChanged( numberOfDesktops() ); if ( m[ PROTOCOLS ] & WorkArea ) - for ( QPtrListIterator<KWinModule> mit( modules ); mit.current(); ++mit ) + for ( TQPtrListIterator<KWinModule> mit( modules ); mit.current(); ++mit ) emit (*mit)->workAreaChanged(); if ( m[ PROTOCOLS ] & ClientListStacking ) { updateStackingOrder(); - for ( QPtrListIterator<KWinModule> mit( modules ); mit.current(); ++mit ) + for ( TQPtrListIterator<KWinModule> mit( modules ); mit.current(); ++mit ) emit (*mit)->stackingOrderChanged(); } if(( m[ PROTOCOLS2 ] & WM2ShowingDesktop ) && showingDesktop() != old_showing_desktop ) { - for ( QPtrListIterator<KWinModule> mit( modules ); mit.current(); ++mit ) + for ( TQPtrListIterator<KWinModule> mit( modules ); mit.current(); ++mit ) emit (*mit)->showingDesktopChanged( showingDesktop()); } } else if ( windows.findIndex( ev->xany.window ) != -1 ){ @@ -261,7 +261,7 @@ bool KWinModulePrivate::x11Event( XEvent * ev ) possibleStrutWindows.append( ev->xany.window ); } if ( dirty[ NETWinInfo::PROTOCOLS ] || dirty[ NETWinInfo::PROTOCOLS2 ] ) { - for ( QPtrListIterator<KWinModule> mit( modules ); mit.current(); ++mit ) { + for ( TQPtrListIterator<KWinModule> mit( modules ); mit.current(); ++mit ) { emit (*mit)->windowChanged( ev->xany.window ); emit (*mit)->windowChanged( ev->xany.window, dirty ); emit (*mit)->windowChanged( ev->xany.window, dirty[ NETWinInfo::PROTOCOLS ] ); @@ -276,7 +276,7 @@ bool KWinModulePrivate::x11Event( XEvent * ev ) bool KWinModulePrivate::removeStrutWindow( WId w ) { - for( QValueList< StrutData >::Iterator it = strutWindows.begin(); + for( TQValueList< StrutData >::Iterator it = strutWindows.begin(); it != strutWindows.end(); ++it ) if( (*it).window == w ) { @@ -295,7 +295,7 @@ void KWinModulePrivate::updateStackingOrder() void KWinModulePrivate::addClient(Window w) { - if ( (what >= KWinModule::INFO_WINDOWS) && !QWidget::find( w ) ) + if ( (what >= KWinModule::INFO_WINDOWS) && !TQWidget::find( w ) ) XSelectInput( qt_xdisplay(), w, PropertyChangeMask | StructureNotifyMask ); bool emit_strutChanged = false; if( strutSignalConnected && modules.count() > 0 ) { @@ -308,7 +308,7 @@ void KWinModulePrivate::addClient(Window w) } else possibleStrutWindows.append( w ); windows.append( w ); - for ( QPtrListIterator<KWinModule> mit( modules ); mit.current(); ++mit ) { + for ( TQPtrListIterator<KWinModule> mit( modules ); mit.current(); ++mit ) { emit (*mit)->windowAdded( w ); if ( emit_strutChanged ) emit (*mit)->strutChanged(); @@ -327,7 +327,7 @@ void KWinModulePrivate::removeClient(Window w) } possibleStrutWindows.remove( w ); windows.remove( w ); - for ( QPtrListIterator<KWinModule> mit( modules ); mit.current(); ++mit ) { + for ( TQPtrListIterator<KWinModule> mit( modules ); mit.current(); ++mit ) { emit (*mit)->windowRemoved( w ); if ( emit_strutChanged ) emit (*mit)->strutChanged(); @@ -337,14 +337,14 @@ void KWinModulePrivate::removeClient(Window w) void KWinModulePrivate::addSystemTrayWin(Window w) { systemTrayWindows.append( w ); - for ( QPtrListIterator<KWinModule> mit( modules ); mit.current(); ++mit ) + for ( TQPtrListIterator<KWinModule> mit( modules ); mit.current(); ++mit ) emit (*mit)->systemTrayWindowAdded( w ); } void KWinModulePrivate::removeSystemTrayWin(Window w) { systemTrayWindows.remove( w ); - for ( QPtrListIterator<KWinModule> mit( modules ); mit.current(); ++mit ) + for ( TQPtrListIterator<KWinModule> mit( modules ); mit.current(); ++mit ) emit (*mit)->systemTrayWindowRemoved( w ); } @@ -358,12 +358,12 @@ int KWinModule::numberOfDesktops() const return d->numberOfDesktops(); } -QSize KWinModule::numberOfViewports(int desktop) const +TQSize KWinModule::numberOfViewports(int desktop) const { return d->numberOfViewports(desktop); } -QPoint KWinModule::currentViewport(int desktop) const +TQPoint KWinModule::currentViewport(int desktop) const { return d->currentViewport(desktop); } @@ -378,26 +378,26 @@ bool KWinModule::showingDesktop() const return d->showingDesktop(); } -QRect KWinModule::workArea( int desktop ) const +TQRect KWinModule::workArea( int desktop ) const { int desk = (desktop > 0 && desktop <= (int) d->numberOfDesktops() ) ? desktop : currentDesktop(); if ( desk <= 0 ) - return QApplication::desktop()->geometry(); + return TQApplication::desktop()->geometry(); NETRect r = d->workArea( desk ); if( r.size.width <= 0 || r.size.height <= 0 ) // not set - return QApplication::desktop()->geometry(); - return QRect( r.pos.x, r.pos.y, r.size.width, r.size.height ); + return TQApplication::desktop()->geometry(); + return TQRect( r.pos.x, r.pos.y, r.size.width, r.size.height ); } -QRect KWinModule::workArea( const QValueList<WId>& exclude, int desktop ) const +TQRect KWinModule::workArea( const TQValueList<WId>& exclude, int desktop ) const { - QRect all = QApplication::desktop()->geometry(); - QRect a = all; + TQRect all = TQApplication::desktop()->geometry(); + TQRect a = all; if (desktop == -1) desktop = d->currentDesktop(); - QValueList<WId>::ConstIterator it1; + TQValueList<WId>::ConstIterator it1; for( it1 = d->windows.begin(); it1 != d->windows.end(); ++it1 ) { if(exclude.findIndex(*it1) != -1) continue; @@ -406,7 +406,7 @@ QRect KWinModule::workArea( const QValueList<WId>& exclude, int desktop ) const // to repeatedly find out struts of all windows. Therefore strut values for strut // windows are cached here. NETStrut strut; - QValueList< KWinModulePrivate::StrutData >::Iterator it2 = d->strutWindows.begin(); + TQValueList< KWinModulePrivate::StrutData >::Iterator it2 = d->strutWindows.begin(); for( ; it2 != d->strutWindows.end(); ++it2 ) @@ -426,7 +426,7 @@ QRect KWinModule::workArea( const QValueList<WId>& exclude, int desktop ) const } else continue; // not a strut window - QRect r = all; + TQRect r = all; if ( strut.left > 0 ) r.setLeft( r.left() + (int) strut.left ); if ( strut.top > 0 ) @@ -443,20 +443,20 @@ QRect KWinModule::workArea( const QValueList<WId>& exclude, int desktop ) const void KWinModule::connectNotify( const char* signal ) { - if( !d->strutSignalConnected && qstrcmp( signal, SIGNAL(strutChanged())) == 0 ) + if( !d->strutSignalConnected && qstrcmp( signal, TQT_SIGNAL(strutChanged())) == 0 ) d->strutSignalConnected = true; - QObject::connectNotify( signal ); + TQObject::connectNotify( signal ); } -QString KWinModule::desktopName( int desktop ) const +TQString KWinModule::desktopName( int desktop ) const { const char* name = d->desktopName( (desktop > 0 && desktop <= (int) d->numberOfDesktops() ) ? desktop : currentDesktop() ); if ( name && name[0] ) - return QString::fromUtf8( name ); + return TQString::fromUtf8( name ); return i18n("Desktop %1").arg( desktop ); } -void KWinModule::setDesktopName( int desktop, const QString& name ) +void KWinModule::setDesktopName( int desktop, const TQString& name ) { if (desktop <= 0 || desktop > (int) d->numberOfDesktops() ) desktop = currentDesktop(); @@ -464,15 +464,15 @@ void KWinModule::setDesktopName( int desktop, const QString& name ) } -void KWinModule::doNotManage( const QString& title ) +void KWinModule::doNotManage( const TQString& title ) { if ( !kapp->dcopClient()->isAttached() ) kapp->dcopClient()->attach(); - QByteArray data, replyData; - QCString replyType; - QDataStream arg(data, IO_WriteOnly); + TQByteArray data, replyData; + TQCString replyType; + TQDataStream arg(data, IO_WriteOnly); arg << title; - kapp->dcopClient()->call("kwin", "", "doNotManage(QString)", + kapp->dcopClient()->call("kwin", "", "doNotManage(TQString)", data, replyType, replyData); } |