diff options
Diffstat (limited to 'twin')
140 files changed, 2441 insertions, 1732 deletions
diff --git a/twin/CMakeL10n.txt b/twin/CMakeL10n.txt index 11540e442..07bc99559 100644 --- a/twin/CMakeL10n.txt +++ b/twin/CMakeL10n.txt @@ -5,6 +5,7 @@ tde_l10n_create_template( EXCLUDES "^clients/" "^kcmtwin/" + "^lib/" ) tde_l10n_auto_add_subdirectories( ) diff --git a/twin/KWinInterface.h b/twin/KWinInterface.h index dbc132888..37fe2d9b6 100644 --- a/twin/KWinInterface.h +++ b/twin/KWinInterface.h @@ -18,7 +18,8 @@ class KWinInterface : virtual public DCOPObject virtual bool isResumeableWindowID(unsigned long winId) = 0; virtual void refresh() = 0; virtual void doNotManage(TQString)= 0; - virtual void showWindowMenuAt(unsigned long winId, int x, int y)= 0; + virtual void showWindowMenuAt(unsigned long winId, int x, int y) = 0; + virtual void showWindowMenu(unsigned long winId) = 0; virtual void kDestopResized() = 0; virtual void setDesktopLayout(int orientation, int x, int y)= 0; virtual bool setCurrentDesktop(int)= 0; @@ -28,6 +29,10 @@ class KWinInterface : virtual public DCOPObject virtual void circulateDesktopApplications() = 0; virtual void updateOverlappingShadows(unsigned long window) = 0; virtual void setShadowed(unsigned long window, bool shadowed) = 0; + virtual void tileWindowToBorder(unsigned long w1, int location) = 0; + virtual void tileTwoWindowsHorizontally(unsigned long w1, unsigned long w2) = 0; + virtual void tileTwoWindowsVertically(unsigned long w1, unsigned long w2) = 0; + virtual void tileFourWindowsInGrid(unsigned long w1, unsigned long w2, unsigned long w3, unsigned long w4) = 0; // kompmgr stuff virtual void startKompmgr() = 0; diff --git a/twin/README b/twin/README index 8d61c7163..d2fb31c75 100644 --- a/twin/README +++ b/twin/README @@ -163,16 +163,16 @@ WM_TRANSIENT_FOR property is manually set using the XSetTransientForHint() call (see tdelibs/tdeioslave/http/kcookiejar/kcookiewin.cpp). The arguments to XSetTransientForHint() call are the X display (i.e. qt_xdisplay()), the window id on which the WM_TRANSIENT_FOR property is to be set -(i.e. use QWidget::winId()), and the window id of the mainwindow. +(i.e. use TQWidget::winId()), and the window id of the mainwindow. Simple short HOWTO: To put it simply: Let's say you have a daemon application that has -DCOP call "showDialog( QString text )", and when this is called, it shows +DCOP call "showDialog( TQString text )", and when this is called, it shows a dialog with the given text. This won't work properly with focus stealing prevention. The DCOP call should be changed to -"showDialog( QString text, long id )". The caller should pass something like +"showDialog( TQString text, long id )". The caller should pass something like myMainWindow->winId() as the second argument. In the daemon, before the dialog is shown, a call to XSetTransientHint() should be added: diff --git a/twin/activation.cpp b/twin/activation.cpp index 83ff24edb..47e0f9a34 100644 --- a/twin/activation.cpp +++ b/twin/activation.cpp @@ -674,7 +674,7 @@ void Workspace::unfakeActivity( Client* c ) void Client::updateUserTime( Time time ) { // copied in Group::updateUserTime if( time == CurrentTime ) - time = GET_QT_X_TIME(); + time = get_tqt_x_time(); if( time != -1U && ( user_time == CurrentTime || timestampCompare( time, user_time ) > 0 )) // time > user_time @@ -727,7 +727,7 @@ void Client::demandAttention( bool set ) if( demandAttentionKNotifyTimer == NULL ) { demandAttentionKNotifyTimer = new TQTimer( this ); - connect( demandAttentionKNotifyTimer, TQT_SIGNAL( timeout()), TQT_SLOT( demandAttentionKNotify())); + connect( demandAttentionKNotifyTimer, TQ_SIGNAL( timeout()), TQ_SLOT( demandAttentionKNotify())); } demandAttentionKNotifyTimer->start( 1000, true ); } @@ -1005,7 +1005,7 @@ void Group::startupIdChanged() void Group::updateUserTime( Time time ) { // copy of Client::updateUserTime if( time == CurrentTime ) - time = GET_QT_X_TIME(); + time = get_tqt_x_time(); if( time != -1U && ( user_time == CurrentTime || timestampCompare( time, user_time ) > 0 )) // time > user_time diff --git a/twin/bridge.cpp b/twin/bridge.cpp index f79382457..5a9365dbe 100644 --- a/twin/bridge.cpp +++ b/twin/bridge.cpp @@ -147,7 +147,7 @@ TQWidget* Bridge::initialParentWidget() const return NULL; } -Qt::WFlags Bridge::initialWFlags() const +TQt::WFlags Bridge::initialWFlags() const { return 0; } diff --git a/twin/bridge.h b/twin/bridge.h index 3208b3192..b7fb51c1a 100644 --- a/twin/bridge.h +++ b/twin/bridge.h @@ -65,7 +65,7 @@ class Bridge : public KDecorationBridge virtual void setKeepBelow( bool ); virtual int currentDesktop() const; virtual TQWidget* initialParentWidget() const; - virtual Qt::WFlags initialWFlags() const; + virtual TQt::WFlags initialWFlags() const; virtual void helperShowHide( bool show ); virtual void grabXServer( bool grab ); private: diff --git a/twin/client.cpp b/twin/client.cpp index b57cab35f..b8f00746e 100644 --- a/twin/client.cpp +++ b/twin/client.cpp @@ -27,6 +27,11 @@ License. See the file "COPYING" for the exact licensing terms. #include <tdelocale.h> #include <stdlib.h> +#ifdef Q_OS_SOLARIS +#include <procfs.h> +#include <libgen.h> +#endif /* SunOS */ + #include "bridge.h" #include "group.h" #include "workspace.h" @@ -94,6 +99,7 @@ Client::Client( Workspace *ws ) decoration( NULL ), wspace( ws ), bridge( new Bridge( this )), + inhibitConfigureRequests(false), move_faked_activity( false ), move_resize_grab_window( None ), transient_for( NULL ), @@ -115,18 +121,23 @@ Client::Client( Workspace *ws ) border_top( 0 ), border_bottom( 0 ), opacity_( 0 ), - demandAttentionKNotifyTimer( NULL ) + demandAttentionKNotifyTimer( NULL ), + activeMaximizing(false), + activeTiled(false) // SELI do all as initialization { autoRaiseTimer = 0; shadeHoverTimer = 0; + configureRequestTimer = new TQTimer(this); + connect(configureRequestTimer, TQ_SIGNAL(timeout()), TQ_SLOT(configureRequestTimeout())); + shadowDelayTimer = new TQTimer(this); opacityCache = &activeOpacityCache; shadowAfterClient = NULL; shadowWidget = NULL; shadowMe = true; - connect(shadowDelayTimer, TQT_SIGNAL(timeout()), TQT_SLOT(drawShadow())); + connect(shadowDelayTimer, TQ_SIGNAL(timeout()), TQ_SLOT(drawShadow())); // set the initial mapping state mapping_state = WithdrawnState; @@ -171,7 +182,7 @@ Client::Client( Workspace *ws ) max_mode = MaximizeRestore; maxmode_restore = MaximizeRestore; - + cmap = None; frame_geometry = TQRect( 0, 0, 100, 100 ); // so that decorations don't start with size being (0,0) @@ -255,7 +266,7 @@ void Client::releaseWindow( bool on_shutdown ) { // Make sure it's not mapped if the app unmapped it (#65279). The app // may do map+unmap before we initially map the window by calling rawShow() from manage(). - XUnmapWindow( tqt_xdisplay(), client ); + XUnmapWindow( tqt_xdisplay(), client ); } client = None; XDestroyWindow( tqt_xdisplay(), wrapper ); @@ -519,7 +530,7 @@ bool Client::isModalSystemNotification() const void Client::updateShape() { // workaround for #19644 - shaped windows shouldn't have decoration - if( shape() && !noBorder()) + if( shape() && !noBorder()) { noborder = true; updateDecoration( true ); @@ -598,7 +609,7 @@ TQRegion Client::mask() const return TQRegion( 0, 0, width(), height()); return _mask; } - + void Client::setShapable(bool b) { long tmp = b?1:0; @@ -740,12 +751,12 @@ void Client::animateMinimizeOrUnminimize( bool minimize ) TQPixmap pm = animationPixmap( minimize ? width() : icongeom.width() ); TQRect before, after; - if ( minimize ) + if ( minimize ) { before = TQRect( x(), y(), width(), pm.height() ); after = TQRect( icongeom.x(), icongeom.y(), icongeom.width(), pm.height() ); } - else + else { before = TQRect( icongeom.x(), icongeom.y(), icongeom.width(), pm.height() ); after = TQRect( x(), y(), width(), pm.height() ); @@ -769,14 +780,14 @@ void Client::animateMinimizeOrUnminimize( bool minimize ) TQPainter p ( workspace()->desktopWidget() ); bool need_to_clear = FALSE; TQPixmap pm3; - do + do { if (area2 != area) { pm = animationPixmap( area.width() ); pm2 = TQPixmap::grabWindow( tqt_xrootwin(), area.x(), area.y(), area.width(), area.height() ); p.drawPixmap( area.x(), area.y(), pm ); - if ( need_to_clear ) + if ( need_to_clear ) { p.drawPixmap( area2.x(), area2.y(), pm3 ); need_to_clear = FALSE; @@ -792,11 +803,11 @@ void Client::animateMinimizeOrUnminimize( bool minimize ) area.setRight(before.right() + int(diff*rf)); area.setTop(before.top() + int(diff*tf)); area.setBottom(before.bottom() + int(diff*bf)); - if (area2 != area ) + if (area2 != area ) { if ( area2.intersects( area ) ) p.drawPixmap( area2.x(), area2.y(), pm2 ); - else + else { // no overlap, we can clear later to avoid flicker pm3 = pm2; need_to_clear = TRUE; @@ -870,7 +881,7 @@ void Client::setShade( ShadeMode mode ) int as = options->animateShade? 10 : 1; // TODO all this unmapping, resizing etc. feels too much duplicated from elsewhere - if ( isShade()) + if ( isShade()) { // shade_mode == ShadeNormal // we're about to shade, texx xcompmgr to prepare long _shade = 1; @@ -884,13 +895,13 @@ void Client::setShade( ShadeMode mode ) XUnmapWindow( tqt_xdisplay(), wrapper ); XUnmapWindow( tqt_xdisplay(), client ); XSelectInput( tqt_xdisplay(), wrapper, ClientWinMask | SubstructureNotifyMask ); - //as we hid the unmap event, xcompmgr didn't recognize the client wid has vanished, so we'll extra inform it + //as we hid the unmap event, xcompmgr didn't recognize the client wid has vanished, so we'll extra inform it //done xcompmgr workaround // FRAME repaint( FALSE ); // bool wasStaticContents = testWFlags( WStaticContents ); // setWFlags( WStaticContents ); - int step = TQMAX( 4, QABS( h - s.height() ) / as )+1; - do + int step = TQMAX( 4, TQABS( h - s.height() ) / as )+1; + do { h -= step; XResizeWindow( tqt_xdisplay(), frameId(), s.width(), h ); @@ -910,17 +921,17 @@ void Client::setShade( ShadeMode mode ) } // tell xcompmgr shade's done _shade = 2; - XChangeProperty(tqt_xdisplay(), frameId(), atoms->net_wm_window_shade, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &_shade, 1L); + XChangeProperty(tqt_xdisplay(), frameId(), atoms->net_wm_window_shade, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &_shade, 1L); } - else + else { int h = height(); shade_geometry_change = true; TQSize s( sizeForClientSize( clientSize())); // FRAME bool wasStaticContents = testWFlags( WStaticContents ); // setWFlags( WStaticContents ); - int step = TQMAX( 4, QABS( h - s.height() ) / as )+1; - do + int step = TQMAX( 4, TQABS( h - s.height() ) / as )+1; + do { h += step; XResizeWindow( tqt_xdisplay(), frameId(), s.width(), h ); @@ -962,6 +973,12 @@ void Client::setShade( ShadeMode mode ) updateWindowRules(); } +void Client::configureRequestTimeout() + { + inhibitConfigureRequests = false; + sendSyntheticConfigureNotify(); + } + void Client::shadeHover() { setShade( ShadeHover ); @@ -1193,7 +1210,7 @@ void Client::drawDelayedShadow() void Client::drawShadowAfter(Client *after) { shadowAfterClient = after; - connect(after, TQT_SIGNAL(shadowDrawn()), TQT_SLOT(drawShadow())); + connect(after, TQ_SIGNAL(shadowDrawn()), TQ_SLOT(drawShadow())); } /*! @@ -1207,7 +1224,7 @@ void Client::drawShadow() // If we are waiting for another Client's shadow to be drawn, stop waiting now if (shadowAfterClient != NULL) { - disconnect(shadowAfterClient, TQT_SIGNAL(shadowDrawn()), this, TQT_SLOT(drawShadow())); + disconnect(shadowAfterClient, TQ_SIGNAL(shadowDrawn()), this, TQ_SLOT(drawShadow())); shadowAfterClient = NULL; } @@ -1253,7 +1270,7 @@ void Client::drawShadow() removeShadow(); - TQMemArray<QRgb> pixelData; + TQMemArray<TQRgb> pixelData; TQPixmap shadowPixmap; TQRect shadow; TQRegion exposedRegion; @@ -1426,7 +1443,7 @@ TQRegion Client::getExposedRegion(TQRegion occludedRegion, int x, int y, int w, */ void Client::imposeCachedShadow(TQPixmap &pixmap, TQRegion exposed) { - QRgb pixel; + TQRgb pixel; double opacity; int red, green, blue, pixelRed, pixelGreen, pixelBlue; int subW, subH, w, x, y, zeroX, zeroY; @@ -1483,7 +1500,7 @@ void Client::imposeRegionShadow(TQPixmap &pixmap, TQRegion occluded, TQRegion exposed, int thickness, double maxOpacity) { int distance, intersectCount, i, j, x, y; - QRgb pixel; + TQRgb pixel; double decay, factor, opacity; int red, green, blue, pixelRed, pixelGreen, pixelBlue; int lineIntersects, maxIntersects, maxY; @@ -1697,7 +1714,7 @@ void Client::sendClientMessage(Window w, Atom a, Atom protocol, long data1, long ev.xclient.message_type = a; ev.xclient.format = 32; ev.xclient.data.l[0] = protocol; - ev.xclient.data.l[1] = GET_QT_X_TIME(); + ev.xclient.data.l[1] = get_tqt_x_time(); ev.xclient.data.l[2] = data1; ev.xclient.data.l[3] = data2; ev.xclient.data.l[4] = data3; @@ -1726,14 +1743,14 @@ void Client::closeWindow() if( !isCloseable()) return; // Update user time, because the window may create a confirming dialog. - updateUserTime(); + updateUserTime(); if ( Pdeletewindow ) { Notify::raise( Notify::Close ); sendClientMessage( window(), atoms->wm_protocols, atoms->wm_delete_window); pingWindow(); } - else + else { // client will not react on wm_delete_window. We have not choice // but destroy his connection to the XServer. @@ -1774,9 +1791,9 @@ void Client::pingWindow() if( ping_timer != NULL ) return; // pinging already ping_timer = new TQTimer( this ); - connect( ping_timer, TQT_SIGNAL( timeout()), TQT_SLOT( pingTimeout())); + connect( ping_timer, TQ_SIGNAL( timeout()), TQ_SLOT( pingTimeout())); ping_timer->start( options->killPingTimeout, true ); - ping_timestamp = GET_QT_X_TIME(); + ping_timestamp = get_tqt_x_time(); workspace()->sendPingToWindow( window(), ping_timestamp ); } @@ -1833,8 +1850,8 @@ void Client::killProcess( bool ask, Time timestamp ) << "--applicationname" << resourceClass() << "--wid" << TQCString().setNum( window()) << "--timestamp" << TQCString().setNum( timestamp ); - connect( process_killer, TQT_SIGNAL( processExited( TDEProcess* )), - TQT_SLOT( processKillerExited())); + connect( process_killer, TQ_SIGNAL( processExited( TDEProcess* )), + TQ_SLOT( processKillerExited())); if( !process_killer->start( TDEProcess::NotifyOnExit )) { delete process_killer; @@ -1860,15 +1877,30 @@ bool Client::isSuspendable() const } else { +#ifdef Q_OS_SOLARIS + TQFile procStatFile(TQString("/proc/%1/lwp/1/lwpsinfo").arg(pid)); +#else /* default */ TQFile procStatFile(TQString("/proc/%1/stat").arg(pid)); +#endif if (procStatFile.open(IO_ReadOnly)) { TQByteArray statRaw = procStatFile.readAll(); procStatFile.close(); +#ifdef Q_OS_SOLARIS + lwpsinfo_t *inf = (lwpsinfo_t *)statRaw.data(); + char tbuf[PATH_MAX]; + TQString tcomm; + TQString state(TQChar(inf->pr_sname)); + + readlink(TQString("/proc/%1/path/a.out").arg(pid).latin1(), + tbuf, sizeof(tbuf)); + tcomm = basename(tbuf); +#else /* default */ TQString statString(statRaw); TQStringList statFields = TQStringList::split(" ", statString, TRUE); TQString tcomm = statFields[1]; TQString state = statFields[2]; +#endif /* default */ if( state != "T" ) { // Make sure no windows of this process are special @@ -1921,15 +1953,24 @@ bool Client::isResumeable() const } else { +#ifdef Q_OS_SOLARIS + TQFile procStatFile(TQString("/proc/%1/lwp/1/lwpsinfo").arg(pid)); +#else /* default */ TQFile procStatFile(TQString("/proc/%1/stat").arg(pid)); +#endif if (procStatFile.open(IO_ReadOnly)) { TQByteArray statRaw = procStatFile.readAll(); procStatFile.close(); +#ifdef Q_OS_SOLARIS + lwpsinfo_t *inf = (lwpsinfo_t *)statRaw.data(); + TQString state(TQChar(inf->pr_sname)); +#else /* default */ TQString statString(statRaw); TQStringList statFields = TQStringList::split(" ", statString, TRUE); TQString tcomm = statFields[1]; TQString state = statFields[2]; +#endif /* default */ if( state == "T" ) { return true; @@ -1961,8 +2002,8 @@ bool Client::queryUserSuspendedResume() << "--windowname" << caption().utf8() << "--applicationname" << resourceClass() << "--wid" << TQCString().setNum( window()); - connect( process_resumer, TQT_SIGNAL( processExited( TDEProcess* )), - TQT_SLOT( processResumerExited())); + connect( process_resumer, TQ_SIGNAL( processExited( TDEProcess* )), + TQ_SLOT( processResumerExited())); if( !process_resumer->start( TDEProcess::NotifyOnExit )) { delete process_resumer; @@ -2172,15 +2213,15 @@ void Client::takeActivity( int flags, bool handled, allowed_t ) #ifndef NDEBUG static Time previous_activity_timestamp; static Client* previous_client; - if( previous_activity_timestamp == GET_QT_X_TIME() && previous_client != this ) + if( previous_activity_timestamp == get_tqt_x_time() && previous_client != this ) { kdDebug( 1212 ) << "Repeated use of the same X timestamp for activity" << endl; kdDebug( 1212 ) << kdBacktrace() << endl; } - previous_activity_timestamp = GET_QT_X_TIME(); + previous_activity_timestamp = get_tqt_x_time(); previous_client = this; #endif - workspace()->sendTakeActivity( this, GET_QT_X_TIME(), flags ); + workspace()->sendTakeActivity( this, get_tqt_x_time(), flags ); } // performs the actual focusing of the window using XSetInputFocus and WM_TAKE_FOCUS @@ -2189,17 +2230,17 @@ void Client::takeFocus( allowed_t ) #ifndef NDEBUG static Time previous_focus_timestamp; static Client* previous_client; - if( previous_focus_timestamp == GET_QT_X_TIME() && previous_client != this ) + if( previous_focus_timestamp == get_tqt_x_time() && previous_client != this ) { kdDebug( 1212 ) << "Repeated use of the same X timestamp for focus" << endl; kdDebug( 1212 ) << kdBacktrace() << endl; } - previous_focus_timestamp = GET_QT_X_TIME(); + previous_focus_timestamp = get_tqt_x_time(); previous_client = this; #endif if ( rules()->checkAcceptFocus( input )) { - XSetInputFocus( tqt_xdisplay(), window(), RevertToPointerRoot, GET_QT_X_TIME() ); + XSetInputFocus( tqt_xdisplay(), window(), RevertToPointerRoot, get_tqt_x_time() ); // Work around opacity bug bool activePrev = active; active = true; @@ -2236,7 +2277,7 @@ bool Client::providesContextHelp() const */ void Client::showContextHelp() { - if ( Pcontexthelp ) + if ( Pcontexthelp ) { sendClientMessage(window(), atoms->wm_protocols, atoms->net_wm_context_help); TQWhatsThis::enterWhatsThisMode(); // SELI? @@ -2255,17 +2296,17 @@ void Client::fetchName() TQString Client::readName() const { - if ( info->name() && info->name()[ 0 ] != '\0' ) + if ( info->name() && info->name()[ 0 ] != '\0' ) return TQString::fromUtf8( info->name() ); - else + else return KWin::readNameProperty( window(), XA_WM_NAME ); } - + KWIN_COMPARE_PREDICATE( FetchNameInternalPredicate, const Client*, (!cl->isSpecialWindow() || cl->isToolbar()) && cl != value && cl->caption() == value->caption()); void Client::setCaption( const TQString& s, bool force ) { - if ( s != cap_normal || force ) + if ( s != cap_normal || force ) { bool reset_name = force; for( unsigned int i = 0; @@ -2280,10 +2321,10 @@ void Client::setCaption( const TQString& s, bool force ) machine_suffix = " <@" + wmClientMachine( true ) + ">"; TQString shortcut_suffix = !shortcut().isNull() ? ( " {" + shortcut().toString() + "}" ) : ""; cap_suffix = machine_suffix + shortcut_suffix; - if ( ( !isSpecialWindow() || isToolbar()) && workspace()->findClient( FetchNameInternalPredicate( this ))) + if ( ( !isSpecialWindow() || isToolbar()) && workspace()->findClient( FetchNameInternalPredicate( this ))) { int i = 2; - do + do { cap_suffix = machine_suffix + " <" + TQString::number(i) + ">" + shortcut_suffix; i++; @@ -2313,11 +2354,11 @@ void Client::updateCaption() void Client::fetchIconicName() { TQString s; - if ( info->iconName() && info->iconName()[ 0 ] != '\0' ) + if ( info->iconName() && info->iconName()[ 0 ] != '\0' ) s = TQString::fromUtf8( info->iconName() ); - else + else s = KWin::readNameProperty( window(), XA_WM_ICON_NAME ); - if ( s != cap_iconic ) + if ( s != cap_iconic ) { bool was_set = !cap_iconic.isEmpty(); cap_iconic = s; @@ -2378,7 +2419,7 @@ void Client::getMotifHints() } void Client::readIcons( Window win, TQPixmap* icon, TQPixmap* miniicon ) - { + { // get the icons, allow scaling if( icon != NULL ) *icon = KWin::icon( win, 32, 32, TRUE, KWin::NETWM | KWin::WMHints ); @@ -2494,7 +2535,7 @@ Window Client::staticWmClientLeader(WId w) FALSE, XA_WINDOW, &type, &format, &nitems, &extra, &data ); XSetErrorHandler(oldHandler); - if (status == Success ) + if (status == Success ) { if (data && nitems > 0) result = *((Window*) data); @@ -2672,29 +2713,29 @@ void Client::setCursor( Position m ) { m = PositionCenter; } - switch ( m ) + switch ( m ) { case PositionTopLeft: case PositionBottomRight: - setCursor( tqsizeFDiagCursor ); + setCursor( TQt::sizeFDiagCursor ); break; case PositionBottomLeft: case PositionTopRight: - setCursor( tqsizeBDiagCursor ); + setCursor( TQt::sizeBDiagCursor ); break; case PositionTop: case PositionBottom: - setCursor( tqsizeVerCursor ); + setCursor( TQt::sizeVerCursor ); break; case PositionLeft: case PositionRight: - setCursor( tqsizeHorCursor ); + setCursor( TQt::sizeHorCursor ); break; default: if( buttonDown && isMovable()) - setCursor( tqsizeAllCursor ); + setCursor( TQt::sizeAllCursor ); else - setCursor( tqarrowCursor ); + setCursor( TQt::arrowCursor ); break; } } @@ -2946,7 +2987,7 @@ void Client::updateOpacity() } } } - + void Client::updateShadowSize() // extra syncscreen flag allows to avoid double syncs when active state changes (as it will usually change for two windows) { @@ -2967,7 +3008,7 @@ uint Client::ruleOpacityActive() { return rule_opacity_active;// != 0; } - + bool Client::getWindowOpacity() //query translucency settings from X, returns true if window opacity is set { unsigned char *data = 0; @@ -2985,12 +3026,12 @@ bool Client::getWindowOpacity() //query translucency settings from X, returns tr } return FALSE; } - + void Client::setCustomOpacityFlag(bool custom) { custom_opacity = custom; } - + uint Client::opacity() { return opacity_; @@ -3000,7 +3041,7 @@ int Client::opacityPercentage() { return int(100*((double)opacity_/0xffffffff)); } - + bool Client::touches(const Client* c) // checks if this client borders c, needed to test beep media player window state { @@ -3014,7 +3055,7 @@ bool Client::touches(const Client* c) return TRUE; return FALSE; } - + void Client::setDecoHashProperty(uint topHeight, uint rightWidth, uint bottomHeight, uint leftWidth) { long data = (topHeight < 255 ? topHeight : 255) << 24 | @@ -3028,7 +3069,7 @@ void Client::unsetDecoHashProperty() { XDeleteProperty( tqt_xdisplay(), frameId(), atoms->net_wm_window_decohash); } - + #ifndef NDEBUG kdbgstream& operator<<( kdbgstream& stream, const Client* cl ) { diff --git a/twin/client.h b/twin/client.h index d3c7e7b13..a59b20acd 100644 --- a/twin/client.h +++ b/twin/client.h @@ -45,7 +45,7 @@ class Bridge; class Client : public TQObject, public KDecorationDefines { - Q_OBJECT + TQ_OBJECT public: Client( Workspace *ws ); Window window() const; @@ -232,6 +232,15 @@ class Client : public TQObject, public KDecorationDefines void resizeWithChecks( int w, int h, ForceGeometry_t force = NormalGeometrySet ); void resizeWithChecks( const TQSize& s, ForceGeometry_t force = NormalGeometrySet ); void keepInArea( TQRect area, bool partial = false ); + void setActiveBorderMode( ActiveMaximizingMode mode ); + void setActiveBorder( ActiveBorder border); + ActiveMaximizingMode activeBorderMode() const; + ActiveBorder activeBorder() const; + void setActiveBorderMaximizing(bool maximizing); + void cancelActiveBorderMaximizing(); + bool isActiveBorderMaximizing() const; + TQRect activeBorderMaximizeGeometry(); + void tileToBorder(ActiveBorder border); void growHorizontal(); void shrinkHorizontal(); @@ -331,6 +340,7 @@ class Client : public TQObject, public KDecorationDefines private slots: void autoRaise(); void shadeHover(); + void configureRequestTimeout(); void shortcutActivated(); void updateOpacityCache(); @@ -448,7 +458,7 @@ class Client : public TQObject, public KDecorationDefines static void sendClientMessage( Window w, Atom a, Atom protocol, long data1 = 0, long data2 = 0, long data3 = 0 ); - void embedClient( Window w, const XWindowAttributes &attr ); + void embedClient( Window w, const XWindowAttributes &attr ); void detectNoBorder(); void detectShapable(); void destroyDecoration(); @@ -472,14 +482,15 @@ class Client : public TQObject, public KDecorationDefines int desk; bool buttonDown; bool moveResizeMode; + bool inhibitConfigureRequests; bool move_faked_activity; Window move_resize_grab_window; bool unrestrictedMoveResize; - bool isMove() const + bool isMove() const { return moveResizeMode && mode == PositionCenter; } - bool isResize() const + bool isResize() const { return moveResizeMode && mode != PositionCenter; } @@ -550,6 +561,7 @@ class Client : public TQObject, public KDecorationDefines WinInfo* info; TQTimer* autoRaiseTimer; TQTimer* shadeHoverTimer; + TQTimer* configureRequestTimer; Colormap cmap; TQCString resource_name; TQCString resource_class; @@ -600,6 +612,12 @@ class Client : public TQObject, public KDecorationDefines bool isBMP_; TQTimer* demandAttentionKNotifyTimer; + bool activeMaximizing; + bool activeTiled; + TQRect activeTiledOrigGeom; + ActiveMaximizingMode activeMode; + ActiveBorder currentActiveBorder; + friend bool performTransiencyCheck(); bool minimized_before_suspend; }; @@ -946,7 +964,7 @@ inline bool Client::hasUserTimeSupport() const { return info->userTime() != -1U; } - + inline bool Client::ignoreFocusStealing() const { return ignore_focus_stealing; diff --git a/twin/clients/PORTING b/twin/clients/PORTING index 0c0c1a6ea..199ddb9de 100644 --- a/twin/clients/PORTING +++ b/twin/clients/PORTING @@ -2,18 +2,14 @@ It's suggested you check sources of some KDE CVS decoration if in doubts or in n Also, the API is documented in the .h header files. Makefile.am: -- Change twin_ to twin3_ (in LDFLAGS, LIBADD, kde_module_LTLIBRARIES, SOURCES). - Make sure LDFLAGS contains $(KDE_PLUGIN) and -module . - Add -ltdecorations to LIBADD. - Do NOT rename the directory where the .desktop file is installed ( $(kde_datadir)/twin/ ). -.desktop file: -- Change twin_ to twin3_ in X-TDE-Library. - Sources: - There are no twin/something.h includes, and don't use the KWinInternal namespace. - Use QToolTip instead of KWinToolTip. -- Use QButton instead of KWinButton, QToolButton instead of KWinToolButton and QWidget +- Use QButton instead of KWinButton, QToolButton instead of KWinToolButton and TQWidget instead of KWinWidgetButton. - For tooltips, use simply QToolTip::add(). - Change Client* to MyClient* (or whatever is your main client class) in your MyButton. @@ -26,11 +22,11 @@ Sources: - As the first thing in init(), call createMainWidget(); if your client class took some flags such as WResizeNoErase, pass them to this function. - Then, do 'widget()->installEventFilter( this );'. -- Implement MyClient::eventFilter() - as MyClient is now no longer QWidget, you need the event +- Implement MyClient::eventFilter() - as MyClient is now no longer TQWidget, you need the event filter to call all the functions that used to be called directly. Usually, it's something like: ===== -bool MyClient::eventFilter( QObject* o, QEvent* e ) +bool MyClient::eventFilter( TQObject* o, QEvent* e ) { if ( o != widget() ) return false; @@ -67,7 +63,7 @@ bool MyClient::eventFilter( QObject* o, QEvent* e ) } ===== - In MyClient, 'this' will have to be often replaced with 'widget()', pay special attention - to cases where this won't cause compile error (e.g. in connect() calls, which take QObject* ). + to cases where this won't cause compile error (e.g. in connect() calls, which take TQObject* ). - Also, many calls may need 'widget()->' prepended. - Layout is created in init(), so call createLayout() directly there (if it's implemented). - Remove calls to Client methods (Client::resizeEvent() and so on). diff --git a/twin/clients/b2/CMakeLists.txt b/twin/clients/b2/CMakeLists.txt index cd08f4d99..ba946ba75 100644 --- a/twin/clients/b2/CMakeLists.txt +++ b/twin/clients/b2/CMakeLists.txt @@ -32,9 +32,9 @@ tde_create_translated_desktop( ) -##### twin3_b2 (module) ######################### +##### twin_b2 (module) ######################### -tde_add_kpart( twin3_b2 AUTOMOC +tde_add_kpart( twin_b2 AUTOMOC SOURCES b2client.cpp LINK tdecorations-shared DESTINATION ${PLUGIN_INSTALL_DIR} diff --git a/twin/clients/b2/Makefile.am b/twin/clients/b2/Makefile.am index ccd7f39fa..71bbbb556 100644 --- a/twin/clients/b2/Makefile.am +++ b/twin/clients/b2/Makefile.am @@ -3,12 +3,12 @@ INCLUDES = -I$(srcdir)/../../lib $(all_includes) SUBDIRS = . config -kde_module_LTLIBRARIES = twin3_b2.la +kde_module_LTLIBRARIES = twin_b2.la -twin3_b2_la_SOURCES = b2client.cpp -twin3_b2_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module +twin_b2_la_SOURCES = b2client.cpp +twin_b2_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module # twin_b2_la_LDFLAGS = $(all_libraries) -avoid-version -module $(KDE_RPATH) $(KDE_MT_LDFLAGS) -twin3_b2_la_LIBADD = ../../lib/libtdecorations.la +twin_b2_la_LIBADD = ../../lib/libtdecorations.la METASOURCES = AUTO noinst_HEADERS = b2client.h diff --git a/twin/clients/b2/b2.desktop b/twin/clients/b2/b2.desktop index b5eacefa9..767e9bfc4 100644 --- a/twin/clients/b2/b2.desktop +++ b/twin/clients/b2/b2.desktop @@ -1,3 +1,3 @@ [Desktop Entry] Name=B II -X-TDE-Library=twin3_b2 +X-TDE-Library=twin_b2 diff --git a/twin/clients/b2/b2client.cpp b/twin/clients/b2/b2client.cpp index 3e0cdf7ad..16a451932 100644 --- a/twin/clients/b2/b2client.cpp +++ b/twin/clients/b2/b2client.cpp @@ -221,7 +221,7 @@ static void create_pixmaps() TQPainter mask; mask.begin(&normalizeMask); - TQBrush one(Qt::color1); + TQBrush one(TQt::color1); mask.fillRect(normalizeMask.width() - 12, normalizeMask.height() - 12, 12, 12, one); mask.fillRect(0, 0, 10, 10, one); @@ -461,11 +461,11 @@ void B2Client::addButtons(const TQString& s, const TQString tips[], if (!isModalSystemNotification()) { if (!button[BtnMenu]) { button[BtnMenu] = new B2Button(this, tb, tips[BtnMenu], - Qt::LeftButton | Qt::RightButton); + TQt::LeftButton | TQt::RightButton); button[BtnMenu]->setPixmaps(P_MENU); button[BtnMenu]->setUseMiniIcon(); - connect(button[BtnMenu], TQT_SIGNAL(pressed()), - this, TQT_SLOT(menuButtonPressed())); + connect(button[BtnMenu], TQ_SIGNAL(pressed()), + this, TQ_SLOT(menuButtonPressed())); titleLayout->addWidget(button[BtnMenu]); } } @@ -477,8 +477,8 @@ void B2Client::addButtons(const TQString& s, const TQString tips[], button[BtnSticky]->setPixmaps(P_PINUP); button[BtnSticky]->setToggle(); button[BtnSticky]->setDown(isOnAllDesktops()); - connect(button[BtnSticky], TQT_SIGNAL(clicked()), - this, TQT_SLOT(toggleOnAllDesktops())); + connect(button[BtnSticky], TQ_SIGNAL(clicked()), + this, TQ_SLOT(toggleOnAllDesktops())); titleLayout->addWidget(button[BtnSticky]); } } @@ -487,8 +487,8 @@ void B2Client::addButtons(const TQString& s, const TQString tips[], if (providesContextHelp() && (!button[BtnHelp])) { button[BtnHelp] = new B2Button(this, tb, tips[BtnHelp]); button[BtnHelp]->setPixmaps(P_HELP); - connect(button[BtnHelp], TQT_SIGNAL(clicked()), - this, TQT_SLOT(showContextHelp())); + connect(button[BtnHelp], TQ_SIGNAL(clicked()), + this, TQ_SLOT(showContextHelp())); titleLayout->addWidget(button[BtnHelp]); } break; @@ -496,19 +496,19 @@ void B2Client::addButtons(const TQString& s, const TQString tips[], if (isMinimizable() && (!button[BtnIconify])) { button[BtnIconify] = new B2Button(this, tb,tips[BtnIconify]); button[BtnIconify]->setPixmaps(P_ICONIFY); - connect(button[BtnIconify], TQT_SIGNAL(clicked()), - this, TQT_SLOT(minimize())); + connect(button[BtnIconify], TQ_SIGNAL(clicked()), + this, TQ_SLOT(minimize())); titleLayout->addWidget(button[BtnIconify]); } break; case 'A': // Maximize button if (isMaximizable() && (!button[BtnMax])) { button[BtnMax] = new B2Button(this, tb, tips[BtnMax], - Qt::LeftButton | Qt::MidButton | Qt::RightButton); + TQt::LeftButton | TQt::MidButton | TQt::RightButton); button[BtnMax]->setPixmaps(maximizeMode() == MaximizeFull ? P_NORMALIZE : P_MAX); - connect(button[BtnMax], TQT_SIGNAL(clicked()), - this, TQT_SLOT(maxButtonClicked())); + connect(button[BtnMax], TQ_SIGNAL(clicked()), + this, TQ_SLOT(maxButtonClicked())); titleLayout->addWidget(button[BtnMax]); } break; @@ -516,8 +516,8 @@ void B2Client::addButtons(const TQString& s, const TQString tips[], if (isCloseable() && !button[BtnClose]) { button[BtnClose] = new B2Button(this, tb, tips[BtnClose]); button[BtnClose]->setPixmaps(P_CLOSE); - connect(button[BtnClose], TQT_SIGNAL(clicked()), - this, TQT_SLOT(closeWindow())); + connect(button[BtnClose], TQ_SIGNAL(clicked()), + this, TQ_SLOT(closeWindow())); titleLayout->addWidget(button[BtnClose]); } break; @@ -525,8 +525,8 @@ void B2Client::addButtons(const TQString& s, const TQString tips[], if (isShadeable() && !button[BtnShade]) { button[BtnShade] = new B2Button(this, tb, tips[BtnShade]); button[BtnShade]->setPixmaps(P_SHADE); - connect(button[BtnShade], TQT_SIGNAL(clicked()), - this, TQT_SLOT(shadeButtonClicked())); + connect(button[BtnShade], TQ_SIGNAL(clicked()), + this, TQ_SLOT(shadeButtonClicked())); titleLayout->addWidget(button[BtnShade]); } break; @@ -534,8 +534,8 @@ void B2Client::addButtons(const TQString& s, const TQString tips[], if (resizable && !button[BtnResize]) { button[BtnResize] = new B2Button(this, tb, tips[BtnResize]); button[BtnResize]->setPixmaps(P_RESIZE); - connect(button[BtnResize], TQT_SIGNAL(pressed()), - this, TQT_SLOT(resizeButtonPressed())); + connect(button[BtnResize], TQ_SIGNAL(pressed()), + this, TQ_SLOT(resizeButtonPressed())); titleLayout->addWidget(button[BtnResize]); } break; @@ -676,7 +676,7 @@ void B2Client::paintEvent(TQPaintEvent* e) // bottom handle rect if (mustDrawHandle()) { - p.setPen(Qt::black); + p.setPen(TQt::black); int hx = width() - 40; int hw = 40; @@ -981,8 +981,8 @@ static void redraw_pixmaps() KPixmap *pix = pixmap[P_SHADE * NumStates + i]; TQColor color = is_act ? aGrp.button() : iGrp.button(); drawB2Rect(&thinBox, color, is_down); - pix->fill(Qt::black); - bitBlt(TQT_TQPAINTDEVICE(pix), 0, 0, TQT_TQPAINTDEVICE(&thinBox), + pix->fill(TQt::black); + bitBlt(pix, 0, 0, &thinBox, 0, 0, thinBox.width(), thinBox.height(), TQt::CopyROP, true); } @@ -1005,12 +1005,12 @@ static void redraw_pixmaps() drawB2Rect(&smallBox, is_act ? aGrp.button() : iGrp.button(), is_down); drawB2Rect(&largeBox, is_act ? aGrp.button() : iGrp.button(), is_down); pix->fill(options()->color(KDecoration::ColorTitleBar, is_act)); - bitBlt(TQT_TQPAINTDEVICE(pix), pix->width() - 12, pix->width() - 12, TQT_TQPAINTDEVICE(&largeBox), + bitBlt(pix, pix->width() - 12, pix->width() - 12, &largeBox, 0, 0, 12, 12, TQt::CopyROP, true); - bitBlt(TQT_TQPAINTDEVICE(pix), 0, 0, TQT_TQPAINTDEVICE(&smallBox), 0, 0, 10, 10, TQt::CopyROP, true); + bitBlt(pix, 0, 0, &smallBox, 0, 0, 10, 10, TQt::CopyROP, true); - bitBlt(TQT_TQPAINTDEVICE(pixmap[P_ICONIFY * NumStates + i]), 0, 0, - TQT_TQPAINTDEVICE(&smallBox), 0, 0, 10, 10, TQt::CopyROP, true); + bitBlt(pixmap[P_ICONIFY * NumStates + i], 0, 0, + &smallBox, 0, 0, 10, 10, TQt::CopyROP, true); } // resize @@ -1020,8 +1020,8 @@ static void redraw_pixmaps() *pixmap[P_RESIZE * NumStates + i] = *pixmap[P_CLOSE * NumStates + i]; pixmap[P_RESIZE * NumStates + i]->detach(); drawB2Rect(&smallBox, is_act ? aGrp.button() : iGrp.button(), is_down); - bitBlt(TQT_TQPAINTDEVICE(pixmap[P_RESIZE * NumStates + i]), - 0, 0, TQT_TQPAINTDEVICE(&smallBox), 0, 0, 10, 10, TQt::CopyROP, true); + bitBlt(pixmap[P_RESIZE * NumStates + i], + 0, 0, &smallBox, 0, 0, 10, 10, TQt::CopyROP, true); } @@ -1166,7 +1166,7 @@ bool B2Client::drawbound(const TQRect& geom, bool clear) *visible_bound = geom; } TQPainter p(workspaceWidget()); - p.setPen(TQPen(Qt::white, 5)); + p.setPen(TQPen(TQt::white, 5)); p.setRasterOp(TQt::XorROP); p.drawPolygon(bound_shape); @@ -1179,26 +1179,26 @@ bool B2Client::drawbound(const TQRect& geom, bool clear) bool B2Client::eventFilter(TQObject *o, TQEvent *e) { - if (TQT_BASE_OBJECT(o) != TQT_BASE_OBJECT(widget())) + if (o != widget()) return false; switch (e->type()) { case TQEvent::Resize: - resizeEvent(TQT_TQRESIZEEVENT(e)); + resizeEvent(static_cast<TQResizeEvent*>(e)); return true; case TQEvent::Paint: - paintEvent(TQT_TQPAINTEVENT(e)); + paintEvent(static_cast<TQPaintEvent*>(e)); return true; case TQEvent::MouseButtonDblClick: - titlebar->mouseDoubleClickEvent(TQT_TQMOUSEEVENT(e)); + titlebar->mouseDoubleClickEvent(static_cast<TQMouseEvent*>(e)); return true; case TQEvent::Wheel: - titlebar->wheelEvent(TQT_TQWHEELEVENT(e)); + titlebar->wheelEvent(static_cast<TQWheelEvent*>(e)); return true; case TQEvent::MouseButtonPress: - processMousePressEvent(TQT_TQMOUSEEVENT(e)); + processMousePressEvent(static_cast<TQMouseEvent*>(e)); return true; case TQEvent::Show: - showEvent(TQT_TQSHOWEVENT(e)); + showEvent(static_cast<TQShowEvent*>(e)); return true; default: break; @@ -1213,7 +1213,7 @@ B2Button::B2Button(B2Client *_client, TQWidget *parent, : TQButton(parent, 0), hover(false) { setBackgroundMode(NoBackground); - setCursor(tqarrowCursor); + setCursor(TQt::arrowCursor); realizeButtons = realizeBtns; client = _client; useMiniIcon = false; @@ -1280,7 +1280,7 @@ void B2Button::mousePressEvent(TQMouseEvent * e) { last_button = e->button(); TQMouseEvent me(e->type(), e->pos(), e->globalPos(), - (e->button() & realizeButtons) ? Qt::LeftButton : Qt::NoButton, + (e->button() & realizeButtons) ? TQt::LeftButton : TQt::NoButton, e->state()); TQButton::mousePressEvent(&me); } @@ -1289,7 +1289,7 @@ void B2Button::mouseReleaseEvent(TQMouseEvent * e) { last_button = e->button(); TQMouseEvent me(e->type(), e->pos(), e->globalPos(), - (e->button() & realizeButtons) ? Qt::LeftButton : Qt::NoButton, + (e->button() & realizeButtons) ? TQt::LeftButton : TQt::NoButton, e->state()); TQButton::mouseReleaseEvent(&me); } @@ -1356,7 +1356,7 @@ void B2Titlebar::drawTitlebar(TQPainter &p, bool state) TQRect t = rect(); // black titlebar frame - p.setPen(Qt::black); + p.setPen(TQt::black); p.drawLine(0, 0, 0, t.bottom()); p.drawLine(0, 0, t.right(), 0); p.drawLine(t.right(), 0, t.right(), t.bottom()); @@ -1395,7 +1395,7 @@ void B2Titlebar::resizeEvent(TQResizeEvent *) void B2Titlebar::paintEvent(TQPaintEvent *) { if(client->isActive()) - bitBlt(TQT_TQPAINTDEVICE(this), 0, 0, TQT_TQPAINTDEVICE(&titleBuffer), 0, 0, titleBuffer.width(), + bitBlt(this, 0, 0, &titleBuffer, 0, 0, titleBuffer.width(), titleBuffer.height(), TQt::CopyROP, true); else { TQPainter p(this); @@ -1405,14 +1405,14 @@ void B2Titlebar::paintEvent(TQPaintEvent *) void B2Titlebar::mouseDoubleClickEvent(TQMouseEvent *e) { - if (e->button() == Qt::LeftButton && e->y() < height()) { + if (e->button() == TQt::LeftButton && e->y() < height()) { client->titlebarDblClickOperation(); } } void B2Titlebar::wheelEvent(TQWheelEvent *e) { - if (client->isSetShade() || TQT_TQRECT_OBJECT(rect()).contains(e->pos())) + if (client->isSetShade() || rect().contains(e->pos())) client->titlebarMouseWheelOperation( e->delta()); } diff --git a/twin/clients/b2/b2client.h b/twin/clients/b2/b2client.h index 30220b175..c9748ccd6 100644 --- a/twin/clients/b2/b2client.h +++ b/twin/clients/b2/b2client.h @@ -28,7 +28,7 @@ class B2Client; class B2Button : public TQButton { public: - B2Button(B2Client *_client=0, TQWidget *parent=0, const TQString& tip=NULL, const int realizeBtns = Qt::LeftButton); + B2Button(B2Client *_client=0, TQWidget *parent=0, const TQString& tip=NULL, const int realizeBtns = TQt::LeftButton); ~B2Button() {}; void setBg(const TQColor &c){bg = c;} @@ -93,7 +93,7 @@ private: class B2Client : public KDecoration { - Q_OBJECT + TQ_OBJECT friend class B2Titlebar; public: B2Client(KDecorationBridge *b, KDecorationFactory *f); diff --git a/twin/clients/b2/config/config.cpp b/twin/clients/b2/config/config.cpp index 5b7a29e0f..b955254ec 100644 --- a/twin/clients/b2/config/config.cpp +++ b/twin/clients/b2/config/config.cpp @@ -70,12 +70,12 @@ B2Config::B2Config( TDEConfig* conf, TQWidget* parent ) load(conf); // Ensure we track user changes properly - connect(cbColorBorder, TQT_SIGNAL(clicked()), - this, TQT_SLOT(slotSelectionChanged())); - connect(showGrabHandleCb, TQT_SIGNAL(clicked()), - this, TQT_SLOT(slotSelectionChanged())); - connect(menuDblClickOp, TQT_SIGNAL(activated(int)), - this, TQT_SLOT(slotSelectionChanged())); + connect(cbColorBorder, TQ_SIGNAL(clicked()), + this, TQ_SLOT(slotSelectionChanged())); + connect(showGrabHandleCb, TQ_SIGNAL(clicked()), + this, TQ_SLOT(slotSelectionChanged())); + connect(menuDblClickOp, TQ_SIGNAL(activated(int)), + this, TQ_SLOT(slotSelectionChanged())); // Make the widgets visible in twindecoration gb->show(); } diff --git a/twin/clients/b2/config/config.h b/twin/clients/b2/config/config.h index a5382dc45..0a3e7c9ec 100644 --- a/twin/clients/b2/config/config.h +++ b/twin/clients/b2/config/config.h @@ -18,7 +18,7 @@ class B2Config: public TQObject { - Q_OBJECT + TQ_OBJECT public: B2Config( TDEConfig* conf, TQWidget* parent ); diff --git a/twin/clients/default/CMakeLists.txt b/twin/clients/default/CMakeLists.txt index 142a9b783..56bae72f9 100644 --- a/twin/clients/default/CMakeLists.txt +++ b/twin/clients/default/CMakeLists.txt @@ -23,9 +23,9 @@ link_directories( ) -##### twin3_default (module) #################### +##### twin_default (module) #################### -tde_add_kpart( twin3_default AUTOMOC +tde_add_kpart( twin_default AUTOMOC SOURCES kdedefault.cpp LINK tdecorations-shared tdecore-shared DESTINATION ${PLUGIN_INSTALL_DIR} diff --git a/twin/clients/default/Makefile.am b/twin/clients/default/Makefile.am index 3e687a2a6..2b609988b 100644 --- a/twin/clients/default/Makefile.am +++ b/twin/clients/default/Makefile.am @@ -3,11 +3,11 @@ INCLUDES = -I$(srcdir)/../../lib $(all_includes) SUBDIRS = . config -kde_module_LTLIBRARIES = twin3_default.la +kde_module_LTLIBRARIES = twin_default.la -twin3_default_la_SOURCES = kdedefault.cpp -twin3_default_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module -twin3_default_la_LIBADD = $(LIB_TDECORE) ../../lib/libtdecorations.la +twin_default_la_SOURCES = kdedefault.cpp +twin_default_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module +twin_default_la_LIBADD = $(LIB_TDECORE) ../../lib/libtdecorations.la METASOURCES = AUTO noinst_HEADERS = kdedefault.h diff --git a/twin/clients/default/config/config.cpp b/twin/clients/default/config/config.cpp index 886077925..36ddb1402 100644 --- a/twin/clients/default/config/config.cpp +++ b/twin/clients/default/config/config.cpp @@ -61,13 +61,13 @@ KDEDefaultConfig::KDEDefaultConfig( TDEConfig* conf, TQWidget* parent ) load( conf ); // Ensure we track user changes properly - connect( cbShowStipple, TQT_SIGNAL(clicked()), - this, TQT_SLOT(slotSelectionChanged()) ); - connect( cbShowGrabBar, TQT_SIGNAL(clicked()), - this, TQT_SLOT(slotSelectionChanged()) ); + connect( cbShowStipple, TQ_SIGNAL(clicked()), + this, TQ_SLOT(slotSelectionChanged()) ); + connect( cbShowGrabBar, TQ_SIGNAL(clicked()), + this, TQ_SLOT(slotSelectionChanged()) ); if (highcolor) - connect( cbUseGradients, TQT_SIGNAL(clicked()), - this, TQT_SLOT(slotSelectionChanged()) ); + connect( cbUseGradients, TQ_SIGNAL(clicked()), + this, TQ_SLOT(slotSelectionChanged()) ); // Make the widgets visible in twindecoration gb->show(); diff --git a/twin/clients/default/config/config.h b/twin/clients/default/config/config.h index daf38af95..d01459a13 100644 --- a/twin/clients/default/config/config.h +++ b/twin/clients/default/config/config.h @@ -19,7 +19,7 @@ class KDEDefaultConfig: public TQObject { - Q_OBJECT + TQ_OBJECT public: KDEDefaultConfig( TDEConfig* conf, TQWidget* parent ); diff --git a/twin/clients/default/kdedefault.cpp b/twin/clients/default/kdedefault.cpp index e6d742bd6..3513ca5df 100644 --- a/twin/clients/default/kdedefault.cpp +++ b/twin/clients/default/kdedefault.cpp @@ -267,11 +267,11 @@ void KDEDefaultHandler::createPixmaps() int i, x, y; titlePix = new TQPixmap(132, normalTitleHeight+2); TQBitmap mask(132, normalTitleHeight+2); - mask.fill(Qt::color0); + mask.fill(TQt::color0); p.begin(titlePix); maskPainter.begin(&mask); - maskPainter.setPen(Qt::color1); + maskPainter.setPen(TQt::color1); for(i=0, y=2; i < 9; ++i, y+=4) for(x=1; x <= 132; x+=3) { @@ -681,9 +681,9 @@ void KDEDefaultButton::drawButton(TQPainter *p) active).rgb() ) > 127; if (isMouseOver) - p->setPen( darkDeco ? Qt::darkGray : Qt::lightGray ); + p->setPen( darkDeco ? TQt::darkGray : TQt::lightGray ); else - p->setPen( darkDeco ? Qt::black : Qt::white ); + p->setPen( darkDeco ? TQt::black : TQt::white ); int xOff = (width()-10)/2; int yOff = (height()-10)/2; @@ -905,7 +905,7 @@ void KDEDefaultClient::paintEvent( TQPaintEvent* ) titleBuffer->resize( rightOffset-3, titleHeight+1 ); // Draw an outer black frame - p.setPen(Qt::black); + p.setPen(TQt::black); p.drawRect(x,y,w,h); // Draw part of the frame that is the titlebar color @@ -923,7 +923,7 @@ void KDEDefaultClient::paintEvent( TQPaintEvent* ) options()->color(ColorTitleBar, isActive() )); // Finish drawing the titlebar extension - p.setPen(Qt::black); + p.setPen(TQt::black); p.drawLine(x+1, leftFrameStart+borderWidth-4, x+borderWidth-2, leftFrameStart-1); p.setPen(g.mid()); p.drawLine(x+borderWidth-2, y+titleHeight+3, x+borderWidth-2, leftFrameStart-2); @@ -939,7 +939,7 @@ void KDEDefaultClient::paintEvent( TQPaintEvent* ) p.setPen(options()->color(ColorFrame, isActive())); TQPointArray a; - TQBrush brush( options()->color(ColorFrame, isActive()), Qt::SolidPattern ); + TQBrush brush( options()->color(ColorFrame, isActive()), TQt::SolidPattern ); p.setBrush( brush ); // use solid, yellow brush a.setPoints( 4, x+2, leftFrameStart+borderWidth-4, x+borderWidth-2, leftFrameStart, diff --git a/twin/clients/keramik/CMakeLists.txt b/twin/clients/keramik/CMakeLists.txt index 6eade7074..736d3dc3a 100644 --- a/twin/clients/keramik/CMakeLists.txt +++ b/twin/clients/keramik/CMakeLists.txt @@ -32,12 +32,12 @@ tde_create_translated_desktop( ) -##### twin3_keramik (module) #################### +##### twin_keramik (module) #################### set_source_files_properties( keramik.cpp PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/tiles.h ) -tde_add_kpart( twin3_keramik AUTOMOC +tde_add_kpart( twin_keramik AUTOMOC SOURCES keramik.cpp LINK tdecorations-shared tdeui-shared DESTINATION ${PLUGIN_INSTALL_DIR} diff --git a/twin/clients/keramik/Makefile.am b/twin/clients/keramik/Makefile.am index 2ed77cac7..3fe2162ed 100644 --- a/twin/clients/keramik/Makefile.am +++ b/twin/clients/keramik/Makefile.am @@ -10,13 +10,13 @@ embedtool_SOURCES = embedtool.cpp embedtool_LDADD = $(LIB_TQT) embedtool_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_TQT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_TDEIO) -ltdetexteditor -kde_module_LTLIBRARIES = twin3_keramik.la +kde_module_LTLIBRARIES = twin_keramik.la -twin3_keramik_la_SOURCES = keramik.cpp -twin3_keramik_la_COMPILE_FIRST = tiles.h -twin3_keramik_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module -twin3_keramik_la_LIBADD = $(LIB_TDEUI) ../../lib/libtdecorations.la -#twin3_keramik_la_LDFLAGS = $(all_libraries) -avoid-version -module $(KDE_RPATH) $(KDE_MT_LDFLAGS) +twin_keramik_la_SOURCES = keramik.cpp +twin_keramik_la_COMPILE_FIRST = tiles.h +twin_keramik_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module +twin_keramik_la_LIBADD = $(LIB_TDEUI) ../../lib/libtdecorations.la +#twin_keramik_la_LDFLAGS = $(all_libraries) -avoid-version -module $(KDE_RPATH) $(KDE_MT_LDFLAGS) METASOURCES = AUTO noinst_headers = keramik.h tiles.h diff --git a/twin/clients/keramik/config/config.cpp b/twin/clients/keramik/config/config.cpp index dfd5e20aa..98a46e308 100644 --- a/twin/clients/keramik/config/config.cpp +++ b/twin/clients/keramik/config/config.cpp @@ -55,10 +55,10 @@ KeramikConfig::KeramikConfig( TDEConfig* conf, TQWidget* parent ) c = new TDEConfig( "twinkeramikrc" ); ui = new KeramikConfigUI( parent ); - connect( ui->showAppIcons, TQT_SIGNAL(clicked()), TQT_SIGNAL(changed()) ); - connect( ui->smallCaptions, TQT_SIGNAL(clicked()), TQT_SIGNAL(changed()) ); - connect( ui->largeGrabBars, TQT_SIGNAL(clicked()), TQT_SIGNAL(changed()) ); - connect( ui->useShadowedText, TQT_SIGNAL(clicked()), TQT_SIGNAL(changed()) ); + connect( ui->showAppIcons, TQ_SIGNAL(clicked()), TQ_SIGNAL(changed()) ); + connect( ui->smallCaptions, TQ_SIGNAL(clicked()), TQ_SIGNAL(changed()) ); + connect( ui->largeGrabBars, TQ_SIGNAL(clicked()), TQ_SIGNAL(changed()) ); + connect( ui->useShadowedText, TQ_SIGNAL(clicked()), TQ_SIGNAL(changed()) ); load( conf ); ui->show(); diff --git a/twin/clients/keramik/config/config.h b/twin/clients/keramik/config/config.h index 721248a09..42f3a44e2 100644 --- a/twin/clients/keramik/config/config.h +++ b/twin/clients/keramik/config/config.h @@ -31,7 +31,7 @@ class KeramikConfig: public TQObject { - Q_OBJECT + TQ_OBJECT public: diff --git a/twin/clients/keramik/embedtool.cpp b/twin/clients/keramik/embedtool.cpp index 88cf93838..1cc56fe32 100644 --- a/twin/clients/keramik/embedtool.cpp +++ b/twin/clients/keramik/embedtool.cpp @@ -66,7 +66,7 @@ KeramikEmbedder::KeramikEmbedder() file = new TQFile( "tiles.h" ); file->open( IO_WriteOnly | IO_Truncate ); - stream.setDevice( TQT_TQIODEVICE(file) ); + stream.setDevice( file ); stream << "/*\n"; stream << " * Generated by embedtool 1.0 on " << datestring << endl; @@ -101,7 +101,7 @@ void KeramikEmbedder::embed( const char *name ) codename = codename.replace( TQRegExp("[^a-zA-Z0-9]"), "_" ); - stream << "\tstatic const QRgb " << codename << "_data[] = {" << endl << "\t\t"; + stream << "\tstatic const TQRgb " << codename << "_data[] = {" << endl << "\t\t"; stream.setf( TQTextStream::hex | TQTextStream::right ); stream.fill( '0' ); @@ -147,7 +147,7 @@ void KeramikEmbedder::writeIndex() stream << "\t\tint width;\n"; stream << "\t\tint height;\n"; stream << "\t\tbool alpha;\n"; - stream << "\t\tconst QRgb *data;\n"; + stream << "\t\tconst TQRgb *data;\n"; stream << "\t};\n\n"; uint i = 0; diff --git a/twin/clients/keramik/keramik.cpp b/twin/clients/keramik/keramik.cpp index 82a6aba83..942962693 100644 --- a/twin/clients/keramik/keramik.cpp +++ b/twin/clients/keramik/keramik.cpp @@ -411,18 +411,18 @@ void KeramikHandler::createPixmaps() } // Pretile the center & border tiles for optimal performance - pretile( activeTiles[ CaptionSmallCenter ], 64, Qt::Horizontal ); - pretile( activeTiles[ CaptionLargeCenter ], 64, Qt::Horizontal ); - pretile( activeTiles[ TitleCenter ], 64, Qt::Horizontal ); - pretile( activeTiles[ GrabBarCenter ], 128, Qt::Horizontal ); - pretile( activeTiles[ BorderLeft ], 128, Qt::Vertical ); - pretile( activeTiles[ BorderRight ], 128, Qt::Vertical ); - - pretile( inactiveTiles[ CaptionSmallCenter ], 64, Qt::Horizontal ); - pretile( inactiveTiles[ TitleCenter ], 64, Qt::Horizontal ); - pretile( inactiveTiles[ GrabBarCenter ], 128, Qt::Horizontal ); - pretile( inactiveTiles[ BorderLeft ], 128, Qt::Vertical ); - pretile( inactiveTiles[ BorderRight ], 128, Qt::Vertical ); + pretile( activeTiles[ CaptionSmallCenter ], 64, TQt::Horizontal ); + pretile( activeTiles[ CaptionLargeCenter ], 64, TQt::Horizontal ); + pretile( activeTiles[ TitleCenter ], 64, TQt::Horizontal ); + pretile( activeTiles[ GrabBarCenter ], 128, TQt::Horizontal ); + pretile( activeTiles[ BorderLeft ], 128, TQt::Vertical ); + pretile( activeTiles[ BorderRight ], 128, TQt::Vertical ); + + pretile( inactiveTiles[ CaptionSmallCenter ], 64, TQt::Horizontal ); + pretile( inactiveTiles[ TitleCenter ], 64, TQt::Horizontal ); + pretile( inactiveTiles[ GrabBarCenter ], 128, TQt::Horizontal ); + pretile( inactiveTiles[ BorderLeft ], 128, TQt::Vertical ); + pretile( inactiveTiles[ BorderRight ], 128, TQt::Vertical ); if (heightOffset > 0) { addHeight (heightOffset, activeTiles[TitleLeft]); @@ -541,12 +541,12 @@ void KeramikHandler::flip( TQPixmap *&pix1, TQPixmap *&pix2 ) } -void KeramikHandler::pretile( TQPixmap *&pix, int size, Qt::Orientation dir ) +void KeramikHandler::pretile( TQPixmap *&pix, int size, TQt::Orientation dir ) { TQPixmap *newpix; TQPainter p; - if ( dir == Qt::Horizontal ) + if ( dir == TQt::Horizontal ) newpix = new TQPixmap( size, pix->height() ); else newpix = new TQPixmap( pix->width(), size ); @@ -759,13 +759,13 @@ TQValueList< KeramikHandler::BorderSize > KeramikHandler::borderSizes() const KeramikButton::KeramikButton( KeramikClient* c, const char *name, Button btn, const TQString &tip, const int realizeBtns ) : TQButton( c->widget(), name ), - client( c ), button( btn ), hover( false ), lastbutton( Qt::NoButton ) + client( c ), button( btn ), hover( false ), lastbutton( TQt::NoButton ) { realizeButtons = realizeBtns; TQToolTip::add( this, tip ); // FRAME setBackgroundMode( NoBackground ); - setCursor( tqarrowCursor ); + setCursor( TQt::arrowCursor ); int size = clientHandler->roundButton()->height(); setFixedSize( size, size ); @@ -800,7 +800,7 @@ void KeramikButton::leaveEvent( TQEvent *e ) void KeramikButton::mousePressEvent( TQMouseEvent *e ) { lastbutton = e->button(); - TQMouseEvent me( e->type(), e->pos(), e->globalPos(), (e->button()&realizeButtons)?Qt::LeftButton:Qt::NoButton, e->state() ); + TQMouseEvent me( e->type(), e->pos(), e->globalPos(), (e->button()&realizeButtons)?TQt::LeftButton:TQt::NoButton, e->state() ); TQButton::mousePressEvent( &me ); } @@ -808,7 +808,7 @@ void KeramikButton::mousePressEvent( TQMouseEvent *e ) void KeramikButton::mouseReleaseEvent( TQMouseEvent *e ) { lastbutton = e->button(); - TQMouseEvent me( e->type(), e->pos(), e->globalPos(), (e->button()&realizeButtons)?Qt::LeftButton:Qt::NoButton, e->state() ); + TQMouseEvent me( e->type(), e->pos(), e->globalPos(), (e->button()&realizeButtons)?TQt::LeftButton:TQt::NoButton, e->state() ); TQButton::mouseReleaseEvent( &me ); } @@ -889,7 +889,7 @@ void KeramikButton::drawButton( TQPainter *p ) deco = NULL; } - p->setPen( Qt::black ); // ### hardcoded color + p->setPen( TQt::black ); // ### hardcoded color p->drawPixmap( (size-17)/2, (size-17)/2, *deco ); } @@ -907,8 +907,8 @@ KeramikClient::KeramikClient( KDecorationBridge* bridge, KDecorationFactory* fac void KeramikClient::init() { - connect( this, TQT_SIGNAL( keepAboveChanged( bool )), TQT_SLOT( keepAboveChange( bool ))); - connect( this, TQT_SIGNAL( keepBelowChanged( bool )), TQT_SLOT( keepBelowChange( bool ))); + connect( this, TQ_SIGNAL( keepAboveChanged( bool )), TQ_SLOT( keepAboveChange( bool ))); + connect( this, TQ_SIGNAL( keepBelowChanged( bool )), TQ_SLOT( keepBelowChange( bool ))); createMainWidget( (WFlags)(WStaticContents | WResizeNoErase | WRepaintNoErase) ); widget()->installEventFilter( this ); @@ -1050,8 +1050,8 @@ void KeramikClient::addButtons( TQBoxLayout *layout, const TQString &s ) case 'M' : if (!isModalSystemNotification()) { if ( !button[MenuButton] ) { - button[MenuButton] = new KeramikButton( this, "menu", MenuButton, i18n("Menu"), Qt::LeftButton|Qt::RightButton ); - connect( button[MenuButton], TQT_SIGNAL( pressed() ), TQT_SLOT( menuButtonPressed() ) ); + button[MenuButton] = new KeramikButton( this, "menu", MenuButton, i18n("Menu"), TQt::LeftButton|TQt::RightButton ); + connect( button[MenuButton], TQ_SIGNAL( pressed() ), TQ_SLOT( menuButtonPressed() ) ); layout->addWidget( button[MenuButton] ); } } @@ -1065,7 +1065,7 @@ void KeramikClient::addButtons( TQBoxLayout *layout, const TQString &s ) OnAllDesktopsButton, isOnAllDesktops()?i18n("Not on all desktops"):i18n("On all desktops") ); if(isOnAllDesktops()) button[OnAllDesktopsButton]->toggle(); - connect( button[OnAllDesktopsButton], TQT_SIGNAL( clicked() ), TQT_SLOT( toggleOnAllDesktops() ) ); + connect( button[OnAllDesktopsButton], TQ_SIGNAL( clicked() ), TQ_SLOT( toggleOnAllDesktops() ) ); layout->addWidget( button[OnAllDesktopsButton] ); } } @@ -1075,7 +1075,7 @@ void KeramikClient::addButtons( TQBoxLayout *layout, const TQString &s ) case 'H' : if ( !button[HelpButton] && providesContextHelp() ) { button[HelpButton] = new KeramikButton( this, "help", HelpButton, i18n("Help") ); - connect( button[HelpButton], TQT_SIGNAL( clicked() ), TQT_SLOT( showContextHelp() ) ); + connect( button[HelpButton], TQ_SIGNAL( clicked() ), TQ_SLOT( showContextHelp() ) ); layout->addWidget( button[HelpButton] ); } break; @@ -1084,7 +1084,7 @@ void KeramikClient::addButtons( TQBoxLayout *layout, const TQString &s ) case 'I' : if ( !button[MinButton] && isMinimizable() ) { button[MinButton] = new KeramikButton( this, "minimize", MinButton, i18n("Minimize") ); - connect( button[MinButton], TQT_SIGNAL( clicked() ), TQT_SLOT( minimize() ) ); + connect( button[MinButton], TQ_SIGNAL( clicked() ), TQ_SLOT( minimize() ) ); layout->addWidget( button[MinButton] ); } break; @@ -1092,8 +1092,8 @@ void KeramikClient::addButtons( TQBoxLayout *layout, const TQString &s ) // Maximize button case 'A' : if ( !button[MaxButton] && isMaximizable() ) { - button[MaxButton] = new KeramikButton( this, "maximize", MaxButton, i18n("Maximize"), Qt::LeftButton|Qt::MidButton|Qt::RightButton ); - connect( button[MaxButton], TQT_SIGNAL( clicked() ), TQT_SLOT( slotMaximize() ) ); + button[MaxButton] = new KeramikButton( this, "maximize", MaxButton, i18n("Maximize"), TQt::LeftButton|TQt::MidButton|TQt::RightButton ); + connect( button[MaxButton], TQ_SIGNAL( clicked() ), TQ_SLOT( slotMaximize() ) ); layout->addWidget( button[MaxButton] ); } break; @@ -1102,7 +1102,7 @@ void KeramikClient::addButtons( TQBoxLayout *layout, const TQString &s ) case 'X' : if ( !button[CloseButton] && isCloseable() ) { button[CloseButton] = new KeramikButton( this, "close", CloseButton, i18n("Close") ); - connect( button[CloseButton], TQT_SIGNAL( clicked() ), TQT_SLOT( closeWindow() ) ); + connect( button[CloseButton], TQ_SIGNAL( clicked() ), TQ_SLOT( closeWindow() ) ); layout->addWidget( button[CloseButton] ); } break; @@ -1111,7 +1111,7 @@ void KeramikClient::addButtons( TQBoxLayout *layout, const TQString &s ) case 'F' : if ( !button[AboveButton]) { button[AboveButton] = new KeramikButton( this, "above", AboveButton, i18n("Keep Above Others") ); - connect( button[AboveButton], TQT_SIGNAL( clicked() ), TQT_SLOT( slotAbove() ) ); + connect( button[AboveButton], TQ_SIGNAL( clicked() ), TQ_SLOT( slotAbove() ) ); layout->addWidget( button[AboveButton] ); } break; @@ -1120,7 +1120,7 @@ void KeramikClient::addButtons( TQBoxLayout *layout, const TQString &s ) case 'B' : if ( !button[BelowButton]) { button[BelowButton] = new KeramikButton( this, "below", BelowButton, i18n("Keep Below Others") ); - connect( button[BelowButton], TQT_SIGNAL( clicked() ), TQT_SLOT( slotBelow() ) ); + connect( button[BelowButton], TQ_SIGNAL( clicked() ), TQ_SLOT( slotBelow() ) ); layout->addWidget( button[BelowButton] ); } break; @@ -1130,7 +1130,7 @@ void KeramikClient::addButtons( TQBoxLayout *layout, const TQString &s ) if ( !button[ShadeButton] && isShadeable() ) { button[ShadeButton] = new KeramikButton( this, "shade", ShadeButton, isSetShade() ? i18n("Unshade") : i18n( "Shade" )); - connect( button[ShadeButton], TQT_SIGNAL( clicked() ), TQT_SLOT( slotShade() ) ); + connect( button[ShadeButton], TQ_SIGNAL( clicked() ), TQ_SLOT( slotShade() ) ); layout->addWidget( button[ShadeButton] ); } break; @@ -1277,7 +1277,7 @@ void KeramikClient::updateCaptionBuffer() TQRect tr = TQStyle::visualRect( TQRect(xpos, 1, captionRect.width() - xpos - 10, captionRect.height() - 4), captionBuffer.rect() ); - //p.setPen( Qt::red ); // debug + //p.setPen( TQt::red ); // debug //p.drawRect( tr ); // debug // Application icon @@ -1647,10 +1647,10 @@ void KeramikClient::resizeEvent( TQResizeEvent *e ) 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 ) widget()->update( 0, height() - dy + 1, width(), dy ); @@ -1670,7 +1670,7 @@ void KeramikClient::resizeEvent( TQResizeEvent *e ) void KeramikClient::mouseDoubleClickEvent( TQMouseEvent *e ) { - if ( e->button() == Qt::LeftButton + if ( e->button() == TQt::LeftButton && TQRect( 0, 0, width(), clientHandler->titleBarHeight( largeTitlebar ) ).contains( e->pos() ) ) titlebarDblClickOperation(); } @@ -1796,29 +1796,29 @@ TQSize KeramikClient::minimumSize() const bool KeramikClient::eventFilter( TQObject* o, TQEvent* e ) { - if ( TQT_BASE_OBJECT(o) != TQT_BASE_OBJECT(widget()) ) + if ( o != widget() ) return false; switch ( e->type() ) { case TQEvent::Resize: - resizeEvent( TQT_TQRESIZEEVENT( e ) ); + resizeEvent( static_cast<TQResizeEvent*>( e ) ); return true; case TQEvent::Paint: - paintEvent( TQT_TQPAINTEVENT( e ) ); + paintEvent( static_cast<TQPaintEvent*>( e ) ); return true; case TQEvent::MouseButtonDblClick: - mouseDoubleClickEvent( TQT_TQMOUSEEVENT( e ) ); + mouseDoubleClickEvent( static_cast<TQMouseEvent*>( e ) ); return true; case TQEvent::MouseButtonPress: - processMousePressEvent( TQT_TQMOUSEEVENT( e ) ); + processMousePressEvent( static_cast<TQMouseEvent*>( e ) ); return true; case TQEvent::Wheel: - wheelEvent( TQT_TQWHEELEVENT( e )); + wheelEvent( static_cast<TQWheelEvent*>( e )); return true; default: diff --git a/twin/clients/keramik/keramik.desktop b/twin/clients/keramik/keramik.desktop index fa51c6ea1..fde07b804 100644 --- a/twin/clients/keramik/keramik.desktop +++ b/twin/clients/keramik/keramik.desktop @@ -1,3 +1,3 @@ [Desktop Entry] Name=Keramik -X-TDE-Library=twin3_keramik +X-TDE-Library=twin_keramik diff --git a/twin/clients/keramik/keramik.h b/twin/clients/keramik/keramik.h index 54639dece..7369b5346 100644 --- a/twin/clients/keramik/keramik.h +++ b/twin/clients/keramik/keramik.h @@ -92,7 +92,7 @@ namespace Keramik { void addWidth (int width, TQPixmap *&pix, bool left, TQPixmap *bottomPix); void addHeight (int height, TQPixmap *&pix); void flip( TQPixmap *&, TQPixmap *& ); - void pretile( TQPixmap *&, int, Qt::Orientation ); + void pretile( TQPixmap *&, int, TQt::Orientation ); TQPixmap *composite( TQImage *, TQImage * ); TQImage *loadImage( const TQString &, const TQColor & ); TQPixmap *loadPixmap( const TQString &, const TQColor & ); @@ -114,7 +114,7 @@ namespace Keramik { class KeramikButton : public TQButton { public: - KeramikButton( KeramikClient *, const char *, Button, const TQString &, const int realizeBtns = Qt::LeftButton ); + KeramikButton( KeramikClient *, const char *, Button, const TQString &, const int realizeBtns = TQt::LeftButton ); ~KeramikButton(); ButtonState lastButton() const { return lastbutton; } @@ -137,7 +137,7 @@ namespace Keramik { class KeramikClient : public KDecoration { - Q_OBJECT + TQ_OBJECT public: diff --git a/twin/clients/kwmtheme/Makefile.am b/twin/clients/kwmtheme/Makefile.am index e9d3c36b8..6a201bccf 100644 --- a/twin/clients/kwmtheme/Makefile.am +++ b/twin/clients/kwmtheme/Makefile.am @@ -1,11 +1,11 @@ SUBDIRS=cli_installer INCLUDES = $(all_includes) -kde_module_LTLIBRARIES = twin3_kwmtheme.la +kde_module_LTLIBRARIES = twin_kwmtheme.la -twin3_kwmtheme_la_SOURCES = kwmthemeclient.cpp -twin3_kwmtheme_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module -twin3_kwmtheme_la_LIBADD = -ltdecorations +twin_kwmtheme_la_SOURCES = kwmthemeclient.cpp +twin_kwmtheme_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module +twin_kwmtheme_la_LIBADD = -ltdecorations METASOURCES = AUTO noinst_HEADERS = kwmthemeclient.h diff --git a/twin/clients/kwmtheme/kwmtheme.desktop b/twin/clients/kwmtheme/kwmtheme.desktop index 69e066f63..b18ce962b 100644 --- a/twin/clients/kwmtheme/kwmtheme.desktop +++ b/twin/clients/kwmtheme/kwmtheme.desktop @@ -1,3 +1,3 @@ [Desktop Entry] Name=KWM Theme -X-TDE-Library=twin3_kwmtheme +X-TDE-Library=twin_kwmtheme diff --git a/twin/clients/kwmtheme/kwmthemeclient.cpp b/twin/clients/kwmtheme/kwmthemeclient.cpp index 73c8feaca..defc8a3df 100644 --- a/twin/clients/kwmtheme/kwmthemeclient.cpp +++ b/twin/clients/kwmtheme/kwmthemeclient.cpp @@ -141,11 +141,11 @@ static void create_pixmaps() tmpStr = config->readEntry("TitleAlignment"); if(tmpStr == "right") - titleAlign = Qt::AlignRight | Qt::AlignVCenter; + titleAlign = TQt::AlignRight | TQt::AlignVCenter; else if(tmpStr == "middle") - titleAlign = Qt::AlignCenter; + titleAlign = TQt::AlignCenter; else - titleAlign = Qt::AlignLeft | Qt::AlignVCenter; + titleAlign = TQt::AlignLeft | TQt::AlignVCenter; titleSunken = config->readBoolEntry("TitleFrameShaded", true); // titleSunken = true; // is this fixed? titleTransparent = config->readBoolEntry("PixmapUnderTitleText", true); @@ -293,8 +293,8 @@ void KWMThemeClient::init() iconChange(); hb->addWidget(mnuBtn); mnuBtn->setFixedSize(20, 20); - connect(mnuBtn, TQT_SIGNAL(pressed()), this, - TQT_SLOT(menuButtonPressed())); + connect(mnuBtn, TQ_SIGNAL(pressed()), this, + TQ_SLOT(menuButtonPressed())); } else if(val == "Sticky"){ stickyBtn = new MyButton(widget(), "sticky"); @@ -303,7 +303,7 @@ void KWMThemeClient::init() stickyBtn->setPixmap(*pindownPix); else stickyBtn->setPixmap(*pinupPix); - connect(stickyBtn, TQT_SIGNAL( clicked() ), this, TQT_SLOT(toggleOnAllDesktops())); + connect(stickyBtn, TQ_SIGNAL( clicked() ), this, TQ_SLOT(toggleOnAllDesktops())); hb->addWidget(stickyBtn); stickyBtn->setFixedSize(20, 20); } @@ -311,7 +311,7 @@ void KWMThemeClient::init() btn = new MyButton(widget(), "iconify"); TQToolTip::add( btn, i18n("Minimize")); btn->setPixmap(*iconifyPix); - connect(btn, TQT_SIGNAL(clicked()), this, TQT_SLOT(minimize())); + connect(btn, TQ_SIGNAL(clicked()), this, TQ_SLOT(minimize())); hb->addWidget(btn); btn->setFixedSize(20, 20); } @@ -319,7 +319,7 @@ void KWMThemeClient::init() maxBtn = new MyButton(widget(), "max"); TQToolTip::add( maxBtn, i18n("Maximize")); maxBtn->setPixmap(*maxPix); - connect(maxBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(maximize())); + connect(maxBtn, TQ_SIGNAL(clicked()), this, TQ_SLOT(maximize())); hb->addWidget(maxBtn); maxBtn->setFixedSize(20, 20); } @@ -327,7 +327,7 @@ void KWMThemeClient::init() btn = new MyButton(widget(), "close"); TQToolTip::add( btn, i18n("Close")); btn->setPixmap(*closePix); - connect(btn, TQT_SIGNAL(clicked()), this, TQT_SLOT(closeWindow())); + connect(btn, TQ_SIGNAL(clicked()), this, TQ_SLOT(closeWindow())); hb->addWidget(btn); btn->setFixedSize(20, 20); } diff --git a/twin/clients/kwmtheme/kwmthemeclient.h b/twin/clients/kwmtheme/kwmthemeclient.h index 58db3d14f..f611e89d2 100644 --- a/twin/clients/kwmtheme/kwmthemeclient.h +++ b/twin/clients/kwmtheme/kwmthemeclient.h @@ -24,7 +24,7 @@ protected: class KWMThemeClient : public KDecoration { - Q_OBJECT + TQ_OBJECT public: KWMThemeClient( KDecorationBridge* b, KDecorationFactory* f ); ~KWMThemeClient(){;} diff --git a/twin/clients/laptop/CMakeLists.txt b/twin/clients/laptop/CMakeLists.txt index 479de7a84..9fe25af3a 100644 --- a/twin/clients/laptop/CMakeLists.txt +++ b/twin/clients/laptop/CMakeLists.txt @@ -30,9 +30,9 @@ tde_create_translated_desktop( ) -##### twin3_laptop (module) ##################### +##### twin_laptop (module) ##################### -tde_add_kpart( twin3_laptop AUTOMOC +tde_add_kpart( twin_laptop AUTOMOC SOURCES laptopclient.cpp LINK tdecorations-shared DESTINATION ${PLUGIN_INSTALL_DIR} diff --git a/twin/clients/laptop/Makefile.am b/twin/clients/laptop/Makefile.am index ccf1d359b..1788a8691 100644 --- a/twin/clients/laptop/Makefile.am +++ b/twin/clients/laptop/Makefile.am @@ -1,11 +1,11 @@ INCLUDES = -I$(srcdir)/../../lib $(all_includes) -kde_module_LTLIBRARIES = twin3_laptop.la +kde_module_LTLIBRARIES = twin_laptop.la -twin3_laptop_la_SOURCES = laptopclient.cpp -twin3_laptop_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module -twin3_laptop_la_LIBADD = ../../lib/libtdecorations.la +twin_laptop_la_SOURCES = laptopclient.cpp +twin_laptop_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module +twin_laptop_la_LIBADD = ../../lib/libtdecorations.la METASOURCES = AUTO noinst_HEADERS = laptopclient.h diff --git a/twin/clients/laptop/laptop.desktop b/twin/clients/laptop/laptop.desktop index 27f569634..060b0cce2 100644 --- a/twin/clients/laptop/laptop.desktop +++ b/twin/clients/laptop/laptop.desktop @@ -1,3 +1,3 @@ [Desktop Entry] Name=Laptop -X-TDE-Library=twin3_laptop +X-TDE-Library=twin_laptop diff --git a/twin/clients/laptop/laptopclient.cpp b/twin/clients/laptop/laptopclient.cpp index 114b03f4d..30fb76b3a 100644 --- a/twin/clients/laptop/laptopclient.cpp +++ b/twin/clients/laptop/laptopclient.cpp @@ -121,11 +121,11 @@ static void create_pixmaps() int i, x, y; titlePix = new TQPixmap(33, 12); TQBitmap mask(33, 12); - mask.fill(Qt::color0); + mask.fill(TQt::color0); p.begin(titlePix); maskPainter.begin(&mask); - maskPainter.setPen(Qt::color1); + maskPainter.setPen(TQt::color1); for(i=0, y=2; i < 3; ++i, y+=4){ for(x=1; x <= 33; x+=3){ p.setPen(options()->color(KDecoration::ColorTitleBar, true).light(150)); @@ -221,9 +221,9 @@ static void create_pixmaps() drawButtonFrame(iBtnDownPix2, g, true); if(tqGray(options()->color(KDecoration::ColorButtonBg, true).rgb()) > 128) - btnForeground = Qt::black; + btnForeground = TQt::black; else - btnForeground = Qt::white; + btnForeground = TQt::white; } static void delete_pixmaps() @@ -290,7 +290,7 @@ void LaptopButton::setBitmap(const unsigned char *bitmap) deco = TQBitmap(8, 8, bitmap, true); else { deco = TQBitmap(8,8); - deco.fill(Qt::color0); + deco.fill(TQt::color0); } deco.setMask(deco); repaint(); @@ -472,7 +472,7 @@ void LaptopClient::paintEvent( TQPaintEvent* ) TQColorGroup g = options()->colorGroup(KDecoration::ColorFrame, isActive()); TQRect r(widget()->rect()); - p.setPen(Qt::black); + p.setPen(TQt::black); p.drawRect(r); // fill mid frame... diff --git a/twin/clients/modernsystem/CMakeLists.txt b/twin/clients/modernsystem/CMakeLists.txt index 5bb92031e..166e3aae5 100644 --- a/twin/clients/modernsystem/CMakeLists.txt +++ b/twin/clients/modernsystem/CMakeLists.txt @@ -31,9 +31,9 @@ tde_create_translated_desktop( ) -##### twin3_modernsys (module) ################## +##### twin_modernsys (module) ################## -tde_add_kpart( twin3_modernsys +tde_add_kpart( twin_modernsys SOURCES modernsys.cpp LINK tdecorations-shared DESTINATION ${PLUGIN_INSTALL_DIR} diff --git a/twin/clients/modernsystem/Makefile.am b/twin/clients/modernsystem/Makefile.am index e4c21d7a3..902669685 100644 --- a/twin/clients/modernsystem/Makefile.am +++ b/twin/clients/modernsystem/Makefile.am @@ -3,11 +3,11 @@ INCLUDES = -I$(srcdir)/../../lib $(all_includes) SUBDIRS = config -kde_module_LTLIBRARIES = twin3_modernsys.la +kde_module_LTLIBRARIES = twin_modernsys.la -twin3_modernsys_la_SOURCES = modernsys.cpp -twin3_modernsys_la_LIBADD = ../../lib/libtdecorations.la -twin3_modernsys_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module +twin_modernsys_la_SOURCES = modernsys.cpp +twin_modernsys_la_LIBADD = ../../lib/libtdecorations.la +twin_modernsys_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module METASOURCES = AUTO noinst_HEADERS = modernsys.h diff --git a/twin/clients/modernsystem/config/config.cpp b/twin/clients/modernsystem/config/config.cpp index 18d6870f7..187278d43 100644 --- a/twin/clients/modernsystem/config/config.cpp +++ b/twin/clients/modernsystem/config/config.cpp @@ -44,15 +44,15 @@ ModernSysConfig::ModernSysConfig(TDEConfig* conf, TQWidget* parent) : TQObject(p "easier, especially for trackballs and other mouse replacements " "on laptops.")); layout->addMultiCellWidget(cbShowHandle, 0, 0, 0, 1); - connect(cbShowHandle, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotSelectionChanged())); + connect(cbShowHandle, TQ_SIGNAL(clicked()), this, TQ_SLOT(slotSelectionChanged())); sliderBox = new TQVBox(handleBox); - handleSizeSlider = new TQSlider(0, 4, 1, 0, Qt::Horizontal, sliderBox); + handleSizeSlider = new TQSlider(0, 4, 1, 0, TQt::Horizontal, sliderBox); TQWhatsThis::add(handleSizeSlider, i18n("Here you can change the size of the resize handle.")); handleSizeSlider->setTickInterval(1); handleSizeSlider->setTickmarks(TQSlider::Below); - connect(handleSizeSlider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotSelectionChanged())); + connect(handleSizeSlider, TQ_SIGNAL(valueChanged(int)), this, TQ_SLOT(slotSelectionChanged())); hbox = new TQHBox(sliderBox); hbox->setSpacing(6); diff --git a/twin/clients/modernsystem/config/config.h b/twin/clients/modernsystem/config/config.h index 20ce5539e..004dd9855 100644 --- a/twin/clients/modernsystem/config/config.h +++ b/twin/clients/modernsystem/config/config.h @@ -10,7 +10,7 @@ class ModernSysConfig : public TQObject { - Q_OBJECT + TQ_OBJECT public: ModernSysConfig(TDEConfig* conf, TQWidget* parent); diff --git a/twin/clients/modernsystem/modernsys.cpp b/twin/clients/modernsystem/modernsys.cpp index f2d31ed11..94615b190 100644 --- a/twin/clients/modernsystem/modernsys.cpp +++ b/twin/clients/modernsystem/modernsys.cpp @@ -185,9 +185,9 @@ static void create_pixmaps() if(tqGray(btnColor.background().rgb()) < 150) - buttonFg = new TQColor(Qt::white); + buttonFg = new TQColor(TQt::white); else - buttonFg = new TQColor(Qt::black); + buttonFg = new TQColor(TQt::black); delete lcDark1; delete lcDark2; @@ -342,7 +342,7 @@ void ModernButton::setBitmap(const unsigned char *bitmap) deco = TQBitmap(8, 8, bitmap, true); else { deco = TQBitmap(8,8); - deco.fill(Qt::color0); + deco.fill(TQt::color0); } deco.setMask(deco); } @@ -631,7 +631,7 @@ void ModernSys::paintEvent( TQPaintEvent* ) p.drawLine(width()-hw, height()-hs-1, width()-4, height()-hs-1); p.drawLine(width()-hs-1, height()-hw, width()-hs-1, height()-4); - p.setPen(Qt::black); + p.setPen(TQt::black); p.drawRect(0, 0, w, h); // handle outline @@ -640,7 +640,7 @@ void ModernSys::paintEvent( TQPaintEvent* ) p.drawLine(width()-hs, height()-2, width()-2, height()-2); p.drawLine(width()-hs, height()-hw, width()-hs, height()-2); } else { - p.setPen(Qt::black); + p.setPen(TQt::black); p.drawRect(0, 0, w, h); } } diff --git a/twin/clients/modernsystem/modernsystem.desktop b/twin/clients/modernsystem/modernsystem.desktop index 85a301733..76601f9f2 100644 --- a/twin/clients/modernsystem/modernsystem.desktop +++ b/twin/clients/modernsystem/modernsystem.desktop @@ -1,3 +1,3 @@ [Desktop Entry] Name=Modern System -X-TDE-Library=twin3_modernsys +X-TDE-Library=twin_modernsys diff --git a/twin/clients/plastik/CMakeLists.txt b/twin/clients/plastik/CMakeLists.txt index 695468994..8e920bdc2 100644 --- a/twin/clients/plastik/CMakeLists.txt +++ b/twin/clients/plastik/CMakeLists.txt @@ -34,9 +34,9 @@ tde_create_translated_desktop( ) -##### twin3_plastik (module) #################### +##### twin_plastik (module) #################### -tde_add_kpart( twin3_plastik AUTOMOC +tde_add_kpart( twin_plastik AUTOMOC SOURCES plastik.cpp plastikclient.cpp plastikbutton.cpp misc.cpp LINK tdecorations-shared tdeui-shared DESTINATION ${PLUGIN_INSTALL_DIR} diff --git a/twin/clients/plastik/Makefile.am b/twin/clients/plastik/Makefile.am index c1757891d..0afee676a 100644 --- a/twin/clients/plastik/Makefile.am +++ b/twin/clients/plastik/Makefile.am @@ -9,11 +9,11 @@ INCLUDES = -I$(srcdir)/../../lib $(all_includes) twindir = $(kde_datadir)/twin/ twin_DATA = plastik.desktop -kde_module_LTLIBRARIES = twin3_plastik.la -twin3_plastik_la_SOURCES = plastik.cpp plastikclient.cpp plastikbutton.cpp misc.cpp -twin3_plastik_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module -twin3_plastik_la_LIBADD = $(LIB_TDEUI) ../../lib/libtdecorations.la -twin3_plastik_la_METASOURCES = AUTO +kde_module_LTLIBRARIES = twin_plastik.la +twin_plastik_la_SOURCES = plastik.cpp plastikclient.cpp plastikbutton.cpp misc.cpp +twin_plastik_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module +twin_plastik_la_LIBADD = $(LIB_TDEUI) ../../lib/libtdecorations.la +twin_plastik_la_METASOURCES = AUTO -DISTCLEANFILES = $(twin3_plastik_la_METASOURCES) +DISTCLEANFILES = $(twin_plastik_la_METASOURCES) diff --git a/twin/clients/plastik/config/config.cpp b/twin/clients/plastik/config/config.cpp index 04658796c..81192f699 100644 --- a/twin/clients/plastik/config/config.cpp +++ b/twin/clients/plastik/config/config.cpp @@ -49,16 +49,16 @@ PlastikConfig::PlastikConfig(TDEConfig* config, TQWidget* parent) load(config); // setup the connections - connect(m_dialog->titleAlign, TQT_SIGNAL(clicked(int)), - this, TQT_SIGNAL(changed())); - connect(m_dialog->animateButtons, TQT_SIGNAL(toggled(bool)), - this, TQT_SIGNAL(changed())); - connect(m_dialog->menuClose, TQT_SIGNAL(toggled(bool)), - this, TQT_SIGNAL(changed())); - connect(m_dialog->titleShadow, TQT_SIGNAL(toggled(bool)), - this, TQT_SIGNAL(changed())); - connect(m_dialog->coloredBorder, TQT_SIGNAL(toggled(bool)), - this, TQT_SIGNAL(changed())); + connect(m_dialog->titleAlign, TQ_SIGNAL(clicked(int)), + this, TQ_SIGNAL(changed())); + connect(m_dialog->animateButtons, TQ_SIGNAL(toggled(bool)), + this, TQ_SIGNAL(changed())); + connect(m_dialog->menuClose, TQ_SIGNAL(toggled(bool)), + this, TQ_SIGNAL(changed())); + connect(m_dialog->titleShadow, TQ_SIGNAL(toggled(bool)), + this, TQ_SIGNAL(changed())); + connect(m_dialog->coloredBorder, TQ_SIGNAL(toggled(bool)), + this, TQ_SIGNAL(changed())); } PlastikConfig::~PlastikConfig() diff --git a/twin/clients/plastik/config/config.h b/twin/clients/plastik/config/config.h index 73231c50f..d83ebf149 100644 --- a/twin/clients/plastik/config/config.h +++ b/twin/clients/plastik/config/config.h @@ -32,7 +32,7 @@ class ConfigDialog; class PlastikConfig : public TQObject { - Q_OBJECT + TQ_OBJECT public: PlastikConfig(TDEConfig* config, TQWidget* parent); ~PlastikConfig(); diff --git a/twin/clients/plastik/config/configdialog.ui b/twin/clients/plastik/config/configdialog.ui index f751d8024..505d91b06 100644 --- a/twin/clients/plastik/config/configdialog.ui +++ b/twin/clients/plastik/config/configdialog.ui @@ -66,9 +66,6 @@ <property name="text"> <string>Colored window border</string> </property> - <property name="accel"> - <string></string> - </property> <property name="whatsThis" stdset="0"> <string>Check this option if the window border should be painted in the titlebar color. Otherwise it will be painted in the background color.</string> </property> diff --git a/twin/clients/plastik/misc.cpp b/twin/clients/plastik/misc.cpp index 1b259d383..053cf15ea 100644 --- a/twin/clients/plastik/misc.cpp +++ b/twin/clients/plastik/misc.cpp @@ -54,8 +54,8 @@ TQColor alphaBlendColors(const TQColor &bgColor, const TQColor &fgColor, const i { // normal button... - QRgb rgb = bgColor.rgb(); - QRgb rgb_b = fgColor.rgb(); + TQRgb rgb = bgColor.rgb(); + TQRgb rgb_b = fgColor.rgb(); int alpha = a; if(alpha>255) alpha = 255; if(alpha<0) alpha = 0; diff --git a/twin/clients/plastik/plastik.cpp b/twin/clients/plastik/plastik.cpp index b5cdeb85b..b5a4808d7 100644 --- a/twin/clients/plastik/plastik.cpp +++ b/twin/clients/plastik/plastik.cpp @@ -185,9 +185,9 @@ void PlastikHandler::readConfig() m_titleHeightTool++; TQString value = config.readEntry("TitleAlignment", "AlignLeft"); - if (value == "AlignLeft") m_titleAlign = Qt::AlignLeft; - else if (value == "AlignHCenter") m_titleAlign = Qt::AlignHCenter; - else if (value == "AlignRight") m_titleAlign = Qt::AlignRight; + if (value == "AlignLeft") m_titleAlign = TQt::AlignLeft; + else if (value == "AlignHCenter") m_titleAlign = TQt::AlignHCenter; + else if (value == "AlignRight") m_titleAlign = TQt::AlignRight; m_coloredBorder = config.readBoolEntry("ColoredBorder", true); m_animateButtons = config.readBoolEntry("AnimateButtons", true); @@ -210,27 +210,27 @@ TQColor PlastikHandler::getColor(KWinPlastik::ColorType type, const bool active) break; case ShadeTitleLight: return alphaBlendColors(KDecoration::options()->color(ColorTitleBar, active), - Qt::white, active?205:215); + TQt::white, active?205:215); break; case ShadeTitleDark: return alphaBlendColors(KDecoration::options()->color(ColorTitleBar, active), - Qt::black, active?205:215); + TQt::black, active?205:215); break; case Border: return KDecoration::options()->color(ColorFrame, active); case TitleFont: return KDecoration::options()->color(ColorFont, active); default: - return Qt::black; + return TQt::black; } } -void PlastikHandler::pretile( TQPixmap *&pix, int size, Qt::Orientation dir ) const +void PlastikHandler::pretile( TQPixmap *&pix, int size, TQt::Orientation dir ) const { TQPixmap *newpix; TQPainter p; - if ( dir == Qt::Horizontal ) + if ( dir == TQt::Horizontal ) newpix = new TQPixmap( size, pix->height() ); else newpix = new TQPixmap( pix->width(), size ); @@ -300,7 +300,7 @@ const TQPixmap &PlastikHandler::pixmap(Pixmaps type, bool active, bool toolWindo painter.end(); } - pretile(pm, 64, Qt::Horizontal); + pretile(pm, 64, TQt::Horizontal); break; } @@ -399,7 +399,7 @@ const TQPixmap &PlastikHandler::pixmap(Pixmaps type, bool active, bool toolWindo painter.end(); - pretile(pm, 64, Qt::Vertical); + pretile(pm, 64, TQt::Vertical); break; } @@ -433,7 +433,7 @@ const TQPixmap &PlastikHandler::pixmap(Pixmaps type, bool active, bool toolWindo } painter.end(); - pretile(pm, 64, Qt::Vertical); + pretile(pm, 64, TQt::Vertical); break; } @@ -523,7 +523,7 @@ const TQPixmap &PlastikHandler::pixmap(Pixmaps type, bool active, bool toolWindo painter.drawPoint(0, h-1); painter.end(); - pretile(pm, 64, Qt::Horizontal); + pretile(pm, 64, TQt::Horizontal); break; } diff --git a/twin/clients/plastik/plastik.desktop b/twin/clients/plastik/plastik.desktop index cbe609785..564f33e5c 100644 --- a/twin/clients/plastik/plastik.desktop +++ b/twin/clients/plastik/plastik.desktop @@ -1,3 +1,3 @@ [Desktop Entry] Name=Plastik -X-TDE-Library=twin3_plastik +X-TDE-Library=twin_plastik diff --git a/twin/clients/plastik/plastik.h b/twin/clients/plastik/plastik.h index a4c1bc5b7..558ac848a 100644 --- a/twin/clients/plastik/plastik.h +++ b/twin/clients/plastik/plastik.h @@ -73,7 +73,7 @@ enum ButtonIcon { class PlastikHandler: public TQObject, public KDecorationFactory { - Q_OBJECT + TQ_OBJECT public: PlastikHandler(); ~PlastikHandler(); @@ -93,7 +93,7 @@ public: int borderSize() { return m_borderSize; } bool animateButtons() { return m_animateButtons; } bool menuClose() { return m_menuClose; } - TQ_Alignment titleAlign() { return m_titleAlign; } + TQt::AlignmentFlags titleAlign() { return m_titleAlign; } bool reverseLayout() { return m_reverse; } TQColor getColor(KWinPlastik::ColorType type, const bool active = true); @@ -101,7 +101,7 @@ public: private: void readConfig(); - void pretile(TQPixmap *&pix, int size, Qt::Orientation dir) const; + void pretile(TQPixmap *&pix, int size, TQt::Orientation dir) const; bool m_coloredBorder; bool m_titleShadow; @@ -113,7 +113,7 @@ private: int m_titleHeightTool; TQFont m_titleFont; TQFont m_titleFontTool; - TQ_Alignment m_titleAlign; + TQt::AlignmentFlags m_titleAlign; // pixmap cache TQPixmap *m_pixmaps[2][2][NumPixmaps]; // button pixmaps have normal+pressed state... diff --git a/twin/clients/plastik/plastikbutton.cpp b/twin/clients/plastik/plastikbutton.cpp index 3a097be15..3f3f81f62 100644 --- a/twin/clients/plastik/plastikbutton.cpp +++ b/twin/clients/plastik/plastikbutton.cpp @@ -51,7 +51,7 @@ PlastikButton::PlastikButton(ButtonType type, PlastikClient *parent, const char // no need to reset here as the button will be resetted on first resize. animTmr = new TQTimer(this); - connect(animTmr, TQT_SIGNAL(timeout() ), this, TQT_SLOT(animate() ) ); + connect(animTmr, TQ_SIGNAL(timeout() ), this, TQ_SLOT(animate() ) ); animProgress = 0; } @@ -170,17 +170,17 @@ void PlastikButton::drawButton(TQPainter *painter) if(type() == CloseButton) { highlightColor = TQColor(255,64,0); } else { - highlightColor = Qt::white; + highlightColor = TQt::white; } TQColor contourTop = alphaBlendColors(Handler()->getColor(TitleGradient2, active), - Qt::black, 215); + TQt::black, 215); TQColor contourBottom = alphaBlendColors(Handler()->getColor(TitleGradient3, active), - Qt::black, 215); + TQt::black, 215); TQColor sourfaceTop = alphaBlendColors(Handler()->getColor(TitleGradient2, active), - Qt::white, 210); + TQt::white, 210); TQColor sourfaceBottom = alphaBlendColors(Handler()->getColor(TitleGradient3, active), - Qt::white, 210); + TQt::white, 210); int highlightAlpha = static_cast<int>(255-((60/static_cast<double>(ANIMATIONSTEPS))* static_cast<double>(animProgress) ) ); @@ -190,10 +190,10 @@ void PlastikButton::drawButton(TQPainter *painter) sourfaceBottom = alphaBlendColors(sourfaceBottom, highlightColor, highlightAlpha); if (isDown() ) { - contourTop = alphaBlendColors(contourTop, Qt::black, 200); - contourBottom = alphaBlendColors(contourBottom, Qt::black, 200); - sourfaceTop = alphaBlendColors(sourfaceTop, Qt::black, 200); - sourfaceBottom = alphaBlendColors(sourfaceBottom, Qt::black, 200); + contourTop = alphaBlendColors(contourTop, TQt::black, 200); + contourBottom = alphaBlendColors(contourBottom, TQt::black, 200); + sourfaceTop = alphaBlendColors(sourfaceTop, TQt::black, 200); + sourfaceBottom = alphaBlendColors(sourfaceBottom, TQt::black, 200); } TQPixmap buffer; @@ -291,10 +291,10 @@ TQBitmap IconEngine::icon(ButtonIcon icon, int size) --size; TQBitmap bitmap(size,size); - bitmap.fill(Qt::color0); + bitmap.fill(TQt::color0); TQPainter p(&bitmap); - p.setPen(Qt::color1); + p.setPen(TQt::color1); TQRect r = bitmap.rect(); diff --git a/twin/clients/plastik/plastikbutton.h b/twin/clients/plastik/plastikbutton.h index dbebcf63f..6deaa56f6 100644 --- a/twin/clients/plastik/plastikbutton.h +++ b/twin/clients/plastik/plastikbutton.h @@ -37,7 +37,7 @@ class PlastikClient; class PlastikButton : public KCommonDecorationButton { - Q_OBJECT + TQ_OBJECT public: PlastikButton(ButtonType type, PlastikClient *parent, const char *name); ~PlastikButton(); @@ -65,7 +65,7 @@ private: /** * This class creates bitmaps which can be used as icons on buttons. The icons * are "hardcoded". - * Over the previous "Gimp->xpm->QImage->recolor->SmoothScale->TQPixmap" solution + * Over the previous "Gimp->xpm->TQImage->recolor->SmoothScale->TQPixmap" solution * it has the important advantage that icons are more scalable and at the same * time sharp and not blurred. */ diff --git a/twin/clients/plastik/plastikclient.cpp b/twin/clients/plastik/plastikclient.cpp index 31c9e2ad9..bb2c465a6 100644 --- a/twin/clients/plastik/plastikclient.cpp +++ b/twin/clients/plastik/plastikclient.cpp @@ -394,7 +394,7 @@ TQRect PlastikClient::captionRect() const buttonsLeftWidth() - buttonsRightWidth() - marginLeft - marginRight; - TQ_Alignment a = Handler()->titleAlign(); + TQt::AlignmentFlags a = Handler()->titleAlign(); int tX, tW; // position/width of the title buffer if (caption.width() > titleWidth) { @@ -402,10 +402,10 @@ TQRect PlastikClient::captionRect() const } else { tW = caption.width(); } - if (a == Qt::AlignLeft || (caption.width() > titleWidth) ) { + if (a == TQt::AlignLeft || (caption.width() > titleWidth) ) { // Align left tX = titleLeft; - } else if (a == Qt::AlignHCenter) { + } else if (a == TQt::AlignHCenter) { // Align center tX = titleLeft+(titleWidth- caption.width() )/2; } else { diff --git a/twin/clients/quartz/CMakeLists.txt b/twin/clients/quartz/CMakeLists.txt index 49d56d419..70d9fb49a 100644 --- a/twin/clients/quartz/CMakeLists.txt +++ b/twin/clients/quartz/CMakeLists.txt @@ -32,9 +32,9 @@ tde_create_translated_desktop( ) -##### twin3_quartz (module) ##################### +##### twin_quartz (module) ##################### -tde_add_kpart( twin3_quartz AUTOMOC +tde_add_kpart( twin_quartz AUTOMOC SOURCES quartz.cpp LINK tdecorations-shared tdeui-shared DESTINATION ${PLUGIN_INSTALL_DIR} diff --git a/twin/clients/quartz/Makefile.am b/twin/clients/quartz/Makefile.am index 3a5709773..ae69a53a6 100644 --- a/twin/clients/quartz/Makefile.am +++ b/twin/clients/quartz/Makefile.am @@ -3,11 +3,11 @@ INCLUDES = -I$(srcdir)/../../lib $(all_includes) SUBDIRS = . config -kde_module_LTLIBRARIES = twin3_quartz.la +kde_module_LTLIBRARIES = twin_quartz.la -twin3_quartz_la_SOURCES = quartz.cpp -twin3_quartz_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module -twin3_quartz_la_LIBADD = $(LIB_TDEUI) ../../lib/libtdecorations.la +twin_quartz_la_SOURCES = quartz.cpp +twin_quartz_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module +twin_quartz_la_LIBADD = $(LIB_TDEUI) ../../lib/libtdecorations.la METASOURCES = AUTO noinst_HEADERS = quartz.h diff --git a/twin/clients/quartz/config/config.cpp b/twin/clients/quartz/config/config.cpp index 70dc87965..106ea28dc 100644 --- a/twin/clients/quartz/config/config.cpp +++ b/twin/clients/quartz/config/config.cpp @@ -49,8 +49,8 @@ QuartzConfig::QuartzConfig( TDEConfig* conf, TQWidget* parent ) load( conf ); // Ensure we track user changes properly - connect( cbColorBorder, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotSelectionChanged()) ); - connect( cbExtraSmall, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotSelectionChanged()) ); + connect( cbColorBorder, TQ_SIGNAL(clicked()), this, TQ_SLOT(slotSelectionChanged()) ); + connect( cbExtraSmall, TQ_SIGNAL(clicked()), this, TQ_SLOT(slotSelectionChanged()) ); // Make the widgets visible in twindecoration gb->show(); diff --git a/twin/clients/quartz/config/config.h b/twin/clients/quartz/config/config.h index e43c18179..a468d8703 100644 --- a/twin/clients/quartz/config/config.h +++ b/twin/clients/quartz/config/config.h @@ -16,7 +16,7 @@ class QuartzConfig: public TQObject { - Q_OBJECT + TQ_OBJECT public: QuartzConfig( TDEConfig* conf, TQWidget* parent ); diff --git a/twin/clients/quartz/quartz.cpp b/twin/clients/quartz/quartz.cpp index b9762551c..dff79ff4b 100644 --- a/twin/clients/quartz/quartz.cpp +++ b/twin/clients/quartz/quartz.cpp @@ -463,7 +463,7 @@ void QuartzButton::drawButton(TQPainter *p) { int xOff = (width()-10)/2; int yOff = (height()-10)/2; - p->setPen( Qt::black ); + p->setPen( TQt::black ); p->drawPixmap(isDown() ? xOff+2: xOff+1, isDown() ? yOff+2 : yOff+1, *deco); p->setPen( KDecoration::options()->color(KDecoration::ColorButtonBg, decoration()->isActive()).light(150) ); p->drawPixmap(isDown() ? xOff+1: xOff, isDown() ? yOff+1 : yOff, *deco); @@ -723,7 +723,7 @@ void QuartzClient::paintEvent( TQPaintEvent* ) // Draw the title bar. // =================== int r_x, r_y, r_x2, r_y2; - TQT_TQRECT_OBJECT(widget()->rect()).coords(&r_x, &r_y, &r_x2, &r_y2); + widget()->rect().coords(&r_x, &r_y, &r_x2, &r_y2); const int titleEdgeLeft = layoutMetric(LM_TitleEdgeLeft); const int titleEdgeTop = layoutMetric(LM_TitleEdgeTop); const int titleEdgeRight = layoutMetric(LM_TitleEdgeRight); diff --git a/twin/clients/quartz/quartz.desktop b/twin/clients/quartz/quartz.desktop index 8083eec1f..ef69ddda3 100644 --- a/twin/clients/quartz/quartz.desktop +++ b/twin/clients/quartz/quartz.desktop @@ -1,3 +1,3 @@ [Desktop Entry] Name=Quartz -X-TDE-Library=twin3_quartz +X-TDE-Library=twin_quartz diff --git a/twin/clients/quartz/quartz.h b/twin/clients/quartz/quartz.h index d0ab64faf..d0db8b103 100644 --- a/twin/clients/quartz/quartz.h +++ b/twin/clients/quartz/quartz.h @@ -30,7 +30,7 @@ class QuartzClient; class QuartzHandler: public TQObject, public KDecorationFactory { - Q_OBJECT + TQ_OBJECT public: QuartzHandler(); ~QuartzHandler(); diff --git a/twin/clients/redmond/CMakeLists.txt b/twin/clients/redmond/CMakeLists.txt index 7240233a0..17a13bac9 100644 --- a/twin/clients/redmond/CMakeLists.txt +++ b/twin/clients/redmond/CMakeLists.txt @@ -30,9 +30,9 @@ tde_create_translated_desktop( ) -##### twin3_redmond (module) #################### +##### twin_redmond (module) #################### -tde_add_kpart( twin3_redmond AUTOMOC +tde_add_kpart( twin_redmond AUTOMOC SOURCES redmond.cpp LINK tdecorations-shared tdecore-shared DESTINATION ${PLUGIN_INSTALL_DIR} diff --git a/twin/clients/redmond/Makefile.am b/twin/clients/redmond/Makefile.am index 39985f347..c00af257e 100644 --- a/twin/clients/redmond/Makefile.am +++ b/twin/clients/redmond/Makefile.am @@ -1,11 +1,11 @@ INCLUDES = -I$(srcdir)/../../lib $(all_includes) -kde_module_LTLIBRARIES = twin3_redmond.la +kde_module_LTLIBRARIES = twin_redmond.la -twin3_redmond_la_SOURCES = redmond.cpp -twin3_redmond_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module -twin3_redmond_la_LIBADD = $(LIB_TDECORE) ../../lib/libtdecorations.la +twin_redmond_la_SOURCES = redmond.cpp +twin_redmond_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module +twin_redmond_la_LIBADD = $(LIB_TDECORE) ../../lib/libtdecorations.la METASOURCES = AUTO noinst_HEADERS = redmond.h diff --git a/twin/clients/redmond/redmond.cpp b/twin/clients/redmond/redmond.cpp index c59cd48d1..6deddeaee 100644 --- a/twin/clients/redmond/redmond.cpp +++ b/twin/clients/redmond/redmond.cpp @@ -210,9 +210,9 @@ static void create_pixmaps () // Make sure button pixmaps contrast with the current colour scheme. if (tqGray(options()->color(KDecoration::ColorButtonBg, true).rgb()) > 127) - btnForeground = new TQColor(Qt::black); + btnForeground = new TQColor(TQt::black); else - btnForeground = new TQColor(Qt::white); + btnForeground = new TQColor(TQt::white); } void delete_pixmaps() @@ -283,7 +283,7 @@ void RedmondButton::setBitmap(const unsigned char *bitmap) deco = TQBitmap(10, 10, bitmap, true); else { deco = TQBitmap(10,10); - deco.fill(Qt::color0); + deco.fill(TQt::color0); } deco.setMask(deco); } @@ -556,7 +556,7 @@ void RedmondDeco::paintEvent( TQPaintEvent* ) TQImage image = KImageEffect::gradient(titleBuffer->size(), c1, c2, KImageEffect::HorizontalGradient); - titleBuffer->convertFromImage(image, Qt::OrderedDither); + titleBuffer->convertFromImage(image, TQt::OrderedDither); } TQPainter p2( titleBuffer, this ); diff --git a/twin/clients/redmond/redmond.desktop b/twin/clients/redmond/redmond.desktop index d6bf0a9b0..68a360be0 100644 --- a/twin/clients/redmond/redmond.desktop +++ b/twin/clients/redmond/redmond.desktop @@ -1,3 +1,3 @@ [Desktop Entry] Name=Redmond -X-TDE-Library=twin3_redmond +X-TDE-Library=twin_redmond diff --git a/twin/clients/redmond/redmond.h b/twin/clients/redmond/redmond.h index 211763535..3ef7337fb 100644 --- a/twin/clients/redmond/redmond.h +++ b/twin/clients/redmond/redmond.h @@ -29,7 +29,7 @@ class RedmondDeco; class RedmondButton : public KCommonDecorationButton { - Q_OBJECT + TQ_OBJECT public: RedmondButton(ButtonType type, RedmondDeco *parent, const char *name); void setBitmap(const unsigned char *bitmap); @@ -72,7 +72,7 @@ private: class RedmondDecoFactory : public TQObject, public KDecorationFactory { - Q_OBJECT + TQ_OBJECT public: RedmondDecoFactory(); virtual ~RedmondDecoFactory(); diff --git a/twin/clients/test/Makefile.am b/twin/clients/test/Makefile.am index 07ac72c02..f25bc0b3e 100644 --- a/twin/clients/test/Makefile.am +++ b/twin/clients/test/Makefile.am @@ -1,10 +1,10 @@ INCLUDES = -I$(srcdir)/../../lib $(all_includes) -kde_module_LTLIBRARIES = twin3_test.la +kde_module_LTLIBRARIES = twin_test.la -twin3_test_la_SOURCES = test.cpp -twin3_test_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module -twin3_test_la_LIBADD = $(LIB_TDEUI) ../../lib/libtdecorations.la +twin_test_la_SOURCES = test.cpp +twin_test_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module +twin_test_la_LIBADD = $(LIB_TDEUI) ../../lib/libtdecorations.la #twin_keramik_la_LDFLAGS = $(all_libraries) -avoid-version -module $(KDE_RPATH) $(KDE_MT_LDFLAGS) METASOURCES = AUTO diff --git a/twin/clients/test/test.cpp b/twin/clients/test/test.cpp index e01d1d98e..0cf45a90b 100644 --- a/twin/clients/test/test.cpp +++ b/twin/clients/test/test.cpp @@ -22,9 +22,9 @@ void Decoration::init() { button = new TQPushButton( widget()); button->show(); - button->setCursor( tqarrowCursor ); + button->setCursor( TQt::arrowCursor ); button->move( 0, 0 ); - connect( button, TQT_SIGNAL( clicked()), TQT_SLOT( closeWindow())); + connect( button, TQ_SIGNAL( clicked()), TQ_SLOT( closeWindow())); TQToolTip::add( button, "Zelva Mana" ); } } @@ -100,13 +100,13 @@ TQSize Decoration::minimumSize() const bool Decoration::eventFilter( TQObject* o, TQEvent* e ) { - if( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(widget())) + if( o == widget()) { switch( e->type()) { case TQEvent::MouseButtonPress: { // FRAME - processMousePressEvent( TQT_TQMOUSEEVENT( e )); + processMousePressEvent( static_cast<TQMouseEvent*>( e )); return true; } case TQEvent::Show: diff --git a/twin/clients/test/test.desktop b/twin/clients/test/test.desktop index 04e9ebaeb..17a13bad8 100644 --- a/twin/clients/test/test.desktop +++ b/twin/clients/test/test.desktop @@ -1,3 +1,3 @@ [Desktop Entry] Name=KWin test -X-TDE-Library=twin3_test +X-TDE-Library=twin_test diff --git a/twin/clients/test/test.h b/twin/clients/test/test.h index bfe36fa7c..f735df6c4 100644 --- a/twin/clients/test/test.h +++ b/twin/clients/test/test.h @@ -15,7 +15,7 @@ const int SUPPORTED_WINDOW_TYPES_MASK = NET::NormalMask | NET::DesktopMask | NET class Decoration : public KDecoration { - Q_OBJECT + TQ_OBJECT public: Decoration( KDecorationBridge* bridge, KDecorationFactory* factory ); virtual void init(); diff --git a/twin/clients/web/CMakeLists.txt b/twin/clients/web/CMakeLists.txt index 6045bcbb0..5547dabe7 100644 --- a/twin/clients/web/CMakeLists.txt +++ b/twin/clients/web/CMakeLists.txt @@ -29,9 +29,9 @@ tde_create_translated_desktop( ) -##### twin3_web (module) ######################## +##### twin_web (module) ######################## -tde_add_kpart( twin3_web AUTOMOC +tde_add_kpart( twin_web AUTOMOC SOURCES Web.cpp WebButton.cpp LINK tdecorations-shared tdeui-shared DESTINATION ${PLUGIN_INSTALL_DIR} diff --git a/twin/clients/web/Makefile.am b/twin/clients/web/Makefile.am index 4855602ca..ba3efcb59 100644 --- a/twin/clients/web/Makefile.am +++ b/twin/clients/web/Makefile.am @@ -1,12 +1,12 @@ INCLUDES = -I$(top_srcdir) $(all_includes) -kde_module_LTLIBRARIES = twin3_web.la +kde_module_LTLIBRARIES = twin_web.la -twin3_web_la_SOURCES = Web.cpp WebButton.cpp +twin_web_la_SOURCES = Web.cpp WebButton.cpp noinst_HEADERS = Web.h WebButton.h -twin3_web_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module -twin3_web_la_LIBADD = $(LIB_TDEUI) ../../lib/libtdecorations.la +twin_web_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module +twin_web_la_LIBADD = $(LIB_TDEUI) ../../lib/libtdecorations.la METASOURCES = AUTO linkdir = $(kde_datadir)/twin/ diff --git a/twin/clients/web/Web.cpp b/twin/clients/web/Web.cpp index 2c0ffc8f9..5c2457e1c 100644 --- a/twin/clients/web/Web.cpp +++ b/twin/clients/web/Web.cpp @@ -216,7 +216,7 @@ WebClient::reset( unsigned long changed ) WebClient::paintEvent(TQPaintEvent * pe) { int r_x, r_y, r_x2, r_y2; - TQT_TQRECT_OBJECT(widget()->rect()).coords(&r_x, &r_y, &r_x2, &r_y2); + widget()->rect().coords(&r_x, &r_y, &r_x2, &r_y2); const int titleEdgeLeft = layoutMetric(LM_TitleEdgeLeft); const int titleEdgeTop = layoutMetric(LM_TitleEdgeTop); const int titleEdgeRight = layoutMetric(LM_TitleEdgeRight); @@ -230,7 +230,7 @@ WebClient::paintEvent(TQPaintEvent * pe) TQPainter p(widget()); - p.setPen(Qt::black); + p.setPen(TQt::black); p.setBrush(options()->colorGroup(ColorFrame, isActive()).background()); p.setClipRegion(pe->region() - titleRect); diff --git a/twin/clients/web/Web.h b/twin/clients/web/Web.h index d73f370d3..175928c91 100644 --- a/twin/clients/web/Web.h +++ b/twin/clients/web/Web.h @@ -69,7 +69,7 @@ namespace Web class WebFactory : public TQObject, public KDecorationFactory { - Q_OBJECT + TQ_OBJECT public: diff --git a/twin/clients/web/WebButton.cpp b/twin/clients/web/WebButton.cpp index f8d1c4add..eb6d8d530 100644 --- a/twin/clients/web/WebButton.cpp +++ b/twin/clients/web/WebButton.cpp @@ -170,7 +170,7 @@ WebButton::drawButton(TQPainter *p) { // Draw edge. - p->setPen(Qt::black); + p->setPen(TQt::black); p->drawLine(0, 0, width(), 0); p->drawLine(0, 1, 0, height() - 1); @@ -207,7 +207,7 @@ WebButton::drawButton(TQPainter *p) { // Draw edge. - p->setPen(Qt::black); + p->setPen(TQt::black); p->drawLine(0, 0, width(), 0); p->drawLine(width() - 1, 1, width() - 1, height() - 1); if (shape_) @@ -244,7 +244,7 @@ WebButton::drawButton(TQPainter *p) { // Draw edge. - p->setPen(Qt::black); + p->setPen(TQt::black); p->drawLine(0, 0, width(), 0); // Draw highlight. @@ -266,7 +266,7 @@ WebButton::drawButton(TQPainter *p) int bhby2(bitmap_.height() / 2); // Bitmap Height BY 2 p->setBrush(NoBrush); - p->setPen(Qt::black); + p->setPen(TQt::black); p->drawPixmap(center.x() - bwby2 + 1, center.y() - bhby2 + 1, bitmap_); } diff --git a/twin/clients/web/web.desktop b/twin/clients/web/web.desktop index 10a05ccf1..e850418a4 100644 --- a/twin/clients/web/web.desktop +++ b/twin/clients/web/web.desktop @@ -1,3 +1,3 @@ [Desktop Entry] Name=Web -X-TDE-Library=twin3_web +X-TDE-Library=twin_web diff --git a/twin/compton-tde/compton.c b/twin/compton-tde/compton.c index 603402fc6..2e76cb6b3 100644 --- a/twin/compton-tde/compton.c +++ b/twin/compton-tde/compton.c @@ -161,7 +161,11 @@ void delete_pid_file() printf("compton-tde lost connection to X server, restarting...\n"); fflush(stdout); sleep(1); char me[2048]; +#ifdef Q_OS_SOLARIS + int chars = readlink("/proc/self/path/a.out", me, sizeof(me)); +#else /* default */ int chars = readlink("/proc/self/exe", me, sizeof(me)); +#endif /* self exe */ me[chars] = 0; me[2047] = 0; execl(me, basename(me), (char*)NULL); diff --git a/twin/data/CMakeLists.txt b/twin/data/CMakeLists.txt index 840c5afcf..df0b79f88 100644 --- a/twin/data/CMakeLists.txt +++ b/twin/data/CMakeLists.txt @@ -22,13 +22,13 @@ link_directories( ##### other data ################################ install( FILES - twin.upd twinsticky.upd twiniconify.upd twin3_plugin.upd + twin.upd twinsticky.upd twiniconify.upd twin_focus1.upd twinupdatewindowsettings.upd twin_focus2.upd twin_fsp_workarounds_1.upd DESTINATION ${KCONF_UPDATE_INSTALL_DIR} ) install( PROGRAMS - pluginlibFix.pl twin3_plugin.pl twin_focus1.sh twin_focus2.sh + pluginlibFix.pl twin_focus1.sh twin_focus2.sh DESTINATION ${KCONF_UPDATE_INSTALL_DIR} ) install( FILES diff --git a/twin/data/Makefile.am b/twin/data/Makefile.am index 0a2dab482..64ce6ab81 100644 --- a/twin/data/Makefile.am +++ b/twin/data/Makefile.am @@ -16,9 +16,9 @@ METASOURCES = AUTO sounddir= $(kde_sounddir) sound_DATA = pop.wav -update_DATA = twin.upd twinsticky.upd twiniconify.upd twin3_plugin.upd twin_focus1.upd \ +update_DATA = twin.upd twinsticky.upd twiniconify.upd twin_focus1.upd \ twinupdatewindowsettings.upd twin_focus2.upd twin_fsp_workarounds_1.upd -update_SCRIPTS = pluginlibFix.pl twin3_plugin.pl twin_focus1.sh twin_focus2.sh +update_SCRIPTS = pluginlibFix.pl twin_focus1.sh twin_focus2.sh updatedir = $(kde_datadir)/tdeconf_update twin_default_rules_DATA = fsp_workarounds_1.twinrules diff --git a/twin/data/twin3_plugin.pl b/twin/data/twin3_plugin.pl deleted file mode 100644 index f5234bcce..000000000 --- a/twin/data/twin3_plugin.pl +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/perl -foreach (<>) { - if(/^PluginLib=twin_(.*)$/) { - print "PluginLib=twin3_$1\n"; - next; - } - print $_; -} diff --git a/twin/data/twin3_plugin.upd b/twin/data/twin3_plugin.upd deleted file mode 100644 index 7194b5641..000000000 --- a/twin/data/twin3_plugin.upd +++ /dev/null @@ -1,4 +0,0 @@ -Id=trinity.2 -File=twinrc -Options=overwrite -Script=twin3_plugin.pl,perl diff --git a/twin/events.cpp b/twin/events.cpp index e9f8fd484..3d3ba999c 100644 --- a/twin/events.cpp +++ b/twin/events.cpp @@ -194,10 +194,10 @@ void RootInfo::changeShowingDesktop( bool showing ) */ bool Workspace::workspaceEvent( XEvent * e ) { - if ( mouse_emulation && (e->type == ButtonPress || e->type == ButtonRelease ) ) + if ( mouse_emulation && (e->type == ButtonPress || e->type == ButtonRelease ) ) { mouse_emulation = FALSE; - XUngrabKeyboard( tqt_xdisplay(), GET_QT_X_TIME() ); + XUngrabKeyboard( tqt_xdisplay(), get_tqt_x_time() ); } if( e->type == PropertyNotify || e->type == ClientMessage ) @@ -211,7 +211,7 @@ bool Workspace::workspaceEvent( XEvent * e ) } // events that should be handled before Clients can get them - switch (e->type) + switch (e->type) { case ButtonPress: case ButtonRelease: @@ -284,7 +284,7 @@ bool Workspace::workspaceEvent( XEvent * e ) return true; } - switch (e->type) + switch (e->type) { case CreateNotify: if ( e->xcreatewindow.parent == root && @@ -292,18 +292,18 @@ bool Workspace::workspaceEvent( XEvent * e ) !e->xcreatewindow.override_redirect ) { // see comments for allowClientActivation() - Time my_qtx_time = GET_QT_X_TIME(); + Time my_qtx_time = get_tqt_x_time(); XChangeProperty(tqt_xdisplay(), e->xcreatewindow.window, atoms->kde_net_wm_user_creation_time, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&my_qtx_time, 1); - SET_QT_X_TIME(my_qtx_time); + set_tqt_x_time(my_qtx_time); } break; case UnmapNotify: { // check for system tray windows - if ( removeSystemTrayWin( e->xunmap.window, true ) ) + if ( removeSystemTrayWin( e->xunmap.window, true ) ) { // If the system tray gets destroyed, the system tray // icons automatically get unmapped, reparented and mapped @@ -317,7 +317,7 @@ bool Workspace::workspaceEvent( XEvent * e ) if ( XCheckTypedWindowEvent (tqt_xdisplay(), w, ReparentNotify, &ev) ) { - if ( ev.xreparent.parent != root ) + if ( ev.xreparent.parent != root ) { XReparentWindow( tqt_xdisplay(), w, root, 0, 0 ); addSystemTrayWin( w ); @@ -351,7 +351,7 @@ bool Workspace::workspaceEvent( XEvent * e ) // e->xmaprequest.window is different from e->xany.window // TODO this shouldn't be necessary now Client* c = findClient( WindowMatchPredicate( e->xmaprequest.window )); - if ( !c ) + if ( !c ) { // don't check for the parent being the root window, this breaks when some app unmaps // a window, changes something and immediately maps it back, without giving KWin @@ -364,7 +364,7 @@ bool Workspace::workspaceEvent( XEvent * e ) if ( addSystemTrayWin( e->xmaprequest.window ) ) return TRUE; c = createClient( e->xmaprequest.window, false ); - if ( c != NULL && root != tqt_xrootwin() ) + if ( c != NULL && root != tqt_xrootwin() ) { // TODO what is this? // TODO may use TQWidget::create XReparentWindow( tqt_xdisplay(), c->frameId(), root, 0, 0 ); @@ -389,7 +389,7 @@ bool Workspace::workspaceEvent( XEvent * e ) if ( w ) TQWhatsThis::leaveWhatsThisMode(); } - if( electricBorder(e)) + if (activeBorderEvent(e)) return true; break; } @@ -405,7 +405,7 @@ bool Workspace::workspaceEvent( XEvent * e ) } case ConfigureRequest: { - if ( e->xconfigurerequest.parent == root ) + if ( e->xconfigurerequest.parent == root ) { XWindowChanges wc; wc.border_width = e->xconfigurerequest.border_width; @@ -454,7 +454,7 @@ bool Workspace::workspaceEvent( XEvent * e ) case FocusOut: return true; // always eat these, they would tell Qt that KWin is the active app case ClientMessage: - if( electricBorder( e )) + if (activeBorderEvent(e)) return true; break; default: @@ -542,7 +542,7 @@ bool Client::windowEvent( XEvent* e ) } // TODO move all focus handling stuff to separate file? - switch (e->type) + switch (e->type) { case UnmapNotify: unmapNotifyEvent( &e->xunmap ); @@ -785,8 +785,13 @@ void Client::configureRequestEvent( XConfigureRequestEvent* e ) { if( e->window != window()) return; // ignore frame/wrapper - if ( isResize() || isMove()) + if ( isResize() || isMove() || inhibitConfigureRequests) + { + // Send a synthetic configure notification to make sure the + // window contents get updated by the application + sendSyntheticConfigureNotify(); return; // we have better things to do right now + } if( fullscreen_mode == FullScreenNormal ) // refuse resizing of fullscreen windows { // but allow resizing fullscreen hacks in order to let them cancel fullscreen mode @@ -800,7 +805,7 @@ void Client::configureRequestEvent( XConfigureRequestEvent* e ) return; } - if ( e->value_mask & CWBorderWidth ) + if ( e->value_mask & CWBorderWidth ) { // first, get rid of a window border XWindowChanges wc; @@ -818,7 +823,7 @@ void Client::configureRequestEvent( XConfigureRequestEvent* e ) restackWindow( e->above, e->detail, NET::FromApplication, userTime(), false ); // TODO sending a synthetic configure notify always is fine, even in cases where - // the ICCCM doesn't require this - it can be though of as 'the WM decided to move + // the ICCCM doesn't require this - it can be thought of as 'the WM decided to move // the window later'. The client should not cause that many configure request, // so this should not have any significant impact. With user moving/resizing // the it should be optimized though (see also Client::setGeometry()/plainResize()/move()). @@ -836,7 +841,7 @@ void Client::propertyNotifyEvent( XPropertyEvent* e ) { if( e->window != window()) return; // ignore frame/wrapper - switch ( e->atom ) + switch ( e->atom ) { case XA_WM_NORMAL_HINTS: getWmNormalHints(); @@ -874,14 +879,14 @@ void Client::enterNotifyEvent( XCrossingEvent* e ) return; // care only about entering the whole frame if( e->mode == NotifyNormal || ( !options->focusPolicyIsReasonable() && - e->mode == NotifyUngrab ) ) + e->mode == NotifyUngrab ) ) { - if (options->shadeHover && isShade()) + if (options->shadeHover && isShade()) { delete shadeHoverTimer; shadeHoverTimer = new TQTimer( this ); - connect( shadeHoverTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( shadeHover() )); + connect( shadeHoverTimer, TQ_SIGNAL( timeout() ), this, TQ_SLOT( shadeHover() )); shadeHoverTimer->start( options->shadeHoverInterval, TRUE ); } @@ -890,11 +895,11 @@ void Client::enterNotifyEvent( XCrossingEvent* e ) if ( options->autoRaise && !isDesktop() && !isDock() && !isTopMenu() && workspace()->focusChangeEnabled() && - workspace()->topClientOnDesktop( workspace()->currentDesktop()) != this ) + workspace()->topClientOnDesktop( workspace()->currentDesktop()) != this ) { delete autoRaiseTimer; autoRaiseTimer = new TQTimer( this ); - connect( autoRaiseTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( autoRaise() ) ); + connect( autoRaiseTimer, TQ_SIGNAL( timeout() ), this, TQ_SLOT( autoRaise() ) ); autoRaiseTimer->start( options->autoRaiseInterval, TRUE ); } @@ -919,12 +924,12 @@ void Client::leaveNotifyEvent( XCrossingEvent* e ) { if( e->window != frameId()) return; // care only about leaving the whole frame - if ( e->mode == NotifyNormal ) + if ( e->mode == NotifyNormal ) { - if ( !buttonDown ) + if ( !buttonDown ) { mode = PositionCenter; - setCursor( tqarrowCursor ); + setCursor( TQt::arrowCursor ); } bool lostMouse = !rect().contains( TQPoint( e->x, e->y ) ); // 'lostMouse' wouldn't work with e.g. B2 or Keramik, which have non-rectangular decorations @@ -934,7 +939,7 @@ void Client::leaveNotifyEvent( XCrossingEvent* e ) // TODO this still sucks if a window appears above this one - it should lose the mouse // if this window is another client, but not if it's a popup ... maybe after KDE3.1 :( // (repeat after me 'AARGHL!') - if ( !lostMouse && e->detail != NotifyInferior ) + if ( !lostMouse && e->detail != NotifyInferior ) { int d1, d2, d3, d4; unsigned int d5; @@ -943,7 +948,7 @@ void Client::leaveNotifyEvent( XCrossingEvent* e ) || child == None ) lostMouse = true; // really lost the mouse } - if ( lostMouse ) + if ( lostMouse ) { cancelAutoRaise(); workspace()->cancelDelayFocus(); @@ -963,7 +968,7 @@ void Client::leaveNotifyEvent( XCrossingEvent* e ) #define XScrL KKeyNative::modXScrollLock() void Client::grabButton( int modifier ) { - unsigned int mods[ 8 ] = + unsigned int mods[ 8 ] = { 0, XCapL, XNumL, XNumL | XCapL, XScrL, XScrL | XCapL, @@ -980,7 +985,7 @@ void Client::grabButton( int modifier ) void Client::ungrabButton( int modifier ) { - unsigned int mods[ 8 ] = + unsigned int mods[ 8 ] = { 0, XCapL, XNumL, XNumL | XCapL, XScrL, XScrL | XCapL, @@ -1046,23 +1051,23 @@ void Client::updateMouseGrab() int qtToX11Button( TQt::ButtonState button ) { - if( button == Qt::LeftButton ) + if( button == TQt::LeftButton ) return Button1; - else if( button == Qt::MidButton ) + else if( button == TQt::MidButton ) return Button2; - else if( button == Qt::RightButton ) + else if( button == TQt::RightButton ) return Button3; return AnyButton; } - + int qtToX11State( TQt::ButtonState state ) { int ret = 0; - if( state & Qt::LeftButton ) + if( state & TQt::LeftButton ) ret |= Button1Mask; - if( state & Qt::MidButton ) + if( state & TQt::MidButton ) ret |= Button2Mask; - if( state & Qt::RightButton ) + if( state & TQt::RightButton ) ret |= Button3Mask; if( state & TQt::ShiftButton ) ret |= ShiftMask; @@ -1079,7 +1084,7 @@ int qtToX11State( TQt::ButtonState state ) // for the decoration window cannot be (easily) intercepted as X11 events bool Client::eventFilter( TQObject* o, TQEvent* e ) { - if (TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(shadowWidget)) + if (o == shadowWidget) { if (e->type() == TQEvent::MouseButtonRelease) { @@ -1092,11 +1097,11 @@ bool Client::eventFilter( TQObject* o, TQEvent* e ) removeShadow(); switch (qe->button()) { - case Qt::MidButton: + case TQt::MidButton: buttonMask = Button2Mask; buttonPressed = Button2; break; - case Qt::RightButton: + case TQt::RightButton: buttonMask = Button3Mask; buttonPressed = Button3; break; @@ -1291,29 +1296,29 @@ bool Client::eventFilter( TQObject* o, TQEvent* e ) } } if( decoration == NULL - || TQT_BASE_OBJECT(o) != TQT_BASE_OBJECT(decoration->widget())) + || o != decoration->widget()) return false; if( e->type() == TQEvent::MouseButtonPress ) { - TQMouseEvent* ev = TQT_TQMOUSEEVENT( e ); + TQMouseEvent* ev = static_cast<TQMouseEvent*>( e ); return buttonPressEvent( decorationId(), qtToX11Button( ev->button()), qtToX11State( ev->state()), ev->x(), ev->y(), ev->globalX(), ev->globalY() ); } if( e->type() == TQEvent::MouseButtonRelease ) { - TQMouseEvent* ev = TQT_TQMOUSEEVENT( e ); + TQMouseEvent* ev = static_cast<TQMouseEvent*>( e ); return buttonReleaseEvent( decorationId(), qtToX11Button( ev->button()), qtToX11State( ev->state()), ev->x(), ev->y(), ev->globalX(), ev->globalY() ); } if( e->type() == TQEvent::MouseMove ) // FRAME i fake z enter/leave? { - TQMouseEvent* ev = TQT_TQMOUSEEVENT( e ); + TQMouseEvent* ev = static_cast<TQMouseEvent*>( e ); return motionNotifyEvent( decorationId(), qtToX11State( ev->state()), ev->x(), ev->y(), ev->globalX(), ev->globalY() ); } if( e->type() == TQEvent::Wheel ) { - TQWheelEvent* ev = TQT_TQWHEELEVENT( e ); + TQWheelEvent* ev = static_cast<TQWheelEvent*>( e ); bool r = buttonPressEvent( decorationId(), ev->delta() > 0 ? Button4 : Button5, qtToX11State( ev->state()), ev->x(), ev->y(), ev->globalX(), ev->globalY() ); r = r || buttonReleaseEvent( decorationId(), ev->delta() > 0 ? Button4 : Button5, qtToX11State( ev->state()), @@ -1322,7 +1327,7 @@ bool Client::eventFilter( TQObject* o, TQEvent* e ) } if( e->type() == TQEvent::Resize ) { - TQResizeEvent* ev = TQT_TQRESIZEEVENT( e ); + TQResizeEvent* ev = static_cast<TQResizeEvent*>( e ); // Filter out resize events that inform about size different than frame size. // This will ensure that decoration->width() etc. and decoration->widget()->width() will be in sync. // These events only seem to be delayed events from initial resizing before show() was called @@ -1348,7 +1353,7 @@ bool Client::buttonPressEvent( Window w, int button, int state, int x, int y, in // FRAME something out of this would be processed before it gets decorations updateUserTime(); workspace()->setWasUserInteraction(); - uint keyModX = (options->keyCmdAllModKey() == Qt::Key_Meta) ? + uint keyModX = (options->keyCmdAllModKey() == TQt::Key_Meta) ? KKeyNative::modX(KKey::WIN) : KKeyNative::modX(KKey::ALT); bool bModKeyHeld = keyModX != 0 && ( state & KKeyNative::accelModMaskX()) == keyModX; @@ -1368,7 +1373,7 @@ bool Client::buttonPressEvent( Window w, int button, int state, int x, int y, in if ( bModKeyHeld ) { was_action = true; - switch (button) + switch (button) { case Button1: com = options->commandAll1(); @@ -1391,7 +1396,7 @@ bool Client::buttonPressEvent( Window w, int button, int state, int x, int y, in { was_action = true; perform_handled = true; - switch (button) + switch (button) { case Button1: com = options->commandWindow1(); @@ -1481,13 +1486,13 @@ void Client::processMousePressEvent( TQMouseEvent* e ) int button; switch( e->button()) { - case Qt::LeftButton: + case TQt::LeftButton: button = Button1; break; - case Qt::MidButton: + case TQt::MidButton: button = Button2; break; - case Qt::RightButton: + case TQt::RightButton: button = Button3; break; default: @@ -1513,7 +1518,7 @@ bool Client::buttonReleaseEvent( Window w, int /*button*/, int state, int x, int if ( (state & ( Button1Mask & Button2Mask & Button3Mask )) == 0 ) { buttonDown = FALSE; - if ( moveResizeMode ) + if ( moveResizeMode ) { finishMoveResize( false ); // mouse position is still relative to old Client position, adjust it @@ -1550,7 +1555,7 @@ static bool waitingMotionEvent() // of processes events reaches the timestamp of the last suitable // MotionNotify event in the queue. if( next_motion_time != CurrentTime - && timestampCompare( GET_QT_X_TIME(), next_motion_time ) < 0 ) + && timestampCompare( get_tqt_x_time(), next_motion_time ) < 0 ) return true; was_motion = false; XSync( tqt_xdisplay(), False ); // this helps to discard more MotionNotify events @@ -1564,7 +1569,7 @@ bool Client::motionNotifyEvent( Window w, int /*state*/, int x, int y, int x_roo { if( w != frameId() && w != decorationId() && w != moveResizeGrabWindow()) return true; // care only about the whole frame - if ( !buttonDown ) + if ( !buttonDown ) { Position newmode = mousePosition( TQPoint( x, y )); if( newmode != mode ) @@ -1682,7 +1687,7 @@ void Client::NETMoveResize( int x_root, int y_root, NET::Direction direction ) buttonDown = FALSE; setCursor( mode ); } - else if( direction >= NET::TopLeft && direction <= NET::Left ) + else if( direction >= NET::TopLeft && direction <= NET::Left ) { static const Position convert[] = { @@ -1728,12 +1733,12 @@ void Client::keyPressEvent( uint key_code ) updateUserTime(); if ( !isMove() && !isResize() ) return; - bool is_control = key_code & Qt::CTRL; - bool is_alt = key_code & Qt::ALT; + bool is_control = key_code & TQt::CTRL; + bool is_alt = key_code & TQt::ALT; key_code = key_code & 0xffff; int delta = is_control?1:is_alt?32:8; TQPoint pos = TQCursor::pos(); - switch ( key_code ) + switch ( key_code ) { case Key_Left: pos.rx() -= delta; diff --git a/twin/geometry.cpp b/twin/geometry.cpp index 5c71e7c1f..581c07ac1 100644 --- a/twin/geometry.cpp +++ b/twin/geometry.cpp @@ -40,7 +40,7 @@ namespace KWinInternal Resizes the workspace after an XRANDR screen size change */ void Workspace::desktopResized() - { +{ //printf("Workspace::desktopResized()\n"); TQRect geom = TDEApplication::desktop()->geometry(); NETSize desktop_geometry; @@ -49,24 +49,17 @@ void Workspace::desktopResized() rootInfo->setDesktopGeometry( -1, desktop_geometry ); updateClientArea( true ); - checkElectricBorders( true ); - } + destroyActiveBorders(); + updateActiveBorders(); +} /*! Resizes the workspace after kdesktop signals a desktop resize */ void Workspace::kDestopResized() - { - //printf("Workspace::kDesktopResized()\n"); - TQRect geom = TDEApplication::desktop()->geometry(); - NETSize desktop_geometry; - desktop_geometry.width = geom.width(); - desktop_geometry.height = geom.height(); - rootInfo->setDesktopGeometry( -1, desktop_geometry ); - - updateClientArea( true ); - checkElectricBorders( true ); - } +{ + desktopResized(); +} /*! Updates the current client areas according to the current clients. @@ -344,23 +337,23 @@ TQPoint Workspace::adjustClientPosition( Client* c, TQPoint pos ) int snap = options->borderSnapZone; //snap trigger if (snap) { - if ((sOWO?(cx<xmin):true) && (QABS(xmin-cx)<snap)) + if ((sOWO?(cx<xmin):true) && (TQABS(xmin-cx)<snap)) { deltaX = xmin-cx; nx = xmin; } - if ((sOWO?(rx>xmax):true) && (QABS(rx-xmax)<snap) && (QABS(xmax-rx) < deltaX)) + if ((sOWO?(rx>xmax):true) && (TQABS(rx-xmax)<snap) && (TQABS(xmax-rx) < deltaX)) { deltaX = rx-xmax; nx = xmax - cw; } - if ((sOWO?(cy<ymin):true) && (QABS(ymin-cy)<snap)) + if ((sOWO?(cy<ymin):true) && (TQABS(ymin-cy)<snap)) { deltaY = ymin-cy; ny = ymin; } - if ((sOWO?(ry>ymax):true) && (QABS(ry-ymax)<snap) && (QABS(ymax-ry) < deltaY)) + if ((sOWO?(ry>ymax):true) && (TQABS(ry-ymax)<snap) && (TQABS(ymax-ry) < deltaY)) { deltaY =ry-ymax; ny = ymax - ch; @@ -387,14 +380,14 @@ TQPoint Workspace::adjustClientPosition( Client* c, TQPoint pos ) (( ry >= ly ) && ( ry <= lry )) || (( cy <= ly ) && ( ry >= lry )) ) { - if ((sOWO?(cx<lrx):true) && (QABS(lrx-cx)<snap) && ( QABS(lrx -cx) < deltaX) ) + if ((sOWO?(cx<lrx):true) && (TQABS(lrx-cx)<snap) && ( TQABS(lrx -cx) < deltaX) ) { - deltaX = QABS( lrx - cx ); + deltaX = TQABS( lrx - cx ); nx = lrx; } - if ((sOWO?(rx>lx):true) && (QABS(rx-lx)<snap) && ( QABS( rx - lx )<deltaX) ) + if ((sOWO?(rx>lx):true) && (TQABS(rx-lx)<snap) && ( TQABS( rx - lx )<deltaX) ) { - deltaX = QABS(rx - lx); + deltaX = TQABS(rx - lx); nx = lx - cw; } } @@ -403,15 +396,15 @@ TQPoint Workspace::adjustClientPosition( Client* c, TQPoint pos ) (( rx >= lx ) && ( rx <= lrx )) || (( cx <= lx ) && ( rx >= lrx )) ) { - if ((sOWO?(cy<lry):true) && (QABS(lry-cy)<snap) && (QABS( lry -cy ) < deltaY)) + if ((sOWO?(cy<lry):true) && (TQABS(lry-cy)<snap) && (TQABS( lry -cy ) < deltaY)) { - deltaY = QABS( lry - cy ); + deltaY = TQABS( lry - cy ); ny = lry; } - //if ( (QABS( ry-ly ) < snap) && (QABS( ry - ly ) < deltaY )) - if ((sOWO?(ry>ly):true) && (QABS(ry-ly)<snap) && (QABS( ry - ly ) < deltaY )) + //if ( (TQABS( ry-ly ) < snap) && (TQABS( ry - ly ) < deltaY )) + if ((sOWO?(ry>ly):true) && (TQABS(ry-ly)<snap) && (TQABS( ry - ly ) < deltaY )) { - deltaY = QABS( ry - ly ); + deltaY = TQABS( ry - ly ); ny = ly - ch; } } @@ -458,30 +451,30 @@ TQRect Workspace::adjustClientSize( Client* c, TQRect moveResizeGeom, int mode ) deltaY = int(snap); #define SNAP_BORDER_TOP \ - if ((sOWO?(newcy<ymin):true) && (QABS(ymin-newcy)<deltaY)) \ + if ((sOWO?(newcy<ymin):true) && (TQABS(ymin-newcy)<deltaY)) \ { \ - deltaY = QABS(ymin-newcy); \ + deltaY = TQABS(ymin-newcy); \ newcy = ymin; \ } #define SNAP_BORDER_BOTTOM \ - if ((sOWO?(newry>ymax):true) && (QABS(ymax-newry)<deltaY)) \ + if ((sOWO?(newry>ymax):true) && (TQABS(ymax-newry)<deltaY)) \ { \ - deltaY = QABS(ymax-newcy); \ + deltaY = TQABS(ymax-newcy); \ newry = ymax; \ } #define SNAP_BORDER_LEFT \ - if ((sOWO?(newcx<xmin):true) && (QABS(xmin-newcx)<deltaX)) \ + if ((sOWO?(newcx<xmin):true) && (TQABS(xmin-newcx)<deltaX)) \ { \ - deltaX = QABS(xmin-newcx); \ + deltaX = TQABS(xmin-newcx); \ newcx = xmin; \ } #define SNAP_BORDER_RIGHT \ - if ((sOWO?(newrx>xmax):true) && (QABS(xmax-newrx)<deltaX)) \ + if ((sOWO?(newrx>xmax):true) && (TQABS(xmax-newrx)<deltaX)) \ { \ - deltaX = QABS(xmax-newrx); \ + deltaX = TQABS(xmax-newrx); \ newrx = xmax; \ } switch ( mode ) @@ -550,30 +543,30 @@ TQRect Workspace::adjustClientSize( Client* c, TQRect moveResizeGeom, int mode ) #define SNAP_WINDOW_TOP if ( (sOWO?(newcy<lry):true) \ && WITHIN_WIDTH \ - && (QABS( lry - newcy ) < deltaY) ) { \ - deltaY = QABS( lry - newcy ); \ + && (TQABS( lry - newcy ) < deltaY) ) { \ + deltaY = TQABS( lry - newcy ); \ newcy=lry; \ } #define SNAP_WINDOW_BOTTOM if ( (sOWO?(newry>ly):true) \ && WITHIN_WIDTH \ - && (QABS( ly - newry ) < deltaY) ) { \ - deltaY = QABS( ly - newry ); \ + && (TQABS( ly - newry ) < deltaY) ) { \ + deltaY = TQABS( ly - newry ); \ newry=ly; \ } #define SNAP_WINDOW_LEFT if ( (sOWO?(newcx<lrx):true) \ && WITHIN_HEIGHT \ - && (QABS( lrx - newcx ) < deltaX)) { \ - deltaX = QABS( lrx - newcx ); \ + && (TQABS( lrx - newcx ) < deltaX)) { \ + deltaX = TQABS( lrx - newcx ); \ newcx=lrx; \ } #define SNAP_WINDOW_RIGHT if ( (sOWO?(newrx>lx):true) \ && WITHIN_HEIGHT \ - && (QABS( lx - newrx ) < deltaX)) \ + && (TQABS( lx - newrx ) < deltaX)) \ { \ - deltaX = QABS( lx - newrx ); \ + deltaX = TQABS( lx - newrx ); \ newrx=lx; \ } @@ -686,7 +679,7 @@ void Workspace::updateTopMenuGeometry( Client* c ) static Atom msg_type_atom = XInternAtom( tqt_xdisplay(), "_KDE_TOPMENU_MINSIZE", False ); ev.xclient.message_type = msg_type_atom; ev.xclient.format = 32; - ev.xclient.data.l[0] = GET_QT_X_TIME(); + ev.xclient.data.l[0] = get_tqt_x_time(); ev.xclient.data.l[1] = topmenu_space->width(); ev.xclient.data.l[2] = topmenu_space->height(); ev.xclient.data.l[3] = 0; @@ -1458,6 +1451,8 @@ const TQPoint Client::calculateGravitation( bool invert, int gravity ) const void Client::configureRequest( int value_mask, int rx, int ry, int rw, int rh, int gravity, bool from_tool ) { + inhibitConfigureRequests = true; + configureRequestTimer->start(100, true); if( gravity == 0 ) // default (nonsense) value for the argument gravity = xSizeHint.win_gravity; if( value_mask & ( CWX | CWY )) @@ -1906,7 +1901,7 @@ void Client::changeMaximize( bool vertical, bool horizontal, bool adjust ) if( horizontal ) max_mode = MaximizeMode( max_mode ^ MaximizeHorizontal ); } - + max_mode = rules()->checkMaximize( max_mode ); if( !adjust && max_mode == old_mode ) return; @@ -1955,9 +1950,9 @@ void Client::changeMaximize( bool vertical, bool horizontal, bool adjust ) { max_mode = MaximizeHorizontal; maxmode_restore = MaximizeRestore; - } + } } - + switch (max_mode) { @@ -2223,8 +2218,8 @@ void Client::updateFullScreenHack( const TQRect& geom ) workspace()->updateClientLayer( this ); // active fullscreens get different layer } -static TQRect* visible_bound = 0; -static GeometryTip* geometryTip = 0; +static TQRect* visible_bound = nullptr; +static GeometryTip* geometryTip = nullptr; void Client::drawbound( const TQRect& geom ) { @@ -2247,7 +2242,7 @@ void Client::doDrawbound( const TQRect& geom, bool clear ) if( decoration != NULL && decoration->drawbound( geom, clear )) return; // done by decoration TQPainter p ( workspace()->desktopWidget() ); - p.setPen( TQPen( Qt::white, 5 ) ); + p.setPen( TQPen( TQt::white, 5 ) ); p.setRasterOp( TQt::XorROP ); // the line is 5 pixel thick, so compensate for the extra two pixels // on outside (#88657) @@ -2265,44 +2260,43 @@ void Client::doDrawbound( const TQRect& geom, bool clear ) p.drawRect( g ); } -void Client::positionGeometryTip() - { - assert( isMove() || isResize()); +void Client::positionGeometryTip() { + assert(isMove() || isResize()); + // Position and Size display - if (options->showGeometryTip()) - { - if( !geometryTip ) - { // save under is not necessary with opaque, and seem to make things slower + if (options->showGeometryTip()) { + if (!geometryTip) { + // save under is not necessary with opaque, and seem to make things slower bool save_under = ( isMove() && rules()->checkMoveResizeMode( options->moveMode ) != Options::Opaque ) - || ( isResize() && rules()->checkMoveResizeMode( options->resizeMode ) != Options::Opaque ); + || ( isResize() && rules()->checkMoveResizeMode( options->resizeMode ) != Options::Opaque ); geometryTip = new GeometryTip( &xSizeHint, save_under ); - } - TQRect wgeom( moveResizeGeom ); // position of the frame, size of the window itself - wgeom.setWidth( wgeom.width() - ( width() - clientSize().width())); - wgeom.setHeight( wgeom.height() - ( height() - clientSize().height())); - if( isShade()) - wgeom.setHeight( 0 ); - geometryTip->setGeometry( wgeom ); - if( !geometryTip->isVisible()) - { + } + + // position of the frame, size of the window itself + TQRect wgeom(isActiveBorderMaximizing() ? activeBorderMaximizeGeometry() : moveResizeGeom); + wgeom.setWidth(wgeom.width() - (width() - clientSize().width())); + wgeom.setHeight(isShade() ? 0 : wgeom.height() - (height() - clientSize().height())); + + geometryTip->setGeometry(wgeom); + if (!geometryTip->isVisible()) { geometryTip->show(); geometryTip->raise(); - } } } +} class EatAllPaintEvents - : public QObject + : public TQObject { protected: virtual bool eventFilter( TQObject* o, TQEvent* e ) - { return e->type() == TQEvent::Paint && TQT_BASE_OBJECT(o) != TQT_BASE_OBJECT(geometryTip); } + { return e->type() == TQEvent::Paint && o != geometryTip; } }; static EatAllPaintEvents* eater = 0; bool Client::startMoveResize() - { +{ assert( !moveResizeMode ); assert( TQWidget::keyboardGrabber() == NULL ); assert( TQWidget::mouseGrabber() == NULL ); @@ -2319,33 +2313,68 @@ bool Client::startMoveResize() XMapRaised( tqt_xdisplay(), move_resize_grab_window ); if( XGrabPointer( tqt_xdisplay(), move_resize_grab_window, False, ButtonPressMask | ButtonReleaseMask | PointerMotionMask | EnterWindowMask | LeaveWindowMask, - GrabModeAsync, GrabModeAsync, move_resize_grab_window, cursor.handle(), GET_QT_X_TIME() ) == Success ) + GrabModeAsync, GrabModeAsync, move_resize_grab_window, cursor.handle(), get_tqt_x_time() ) == Success ) has_grab = true; - if( XGrabKeyboard( tqt_xdisplay(), frameId(), False, GrabModeAsync, GrabModeAsync, GET_QT_X_TIME() ) == Success ) + if( XGrabKeyboard( tqt_xdisplay(), frameId(), False, GrabModeAsync, GrabModeAsync, get_tqt_x_time() ) == Success ) has_grab = true; if( !has_grab ) // at least one grab is necessary in order to be able to finish move/resize - { + { XDestroyWindow( tqt_xdisplay(), move_resize_grab_window ); move_resize_grab_window = None; return false; - } - if ( maximizeMode() != MaximizeRestore ) - resetMaximize(); + } + removeShadow(); moveResizeMode = true; + initialMoveResizeGeom = geometry(); + + if (activeTiled) + { + // Restore original geometry + activeTiled = false; + if (options->resetMaximizedWindowGeometry() && isMove()) { + /* Original geometry might be smaller than the tiled one, so the + * mouse pointer might appear off-window when untiling. + * Here we center the window horizontally under the mouse pointer. + * This should work with most window decorations. + */ + activeTiledOrigGeom.moveLeft(TQCursor::pos().x() - (activeTiledOrigGeom.width() / 2)); + moveOffset.setX(TQCursor::pos().x() - activeTiledOrigGeom.x()); + + setGeometry(activeTiledOrigGeom); + } + } + + if ( maximizeMode() != MaximizeRestore ) + { + if (options->resetMaximizedWindowGeometry() && isMove()) { + maximize(MaximizeRestore); + } + else { + resetMaximize(); + } + activeTiled = false; + } + + moveResizeGeom = geometry(); workspace()->setClientIsMoving(this); - initialMoveResizeGeom = moveResizeGeom = geometry(); checkUnrestrictedMoveResize(); + // rule out non opaque windows from useless translucency settings, maybe resizes? if ((isResize() && options->removeShadowsOnResize) || (isMove() && options->removeShadowsOnMove)) + { setShadowSize(0); - if (rules()->checkMoveResizeMode( options->moveMode ) == Options::Opaque){ + } + + if (rules()->checkMoveResizeMode( options->moveMode ) == Options::Opaque) + { savedOpacity_ = opacity_; setOpacity(options->translucentMovingWindows, options->movingWindowOpacity); } + if ( ( isMove() && rules()->checkMoveResizeMode( options->moveMode ) != Options::Opaque ) || ( isResize() && rules()->checkMoveResizeMode( options->resizeMode ) != Options::Opaque ) ) - { + { grabXServer(); kapp->sendPostedEvents(); // we have server grab -> nothing should cause paint events @@ -2353,27 +2382,59 @@ bool Client::startMoveResize() // paint events on some widgets due to FocusIn(?) // eat them, otherwise XOR painting will be broken (#58054) // paint events for the geometrytip need to be allowed, though - eater = new EatAllPaintEvents; + // eater = new EatAllPaintEvents; // not needed anymore? kapp->installEventFilter( eater ); - } + } Notify::raise( isResize() ? Notify::ResizeStart : Notify::MoveStart ); - return true; + + if (options->activeBorders() == Options::ActiveSwitchOnMove || + options->activeBorders() == Options::ActiveTileMaximize || + options->activeBorders() == Options::ActiveTileOnly) + + { + workspace()->reserveActiveBorderSwitching(true); } + return true; +} + void Client::finishMoveResize( bool cancel ) - { +{ leaveMoveResize(); - if( cancel ) - setGeometry( initialMoveResizeGeom ); + + if (!isActiveBorderMaximizing()) { + setGeometry(cancel ? initialMoveResizeGeom : moveResizeGeom); + } + else - setGeometry( moveResizeGeom ); + { + kdDebug() <<"finishing moveresize in active mode, cancel is " << cancel << endl; + activeMaximizing = false; + activeTiled = true; + activeTiledOrigGeom = initialMoveResizeGeom; + switch (activeMode) + { + case ActiveMaximizeMode: { + if (!cancel) { + bool full = (maximizeMode() == MaximizeFull); + setMaximize(!full, !full); + } + break; + } + default: + setGeometry(cancel ? initialMoveResizeGeom + : activeBorderMaximizeGeometry()); + } + activeTiledOrigGeom.moveTopLeft(rect().topLeft()); + } + checkMaximizeGeometry(); // FRAME update(); Notify::raise( isResize() ? Notify::ResizeEnd : Notify::MoveEnd ); - } +} void Client::leaveMoveResize() - { +{ // rule out non opaque windows from useless translucency settings, maybe resizes? if (rules()->checkMoveResizeMode( options->moveMode ) == Options::Opaque) setOpacity(true, savedOpacity_); @@ -2389,8 +2450,8 @@ void Client::leaveMoveResize() if ( ( isMove() && rules()->checkMoveResizeMode( options->moveMode ) != Options::Opaque ) || ( isResize() && rules()->checkMoveResizeMode( options->resizeMode ) != Options::Opaque ) ) ungrabXServer(); - XUngrabKeyboard( tqt_xdisplay(), GET_QT_X_TIME() ); - XUngrabPointer( tqt_xdisplay(), GET_QT_X_TIME() ); + XUngrabKeyboard( tqt_xdisplay(), get_tqt_x_time() ); + XUngrabPointer( tqt_xdisplay(), get_tqt_x_time() ); XDestroyWindow( tqt_xdisplay(), move_resize_grab_window ); move_resize_grab_window = None; workspace()->setClientIsMoving(0); @@ -2401,12 +2462,19 @@ void Client::leaveMoveResize() delete eater; eater = 0; if (options->shadowEnabled(isActive())) - { + { drawIntersectingShadows(); updateOpacityCache(); - } } + if (options->activeBorders() == Options::ActiveSwitchOnMove || + options->activeBorders() == Options::ActiveTileMaximize || + options->activeBorders() == Options::ActiveTileOnly) + { + workspace()->reserveActiveBorderSwitching(false); + } +} + // This function checks if it actually makes sense to perform a restricted move/resize. // If e.g. the titlebar is already outside of the workarea, there's no point in performing // a restricted move resize, because then e.g. resize would also move the window (#74555). @@ -2417,7 +2485,7 @@ void Client::checkUnrestrictedMoveResize() return; TQRect desktopArea = workspace()->clientArea( WorkArea, moveResizeGeom.center(), desktop()); int left_marge, right_marge, top_marge, bottom_marge, titlebar_marge; - // restricted move/resize - keep at least part of the titlebar always visible + // restricted move/resize - keep at least part of the titlebar always visible // how much must remain visible when moved away in that direction left_marge = KMIN( 100 + border_right, moveResizeGeom.width()); right_marge = KMIN( 100 + border_left, moveResizeGeom.width()); @@ -2452,27 +2520,22 @@ void Client::checkUnrestrictedMoveResize() } } -void Client::handleMoveResize( int x, int y, int x_root, int y_root ) - { - if(( mode == PositionCenter && !isMovable()) - || ( mode != PositionCenter && ( isShade() || !isResizable()))) +void Client::handleMoveResize(int x, int y, int x_root, int y_root) { + if ( (mode == PositionCenter && !isMovable()) + || (mode != PositionCenter && (isShade() || !isResizable())) ) return; - if ( !moveResizeMode ) - { - TQPoint p( TQPoint( x, y ) - moveOffset ); - if (p.manhattanLength() >= 6) - { - if( !startMoveResize()) - { + if (!moveResizeMode) { + TQPoint p(TQPoint( x, y ) - moveOffset); + if (p.manhattanLength() >= 6) { + if (!startMoveResize()) { buttonDown = false; setCursor( mode ); return; - } } - else - return; } + else return; + } // ShadeHover or ShadeActive, ShadeNormal was already avoided above if ( mode != PositionCenter && shade_mode != ShadeNone ) @@ -2493,8 +2556,8 @@ void Client::handleMoveResize( int x, int y, int x_root, int y_root ) int left_marge, right_marge, top_marge, bottom_marge, titlebar_marge; if( unrestrictedMoveResize ) // unrestricted, just don't let it go out completely left_marge = right_marge = top_marge = bottom_marge = titlebar_marge = 5; - else // restricted move/resize - keep at least part of the titlebar always visible - { + else // restricted move/resize - keep at least part of the titlebar always visible + { // how much must remain visible when moved away in that direction left_marge = KMIN( 100 + border_right, moveResizeGeom.width()); right_marge = KMIN( 100 + border_left, moveResizeGeom.width()); @@ -2502,16 +2565,16 @@ void Client::handleMoveResize( int x, int y, int x_root, int y_root ) titlebar_marge = initialMoveResizeGeom.height(); top_marge = border_bottom; bottom_marge = border_top; - } + } bool update = false; - if( isResize()) - { + if (isResize()) + { // first resize (without checking constraints), then snap, then check bounds, then check constraints TQRect orig = initialMoveResizeGeom; Sizemode sizemode = SizemodeAny; switch ( mode ) - { + { case PositionTopLeft: moveResizeGeom = TQRect( topleft, orig.bottomRight() ) ; break; @@ -2544,7 +2607,7 @@ void Client::handleMoveResize( int x, int y, int x_root, int y_root ) default: assert( false ); break; - } + } // adjust new size to snap to other windows/borders moveResizeGeom = workspace()->adjustClientSize( this, moveResizeGeom, mode ); @@ -2567,7 +2630,7 @@ void Client::handleMoveResize( int x, int y, int x_root, int y_root ) bottomright = TQPoint( moveResizeGeom.left() + size.width() - 1, moveResizeGeom.top() + size.height() - 1 ); orig = moveResizeGeom; switch ( mode ) - { // these 4 corners ones are copied from above + { // these 4 corners ones are copied from above case PositionTopLeft: moveResizeGeom = TQRect( topleft, orig.bottomRight() ) ; break; @@ -2599,12 +2662,12 @@ void Client::handleMoveResize( int x, int y, int x_root, int y_root ) default: assert( false ); break; - } - if( moveResizeGeom.size() != previousMoveResizeGeom.size()) - update = true; } - else if( isMove()) - { + if (moveResizeGeom.size() != previousMoveResizeGeom.size()) + update = true; + } + else if (isMove()) + { assert( mode == PositionCenter ); // first move, then snap, then check bounds moveResizeGeom.moveTopLeft( topleft ); @@ -2621,29 +2684,160 @@ void Client::handleMoveResize( int x, int y, int x_root, int y_root ) moveResizeGeom.moveLeft(desktopArea.right() - right_marge ); if( moveResizeGeom.topLeft() != previousMoveResizeGeom.topLeft()) update = true; - } + } else - assert( false ); + assert(false); - if( update ) + if (update) + { + bool active = isActiveBorderMaximizing(); + auto mode = active ? options->tilingMode + : isResize() ? options->resizeMode : options->moveMode; + + if (rules()->checkMoveResizeMode(mode) == Options::Opaque) { - if( rules()->checkMoveResizeMode - ( isResize() ? options->resizeMode : options->moveMode ) == Options::Opaque ) - { - setGeometry( moveResizeGeom ); + setGeometry(active ? activeBorderMaximizeGeometry() : moveResizeGeom); positionGeometryTip(); - } - else if( rules()->checkMoveResizeMode - ( isResize() ? options->resizeMode : options->moveMode ) == Options::Transparent ) + } + else if (rules()->checkMoveResizeMode(mode) == Options::Transparent) + { + /* It's necessary to move the geometry tip when there's no outline + * shown, otherwise it would cause repaint problems in case + * they overlap; the paint event will come after this, + * so the geometry tip will be painted above the outline + */ + clearbound(); + positionGeometryTip(); + drawbound(active ? activeBorderMaximizeGeometry() : moveResizeGeom); + } + } + if (isMove()) { + workspace()->checkActiveBorder(globalPos, get_tqt_x_time()); + } +} + +void Client::setActiveBorderMode( ActiveMaximizingMode mode ) +{ + activeMode = mode; +} + +ActiveMaximizingMode Client::activeBorderMode() const +{ + return activeMode; +} + +void Client::setActiveBorder(ActiveBorder border) { + currentActiveBorder = border; +} + +ActiveBorder Client::activeBorder() const { + return currentActiveBorder; +} + +bool Client::isActiveBorderMaximizing() const +{ + return activeMaximizing; +} + +void Client::setActiveBorderMaximizing( bool maximizing ) +{ + activeMaximizing = maximizing; + bool opaque = rules()->checkMoveResizeMode(options->tilingMode) == Options::Opaque; + + if (maximizing || opaque) { + clearbound(); + } + + if (maximizing && !opaque) { + drawbound(activeBorderMaximizeGeometry()); + } +} + +void Client::cancelActiveBorderMaximizing() { + if (!activeMaximizing) return; + activeMaximizing = false; + + // If we are in transparent mode, we need to clear out the bound we had drawn + if (rules()->checkMoveResizeMode(options->tilingMode) == Options::Transparent) { + clearbound(); + } +} + +TQRect Client::activeBorderMaximizeGeometry() +{ + TQRect ret; + TQRect max = workspace()->clientArea(MaximizeArea, TQCursor::pos(), workspace()->currentDesktop()); + switch (activeBorderMode()) + { + case ActiveMaximizeMode: + { + if (maximizeMode() == MaximizeFull) + ret = geometryRestore(); + else + ret = max; + break; + } + + case ActiveTilingMode: + { + switch (activeBorder()) { - clearbound(); // it's necessary to move the geometry tip when there's no outline - positionGeometryTip(); // shown, otherwise it would cause repaint problems in case - drawbound( moveResizeGeom ); // they overlap; the paint event will come after this, - } // so the geometry tip will be painted above the outline + case ActiveLeft: + { + ret = TQRect( max.x(), max.y(), max.width()/2, max.height() ); + break; + } + case ActiveRight: + { + ret = TQRect( max.x() + max.width()/2, max.y(), max.width()/2, max.height() ); + break; + } + case ActiveTop: + { + ret = TQRect( max.x(), max.y(), max.width(), max.height()/2 ); + break; + } + case ActiveBottom: + { + ret = TQRect( max.x(), max.y() + max.height()/2, max.width(), max.height()/2 ); + break; + } + case ActiveTopLeft: + { + ret = TQRect( max.x(), max.y(), max.width()/2, max.height()/2 ); + break; + } + case ActiveTopRight: + { + ret = TQRect( max.x() + max.width()/2, max.y(), max.width()/2, max.height()/2 ); + break; + } + case ActiveBottomLeft: + { + ret = TQRect( max.x(), max.y() + max.height()/2, max.width()/2, max.height()/2 ); + break; + } + case ActiveBottomRight: + { + ret = TQRect( max.x() + max.width()/2, max.y() + max.height()/2, max.width()/2, max.height()/2); + break; + } + } } - if ( isMove() ) - workspace()->clientMoved(globalPos, GET_QT_X_TIME()); } + return ret; +} +void Client::tileToBorder(ActiveBorder border) { + if (!isResizable()) return; + activeTiled = true; + setActiveBorderMode(ActiveTilingMode); + setActiveBorder(border); + TQRect geo = activeBorderMaximizeGeometry(); + if (geo.isValid() && !geo.isEmpty()) { + setGeometry(geo); + } + workspace()->raiseClient(this); +} } // namespace diff --git a/twin/geometrytip.h b/twin/geometrytip.h index a9c194250..40c2a63eb 100644 --- a/twin/geometrytip.h +++ b/twin/geometrytip.h @@ -19,7 +19,7 @@ namespace KWinInternal class GeometryTip: public TQLabel { - Q_OBJECT + TQ_OBJECT public: GeometryTip( const XSizeHints* xSizeHints, bool save_under ); ~GeometryTip(); diff --git a/twin/kcmtwin/twindecoration/buttons.cpp b/twin/kcmtwin/twindecoration/buttons.cpp index 17381247a..0a3c6331e 100644 --- a/twin/kcmtwin/twindecoration/buttons.cpp +++ b/twin/kcmtwin/twindecoration/buttons.cpp @@ -606,7 +606,7 @@ void ButtonDropSite::drawContents( TQPainter* p ) TQColor c1( 0x0A, 0x5F, 0x89 ); // KDE 2 titlebar default colour p->fillRect( r, c1 ); - p->setPen( Qt::white ); + p->setPen( TQt::white ); p->setFont( TQFont( TDEGlobalSettings::generalFont().family(), 12, TQFont::Bold) ); p->drawText( r, AlignLeft | AlignVCenter, i18n("TDE") ); @@ -689,11 +689,11 @@ ButtonPositionWidget::ButtonPositionWidget(TQWidget *parent, const char* name) layout->addWidget(m_dropSite); layout->addWidget(m_buttonSource); - connect( m_dropSite, TQT_SIGNAL(buttonAdded(TQChar)), m_buttonSource, TQT_SLOT(hideButton(TQChar)) ); - connect( m_dropSite, TQT_SIGNAL(buttonRemoved(TQChar)), m_buttonSource, TQT_SLOT(showButton(TQChar)) ); - connect( m_buttonSource, TQT_SIGNAL(dropped(TQDropEvent*, TQListViewItem*)), m_dropSite, TQT_SLOT(removeSelectedButton()) ); + connect( m_dropSite, TQ_SIGNAL(buttonAdded(TQChar)), m_buttonSource, TQ_SLOT(hideButton(TQChar)) ); + connect( m_dropSite, TQ_SIGNAL(buttonRemoved(TQChar)), m_buttonSource, TQ_SLOT(showButton(TQChar)) ); + connect( m_buttonSource, TQ_SIGNAL(dropped(TQDropEvent*, TQListViewItem*)), m_dropSite, TQ_SLOT(removeSelectedButton()) ); - connect( m_dropSite, TQT_SIGNAL(changed()), TQT_SIGNAL(changed()) ); + connect( m_dropSite, TQ_SIGNAL(changed()), TQ_SIGNAL(changed()) ); // insert all possible buttons into the source (backwards to keep the preferred order...) bool dummy; diff --git a/twin/kcmtwin/twindecoration/buttons.h b/twin/kcmtwin/twindecoration/buttons.h index 0564d8915..c9f562208 100644 --- a/twin/kcmtwin/twindecoration/buttons.h +++ b/twin/kcmtwin/twindecoration/buttons.h @@ -111,7 +111,7 @@ class ButtonSourceItem : public TQListViewItem */ class ButtonSource : public TDEListView { - Q_OBJECT + TQ_OBJECT public: ButtonSource(TQWidget *parent = 0, const char* name = 0); @@ -138,7 +138,7 @@ typedef TQValueList<ButtonDropSiteItem*> ButtonList; */ class ButtonDropSite: public TQFrame { - Q_OBJECT + TQ_OBJECT public: ButtonDropSite( TQWidget* parent=0, const char* name=0 ); @@ -191,7 +191,7 @@ class ButtonDropSite: public TQFrame class ButtonPositionWidget : public TQWidget { - Q_OBJECT + TQ_OBJECT public: ButtonPositionWidget(TQWidget *parent = 0, const char* name = 0); diff --git a/twin/kcmtwin/twindecoration/preview.cpp b/twin/kcmtwin/twindecoration/preview.cpp index 954ff1774..a1c92c8cb 100644 --- a/twin/kcmtwin/twindecoration/preview.cpp +++ b/twin/kcmtwin/twindecoration/preview.cpp @@ -234,7 +234,7 @@ TQWidget* KDecorationPreviewBridge::initialParentWidget() const return preview; } -Qt::WFlags KDecorationPreviewBridge::initialWFlags() const +TQt::WFlags KDecorationPreviewBridge::initialWFlags() const { return 0; } diff --git a/twin/kcmtwin/twindecoration/preview.h b/twin/kcmtwin/twindecoration/preview.h index 56a342cfc..9d9f09402 100644 --- a/twin/kcmtwin/twindecoration/preview.h +++ b/twin/kcmtwin/twindecoration/preview.h @@ -32,7 +32,7 @@ class KDecorationPreviewOptions; class KDecorationPreview : public TQWidget { - Q_OBJECT + TQ_OBJECT public: // Note: Windows can't be added or removed without making changes to // the code, since parts of it assume there's just an active @@ -106,7 +106,7 @@ class KDecorationPreviewBridge virtual void setKeepBelow( bool ); virtual int currentDesktop() const; virtual TQWidget* initialParentWidget() const; - virtual Qt::WFlags initialWFlags() const; + virtual TQt::WFlags initialWFlags() const; virtual void helperShowHide( bool show ); virtual void grabXServer( bool grab ); private: diff --git a/twin/kcmtwin/twindecoration/twindecoration.cpp b/twin/kcmtwin/twindecoration/twindecoration.cpp index 79a72aafd..265fe2a1c 100644 --- a/twin/kcmtwin/twindecoration/twindecoration.cpp +++ b/twin/kcmtwin/twindecoration/twindecoration.cpp @@ -98,7 +98,7 @@ KWinDecorationModule::KWinDecorationModule(TQWidget* parent, const char* name, c pluginLayout->addWidget(decorationList); TQGroupBox *pluginSettingsGrp = new TQGroupBox( i18n("Decoration Options"), pluginPage ); - pluginSettingsGrp->setColumnLayout( 0, Qt::Vertical ); + pluginSettingsGrp->setColumnLayout( 0, TQt::Vertical ); pluginSettingsGrp->setFlat( true ); pluginSettingsGrp->layout()->setMargin( 0 ); pluginSettingsGrp->layout()->setSpacing( KDialog::spacingHint() ); @@ -184,77 +184,77 @@ KWinDecorationModule::KWinDecorationModule(TQWidget* parent, const char* name, c i18n("Enabling this checkbox will allow you to choose a kind of " "drop shadow to draw under each window.")); - activeShadowSettings = new TQGroupBox(1, Qt::Horizontal, + activeShadowSettings = new TQGroupBox(1, TQt::Horizontal, i18n("Active Window Shadow"), shadowPage); - inactiveShadowSettings = new TQGroupBox(1, Qt::Horizontal, + inactiveShadowSettings = new TQGroupBox(1, TQt::Horizontal, i18n("Inactive Window Shadows"), shadowPage); - whichShadowSettings = new TQGroupBox(3, Qt::Horizontal, - i18n("Draw Shadow Under Normal Windows And..."), shadowPage); + whichShadowSettings = new TQGroupBox(3, TQt::Horizontal, + i18n("Draw Shadow Under Normal Windows And…"), shadowPage); cbShadowDocks = new TQCheckBox(i18n("Docks and &panels"), whichShadowSettings); - connect(cbShadowDocks, TQT_SIGNAL(toggled(bool)), - TQT_SLOT(slotSelectionChanged())); + connect(cbShadowDocks, TQ_SIGNAL(toggled(bool)), + TQ_SLOT(slotSelectionChanged())); cbShadowOverrides = new TQCheckBox(i18n("O&verride windows"), whichShadowSettings); - connect(cbShadowOverrides, TQT_SIGNAL(toggled(bool)), - TQT_SLOT(slotSelectionChanged())); + connect(cbShadowOverrides, TQ_SIGNAL(toggled(bool)), + TQ_SLOT(slotSelectionChanged())); cbShadowTopMenus = new TQCheckBox(i18n("&Top menu"), whichShadowSettings); - connect(cbShadowTopMenus, TQT_SIGNAL(toggled(bool)), - TQT_SLOT(slotSelectionChanged())); + connect(cbShadowTopMenus, TQ_SIGNAL(toggled(bool)), + TQ_SLOT(slotSelectionChanged())); cbInactiveShadow = new TQCheckBox( i18n("Draw shadow under &inactive windows"), inactiveShadowSettings); - connect(cbInactiveShadow, TQT_SIGNAL(toggled(bool)), - TQT_SLOT(slotSelectionChanged())); + connect(cbInactiveShadow, TQ_SIGNAL(toggled(bool)), + TQ_SLOT(slotSelectionChanged())); shadowColourHBox = new TQHBox(activeShadowSettings); shadowColourHBox->setSpacing(KDialog::spacingHint()); shadowColourLabel = new TQLabel(i18n("Colour:"), shadowColourHBox); shadowColourButton = new KColorButton(shadowColourHBox); - connect(shadowColourButton, TQT_SIGNAL(changed(const TQColor &)), TQT_SLOT(slotSelectionChanged())); + connect(shadowColourButton, TQ_SIGNAL(changed(const TQColor &)), TQ_SLOT(slotSelectionChanged())); inactiveShadowColourHBox = new TQHBox(inactiveShadowSettings); inactiveShadowColourHBox->setSpacing(KDialog::spacingHint()); inactiveShadowColourLabel = new TQLabel(i18n("Colour:"), inactiveShadowColourHBox); inactiveShadowColourButton = new KColorButton(inactiveShadowColourHBox); - connect(inactiveShadowColourButton, TQT_SIGNAL(changed(const TQColor &)), TQT_SLOT(slotSelectionChanged())); + connect(inactiveShadowColourButton, TQ_SIGNAL(changed(const TQColor &)), TQ_SLOT(slotSelectionChanged())); shadowOpacityHBox = new TQHBox(activeShadowSettings); shadowOpacityHBox->setSpacing(KDialog::spacingHint()); shadowOpacityLabel = new TQLabel(i18n("Maximum opacity:"), shadowOpacityHBox); - shadowOpacitySlider = new TQSlider(1, 100, 10, 50, Qt::Horizontal, + shadowOpacitySlider = new TQSlider(1, 100, 10, 50, TQt::Horizontal, shadowOpacityHBox); shadowOpacitySlider->setTickmarks(TQSlider::Below); shadowOpacitySlider->setTickInterval(10); shadowOpacitySpinBox = new TQSpinBox(1, 100, 1, shadowOpacityHBox); shadowOpacitySpinBox->setSuffix(" %"); - connect(shadowOpacitySlider, TQT_SIGNAL(valueChanged(int)), shadowOpacitySpinBox, - TQT_SLOT(setValue(int))); - connect(shadowOpacitySpinBox, TQT_SIGNAL(valueChanged(int)), shadowOpacitySlider, - TQT_SLOT(setValue(int))); - connect(shadowOpacitySlider, TQT_SIGNAL(valueChanged(int)), - TQT_SLOT(slotSelectionChanged())); + connect(shadowOpacitySlider, TQ_SIGNAL(valueChanged(int)), shadowOpacitySpinBox, + TQ_SLOT(setValue(int))); + connect(shadowOpacitySpinBox, TQ_SIGNAL(valueChanged(int)), shadowOpacitySlider, + TQ_SLOT(setValue(int))); + connect(shadowOpacitySlider, TQ_SIGNAL(valueChanged(int)), + TQ_SLOT(slotSelectionChanged())); inactiveShadowOpacityHBox = new TQHBox(inactiveShadowSettings); inactiveShadowOpacityHBox->setSpacing(KDialog::spacingHint()); inactiveShadowOpacityLabel = new TQLabel(i18n("Maximum opacity:"), inactiveShadowOpacityHBox); - inactiveShadowOpacitySlider = new TQSlider(1, 100, 10, 50, Qt::Horizontal, + inactiveShadowOpacitySlider = new TQSlider(1, 100, 10, 50, TQt::Horizontal, inactiveShadowOpacityHBox); inactiveShadowOpacitySlider->setTickmarks(TQSlider::Below); inactiveShadowOpacitySlider->setTickInterval(10); inactiveShadowOpacitySpinBox = new TQSpinBox(1, 100, 1, inactiveShadowOpacityHBox); inactiveShadowOpacitySpinBox->setSuffix(" %"); - connect(inactiveShadowOpacitySlider, TQT_SIGNAL(valueChanged(int)), + connect(inactiveShadowOpacitySlider, TQ_SIGNAL(valueChanged(int)), inactiveShadowOpacitySpinBox, - TQT_SLOT(setValue(int))); - connect(inactiveShadowOpacitySpinBox, TQT_SIGNAL(valueChanged(int)), + TQ_SLOT(setValue(int))); + connect(inactiveShadowOpacitySpinBox, TQ_SIGNAL(valueChanged(int)), inactiveShadowOpacitySlider, - TQT_SLOT(setValue(int))); - connect(inactiveShadowOpacitySlider, TQT_SIGNAL(valueChanged(int)), - TQT_SLOT(slotSelectionChanged())); + TQ_SLOT(setValue(int))); + connect(inactiveShadowOpacitySlider, TQ_SIGNAL(valueChanged(int)), + TQ_SLOT(slotSelectionChanged())); shadowXOffsetHBox = new TQHBox(activeShadowSettings); shadowXOffsetHBox->setSpacing(KDialog::spacingHint()); @@ -263,8 +263,8 @@ KWinDecorationModule::KWinDecorationModule(TQWidget* parent, const char* name, c shadowXOffsetHBox); shadowXOffsetSpinBox = new TQSpinBox(-1024, 1024, 1, shadowXOffsetHBox); shadowXOffsetSpinBox->setSuffix(i18n(" pixels")); - connect(shadowXOffsetSpinBox, TQT_SIGNAL(valueChanged(int)), - TQT_SLOT(slotSelectionChanged())); + connect(shadowXOffsetSpinBox, TQ_SIGNAL(valueChanged(int)), + TQ_SLOT(slotSelectionChanged())); inactiveShadowXOffsetHBox = new TQHBox(inactiveShadowSettings); inactiveShadowXOffsetHBox->setSpacing(KDialog::spacingHint()); @@ -274,8 +274,8 @@ KWinDecorationModule::KWinDecorationModule(TQWidget* parent, const char* name, c inactiveShadowXOffsetSpinBox = new TQSpinBox(-1024, 1024, 1, inactiveShadowXOffsetHBox); inactiveShadowXOffsetSpinBox->setSuffix(i18n(" pixels")); - connect(inactiveShadowXOffsetSpinBox, TQT_SIGNAL(valueChanged(int)), - TQT_SLOT(slotSelectionChanged())); + connect(inactiveShadowXOffsetSpinBox, TQ_SIGNAL(valueChanged(int)), + TQ_SLOT(slotSelectionChanged())); shadowYOffsetHBox = new TQHBox(activeShadowSettings); shadowYOffsetHBox->setSpacing(KDialog::spacingHint()); @@ -284,8 +284,8 @@ KWinDecorationModule::KWinDecorationModule(TQWidget* parent, const char* name, c shadowYOffsetHBox); shadowYOffsetSpinBox = new TQSpinBox(-1024, 1024, 1, shadowYOffsetHBox); shadowYOffsetSpinBox->setSuffix(i18n(" pixels")); - connect(shadowYOffsetSpinBox, TQT_SIGNAL(valueChanged(int)), - TQT_SLOT(slotSelectionChanged())); + connect(shadowYOffsetSpinBox, TQ_SIGNAL(valueChanged(int)), + TQ_SLOT(slotSelectionChanged())); inactiveShadowYOffsetHBox = new TQHBox(inactiveShadowSettings); inactiveShadowYOffsetHBox->setSpacing(KDialog::spacingHint()); @@ -295,8 +295,8 @@ KWinDecorationModule::KWinDecorationModule(TQWidget* parent, const char* name, c inactiveShadowYOffsetSpinBox = new TQSpinBox(-1024, 1024, 1, inactiveShadowYOffsetHBox); inactiveShadowYOffsetSpinBox->setSuffix(i18n(" pixels")); - connect(inactiveShadowYOffsetSpinBox, TQT_SIGNAL(valueChanged(int)), - TQT_SLOT(slotSelectionChanged())); + connect(inactiveShadowYOffsetSpinBox, TQ_SIGNAL(valueChanged(int)), + TQ_SLOT(slotSelectionChanged())); shadowThicknessHBox = new TQHBox(activeShadowSettings); shadowThicknessHBox->setSpacing(KDialog::spacingHint()); @@ -306,8 +306,8 @@ KWinDecorationModule::KWinDecorationModule(TQWidget* parent, const char* name, c shadowThicknessSpinBox = new TQSpinBox(1, 100, 1, shadowThicknessHBox); shadowThicknessSpinBox->setSuffix(i18n(" pixels")); - connect(shadowThicknessSpinBox, TQT_SIGNAL(valueChanged(int)), - TQT_SLOT(slotSelectionChanged())); + connect(shadowThicknessSpinBox, TQ_SIGNAL(valueChanged(int)), + TQ_SLOT(slotSelectionChanged())); inactiveShadowThicknessHBox = new TQHBox(inactiveShadowSettings); inactiveShadowThicknessHBox->setSpacing(KDialog::spacingHint()); @@ -317,8 +317,8 @@ KWinDecorationModule::KWinDecorationModule(TQWidget* parent, const char* name, c inactiveShadowThicknessSpinBox = new TQSpinBox(1, 100, 1, inactiveShadowThicknessHBox); inactiveShadowThicknessSpinBox->setSuffix(i18n(" pixels")); - connect(inactiveShadowThicknessSpinBox, TQT_SIGNAL(valueChanged(int)), - TQT_SLOT(slotSelectionChanged())); + connect(inactiveShadowThicknessSpinBox, TQ_SIGNAL(valueChanged(int)), + TQ_SLOT(slotSelectionChanged())); // Page 4 (WM selector) windowmanagerPage = new TQWidget( tabWidget ); @@ -355,25 +355,25 @@ KWinDecorationModule::KWinDecorationModule(TQWidget* parent, const char* name, c tabWidget->insertTab( shadowPage, i18n("&Shadows") ); tabWidget->insertTab( windowmanagerPage, i18n("&Window Manager") ); - connect( buttonPositionWidget, TQT_SIGNAL(changed()), this, TQT_SLOT(slotButtonsChanged()) ); // update preview etc. - connect( buttonPositionWidget, TQT_SIGNAL(changed()), this, TQT_SLOT(slotSelectionChanged()) ); // emit changed()... - connect( decorationList, TQT_SIGNAL(activated(const TQString&)), TQT_SLOT(slotSelectionChanged()) ); - connect( decorationList, TQT_SIGNAL(activated(const TQString&)), - TQT_SLOT(slotChangeDecoration(const TQString&)) ); - connect( cbUseCustomButtonPositions, TQT_SIGNAL(clicked()), TQT_SLOT(slotSelectionChanged()) ); - connect(cbUseCustomButtonPositions, TQT_SIGNAL(toggled(bool)), buttonPositionWidget, TQT_SLOT(setEnabled(bool))); - connect(cbUseCustomButtonPositions, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotButtonsChanged()) ); - connect(cbWindowShadow, TQT_SIGNAL(toggled(bool)), activeShadowSettings, TQT_SLOT(setEnabled(bool))); - connect(cbWindowShadow, TQT_SIGNAL(toggled(bool)), inactiveShadowSettings, TQT_SLOT(setEnabled(bool))); - connect(cbWindowShadow, TQT_SIGNAL(toggled(bool)), whichShadowSettings, TQT_SLOT(setEnabled(bool))); - - connect( cbShowToolTips, TQT_SIGNAL(clicked()), TQT_SLOT(slotSelectionChanged()) ); - connect( cbWindowShadow, TQT_SIGNAL(clicked()), TQT_SLOT(slotSelectionChanged()) ); - connect( cBorder, TQT_SIGNAL( activated( int )), TQT_SLOT( slotBorderChanged( int ))); -// connect( cbUseMiniWindows, TQT_SIGNAL(clicked()), TQT_SLOT(slotSelectionChanged()) ); - - connect( thirdpartyWMList, TQT_SIGNAL(activated(const TQString&)), TQT_SLOT(slotSelectionChanged()) ); - connect( thirdpartyWMArguments, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotSelectionChanged()) ); + connect( buttonPositionWidget, TQ_SIGNAL(changed()), this, TQ_SLOT(slotButtonsChanged()) ); // update preview etc. + connect( buttonPositionWidget, TQ_SIGNAL(changed()), this, TQ_SLOT(slotSelectionChanged()) ); // emit changed()... + connect( decorationList, TQ_SIGNAL(activated(const TQString&)), TQ_SLOT(slotSelectionChanged()) ); + connect( decorationList, TQ_SIGNAL(activated(const TQString&)), + TQ_SLOT(slotChangeDecoration(const TQString&)) ); + connect( cbUseCustomButtonPositions, TQ_SIGNAL(clicked()), TQ_SLOT(slotSelectionChanged()) ); + connect(cbUseCustomButtonPositions, TQ_SIGNAL(toggled(bool)), buttonPositionWidget, TQ_SLOT(setEnabled(bool))); + connect(cbUseCustomButtonPositions, TQ_SIGNAL(toggled(bool)), this, TQ_SLOT(slotButtonsChanged()) ); + connect(cbWindowShadow, TQ_SIGNAL(toggled(bool)), activeShadowSettings, TQ_SLOT(setEnabled(bool))); + connect(cbWindowShadow, TQ_SIGNAL(toggled(bool)), inactiveShadowSettings, TQ_SLOT(setEnabled(bool))); + connect(cbWindowShadow, TQ_SIGNAL(toggled(bool)), whichShadowSettings, TQ_SLOT(setEnabled(bool))); + + connect( cbShowToolTips, TQ_SIGNAL(clicked()), TQ_SLOT(slotSelectionChanged()) ); + connect( cbWindowShadow, TQ_SIGNAL(clicked()), TQ_SLOT(slotSelectionChanged()) ); + connect( cBorder, TQ_SIGNAL( activated( int )), TQ_SLOT( slotBorderChanged( int ))); +// connect( cbUseMiniWindows, TQ_SIGNAL(clicked()), TQ_SLOT(slotSelectionChanged()) ); + + connect( thirdpartyWMList, TQ_SIGNAL(activated(const TQString&)), TQ_SLOT(slotSelectionChanged()) ); + connect( thirdpartyWMArguments, TQ_SIGNAL(textChanged(const TQString&)), TQ_SLOT(slotSelectionChanged()) ); // Allow twin dcop signal to update our selection list connectDCOPSignal("twin", 0, "dcopResetAllClients()", "dcopUpdateClientList()", false); @@ -414,7 +414,7 @@ void KWinDecorationModule::findDecorations() KDesktopFile desktopFile(filename); TQString libName = desktopFile.readEntry("X-TDE-Library"); - if (!libName.isEmpty() && libName.startsWith( "twin3_" )) + if (!libName.isEmpty() && libName.startsWith("twin_") || libName.startsWith("twin3_")) { DecorationInfo di; di.name = desktopFile.readName(); @@ -614,7 +614,7 @@ TQString KWinDecorationModule::decorationLibName( const TQString& name ) void KWinDecorationModule::resetPlugin( TDEConfig* conf, const TQString& currentDecoName ) { // Config names are "twin_icewm_config" - // for "twin3_icewm" twin client + // for "twin_icewm" twin client TQString oldName = styleToConfigLib( oldLibraryName ); @@ -660,10 +660,10 @@ void KWinDecorationModule::resetPlugin( TDEConfig* conf, const TQString& current pluginObject = (TQObject*)(allocatePlugin( conf, pluginConfigWidget )); // connect required signals and slots together... - connect( pluginObject, TQT_SIGNAL(changed()), this, TQT_SLOT(slotSelectionChanged()) ); - connect( this, TQT_SIGNAL(pluginLoad(TDEConfig*)), pluginObject, TQT_SLOT(load(TDEConfig*)) ); - connect( this, TQT_SIGNAL(pluginSave(TDEConfig*)), pluginObject, TQT_SLOT(save(TDEConfig*)) ); - connect( this, TQT_SIGNAL(pluginDefaults()), pluginObject, TQT_SLOT(defaults()) ); + connect( pluginObject, TQ_SIGNAL(changed()), this, TQ_SLOT(slotSelectionChanged()) ); + connect( this, TQ_SIGNAL(pluginLoad(TDEConfig*)), pluginObject, TQ_SLOT(load(TDEConfig*)) ); + connect( this, TQ_SIGNAL(pluginSave(TDEConfig*)), pluginObject, TQ_SLOT(save(TDEConfig*)) ); + connect( this, TQ_SIGNAL(pluginDefaults()), pluginObject, TQ_SLOT(defaults()) ); pluginConfigWidget->show(); return; } @@ -895,7 +895,7 @@ void KWinDecorationModule::defaults() border_size = BorderNormal; checkSupportedBorderSizes(); - shadowColourButton->setColor(Qt::black); + shadowColourButton->setColor(TQt::black); shadowOpacitySlider->setValue(70); shadowXOffsetSpinBox->setValue(0); shadowYOffsetSpinBox->setValue(10); @@ -904,7 +904,7 @@ void KWinDecorationModule::defaults() cbShadowOverrides->setChecked(false); cbShadowTopMenus->setChecked(false); cbInactiveShadow->setChecked(false); - inactiveShadowColourButton->setColor(Qt::black); + inactiveShadowColourButton->setColor(TQt::black); inactiveShadowOpacitySlider->setValue(70); inactiveShadowXOffsetSpinBox->setValue(0); inactiveShadowYOffsetSpinBox->setValue(5); @@ -938,10 +938,7 @@ void KWinDecorationModule::checkSupportedBorderSizes() TQString KWinDecorationModule::styleToConfigLib( TQString& styleLib ) { - if( styleLib.startsWith( "twin3_" )) - return "twin_" + styleLib.mid( 6 ) + "_config"; - else - return styleLib + "_config"; + return styleLib + "_config"; } TQString KWinDecorationModule::quickHelp() const @@ -951,7 +948,7 @@ TQString KWinDecorationModule::quickHelp() const "as well as titlebar button positions and custom decoration options.</p>" "To choose a theme for your window decoration click on its name and apply your choice by clicking the \"Apply\" button below." " If you do not want to apply your choice you can click the \"Reset\" button to discard your changes." - "<p>You can configure each theme in the \"Configure [...]\" tab. There are different options specific for each theme.</p>" + "<p>You can configure each theme in the \"Configure […]\" tab. There are different options specific for each theme.</p>" "<p>In \"General Options (if available)\" you can activate the \"Buttons\" tab by checking the \"Use custom titlebar button positions\" box." " In the \"Buttons\" tab you can change the positions of the buttons to your liking.</p>" ); } diff --git a/twin/kcmtwin/twindecoration/twindecoration.h b/twin/kcmtwin/twindecoration/twindecoration.h index 5f5f94ab9..b55455c12 100644 --- a/twin/kcmtwin/twindecoration/twindecoration.h +++ b/twin/kcmtwin/twindecoration/twindecoration.h @@ -61,7 +61,7 @@ struct DecorationInfo class KWinDecorationModule : public TDECModule, virtual public KWinDecorationIface, public KDecorationDefines { - Q_OBJECT + TQ_OBJECT public: KWinDecorationModule(TQWidget* parent, const char* name, const TQStringList &); diff --git a/twin/kcmtwin/twinoptions/CMakeLists.txt b/twin/kcmtwin/twinoptions/CMakeLists.txt index b991bac96..6686f99b1 100644 --- a/twin/kcmtwin/twinoptions/CMakeLists.txt +++ b/twin/kcmtwin/twinoptions/CMakeLists.txt @@ -31,7 +31,7 @@ tde_create_translated_desktop( tde_create_translated_desktop( SOURCE twinactions.desktop twinadvanced.desktop twinfocus.desktop - twinmoving.desktop twintranslucency.desktop + twinmoving.desktop twintranslucency.desktop twinactiveborders.desktop DESTINATION ${APPS_INSTALL_DIR}/.hidden PO_DIR twin-desktops ) diff --git a/twin/kcmtwin/twinoptions/main.cpp b/twin/kcmtwin/twinoptions/main.cpp index 8ed52b067..2ce258c3c 100644 --- a/twin/kcmtwin/twinoptions/main.cpp +++ b/twin/kcmtwin/twinoptions/main.cpp @@ -59,6 +59,13 @@ extern "C" return new KMovingConfig(true, c, parent, name); } + KDE_EXPORT TDECModule *create_twinaborders(TQWidget *parent, const char *name) + { + TDEGlobal::locale()->insertCatalogue("kcmkwm"); + TDEConfig *c = new TDEConfig("twinrc", false, true); + return new KActiveBorderConfig(true, c, parent, name); + } + KDE_EXPORT TDECModule *create_twinadvanced(TQWidget *parent, const char *name) { //CT there's need for decision: kwm or twin? @@ -66,7 +73,7 @@ extern "C" TDEConfig *c = new TDEConfig("twinrc", false, true); return new KAdvancedConfig(true, c, parent, name); } - + KDE_EXPORT TDECModule *create_twintranslucency(TQWidget *parent, const char *name) { //CT there's need for decision: kwm or twin? @@ -95,33 +102,38 @@ KWinOptions::KWinOptions(TQWidget *parent, const char *name) mFocus = new KFocusConfig(false, mConfig, this, "TWin Focus Config"); mFocus->layout()->setMargin( KDialog::marginHint() ); tab->addTab(mFocus, i18n("&Focus")); - connect(mFocus, TQT_SIGNAL(changed(bool)), this, TQT_SLOT(moduleChanged(bool))); + connect(mFocus, TQ_SIGNAL(changed(bool)), this, TQ_SLOT(moduleChanged(bool))); mTitleBarActions = new KTitleBarActionsConfig(false, mConfig, this, "TWin TitleBar Actions"); mTitleBarActions->layout()->setMargin( KDialog::marginHint() ); tab->addTab(mTitleBarActions, i18n("&Titlebar Actions")); - connect(mTitleBarActions, TQT_SIGNAL(changed(bool)), this, TQT_SLOT(moduleChanged(bool))); + connect(mTitleBarActions, TQ_SIGNAL(changed(bool)), this, TQ_SLOT(moduleChanged(bool))); mWindowActions = new KWindowActionsConfig(false, mConfig, this, "TWin Window Actions"); mWindowActions->layout()->setMargin( KDialog::marginHint() ); tab->addTab(mWindowActions, i18n("Window Actio&ns")); - connect(mWindowActions, TQT_SIGNAL(changed(bool)), this, TQT_SLOT(moduleChanged(bool))); + connect(mWindowActions, TQ_SIGNAL(changed(bool)), this, TQ_SLOT(moduleChanged(bool))); mMoving = new KMovingConfig(false, mConfig, this, "TWin Moving"); mMoving->layout()->setMargin( KDialog::marginHint() ); tab->addTab(mMoving, i18n("&Moving")); - connect(mMoving, TQT_SIGNAL(changed(bool)), this, TQT_SLOT(moduleChanged(bool))); + connect(mMoving, TQ_SIGNAL(changed(bool)), this, TQ_SLOT(moduleChanged(bool))); + + mABorders = new KActiveBorderConfig(false, mConfig, this, "TWin Active Borders"); + mABorders->layout()->setMargin(KDialog::marginHint()); + tab->addTab(mABorders, i18n("Active &Borders")); + connect(mABorders, TQ_SIGNAL(changed(bool)), this, TQ_SLOT(moduleChanged(bool))); mAdvanced = new KAdvancedConfig(false, mConfig, this, "TWin Advanced"); mAdvanced->layout()->setMargin( KDialog::marginHint() ); tab->addTab(mAdvanced, i18n("Ad&vanced")); - connect(mAdvanced, TQT_SIGNAL(changed(bool)), this, TQT_SLOT(moduleChanged(bool))); + connect(mAdvanced, TQ_SIGNAL(changed(bool)), this, TQ_SLOT(moduleChanged(bool))); mTranslucency = new KTranslucencyConfig(false, mConfig, this, "TWin Translucency"); mTranslucency->layout()->setMargin( KDialog::marginHint() ); tab->addTab(mTranslucency, i18n("&Translucency")); - connect(mTranslucency, TQT_SIGNAL(changed(bool)), this, TQT_SLOT(moduleChanged(bool))); - + connect(mTranslucency, TQ_SIGNAL(changed(bool)), this, TQ_SLOT(moduleChanged(bool))); + TDEAboutData *about = new TDEAboutData(I18N_NOOP("kcmtwinoptions"), I18N_NOOP("Window Behavior Configuration Module"), 0, 0, TDEAboutData::License_GPL, @@ -151,6 +163,7 @@ void KWinOptions::load() mTitleBarActions->load(); mWindowActions->load(); mMoving->load(); + mABorders->load(); mAdvanced->load(); mTranslucency->load(); emit TDECModule::changed( false ); @@ -163,6 +176,7 @@ void KWinOptions::save() mTitleBarActions->save(); mWindowActions->save(); mMoving->save(); + mABorders->save(); mAdvanced->save(); mTranslucency->save(); @@ -181,6 +195,7 @@ void KWinOptions::defaults() mTitleBarActions->defaults(); mWindowActions->defaults(); mMoving->defaults(); + mABorders->defaults(); mAdvanced->defaults(); mTranslucency->defaults(); } @@ -222,10 +237,14 @@ TQString KWinOptions::handbookSection() const } else if (index == 4) { - return "advanced"; + return "active-borders"; } else if (index == 5) { + return "advanced"; + } + else if (index == 6) + { return "translucency"; } else @@ -247,12 +266,12 @@ TDEActionsOptions::TDEActionsOptions(TQWidget *parent, const char *name) mTitleBarActions = new KTitleBarActionsConfig(false, mConfig, this, "TWin TitleBar Actions"); mTitleBarActions->layout()->setMargin( KDialog::marginHint() ); tab->addTab(mTitleBarActions, i18n("&Titlebar Actions")); - connect(mTitleBarActions, TQT_SIGNAL(changed(bool)), this, TQT_SLOT(moduleChanged(bool))); + connect(mTitleBarActions, TQ_SIGNAL(changed(bool)), this, TQ_SLOT(moduleChanged(bool))); mWindowActions = new KWindowActionsConfig(false, mConfig, this, "TWin Window Actions"); mWindowActions->layout()->setMargin( KDialog::marginHint() ); tab->addTab(mWindowActions, i18n("Window Actio&ns")); - connect(mWindowActions, TQT_SIGNAL(changed(bool)), this, TQT_SLOT(moduleChanged(bool))); + connect(mWindowActions, TQ_SIGNAL(changed(bool)), this, TQ_SLOT(moduleChanged(bool))); } TDEActionsOptions::~TDEActionsOptions() diff --git a/twin/kcmtwin/twinoptions/main.h b/twin/kcmtwin/twinoptions/main.h index 554b7b761..18464ac79 100644 --- a/twin/kcmtwin/twinoptions/main.h +++ b/twin/kcmtwin/twinoptions/main.h @@ -32,12 +32,13 @@ class TDEConfig; class KFocusConfig; class KTitleBarActionsConfig; class KWindowActionsConfig; +class KActiveBorderConfig; class KAdvancedConfig; class KTranslucencyConfig; class KWinOptions : public TDECModule { - Q_OBJECT + TQ_OBJECT public: @@ -64,6 +65,7 @@ private: KTitleBarActionsConfig *mTitleBarActions; KWindowActionsConfig *mWindowActions; KMovingConfig *mMoving; + KActiveBorderConfig *mABorders; KAdvancedConfig *mAdvanced; KTranslucencyConfig *mTranslucency; @@ -72,7 +74,7 @@ private: class TDEActionsOptions : public TDECModule { - Q_OBJECT + TQ_OBJECT public: diff --git a/twin/kcmtwin/twinoptions/mouse.cpp b/twin/kcmtwin/twinoptions/mouse.cpp index 51a3b8a9f..0e197071c 100644 --- a/twin/kcmtwin/twinoptions/mouse.cpp +++ b/twin/kcmtwin/twinoptions/mouse.cpp @@ -164,7 +164,7 @@ KTitleBarActionsConfig::KTitleBarActionsConfig (bool _standAlone, TDEConfig *_co combo->insertItem(i18n("On All Desktops")); combo->insertItem(i18n("Nothing")); combo->setSizePolicy(TQSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::Fixed)); - connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + connect(combo, TQ_SIGNAL(activated(int)), TQ_SLOT(changed())); hlayout->addWidget(combo); coTiDbl = combo; TQWhatsThis::add(combo, i18n("Behavior on <em>double</em> click into the titlebar.")); @@ -189,14 +189,14 @@ KTitleBarActionsConfig::KTitleBarActionsConfig (bool _standAlone, TDEConfig *_co comboW->insertItem(i18n("Change Opacity")); comboW->insertItem(i18n("Nothing")); comboW->setSizePolicy(TQSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::Fixed)); - connect(comboW, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + connect(comboW, TQ_SIGNAL(activated(int)), TQ_SLOT(changed())); hlayoutW->addWidget(comboW); coTiW = comboW; TQWhatsThis::add(comboW, txtButton4); label->setBuddy(comboW); cbTiRevW = new TQCheckBox(i18n("Reverse wheel direction"), this); - connect(cbTiRevW, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); + connect(cbTiRevW, TQ_SIGNAL(toggled(bool)), TQ_SLOT(changed())); TQWhatsThis::add( cbTiRevW, i18n("Use this to reverse the action of the mouse wheel.") ); hlayoutW->addWidget(cbTiRevW); @@ -209,7 +209,7 @@ KTitleBarActionsConfig::KTitleBarActionsConfig (bool _standAlone, TDEConfig *_co TQWhatsThis::add( box, i18n("Here you can customize mouse click behavior when clicking on the" " titlebar or the frame of a window.") ); - grid = new TQGrid(4, Qt::Vertical, box); + grid = new TQGrid(4, TQt::Vertical, box); new TQLabel(grid); // dummy @@ -244,15 +244,12 @@ KTitleBarActionsConfig::KTitleBarActionsConfig (bool _standAlone, TDEConfig *_co TQWhatsThis::add( label, i18n("In this column you can customize mouse clicks into the titlebar" " or the frame of an active window.") ); - // Titlebar and frame, active, mouse button 1 - combo = new TQComboBox(grid); - combo->insertItem(i18n("Raise")); - combo->insertItem(i18n("Lower")); - combo->insertItem(i18n("Operations Menu")); - combo->insertItem(i18n("Toggle Raise & Lower")); - combo->insertItem(i18n("Nothing")); - connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); - coTiAct1 = combo; + items << i18n("Raise") + << i18n("Lower") + << i18n("Operations Menu") + << i18n("Toggle Raise & Lower") + << i18n("Nothing") + << i18n("Shade"); txtButton1 = i18n("Behavior on <em>left</em> click into the titlebar or frame of an " "<em>active</em> window."); @@ -261,29 +258,29 @@ KTitleBarActionsConfig::KTitleBarActionsConfig (bool _standAlone, TDEConfig *_co "<em>active</em> window."); // Be nice to left handed users - if ( leftHandedMouse ) tqSwap(txtButton1, txtButton3); + if (leftHandedMouse) + { + tqSwap(txtButton1, txtButton3); + } + // Titlebar and frame, active, mouse button 1 + combo = new TQComboBox(grid); + combo->insertStringList(items); + connect(combo, TQ_SIGNAL(activated(int)), TQ_SLOT(changed())); + coTiAct1 = combo; TQWhatsThis::add(combo, txtButton1); // Titlebar and frame, active, mouse button 2 - - items << i18n("Raise") - << i18n("Lower") - << i18n("Operations Menu") - << i18n("Toggle Raise & Lower") - << i18n("Nothing") - << i18n("Shade"); - combo = new TQComboBox(grid); combo->insertStringList(items); - connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + connect(combo, TQ_SIGNAL(activated(int)), TQ_SLOT(changed())); coTiAct2 = combo; TQWhatsThis::add(combo, i18n("Behavior on <em>middle</em> click into the titlebar or frame of an <em>active</em> window.")); // Titlebar and frame, active, mouse button 3 combo = new TQComboBox(grid); combo->insertStringList(items); - connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + connect(combo, TQ_SIGNAL(activated(int)), TQ_SLOT(changed())); coTiAct3 = combo; TQWhatsThis::add(combo, txtButton3 ); @@ -313,19 +310,19 @@ KTitleBarActionsConfig::KTitleBarActionsConfig (bool _standAlone, TDEConfig *_co combo = new TQComboBox(grid); combo->insertStringList(items); - connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + connect(combo, TQ_SIGNAL(activated(int)), TQ_SLOT(changed())); coTiInAct1 = combo; TQWhatsThis::add(combo, txtButton1); combo = new TQComboBox(grid); combo->insertStringList(items); - connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + connect(combo, TQ_SIGNAL(activated(int)), TQ_SLOT(changed())); coTiInAct2 = combo; TQWhatsThis::add(combo, i18n("Behavior on <em>middle</em> click into the titlebar or frame of an <em>inactive</em> window.")); combo = new TQComboBox(grid); combo->insertStringList(items); - connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + connect(combo, TQ_SIGNAL(activated(int)), TQ_SLOT(changed())); coTiInAct3 = combo; TQWhatsThis::add(combo, txtButton3); @@ -365,13 +362,13 @@ KTitleBarActionsConfig::KTitleBarActionsConfig (bool _standAlone, TDEConfig *_co coMax[b] = new ToolTipComboBox(box, tbl_Max); for (int t = 0; t < 3; ++t) coMax[b]->insertItem(maxButtonPixmaps[t]); - connect(coMax[b], TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); - connect(coMax[b], TQT_SIGNAL(activated(int)), coMax[b], TQT_SLOT(changed())); + connect(coMax[b], TQ_SIGNAL(activated(int)), TQ_SLOT(changed())); + connect(coMax[b], TQ_SIGNAL(activated(int)), coMax[b], TQ_SLOT(changed())); TQWhatsThis::add( coMax[b], txtButton[b] ); coMax[b]->setSizePolicy( TQSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Minimum )); } - connect(kapp, TQT_SIGNAL(tdedisplayPaletteChanged()), TQT_SLOT(paletteChanged())); + connect(kapp, TQ_SIGNAL(tdedisplayPaletteChanged()), TQ_SLOT(paletteChanged())); layout->addStretch(); @@ -614,7 +611,7 @@ KWindowActionsConfig::KWindowActionsConfig (bool _standAlone, TDEConfig *_config TQWhatsThis::add( box, i18n("Here you can customize mouse click behavior when clicking on an inactive" " inner window ('inner' means: not titlebar, not frame).") ); - grid = new TQGrid(3, Qt::Vertical, box); + grid = new TQGrid(3, TQt::Vertical, box); strMouseButton1 = i18n("Left button:"); txtButton1 = i18n("In this row you can customize left click behavior when clicking into" @@ -658,19 +655,19 @@ KWindowActionsConfig::KWindowActionsConfig (bool _standAlone, TDEConfig *_config TQComboBox* combo = new TQComboBox(grid); combo->insertStringList(items); - connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + connect(combo, TQ_SIGNAL(activated(int)), TQ_SLOT(changed())); coWin1 = combo; TQWhatsThis::add( combo, strWin1 ); combo = new TQComboBox(grid); combo->insertStringList(items); - connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + connect(combo, TQ_SIGNAL(activated(int)), TQ_SLOT(changed())); coWin2 = combo; TQWhatsThis::add( combo, strWin2 ); combo = new TQComboBox(grid); combo->insertStringList(items); - connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + connect(combo, TQ_SIGNAL(activated(int)), TQ_SLOT(changed())); coWin3 = combo; TQWhatsThis::add( combo, strWin3 ); @@ -684,7 +681,7 @@ KWindowActionsConfig::KWindowActionsConfig (bool _standAlone, TDEConfig *_config TQWhatsThis::add( box, i18n("Here you can customize TDE's behavior when clicking somewhere into" " a window while pressing a modifier key.")); - grid = new TQGrid(6, Qt::Vertical, box); + grid = new TQGrid(6, TQt::Vertical, box); // Labels label = new TQLabel(i18n("Modifier key:"), grid); @@ -730,7 +727,7 @@ KWindowActionsConfig::KWindowActionsConfig (bool _standAlone, TDEConfig *_config combo = new TQComboBox(grid); combo->insertItem(i18n("Meta")); combo->insertItem(i18n("Alt")); - connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + connect(combo, TQ_SIGNAL(activated(int)), TQ_SLOT(changed())); coAllKey = combo; TQWhatsThis::add( combo, strAllKey ); @@ -746,19 +743,19 @@ KWindowActionsConfig::KWindowActionsConfig (bool _standAlone, TDEConfig *_config combo = new TQComboBox(grid); combo->insertStringList(items); - connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + connect(combo, TQ_SIGNAL(activated(int)), TQ_SLOT(changed())); coAll1 = combo; TQWhatsThis::add( combo, strAll1 ); combo = new TQComboBox(grid); combo->insertStringList(items); - connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + connect(combo, TQ_SIGNAL(activated(int)), TQ_SLOT(changed())); coAll2 = combo; TQWhatsThis::add( combo, strAll2 ); combo = new TQComboBox(grid); combo->insertStringList(items); - connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + connect(combo, TQ_SIGNAL(activated(int)), TQ_SLOT(changed())); coAll3 = combo; TQWhatsThis::add( combo, strAll3 ); @@ -770,12 +767,12 @@ KWindowActionsConfig::KWindowActionsConfig (bool _standAlone, TDEConfig *_config combo->insertItem(i18n("Move to Previous/Next Desktop")); combo->insertItem(i18n("Change Opacity")); combo->insertItem(i18n("Nothing")); - connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + connect(combo, TQ_SIGNAL(activated(int)), TQ_SLOT(changed())); coAllW = combo; TQWhatsThis::add( combo, strAllW ); cbAllRevW = new TQCheckBox(i18n("Reverse wheel direction"), grid); - connect(cbAllRevW, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); + connect(cbAllRevW, TQ_SIGNAL(toggled(bool)), TQ_SLOT(changed())); TQWhatsThis::add( cbAllRevW, i18n("Use this to reverse the action of the mouse wheel.") ); layout->addStretch(); diff --git a/twin/kcmtwin/twinoptions/mouse.h b/twin/kcmtwin/twinoptions/mouse.h index 5dd3b8402..2a57fc534 100644 --- a/twin/kcmtwin/twinoptions/mouse.h +++ b/twin/kcmtwin/twinoptions/mouse.h @@ -33,7 +33,7 @@ class TDEConfig; class ToolTipComboBox: public TQComboBox { - Q_OBJECT + TQ_OBJECT public: ToolTipComboBox(TQWidget * owner, char const * const * toolTips_) @@ -51,7 +51,7 @@ protected: class KTitleBarActionsConfig : public TDECModule { - Q_OBJECT + TQ_OBJECT public: @@ -97,7 +97,7 @@ private slots: class KWindowActionsConfig : public TDECModule { - Q_OBJECT + TQ_OBJECT public: diff --git a/twin/kcmtwin/twinoptions/twinactiveborders.desktop b/twin/kcmtwin/twinoptions/twinactiveborders.desktop new file mode 100644 index 000000000..54e7d0731 --- /dev/null +++ b/twin/kcmtwin/twinoptions/twinactiveborders.desktop @@ -0,0 +1,17 @@ +[Desktop Entry] +Icon=kcmkwm +Type=Application +Exec=tdecmshell twinoptions +X-DocPath=kcontrol/windowbehavior/index.html + +X-TDE-ModuleType=Library +X-TDE-Library=twinoptions +X-TDE-FactoryName=twinaborders + +Name=Active Borders + +Comment=Configure active borders/corners feature + +Keywords=window behavior;windows;frame;titlebar;borders;corners;active borders;aerosnap; + +Categories=Qt;TDE;X-TDE-settings-desktop; diff --git a/twin/kcmtwin/twinoptions/windows.cpp b/twin/kcmtwin/twinoptions/windows.cpp index 66249d474..9d8e8d617 100644 --- a/twin/kcmtwin/twinoptions/windows.cpp +++ b/twin/kcmtwin/twinoptions/windows.cpp @@ -29,6 +29,7 @@ #include <tqslider.h> #include <tqwhatsthis.h> #include <tqvbuttongroup.h> +#include <tqvbox.h> #include <tqcheckbox.h> #include <tqradiobutton.h> #include <tqlabel.h> @@ -55,34 +56,39 @@ // twin config keywords -#define KWIN_FOCUS "FocusPolicy" -#define KWIN_PLACEMENT "Placement" -#define KWIN_MOVE "MoveMode" -#define KWIN_MINIMIZE_ANIM "AnimateMinimize" -#define KWIN_MINIMIZE_ANIM_SPEED "AnimateMinimizeSpeed" -#define KWIN_RESIZE_OPAQUE "ResizeMode" -#define KWIN_GEOMETRY "GeometryTip" -#define KWIN_AUTORAISE_INTERVAL "AutoRaiseInterval" -#define KWIN_AUTORAISE "AutoRaise" -#define KWIN_DELAYFOCUS_INTERVAL "DelayFocusInterval" -#define KWIN_DELAYFOCUS "DelayFocus" -#define KWIN_CLICKRAISE "ClickRaise" -#define KWIN_ANIMSHADE "AnimateShade" -#define KWIN_MOVE_RESIZE_MAXIMIZED "MoveResizeMaximizedWindows" -#define KWIN_ALTTABMODE "AltTabStyle" -#define KWIN_TRAVERSE_ALL "TraverseAll" -#define KWIN_SHOW_POPUP "ShowPopup" -#define KWIN_ROLL_OVER_DESKTOPS "RollOverDesktops" -#define KWIN_SHADEHOVER "ShadeHover" -#define KWIN_SHADEHOVER_INTERVAL "ShadeHoverInterval" -#define KWIN_FOCUS_STEALING "FocusStealingPreventionLevel" -#define KWIN_HIDE_UTILITY "HideUtilityWindowsForInactive" -#define KWIN_SEPARATE_SCREEN_FOCUS "SeparateScreenFocus" -#define KWIN_ACTIVE_MOUSE_SCREEN "ActiveMouseScreen" - -// kwm config keywords -#define KWM_ELECTRIC_BORDER "ElectricBorders" -#define KWM_ELECTRIC_BORDER_DELAY "ElectricBorderDelay" +#define KWIN_FOCUS "FocusPolicy" +#define KWIN_PLACEMENT "Placement" +#define KWIN_MOVE_MODE "MoveMode" +#define KWIN_RESIZE_MODE "ResizeMode" +#define KWIN_TILING_MODE "TilingMode" +#define KWIN_MINIMIZE_ANIM "AnimateMinimize" +#define KWIN_MINIMIZE_ANIM_SPEED "AnimateMinimizeSpeed" +#define KWIN_GEOMETRY "GeometryTip" +#define KWIN_AUTORAISE_INTERVAL "AutoRaiseInterval" +#define KWIN_AUTORAISE "AutoRaise" +#define KWIN_DELAYFOCUS_INTERVAL "DelayFocusInterval" +#define KWIN_DELAYFOCUS "DelayFocus" +#define KWIN_CLICKRAISE "ClickRaise" +#define KWIN_ANIMSHADE "AnimateShade" +#define KWIN_MOVE_RESIZE_MAXIMIZED "MoveResizeMaximizedWindows" +#define KWIN_RESET_MAX_WIN_GEOM "ResetMaximizedWindowGeometry" +#define KWIN_ALTTABMODE "AltTabStyle" +#define KWIN_TRAVERSE_ALL "TraverseAll" +#define KWIN_SHOW_POPUP "ShowPopup" +#define KWIN_ROLL_OVER_DESKTOPS "RollOverDesktops" +#define KWIN_SHADEHOVER "ShadeHover" +#define KWIN_SHADEHOVER_INTERVAL "ShadeHoverInterval" +#define KWIN_FOCUS_STEALING "FocusStealingPreventionLevel" +#define KWIN_HIDE_UTILITY "HideUtilityWindowsForInactive" +#define KWIN_SEPARATE_SCREEN_FOCUS "SeparateScreenFocus" +#define KWIN_ACTIVE_MOUSE_SCREEN "ActiveMouseScreen" +#define KWIN_ACTIVE_BORDERS "ActiveBorders" +#define KWIN_ACTIVE_BORDER_DELAY "ActiveBorderDelay" +#define KWIN_ACTIVE_BORDER_DISTANCE "ActiveBorderDistance" + +// legacy options +#define KWIN_OLD_ACTIVE_BORDERS "ElectricBorders" +#define KWIN_OLD_ACTIVE_BORDER_DELAY "ElectricBorderDelay" //CT 15mar 98 - magics #define KWM_BRDR_SNAP_ZONE "BorderSnapZone" @@ -124,7 +130,7 @@ KFocusConfig::KFocusConfig (bool _standAlone, TDEConfig *_config, TQWidget * par // focus policy fcsBox = new TQButtonGroup(i18n("Focus"),this); - fcsBox->setColumnLayout( 0, Qt::Horizontal ); + fcsBox->setColumnLayout( 0, TQt::Horizontal ); TQBoxLayout *fLay = new TQVBoxLayout(fcsBox->layout(), KDialog::spacingHint()); @@ -137,7 +143,7 @@ KFocusConfig::KFocusConfig (bool _standAlone, TDEConfig *_config, TQWidget * par focusCombo->insertItem(i18n("Focus Follows Mouse"), FOCUS_FOLLOWS_MOUSE); focusCombo->insertItem(i18n("Focus Under Mouse"), FOCUS_UNDER_MOUSE); focusCombo->insertItem(i18n("Focus Strictly Under Mouse"), FOCUS_STRICTLY_UNDER_MOUSE); - cLay->addWidget(focusCombo,1 ,Qt::AlignLeft); + cLay->addWidget(focusCombo,1 ,TQt::AlignLeft); fLabel->setBuddy(focusCombo); // FIXME, when more policies have been added to TWin @@ -163,35 +169,35 @@ KFocusConfig::KFocusConfig (bool _standAlone, TDEConfig *_config, TQWidget * par TQWhatsThis::add( focusCombo, wtstr); TQWhatsThis::add(fLabel, wtstr); - connect(focusCombo, TQT_SIGNAL(activated(int)), this, TQT_SLOT(setAutoRaiseEnabled()) ); + connect(focusCombo, TQ_SIGNAL(activated(int)), this, TQ_SLOT(setAutoRaiseEnabled()) ); // autoraise delay autoRaiseOn = new TQCheckBox(i18n("Auto &raise"), fcsBox); fLay->addWidget(autoRaiseOn); - connect(autoRaiseOn,TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(autoRaiseOnTog(bool))); + connect(autoRaiseOn,TQ_SIGNAL(toggled(bool)), this, TQ_SLOT(autoRaiseOnTog(bool))); autoRaise = new KIntNumInput(500, fcsBox); - autoRaise->setLabel(i18n("Dela&y:"), Qt::AlignVCenter|Qt::AlignLeft); + autoRaise->setLabel(i18n("Dela&y:"), TQt::AlignVCenter|TQt::AlignLeft); autoRaise->setRange(0, 3000, 100, true); autoRaise->setSteps(100,100); autoRaise->setSuffix(i18n(" msec")); fLay->addWidget(autoRaise); - connect(focusCombo, TQT_SIGNAL(activated(int)), this, TQT_SLOT(setDelayFocusEnabled()) ); + connect(focusCombo, TQ_SIGNAL(activated(int)), this, TQ_SLOT(setDelayFocusEnabled()) ); delayFocusOn = new TQCheckBox(i18n("Delay focus"), fcsBox); fLay->addWidget(delayFocusOn); - connect(delayFocusOn,TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(delayFocusOnTog(bool))); + connect(delayFocusOn,TQ_SIGNAL(toggled(bool)), this, TQ_SLOT(delayFocusOnTog(bool))); delayFocus = new KIntNumInput(500, fcsBox); - delayFocus->setLabel(i18n("Dela&y:"), Qt::AlignVCenter|Qt::AlignLeft); + delayFocus->setLabel(i18n("Dela&y:"), TQt::AlignVCenter|TQt::AlignLeft); delayFocus->setRange(0, 3000, 100, true); delayFocus->setSteps(100,100); delayFocus->setSuffix(i18n(" msec")); fLay->addWidget(delayFocus); clickRaiseOn = new TQCheckBox(i18n("Click &raises active window"), fcsBox); - connect(clickRaiseOn,TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(clickRaiseOnTog(bool))); + connect(clickRaiseOn,TQ_SIGNAL(toggled(bool)), this, TQ_SLOT(clickRaiseOnTog(bool))); fLay->addWidget(clickRaiseOn); // fLay->addColSpacing(0,TQMAX(autoRaiseOn->sizeHint().width(), @@ -206,7 +212,7 @@ KFocusConfig::KFocusConfig (bool _standAlone, TDEConfig *_config, TQWidget * par focusStealing->insertItem( i18n( "Focus Stealing Prevention Level", "High" )); focusStealing->insertItem( i18n( "Focus Stealing Prevention Level", "Extreme" )); focusStealingLabel->setBuddy( focusStealing ); - cLay->addWidget(focusStealing,2 ,Qt::AlignLeft); + cLay->addWidget(focusStealing,2 ,TQt::AlignLeft); wtstr = i18n( "<p>This option specifies how much TWin will try to prevent unwanted focus stealing " "caused by unexpected activation of new windows. (Note: This feature does not " "work with the Focus Under Mouse or Focus Strictly Under Mouse focus policies.)" @@ -228,7 +234,7 @@ KFocusConfig::KFocusConfig (bool _standAlone, TDEConfig *_config, TQWidget * par "in the Notifications control module.</p>" ); TQWhatsThis::add( focusStealing, wtstr ); TQWhatsThis::add( focusStealingLabel, wtstr ); - + TQWhatsThis::add( autoRaiseOn, i18n("When this option is enabled, a window in the background will automatically" " come to the front when the mouse pointer has been over it for some time.") ); wtstr = i18n("This is the delay after which the window that the mouse pointer is over will automatically" @@ -257,10 +263,10 @@ KFocusConfig::KFocusConfig (bool _standAlone, TDEConfig *_config, TQWidget * par " with the focused window. This option is by default disabled for Click to focus and" " enabled for other focus policies." ); TQWhatsThis::add( activeMouseScreen, wtstr ); - connect(focusCombo, TQT_SIGNAL(activated(int)), this, TQT_SLOT(updateActiveMouseScreen())); + connect(focusCombo, TQ_SIGNAL(activated(int)), this, TQ_SLOT(updateActiveMouseScreen())); if (!TQApplication::desktop()->isVirtualDesktop() || - TQApplication::desktop()->numScreens() == 1) // No Ximerama + TQApplication::desktop()->numScreens() == 1) // No Ximerama { separateScreenFocus->hide(); activeMouseScreen->hide(); @@ -269,7 +275,7 @@ KFocusConfig::KFocusConfig (bool _standAlone, TDEConfig *_config, TQWidget * par lay->addWidget(fcsBox); kbdBox = new TQButtonGroup(i18n("Navigation"), this); - kbdBox->setColumnLayout( 0, Qt::Horizontal ); + kbdBox->setColumnLayout( 0, TQt::Horizontal ); TQVBoxLayout *kLay = new TQVBoxLayout(kbdBox->layout(), KDialog::spacingHint()); altTabPopup = new TQCheckBox( i18n("Show window list while switching windows"), kbdBox ); @@ -285,7 +291,7 @@ KFocusConfig::KFocusConfig (bool _standAlone, TDEConfig *_config, TQWidget * par " is pressed, with no popup widget. In addition, the previously" " activated window will be sent to the back in this mode."); TQWhatsThis::add( altTabPopup, wtstr ); - connect(focusCombo, TQT_SIGNAL(activated(int)), this, TQT_SLOT(updateAltTabMode())); + connect(focusCombo, TQ_SIGNAL(activated(int)), this, TQ_SLOT(updateAltTabMode())); traverseAll = new TQCheckBox( i18n( "&Traverse windows on all desktops" ), kbdBox ); kLay->addWidget( traverseAll ); @@ -313,17 +319,17 @@ KFocusConfig::KFocusConfig (bool _standAlone, TDEConfig *_config, TQWidget * par lay->addStretch(); // Any changes goes to slotChanged() - connect(focusCombo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); - connect(fcsBox, TQT_SIGNAL(clicked(int)), TQT_SLOT(changed())); - connect(autoRaise, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(changed())); - connect(delayFocus, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(changed())); - connect(separateScreenFocus, TQT_SIGNAL(clicked()), TQT_SLOT(changed())); - connect(activeMouseScreen, TQT_SIGNAL(clicked()), TQT_SLOT(changed())); - connect(altTabPopup, TQT_SIGNAL(clicked()), TQT_SLOT(changed())); - connect(traverseAll, TQT_SIGNAL(clicked()), TQT_SLOT(changed())); - connect(rollOverDesktops, TQT_SIGNAL(clicked()), TQT_SLOT(changed())); - connect(showPopupinfo, TQT_SIGNAL(clicked()), TQT_SLOT(changed())); - connect(focusStealing, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + connect(focusCombo, TQ_SIGNAL(activated(int)), TQ_SLOT(changed())); + connect(fcsBox, TQ_SIGNAL(clicked(int)), TQ_SLOT(changed())); + connect(autoRaise, TQ_SIGNAL(valueChanged(int)), TQ_SLOT(changed())); + connect(delayFocus, TQ_SIGNAL(valueChanged(int)), TQ_SLOT(changed())); + connect(separateScreenFocus, TQ_SIGNAL(clicked()), TQ_SLOT(changed())); + connect(activeMouseScreen, TQ_SIGNAL(clicked()), TQ_SLOT(changed())); + connect(altTabPopup, TQ_SIGNAL(clicked()), TQ_SLOT(changed())); + connect(traverseAll, TQ_SIGNAL(clicked()), TQ_SLOT(changed())); + connect(rollOverDesktops, TQ_SIGNAL(clicked()), TQ_SLOT(changed())); + connect(showPopupinfo, TQ_SIGNAL(clicked()), TQ_SLOT(changed())); + connect(focusStealing, TQ_SIGNAL(activated(int)), TQ_SLOT(changed())); load(); } @@ -493,7 +499,7 @@ void KFocusConfig::load( void ) setClickRaise(key != "off"); setAutoRaiseEnabled(); // this will disable/hide the auto raise delay widget if focus==click setDelayFocusEnabled(); - + setSeparateScreenFocus( config->readBoolEntry(KWIN_SEPARATE_SCREEN_FOCUS, false)); // on by default for non click to focus policies setActiveMouseScreen( config->readBoolEntry(KWIN_ACTIVE_MOUSE_SCREEN, focusCombo->currentItem() != 0 )); @@ -607,6 +613,220 @@ void KFocusConfig::defaults() emit TDECModule::changed(true); } +KActiveBorderConfig::~KActiveBorderConfig() { + if (standAlone) delete config; +} + +KActiveBorderConfig::KActiveBorderConfig(bool _standAlone, TDEConfig *_config, TQWidget *parent, const char*) + : TDECModule(parent, "kcmkwm"), config(_config), standAlone(_standAlone) { + + TQBoxLayout *lay = new TQVBoxLayout(this, 0, KDialog::spacingHint()); + + active_box = new TQButtonGroup(i18n("Active Desktop Borders"), this); + TQVBoxLayout *active_vbox = new TQVBoxLayout(active_box); + active_vbox->setSpacing(5); + active_vbox->setMargin(15); + TQWhatsThis::add( active_box, i18n("If this option is enabled, moving the mouse to a screen border" + " will perform an action. It will either change your desktop or tile the window that is currently" + " dragged.") ); + + TQLabel *active_func_label = new TQLabel(i18n("Function:"), active_box); + + active_disable = new TQRadioButton(i18n("D&isabled"), active_box); + + active_desktop = new TQRadioButton(i18n("Switch &desktop"), active_box); + active_desktop_conf = new TQWidget(active_box); + TQHBoxLayout *active_desktop_conf_hbox = new TQHBoxLayout(active_desktop_conf); + active_desktop_conf_hbox->addSpacing(20); + active_desktop_conf_hbox->setAutoAdd(true); + active_move = new TQCheckBox(i18n("Switch desktop only when &moving a window"), active_desktop_conf); + + active_tile = new TQRadioButton(i18n("Tile &window"), active_box); + active_tile_conf = new TQWidget(active_box); + TQHBoxLayout *active_tile_conf_hbox = new TQHBoxLayout(active_tile_conf); + active_tile_conf_hbox->addSpacing(20); + TQVBox *active_tile_conf_vbox = new TQVBox(active_tile_conf); + active_tile_conf_hbox->addWidget(active_tile_conf_vbox); + active_maximize = new TQCheckBox(i18n("Maximize windows by dragging them to the &top of the screen"), active_tile_conf_vbox); + tilingOpaque = new TQCheckBox(i18n("Display content &while tiling windows"), active_tile_conf_vbox); + TQWhatsThis::add(tilingOpaque, i18n("Enable this option if you want a window's" + " content to be shown while tiling it," + " instead of just showing a window" + " 'skeleton'. The result may not be " + " satisfying on slow machines.")); + + delays = new KIntNumInput(10, active_box); + delays->setRange(0, MAX_EDGE_RES, 50, true); + delays->setSuffix(i18n(" msec")); + delays->setLabel(i18n("Border &activation delay:")); + TQWhatsThis::add( delays, i18n("Here you can set a delay for the activation of" + " active borders feature. The selected action will be performed after the mouse " + " has been pushed against a screen border for the specified number of milliseconds.") ); + + distance = new KIntNumInput(10, active_box); + distance->setRange(1, 100, 1, true); + distance->setSuffix(i18n(" px")); + distance->setLabel(i18n("Border &activation distance:")); + TQWhatsThis::add( distance, i18n("The distance from which an active border can" + " be activated. A lower value requires you to push repeatedly into the edge." + " Setting this to a higher value (e.g. 30) activates the borders when the" + " mouse is close enough, making them easier to activate but also more prone" + " to false activations.")); + + active_vbox->addSpacing(10); + active_vbox->addWidget(active_func_label); + active_vbox->addWidget(active_disable); + active_vbox->addWidget(active_desktop); + active_vbox->addWidget(active_desktop_conf); + active_vbox->addWidget(active_tile); + active_vbox->addWidget(active_tile_conf); + active_vbox->addSpacing(15); + active_vbox->addWidget(delays); + active_vbox->addWidget(distance); + active_vbox->addSpacing(15); + active_vbox->addWidget(tilingOpaque); + + connect(active_box, TQ_SIGNAL(clicked(int)), this, TQ_SLOT(updateActiveBorders())); + + // Any changes go to slotChanged() + connect(active_box, TQ_SIGNAL(clicked(int)), this, TQ_SLOT(changed())); + connect(active_move, TQ_SIGNAL(clicked()), this, TQ_SLOT(changed())); + connect(active_maximize, TQ_SIGNAL(clicked()), this, TQ_SLOT(changed())); + connect(delays, TQ_SIGNAL(valueChanged(int)), this, TQ_SLOT(changed())); + connect(distance, TQ_SIGNAL(valueChanged(int)), this, TQ_SLOT(changed())); + connect(tilingOpaque, TQ_SIGNAL(clicked()), this, TQ_SLOT(changed())); + + lay->addWidget(active_box); + lay->addStretch(); + load(); +} + +void KActiveBorderConfig::load() { + config->setGroup("Windows"); + + // compatibility with old option names + int active_borders = config->readNumEntry(KWIN_ACTIVE_BORDERS, -1); + if (active_borders == -1) { + active_borders = config->readNumEntry(KWIN_OLD_ACTIVE_BORDERS, 0); + } + + int active_borders_delay = config->readNumEntry(KWIN_ACTIVE_BORDER_DELAY, -1); + if (active_borders_delay == -1) { + active_borders_delay = config->readNumEntry(KWIN_OLD_ACTIVE_BORDER_DELAY, 150); + } + + setActiveBorders(active_borders); + setActiveBorderDelay(active_borders_delay); + setActiveBorderDistance(config->readNumEntry(KWIN_ACTIVE_BORDER_DISTANCE, 10)); + + TQString tilingMode = config->readEntry(KWIN_TILING_MODE, "Opaque"); + if (tilingMode == "Opaque") + setTilingMode(OPAQUE); + else if (tilingMode == "Transparent") + setTilingMode(TRANSPARENT); + + emit TDECModule::changed(false); +} + +void KActiveBorderConfig::save() { + config->setGroup("Windows"); + + config->writeEntry(KWIN_ACTIVE_BORDERS, getActiveBorders()); + config->writeEntry(KWIN_ACTIVE_BORDER_DELAY, getActiveBorderDelay()); + config->writeEntry(KWIN_ACTIVE_BORDER_DISTANCE, getActiveBorderDistance()); + + // remove replaced legacy entries + config->deleteEntry(KWIN_OLD_ACTIVE_BORDERS); + config->deleteEntry(KWIN_OLD_ACTIVE_BORDER_DELAY); + + int tilingMode = getTilingMode(); + if (tilingMode == OPAQUE) + config->writeEntry(KWIN_TILING_MODE, "Opaque"); + else + config->writeEntry(KWIN_TILING_MODE, "Transparent"); + + if (standAlone) + { + config->sync(); + if (!kapp->dcopClient()->isAttached()) + kapp->dcopClient()->attach(); + kapp->dcopClient()->send("twin*", "", "reconfigure()", TQString("")); + } + emit TDECModule::changed(false); +} + +void KActiveBorderConfig::defaults() { + setActiveBorders(0); + setActiveBorderDelay(150); + setActiveBorderDistance(10); + setTilingMode(TRANSPARENT); + emit TDECModule::changed(true); +} + +int KActiveBorderConfig::getTilingMode() { + return tilingOpaque->isChecked() ? OPAQUE : TRANSPARENT; +} + +void KActiveBorderConfig::setTilingMode(int opaque) { + tilingOpaque->setChecked(opaque == OPAQUE); +} + +void KActiveBorderConfig::updateActiveBorders() { + active_desktop_conf->setEnabled(active_desktop->isChecked()); + active_tile_conf->setEnabled(active_tile->isChecked()); +} + +int KActiveBorderConfig::getActiveBorders() { + if (active_desktop->isChecked()) + { + return active_move->isChecked() ? 1 : 2; + } + + if (active_tile->isChecked()) + { + return active_maximize->isChecked() ? 4 : 3; + } + + return 0; +} + +int KActiveBorderConfig::getActiveBorderDelay() { + return delays->value(); +} + +int KActiveBorderConfig::getActiveBorderDistance() { + return distance->value(); +} + +void KActiveBorderConfig::setActiveBorders(int i) { + switch(i) + { + case 1: + active_move->setChecked(true); + case 2: + active_desktop->setChecked(true); + break; + case 4: + active_maximize->setChecked(true); + case 3: + active_tile->setChecked(true); + break; + default: + active_disable->setChecked(true); + break; + } + updateActiveBorders(); +} + +void KActiveBorderConfig::setActiveBorderDelay(int delay) +{ + delays->setValue(delay); +} + +void KActiveBorderConfig::setActiveBorderDistance(int d) { + distance->setValue(d); +} + KAdvancedConfig::~KAdvancedConfig () { if (standAlone) @@ -640,10 +860,10 @@ KAdvancedConfig::KAdvancedConfig (bool _standAlone, TDEConfig *_config, TQWidget shadeHoverOn = new TQCheckBox(i18n("&Enable hover"), shBox); - connect(shadeHoverOn, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(shadeHoverChanged(bool))); + connect(shadeHoverOn, TQ_SIGNAL(toggled(bool)), this, TQ_SLOT(shadeHoverChanged(bool))); shadeHover = new KIntNumInput(500, shBox); - shadeHover->setLabel(i18n("Dela&y:"), Qt::AlignVCenter|Qt::AlignLeft); + shadeHover->setLabel(i18n("Dela&y:"), TQt::AlignVCenter|TQt::AlignLeft); shadeHover->setRange(0, 3000, 100, true); shadeHover->setSteps(100, 100); shadeHover->setSuffix(i18n(" msec")); @@ -658,42 +878,16 @@ KAdvancedConfig::KAdvancedConfig (bool _standAlone, TDEConfig *_config, TQWidget lay->addWidget(shBox); // Any changes goes to slotChanged() - connect(animateShade, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); - connect(shadeHoverOn, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); - connect(shadeHover, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(changed())); - - electricBox = new TQVButtonGroup(i18n("Active Desktop Borders"), this); - electricBox->setMargin(15); - - TQWhatsThis::add( electricBox, i18n("If this option is enabled, moving the mouse to a screen border" - " will change your desktop. This is e.g. useful if you want to drag windows from one desktop" - " to the other.") ); - active_disable = new TQRadioButton(i18n("D&isabled"), electricBox); - active_move = new TQRadioButton(i18n("Only &when moving windows"), electricBox); - active_always = new TQRadioButton(i18n("A&lways enabled"), electricBox); - - delays = new KIntNumInput(10, electricBox); - delays->setRange(0, MAX_EDGE_RES, 50, true); - delays->setSuffix(i18n(" msec")); - delays->setLabel(i18n("Desktop &switch delay:")); - TQWhatsThis::add( delays, i18n("Here you can set a delay for switching desktops using the active" - " borders feature. Desktops will be switched after the mouse has been pushed against a screen border" - " for the specified number of milliseconds.") ); - - connect( electricBox, TQT_SIGNAL(clicked(int)), this, TQT_SLOT(setEBorders())); - - // Any changes goes to slotChanged() - connect(electricBox, TQT_SIGNAL(clicked(int)), TQT_SLOT(changed())); - connect(delays, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(changed())); - - lay->addWidget(electricBox); + connect(animateShade, TQ_SIGNAL(toggled(bool)), TQ_SLOT(changed())); + connect(shadeHoverOn, TQ_SIGNAL(toggled(bool)), TQ_SLOT(changed())); + connect(shadeHover, TQ_SIGNAL(valueChanged(int)), TQ_SLOT(changed())); hideUtilityWindowsForInactive = new TQCheckBox( i18n( "Hide utility windows for inactive applications" ), this ); TQWhatsThis::add( hideUtilityWindowsForInactive, - i18n( "When turned on, utility windows (tool windows, torn-off menus,...) of inactive applications will be" + i18n( "When turned on, utility windows (tool windows, torn-off menus,…) of inactive applications will be" " hidden and will be shown only when the application becomes active. Note that applications" " have to mark the windows with the proper window type for this feature to work." )); - connect(hideUtilityWindowsForInactive, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); + connect(hideUtilityWindowsForInactive, TQ_SIGNAL(toggled(bool)), TQ_SLOT(changed())); lay->addWidget( hideUtilityWindowsForInactive ); lay->addStretch(); @@ -736,9 +930,6 @@ void KAdvancedConfig::load( void ) setShadeHover(config->readBoolEntry(KWIN_SHADEHOVER, false)); setShadeHoverInterval(config->readNumEntry(KWIN_SHADEHOVER_INTERVAL, 250)); - setElectricBorders(config->readNumEntry(KWM_ELECTRIC_BORDER, 0)); - setElectricBorderDelay(config->readNumEntry(KWM_ELECTRIC_BORDER_DELAY, 150)); - setHideUtilityWindowsForInactive( config->readBoolEntry( KWIN_HIDE_UTILITY, true )); emit TDECModule::changed(false); @@ -758,10 +949,6 @@ void KAdvancedConfig::save( void ) v = getShadeHoverInterval(); if (v<0) v = 0; config->writeEntry(KWIN_SHADEHOVER_INTERVAL, v); - - config->writeEntry(KWM_ELECTRIC_BORDER, getElectricBorders()); - config->writeEntry(KWM_ELECTRIC_BORDER_DELAY,getElectricBorderDelay()); - config->writeEntry(KWIN_HIDE_UTILITY, hideUtilityWindowsForInactive->isChecked()); if (standAlone) @@ -779,47 +966,10 @@ void KAdvancedConfig::defaults() setAnimateShade(true); setShadeHover(false); setShadeHoverInterval(250); - setElectricBorders(0); - setElectricBorderDelay(150); setHideUtilityWindowsForInactive( true ); emit TDECModule::changed(true); } -void KAdvancedConfig::setEBorders() -{ - delays->setEnabled(!active_disable->isChecked()); -} - -int KAdvancedConfig::getElectricBorders() -{ - if (active_move->isChecked()) - return 1; - if (active_always->isChecked()) - return 2; - return 0; -} - -int KAdvancedConfig::getElectricBorderDelay() -{ - return delays->value(); -} - -void KAdvancedConfig::setElectricBorders(int i){ - switch(i) - { - case 1: active_move->setChecked(true); break; - case 2: active_always->setChecked(true); break; - default: active_disable->setChecked(true); break; - } - setEBorders(); -} - -void KAdvancedConfig::setElectricBorderDelay(int delay) -{ - delays->setValue(delay); -} - - KMovingConfig::~KMovingConfig () { if (standAlone) @@ -833,24 +983,24 @@ KMovingConfig::KMovingConfig (bool _standAlone, TDEConfig *_config, TQWidget *pa TQBoxLayout *lay = new TQVBoxLayout (this, 0, KDialog::spacingHint()); windowsBox = new TQButtonGroup(i18n("Windows"), this); - windowsBox->setColumnLayout( 0, Qt::Horizontal ); + windowsBox->setColumnLayout( 0, TQt::Horizontal ); TQBoxLayout *wLay = new TQVBoxLayout (windowsBox->layout(), KDialog::spacingHint()); TQBoxLayout *bLay = new TQVBoxLayout; wLay->addLayout(bLay); - opaque = new TQCheckBox(i18n("Di&splay content in moving windows"), windowsBox); - bLay->addWidget(opaque); - TQWhatsThis::add( opaque, i18n("Enable this option if you want a window's content to be fully shown" - " while moving it, instead of just showing a window 'skeleton'. The result may not be satisfying" - " on slow machines without graphic acceleration.") ); + moveOpaque = new TQCheckBox(i18n("Di&splay content in moving windows"), windowsBox); + bLay->addWidget(moveOpaque); + TQWhatsThis::add(moveOpaque, i18n("Enable this option if you want a window's content to be fully shown" + " while moving it, instead of just showing a window 'skeleton'. The result may not be satisfying" + " on slow machines without graphic acceleration.")); - resizeOpaqueOn = new TQCheckBox(i18n("Display content in &resizing windows"), windowsBox); - bLay->addWidget(resizeOpaqueOn); - TQWhatsThis::add( resizeOpaqueOn, i18n("Enable this option if you want a window's content to be shown" - " while resizing it, instead of just showing a window 'skeleton'. The result may not be satisfying" - " on slow machines.") ); + resizeOpaque = new TQCheckBox(i18n("Display content in &resizing windows"), windowsBox); + bLay->addWidget(resizeOpaque); + TQWhatsThis::add(resizeOpaque, i18n("Enable this option if you want a window's content to be shown" + " while resizing it, instead of just showing a window 'skeleton'. The result may not be satisfying" + " on slow machines.")); geometryTipOn = new TQCheckBox(i18n("Display window &geometry when moving or resizing"), windowsBox); bLay->addWidget(geometryTipOn); @@ -860,7 +1010,7 @@ KMovingConfig::KMovingConfig (bool _standAlone, TDEConfig *_config, TQWidget *pa " its size.")); TQGridLayout *rLay = new TQGridLayout(2,3); - bLay->addLayout(TQT_TQLAYOUT(rLay)); + bLay->addLayout(rLay); rLay->setColStretch(0,0); rLay->setColStretch(1,1); @@ -870,22 +1020,22 @@ KMovingConfig::KMovingConfig (bool _standAlone, TDEConfig *_config, TQWidget *pa " windows are minimized or restored." ) ); rLay->addWidget(minimizeAnimOn,0,0); - minimizeAnimSlider = new TQSlider(0,10,10,0,Qt::Horizontal, windowsBox); + minimizeAnimSlider = new TQSlider(0,10,10,0,TQt::Horizontal, windowsBox); minimizeAnimSlider->setSteps(1, 1); // TQSlider::Below clashes with a X11/X.h #define #undef Below minimizeAnimSlider->setTickmarks(TQSlider::Below); rLay->addMultiCellWidget(minimizeAnimSlider,0,0,1,2); - connect(minimizeAnimOn, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(setMinimizeAnim(bool))); - connect(minimizeAnimSlider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(setMinimizeAnimSpeed(int))); + connect(minimizeAnimOn, TQ_SIGNAL(toggled(bool)), this, TQ_SLOT(setMinimizeAnim(bool))); + connect(minimizeAnimSlider, TQ_SIGNAL(valueChanged(int)), this, TQ_SLOT(setMinimizeAnimSpeed(int))); minimizeAnimSlowLabel= new TQLabel(i18n("Slow"),windowsBox); - minimizeAnimSlowLabel->setAlignment(Qt::AlignTop|Qt::AlignLeft); + minimizeAnimSlowLabel->setAlignment(TQt::AlignTop|TQt::AlignLeft); rLay->addWidget(minimizeAnimSlowLabel,1,1); minimizeAnimFastLabel= new TQLabel(i18n("Fast"),windowsBox); - minimizeAnimFastLabel->setAlignment(Qt::AlignTop|Qt::AlignRight); + minimizeAnimFastLabel->setAlignment(TQt::AlignTop|TQt::AlignRight); rLay->addWidget(minimizeAnimFastLabel,1,2); wtstr = i18n("Here you can set the speed of the animation shown when windows are" @@ -900,6 +1050,11 @@ KMovingConfig::KMovingConfig (bool _standAlone, TDEConfig *_config, TQWidget *pa " and allows you to move or resize them," " just like for normal windows")); + resetMaximizedWindowGeometry = new TQCheckBox( i18n("Restore size of maximized/tiled windows when moving"), windowsBox); + bLay->addWidget(resetMaximizedWindowGeometry); + TQWhatsThis::add(resetMaximizedWindowGeometry, i18n("If this feature is enabled, dragging a maximized or tiled window" + " will restore the window to its original size.")); + TQBoxLayout *vLay = new TQHBoxLayout(bLay); TQLabel *plcLabel = new TQLabel(i18n("&Placement:"),windowsBox); @@ -935,7 +1090,7 @@ KMovingConfig::KMovingConfig (bool _standAlone, TDEConfig *_config, TQWidget *pa plcLabel->setBuddy(placementCombo); vLay->addWidget(plcLabel, 0); - vLay->addWidget(placementCombo, 1, Qt::AlignLeft); + vLay->addWidget(placementCombo, 1, TQt::AlignLeft); bLay->addSpacing(10); @@ -988,34 +1143,25 @@ KMovingConfig::KMovingConfig (bool _standAlone, TDEConfig *_config, TQWidget *pa load(); // Any changes goes to slotChanged() - connect( opaque, TQT_SIGNAL(clicked()), TQT_SLOT(changed())); - connect( resizeOpaqueOn, TQT_SIGNAL(clicked()), TQT_SLOT(changed())); - connect( geometryTipOn, TQT_SIGNAL(clicked()), TQT_SLOT(changed())); - connect( minimizeAnimOn, TQT_SIGNAL(clicked() ), TQT_SLOT(changed())); - connect( minimizeAnimSlider, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(changed())); - connect( moveResizeMaximized, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); - connect( placementCombo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); - connect( BrdrSnap, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(changed())); - connect( BrdrSnap, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotBrdrSnapChanged(int))); - connect( WndwSnap, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(changed())); - connect( WndwSnap, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotWndwSnapChanged(int))); - connect( OverlapSnap, TQT_SIGNAL(clicked()), TQT_SLOT(changed())); + connect( moveOpaque, TQ_SIGNAL(clicked()), TQ_SLOT(changed())); + connect( resizeOpaque, TQ_SIGNAL(clicked()), TQ_SLOT(changed())); + connect( geometryTipOn, TQ_SIGNAL(clicked()), TQ_SLOT(changed())); + connect( minimizeAnimOn, TQ_SIGNAL(clicked() ), TQ_SLOT(changed())); + connect( minimizeAnimSlider, TQ_SIGNAL(valueChanged(int)), TQ_SLOT(changed())); + connect( moveResizeMaximized, TQ_SIGNAL(toggled(bool)), TQ_SLOT(changed())); + connect( resetMaximizedWindowGeometry, TQ_SIGNAL(toggled(bool)), TQ_SLOT(changed())); + connect( placementCombo, TQ_SIGNAL(activated(int)), TQ_SLOT(changed())); + connect( BrdrSnap, TQ_SIGNAL(valueChanged(int)), TQ_SLOT(changed())); + connect( BrdrSnap, TQ_SIGNAL(valueChanged(int)), TQ_SLOT(slotBrdrSnapChanged(int))); + connect( WndwSnap, TQ_SIGNAL(valueChanged(int)), TQ_SLOT(changed())); + connect( WndwSnap, TQ_SIGNAL(valueChanged(int)), TQ_SLOT(slotWndwSnapChanged(int))); + connect( OverlapSnap, TQ_SIGNAL(clicked()), TQ_SLOT(changed())); // To get suffix to BrdrSnap and WndwSnap inputs with default values. slotBrdrSnapChanged(BrdrSnap->value()); slotWndwSnapChanged(WndwSnap->value()); } -int KMovingConfig::getMove() -{ - return (opaque->isChecked())? OPAQUE : TRANSPARENT; -} - -void KMovingConfig::setMove(int trans) -{ - opaque->setChecked(trans == OPAQUE); -} - void KMovingConfig::setGeometryTip(bool showGeometryTip) { geometryTipOn->setChecked(showGeometryTip); @@ -1060,20 +1206,33 @@ void KMovingConfig::setMinimizeAnimSpeed(int speed) minimizeAnimSlider->setValue(speed); } -int KMovingConfig::getResizeOpaque() +int KMovingConfig::getMoveMode() { + return moveOpaque->isChecked() ? OPAQUE : TRANSPARENT; +} + +void KMovingConfig::setMoveMode(int opaque) +{ + moveOpaque->setChecked(opaque == OPAQUE); +} + +int KMovingConfig::getResizeMode() { - return (resizeOpaqueOn->isChecked())? RESIZE_OPAQUE : RESIZE_TRANSPARENT; + return resizeOpaque->isChecked() ? OPAQUE : TRANSPARENT; } -void KMovingConfig::setResizeOpaque(int opaque) +void KMovingConfig::setResizeMode(int opaque) { - resizeOpaqueOn->setChecked(opaque == RESIZE_OPAQUE); + resizeOpaque->setChecked(opaque == OPAQUE); } void KMovingConfig::setMoveResizeMaximized(bool a) { moveResizeMaximized->setChecked(a); } +void KMovingConfig::setResetMaximizedWindowGeometry(bool a) { + resetMaximizedWindowGeometry->setChecked(a); +} + void KMovingConfig::slotBrdrSnapChanged(int value) { BrdrSnap->setSuffix(i18n(" pixel", " pixels", value)); } @@ -1088,11 +1247,18 @@ void KMovingConfig::load( void ) config->setGroup( "Windows" ); - key = config->readEntry(KWIN_MOVE, "Opaque"); - if( key == "Transparent") - setMove(TRANSPARENT); - else if( key == "Opaque") - setMove(OPAQUE); + // DF: please keep the default consistent with twin (options.cpp) + key = config->readEntry(KWIN_MOVE_MODE, "Opaque"); + if (key == "Opaque") + setMoveMode(OPAQUE); + else if (key == "Transparent") + setMoveMode(TRANSPARENT); + + key = config->readEntry(KWIN_RESIZE_MODE, "Opaque"); + if (key == "Opaque") + setResizeMode(OPAQUE); + else if (key == "Transparent") + setResizeMode(TRANSPARENT); //CT 17Jun1998 - variable animation speed from 0 (none!!) to 10 (max) bool anim = config->readBoolEntry(KWIN_MINIMIZE_ANIM, true ); @@ -1102,13 +1268,6 @@ void KMovingConfig::load( void ) setMinimizeAnim( anim ); setMinimizeAnimSpeed( animSpeed ); - // DF: please keep the default consistent with twin (options.cpp line 145) - key = config->readEntry(KWIN_RESIZE_OPAQUE, "Opaque"); - if( key == "Opaque") - setResizeOpaque(RESIZE_OPAQUE); - else if ( key == "Transparent") - setResizeOpaque(RESIZE_TRANSPARENT); - //KS 10Jan2003 - Geometry Tip during window move/resize bool showGeomTip = config->readBoolEntry(KWIN_GEOMETRY, false); setGeometryTip( showGeomTip ); @@ -1149,6 +1308,7 @@ void KMovingConfig::load( void ) // } setMoveResizeMaximized(config->readBoolEntry(KWIN_MOVE_RESIZE_MAXIMIZED, false)); + setResetMaximizedWindowGeometry(config->readBoolEntry(KWIN_RESET_MAX_WIN_GEOM, false)); int v; @@ -1172,16 +1332,22 @@ void KMovingConfig::save( void ) config->setGroup( "Windows" ); - v = getMove(); - if (v == TRANSPARENT) - config->writeEntry(KWIN_MOVE,"Transparent"); + v = getMoveMode(); + if (v == OPAQUE) + config->writeEntry(KWIN_MOVE_MODE, "Opaque"); + else + config->writeEntry(KWIN_MOVE_MODE, "Transparent"); + + v = getResizeMode(); + if (v == OPAQUE) + config->writeEntry(KWIN_RESIZE_MODE, "Opaque"); else - config->writeEntry(KWIN_MOVE,"Opaque"); + config->writeEntry(KWIN_RESIZE_MODE, "Transparent"); config->writeEntry(KWIN_GEOMETRY, getGeometryTip()); // placement policy --- CT 31jan98 --- - v =getPlacement(); + v = getPlacement(); if (v == RANDOM_PLACEMENT) config->writeEntry(KWIN_PLACEMENT, "Random"); else if (v == CASCADE_PLACEMENT) @@ -1205,13 +1371,8 @@ void KMovingConfig::save( void ) config->writeEntry(KWIN_MINIMIZE_ANIM, getMinimizeAnim()); config->writeEntry(KWIN_MINIMIZE_ANIM_SPEED, getMinimizeAnimSpeed()); - v = getResizeOpaque(); - if (v == RESIZE_OPAQUE) - config->writeEntry(KWIN_RESIZE_OPAQUE, "Opaque"); - else - config->writeEntry(KWIN_RESIZE_OPAQUE, "Transparent"); - config->writeEntry(KWIN_MOVE_RESIZE_MAXIMIZED, moveResizeMaximized->isChecked()); + config->writeEntry(KWIN_RESET_MAX_WIN_GEOM, resetMaximizedWindowGeometry->isChecked()); config->writeEntry(KWM_BRDR_SNAP_ZONE,getBorderSnapZone()); @@ -1230,11 +1391,12 @@ void KMovingConfig::save( void ) void KMovingConfig::defaults() { - setMove(OPAQUE); - setResizeOpaque(RESIZE_TRANSPARENT); + setMoveMode(OPAQUE); + setResizeMode(TRANSPARENT); setGeometryTip(false); setPlacement(SMART_PLACEMENT); setMoveResizeMaximized(false); + setResetMaximizedWindowGeometry(false); //copied from kcontrol/konq/twindesktop, aleXXX setWindowSnapZone(KWM_WNDW_SNAP_ZONE_DEFAULT); @@ -1297,12 +1459,12 @@ KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, TDEConfig *_config, TQWidget *tGroup = new TQWidget(tabW); TQVBoxLayout *vLay = new TQVBoxLayout (tGroup,KDialog::marginHint(), KDialog::spacingHint()); vLay->addSpacing(11); // to get the proper gb top offset - + onlyDecoTranslucent = new TQCheckBox(i18n("Apply translucency only to decoration"),tGroup); vLay->addWidget(onlyDecoTranslucent); - + vLay->addSpacing(11); - + TQGridLayout *gLay = new TQGridLayout(vLay,4,2,KDialog::spacingHint()); gLay->setColStretch(1,1); @@ -1440,7 +1602,7 @@ KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, TDEConfig *_config, TQLabel *label6 = new TQLabel(i18n("Shadow color:"),sGroup); gLay2->addWidget(label6,7,0); - shadowColor = new KColorButton(Qt::black,sGroup); + shadowColor = new KColorButton(TQt::black,sGroup); gLay2->addWidget(shadowColor,7,1); gLay2->setColStretch(1,1); vLay2->addSpacing(11); @@ -1478,84 +1640,84 @@ KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, TDEConfig *_config, lay->addWidget(useTranslucency); lay->addWidget(tabW); - connect(useTranslucency, TQT_SIGNAL(toggled(bool)), tabW, TQT_SLOT(setEnabled(bool))); - - connect(activeWindowTransparency, TQT_SIGNAL(toggled(bool)), activeWindowOpacity, TQT_SLOT(setEnabled(bool))); - connect(inactiveWindowTransparency, TQT_SIGNAL(toggled(bool)), inactiveWindowOpacity, TQT_SLOT(setEnabled(bool))); - connect(movingWindowTransparency, TQT_SIGNAL(toggled(bool)), movingWindowOpacity, TQT_SLOT(setEnabled(bool))); - connect(dockWindowTransparency, TQT_SIGNAL(toggled(bool)), dockWindowOpacity, TQT_SLOT(setEnabled(bool))); - - connect(useTranslucency, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); - connect(onlyDecoTranslucent, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); - connect(activeWindowTransparency, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); - connect(inactiveWindowTransparency, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); - connect(movingWindowTransparency, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); - connect(dockWindowTransparency, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); - connect(keepAboveAsActive, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); - connect(disableARGB, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); - connect(useOpenGL, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); - connect(useOpenGL, TQT_SIGNAL(toggled(bool)), blurBackground, TQT_SLOT(setEnabled(bool))); - connect(blurBackground, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); - connect(useOpenGL, TQT_SIGNAL(toggled(bool)), greyscaleBackground, TQT_SLOT(setEnabled(bool))); - connect(greyscaleBackground, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); - connect(useShadows, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); - connect(useShadowsOnMenuWindows, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); - connect(useShadowsOnToolTipWindows, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); - connect(useShadowsOnDockWindows, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); - connect(removeShadowsOnResize, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); - connect(removeShadowsOnMove, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); - - connect(activeWindowOpacity, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(changed())); - connect(inactiveWindowOpacity, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(changed())); - connect(movingWindowOpacity, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(changed())); - connect(dockWindowOpacity, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(changed())); - connect(dockWindowShadowSize, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(changed())); - connect(menuWindowShadowSize, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(changed())); - connect(activeWindowShadowSize, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(changed())); - connect(inactiveWindowShadowSize, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(changed())); - connect(baseShadowSize, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(changed())); - connect(shadowTopOffset, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(changed())); - connect(shadowLeftOffset, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(changed())); - connect(shadowColor, TQT_SIGNAL(changed(const TQColor&)), TQT_SLOT(changed())); - connect(fadeInWindows, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); - connect(fadeInMenuWindows, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); - connect(fadeInToolTipWindows, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); - connect(fadeOnOpacityChange, TQT_SIGNAL(toggled(bool)), TQT_SLOT(changed())); - connect(fadeInSpeed, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(changed())); - connect(fadeOutSpeed, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(changed())); - - connect(useShadows, TQT_SIGNAL(toggled(bool)), TQT_SLOT(processShadowLockouts())); - connect(useShadowsOnMenuWindows, TQT_SIGNAL(toggled(bool)), TQT_SLOT(processShadowLockouts())); - connect(useShadowsOnToolTipWindows, TQT_SIGNAL(toggled(bool)), TQT_SLOT(processShadowLockouts())); - connect(useShadowsOnDockWindows, TQT_SIGNAL(toggled(bool)), TQT_SLOT(processShadowLockouts())); + connect(useTranslucency, TQ_SIGNAL(toggled(bool)), tabW, TQ_SLOT(setEnabled(bool))); + + connect(activeWindowTransparency, TQ_SIGNAL(toggled(bool)), activeWindowOpacity, TQ_SLOT(setEnabled(bool))); + connect(inactiveWindowTransparency, TQ_SIGNAL(toggled(bool)), inactiveWindowOpacity, TQ_SLOT(setEnabled(bool))); + connect(movingWindowTransparency, TQ_SIGNAL(toggled(bool)), movingWindowOpacity, TQ_SLOT(setEnabled(bool))); + connect(dockWindowTransparency, TQ_SIGNAL(toggled(bool)), dockWindowOpacity, TQ_SLOT(setEnabled(bool))); + + connect(useTranslucency, TQ_SIGNAL(toggled(bool)), TQ_SLOT(changed())); + connect(onlyDecoTranslucent, TQ_SIGNAL(toggled(bool)), TQ_SLOT(changed())); + connect(activeWindowTransparency, TQ_SIGNAL(toggled(bool)), TQ_SLOT(changed())); + connect(inactiveWindowTransparency, TQ_SIGNAL(toggled(bool)), TQ_SLOT(changed())); + connect(movingWindowTransparency, TQ_SIGNAL(toggled(bool)), TQ_SLOT(changed())); + connect(dockWindowTransparency, TQ_SIGNAL(toggled(bool)), TQ_SLOT(changed())); + connect(keepAboveAsActive, TQ_SIGNAL(toggled(bool)), TQ_SLOT(changed())); + connect(disableARGB, TQ_SIGNAL(toggled(bool)), TQ_SLOT(changed())); + connect(useOpenGL, TQ_SIGNAL(toggled(bool)), TQ_SLOT(changed())); + connect(useOpenGL, TQ_SIGNAL(toggled(bool)), blurBackground, TQ_SLOT(setEnabled(bool))); + connect(blurBackground, TQ_SIGNAL(toggled(bool)), TQ_SLOT(changed())); + connect(useOpenGL, TQ_SIGNAL(toggled(bool)), greyscaleBackground, TQ_SLOT(setEnabled(bool))); + connect(greyscaleBackground, TQ_SIGNAL(toggled(bool)), TQ_SLOT(changed())); + connect(useShadows, TQ_SIGNAL(toggled(bool)), TQ_SLOT(changed())); + connect(useShadowsOnMenuWindows, TQ_SIGNAL(toggled(bool)), TQ_SLOT(changed())); + connect(useShadowsOnToolTipWindows, TQ_SIGNAL(toggled(bool)), TQ_SLOT(changed())); + connect(useShadowsOnDockWindows, TQ_SIGNAL(toggled(bool)), TQ_SLOT(changed())); + connect(removeShadowsOnResize, TQ_SIGNAL(toggled(bool)), TQ_SLOT(changed())); + connect(removeShadowsOnMove, TQ_SIGNAL(toggled(bool)), TQ_SLOT(changed())); + + connect(activeWindowOpacity, TQ_SIGNAL(valueChanged(int)), TQ_SLOT(changed())); + connect(inactiveWindowOpacity, TQ_SIGNAL(valueChanged(int)), TQ_SLOT(changed())); + connect(movingWindowOpacity, TQ_SIGNAL(valueChanged(int)), TQ_SLOT(changed())); + connect(dockWindowOpacity, TQ_SIGNAL(valueChanged(int)), TQ_SLOT(changed())); + connect(dockWindowShadowSize, TQ_SIGNAL(valueChanged(int)), TQ_SLOT(changed())); + connect(menuWindowShadowSize, TQ_SIGNAL(valueChanged(int)), TQ_SLOT(changed())); + connect(activeWindowShadowSize, TQ_SIGNAL(valueChanged(int)), TQ_SLOT(changed())); + connect(inactiveWindowShadowSize, TQ_SIGNAL(valueChanged(int)), TQ_SLOT(changed())); + connect(baseShadowSize, TQ_SIGNAL(valueChanged(int)), TQ_SLOT(changed())); + connect(shadowTopOffset, TQ_SIGNAL(valueChanged(int)), TQ_SLOT(changed())); + connect(shadowLeftOffset, TQ_SIGNAL(valueChanged(int)), TQ_SLOT(changed())); + connect(shadowColor, TQ_SIGNAL(changed(const TQColor&)), TQ_SLOT(changed())); + connect(fadeInWindows, TQ_SIGNAL(toggled(bool)), TQ_SLOT(changed())); + connect(fadeInMenuWindows, TQ_SIGNAL(toggled(bool)), TQ_SLOT(changed())); + connect(fadeInToolTipWindows, TQ_SIGNAL(toggled(bool)), TQ_SLOT(changed())); + connect(fadeOnOpacityChange, TQ_SIGNAL(toggled(bool)), TQ_SLOT(changed())); + connect(fadeInSpeed, TQ_SIGNAL(valueChanged(int)), TQ_SLOT(changed())); + connect(fadeOutSpeed, TQ_SIGNAL(valueChanged(int)), TQ_SLOT(changed())); + + connect(useShadows, TQ_SIGNAL(toggled(bool)), TQ_SLOT(processShadowLockouts())); + connect(useShadowsOnMenuWindows, TQ_SIGNAL(toggled(bool)), TQ_SLOT(processShadowLockouts())); + connect(useShadowsOnToolTipWindows, TQ_SIGNAL(toggled(bool)), TQ_SLOT(processShadowLockouts())); + connect(useShadowsOnDockWindows, TQ_SIGNAL(toggled(bool)), TQ_SLOT(processShadowLockouts())); load(); tabW->setEnabled(useTranslucency->isChecked()); - connect(useTranslucency, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(showWarning(bool))); + connect(useTranslucency, TQ_SIGNAL(toggled(bool)), this, TQ_SLOT(showWarning(bool))); // handle kompmgr restarts if necessary - connect(useTranslucency, TQT_SIGNAL(toggled(bool)), TQT_SLOT(resetKompmgr())); - connect(disableARGB, TQT_SIGNAL(toggled(bool)), TQT_SLOT(resetKompmgr())); - connect(useOpenGL, TQT_SIGNAL(toggled(bool)), TQT_SLOT(resetKompmgr())); - connect(blurBackground, TQT_SIGNAL(toggled(bool)), TQT_SLOT(resetKompmgr())); - connect(greyscaleBackground, TQT_SIGNAL(toggled(bool)), TQT_SLOT(resetKompmgr())); - connect(useShadows, TQT_SIGNAL(toggled(bool)), TQT_SLOT(resetKompmgr())); - connect(useShadowsOnMenuWindows, TQT_SIGNAL(toggled(bool)), TQT_SLOT(resetKompmgr())); - connect(useShadowsOnToolTipWindows, TQT_SIGNAL(toggled(bool)), TQT_SLOT(resetKompmgr())); - connect(useShadowsOnDockWindows, TQT_SIGNAL(toggled(bool)), TQT_SLOT(resetKompmgr())); - connect(inactiveWindowShadowSize, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(resetKompmgr())); - connect(baseShadowSize, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(resetKompmgr())); - connect(shadowTopOffset, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(resetKompmgr())); - connect(shadowLeftOffset, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(resetKompmgr())); - connect(shadowColor, TQT_SIGNAL(changed(const TQColor&)), TQT_SLOT(resetKompmgr())); - connect(fadeInWindows, TQT_SIGNAL(toggled(bool)), TQT_SLOT(resetKompmgr())); - connect(fadeInMenuWindows, TQT_SIGNAL(toggled(bool)), TQT_SLOT(resetKompmgr())); - connect(fadeInToolTipWindows, TQT_SIGNAL(toggled(bool)), TQT_SLOT(resetKompmgr())); - connect(fadeOnOpacityChange, TQT_SIGNAL(toggled(bool)), TQT_SLOT(resetKompmgr())); - connect(fadeInSpeed, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(resetKompmgr())); - connect(fadeOutSpeed, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(resetKompmgr())); + connect(useTranslucency, TQ_SIGNAL(toggled(bool)), TQ_SLOT(resetKompmgr())); + connect(disableARGB, TQ_SIGNAL(toggled(bool)), TQ_SLOT(resetKompmgr())); + connect(useOpenGL, TQ_SIGNAL(toggled(bool)), TQ_SLOT(resetKompmgr())); + connect(blurBackground, TQ_SIGNAL(toggled(bool)), TQ_SLOT(resetKompmgr())); + connect(greyscaleBackground, TQ_SIGNAL(toggled(bool)), TQ_SLOT(resetKompmgr())); + connect(useShadows, TQ_SIGNAL(toggled(bool)), TQ_SLOT(resetKompmgr())); + connect(useShadowsOnMenuWindows, TQ_SIGNAL(toggled(bool)), TQ_SLOT(resetKompmgr())); + connect(useShadowsOnToolTipWindows, TQ_SIGNAL(toggled(bool)), TQ_SLOT(resetKompmgr())); + connect(useShadowsOnDockWindows, TQ_SIGNAL(toggled(bool)), TQ_SLOT(resetKompmgr())); + connect(inactiveWindowShadowSize, TQ_SIGNAL(valueChanged(int)), TQ_SLOT(resetKompmgr())); + connect(baseShadowSize, TQ_SIGNAL(valueChanged(int)), TQ_SLOT(resetKompmgr())); + connect(shadowTopOffset, TQ_SIGNAL(valueChanged(int)), TQ_SLOT(resetKompmgr())); + connect(shadowLeftOffset, TQ_SIGNAL(valueChanged(int)), TQ_SLOT(resetKompmgr())); + connect(shadowColor, TQ_SIGNAL(changed(const TQColor&)), TQ_SLOT(resetKompmgr())); + connect(fadeInWindows, TQ_SIGNAL(toggled(bool)), TQ_SLOT(resetKompmgr())); + connect(fadeInMenuWindows, TQ_SIGNAL(toggled(bool)), TQ_SLOT(resetKompmgr())); + connect(fadeInToolTipWindows, TQ_SIGNAL(toggled(bool)), TQ_SLOT(resetKompmgr())); + connect(fadeOnOpacityChange, TQ_SIGNAL(toggled(bool)), TQ_SLOT(resetKompmgr())); + connect(fadeInSpeed, TQ_SIGNAL(valueChanged(int)), TQ_SLOT(resetKompmgr())); + connect(fadeOutSpeed, TQ_SIGNAL(valueChanged(int)), TQ_SLOT(resetKompmgr())); } } @@ -1642,7 +1804,7 @@ void KTranslucencyConfig::load( void ) r = g = b = 256; if (sscanf(hex.latin1(), "0x%02x%02x%02x", &r, &g, &b)!=3 || r > 255 || g > 255 || b > 255) - shadowColor->setColor(Qt::black); + shadowColor->setColor(TQt::black); else shadowColor->setColor(TQColor(r,g,b)); @@ -1850,7 +2012,7 @@ void KTranslucencyConfig::defaults() useShadowsOnDockWindows->setChecked(FALSE); removeShadowsOnMove->setChecked(FALSE); removeShadowsOnResize->setChecked(FALSE); - shadowColor->setColor(Qt::black); + shadowColor->setColor(TQt::black); fadeInWindows->setChecked(FALSE); fadeInMenuWindows->setChecked(TRUE); fadeInToolTipWindows->setChecked(TRUE); diff --git a/twin/kcmtwin/twinoptions/windows.h b/twin/kcmtwin/twinoptions/windows.h index d4d358e9a..80c9e76d7 100644 --- a/twin/kcmtwin/twinoptions/windows.h +++ b/twin/kcmtwin/twinoptions/windows.h @@ -50,9 +50,6 @@ class KIntNumInput; #define TITLEBAR_PLAIN 0 #define TITLEBAR_SHADED 1 -#define RESIZE_TRANSPARENT 0 -#define RESIZE_OPAQUE 1 - #define SMART_PLACEMENT 0 #define MAXIMIZING_PLACEMENT 1 #define CASCADE_PLACEMENT 2 @@ -68,10 +65,11 @@ class KIntNumInput; #define FOCUS_STRICTLY_UNDER_MOUSE 3 class TQSpinBox; +class TQHBox; class KFocusConfig : public TDECModule { - Q_OBJECT + TQ_OBJECT public: KFocusConfig( bool _standAlone, TDEConfig *_config, TQWidget *parent=0, const char* name=0 ); ~KFocusConfig(); @@ -88,7 +86,7 @@ private slots: void clickRaiseOnTog(bool); void updateAltTabMode(); void updateActiveMouseScreen(); - void changed() { emit TDECModule::changed(true); } + void changed() { emit TDECModule::changed(true); } private: @@ -134,7 +132,7 @@ private: class KMovingConfig : public TDECModule { - Q_OBJECT + TQ_OBJECT public: KMovingConfig( bool _standAlone, TDEConfig *config, TQWidget *parent=0, const char* name=0 ); ~KMovingConfig(); @@ -146,32 +144,34 @@ public: private slots: void setMinimizeAnim( bool ); void setMinimizeAnimSpeed( int ); - void changed() { emit TDECModule::changed(true); } + void changed() { emit TDECModule::changed(true); } void slotBrdrSnapChanged( int ); void slotWndwSnapChanged( int ); private: - int getMove( void ); + int getMoveMode( void ); + int getResizeMode ( void ); bool getMinimizeAnim( void ); - int getMinimizeAnimSpeed( void ); - int getResizeOpaque ( void ); + int getMinimizeAnimSpeed( void ); bool getGeometryTip( void ); //KS - int getPlacement( void ); //CT + int getPlacement( void ); //CT - void setMove(int); - void setResizeOpaque(int); + void setMoveMode(int); + void setResizeMode(int); void setGeometryTip(bool); //KS void setPlacement(int); //CT void setMoveResizeMaximized(bool); + void setResetMaximizedWindowGeometry(bool); TQButtonGroup *windowsBox; - TQCheckBox *opaque; - TQCheckBox *resizeOpaqueOn; + TQCheckBox *moveOpaque; + TQCheckBox *resizeOpaque; TQCheckBox *geometryTipOn; - TQCheckBox* minimizeAnimOn; + TQCheckBox *minimizeAnimOn; TQSlider *minimizeAnimSlider; TQLabel *minimizeAnimSlowLabel, *minimizeAnimFastLabel; TQCheckBox *moveResizeMaximized; + TQCheckBox *resetMaximizedWindowGeometry; TQComboBox *placementCombo; @@ -189,9 +189,54 @@ private: }; +class KActiveBorderConfig : public TDECModule +{ + TQ_OBJECT + public: + KActiveBorderConfig(bool _standAlone, TDEConfig *config, TQWidget *parent=0, const char *name = 0); + ~KActiveBorderConfig(); + + void load(); + void save(); + void defaults(); + + private slots: + // copied from kcontrol/konq/twindesktop, aleXXX + // original name: setEBorders() + void updateActiveBorders(); + + void changed() { emit TDECModule::changed(true); } + + private: + int getActiveBorders(); + int getActiveBorderDelay(); + int getActiveBorderDistance(); + int getTilingMode(); + + void setActiveBorders(int); + void setActiveBorderDelay(int); + void setActiveBorderDistance(int); + void setTilingMode(int); + + TQButtonGroup *active_box; + TQRadioButton *active_disable; + TQRadioButton *active_desktop; + TQCheckBox *active_move; + TQRadioButton *active_tile; + TQCheckBox *active_maximize; + KIntNumInput *delays; + KIntNumInput *distance; + TQWidget *active_desktop_conf; + TQWidget *active_tile_conf; + TQCheckBox *tilingOpaque; + + TDEConfig *config; + bool standAlone; +}; + class KAdvancedConfig : public TDECModule { - Q_OBJECT + TQ_OBJECT public: KAdvancedConfig( bool _standAlone, TDEConfig *config, TQWidget *parent=0, const char* name=0 ); ~KAdvancedConfig(); @@ -203,9 +248,6 @@ public: private slots: void shadeHoverChanged(bool); - //copied from kcontrol/konq/twindesktop, aleXXX - void setEBorders(); - void changed() { emit TDECModule::changed(true); } private: @@ -223,17 +265,6 @@ private: TDEConfig *config; bool standAlone; - int getElectricBorders( void ); - int getElectricBorderDelay(); - void setElectricBorders( int ); - void setElectricBorderDelay( int ); - - TQVButtonGroup *electricBox; - TQRadioButton *active_disable; - TQRadioButton *active_move; - TQRadioButton *active_always; - KIntNumInput *delays; - void setHideUtilityWindowsForInactive( bool ); TQCheckBox* hideUtilityWindowsForInactive; @@ -242,15 +273,15 @@ private: class TDEProcess; class KTranslucencyConfig : public TDECModule { - Q_OBJECT + TQ_OBJECT public: KTranslucencyConfig( bool _standAlone, TDEConfig *config, TQWidget *parent=0, const char* name=0 ); ~KTranslucencyConfig(); - + void load(); void save(); void defaults(); - + private: TQCheckBox *useTranslucency; TQCheckBox *activeWindowTransparency; diff --git a/twin/kcmtwin/twinrules/detectwidget.cpp b/twin/kcmtwin/twinrules/detectwidget.cpp index f450938bc..b01066403 100644 --- a/twin/kcmtwin/twinrules/detectwidget.cpp +++ b/twin/kcmtwin/twinrules/detectwidget.cpp @@ -164,19 +164,19 @@ void DetectDialog::selectWindow() grabber = new TQDialog( NULL, NULL, true, (WFlags)WX11BypassWM ); grabber->move( -1000, -1000 ); grabber->show(); - grabber->grabMouse( tqcrossCursor ); + grabber->grabMouse( TQt::crossCursor ); grabber->installEventFilter( this ); } bool DetectDialog::eventFilter( TQObject* o, TQEvent* e ) { - if( TQT_BASE_OBJECT(o) != TQT_BASE_OBJECT(grabber) ) + if( o != grabber ) return false; if( e->type() != TQEvent::MouseButtonRelease ) return false; delete grabber; grabber = NULL; - if( TQT_TQMOUSEEVENT( e )->button() != Qt::LeftButton ) + if( static_cast<TQMouseEvent*>( e )->button() != TQt::LeftButton ) { emit detectionDone( false ); return true; diff --git a/twin/kcmtwin/twinrules/detectwidget.h b/twin/kcmtwin/twinrules/detectwidget.h index 75e725f5f..ecd608ea7 100644 --- a/twin/kcmtwin/twinrules/detectwidget.h +++ b/twin/kcmtwin/twinrules/detectwidget.h @@ -33,7 +33,7 @@ namespace KWinInternal class DetectWidget : public DetectWidgetBase { - Q_OBJECT + TQ_OBJECT public: DetectWidget( TQWidget* parent = NULL, const char* name = NULL ); }; @@ -41,7 +41,7 @@ class DetectWidget class DetectDialog : public KDialogBase { - Q_OBJECT + TQ_OBJECT public: DetectDialog( TQWidget* parent = NULL, const char* name = NULL ); void detect( WId window ); diff --git a/twin/kcmtwin/twinrules/editshortcutbase.ui b/twin/kcmtwin/twinrules/editshortcutbase.ui index 793784c42..8a9339c16 100644 --- a/twin/kcmtwin/twinrules/editshortcutbase.ui +++ b/twin/kcmtwin/twinrules/editshortcutbase.ui @@ -155,10 +155,10 @@ For example "<b>Shift+Alt+(123) Shift+Ctrl+(ABC)</b>" will first try <slot>clearShortcut()</slot> </connection> </connections> -<Q_SLOTS> +<slots> <slot access="protected" specifier="pure virtual">editShortcut()</slot> <slot access="protected" specifier="pure virtual">clearShortcut()</slot> -</Q_SLOTS> +</slots> <layoutdefaults spacing="6" margin="11"/> <layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/> <includes> diff --git a/twin/kcmtwin/twinrules/kcm.cpp b/twin/kcmtwin/twinrules/kcm.cpp index 2f28bc5dd..fb7451626 100644 --- a/twin/kcmtwin/twinrules/kcm.cpp +++ b/twin/kcmtwin/twinrules/kcm.cpp @@ -44,8 +44,8 @@ KCMRules::KCMRules( TQWidget *parent, const char *name ) { TQVBoxLayout *layout = new TQVBoxLayout( this ); widget = new KCMRulesList( this ); - layout->addWidget( TQT_TQWIDGET(widget) ); - connect( widget, TQT_SIGNAL( changed( bool )), TQT_SLOT( moduleChanged( bool ))); + layout->addWidget( widget ); + connect( widget, TQ_SIGNAL( changed( bool )), TQ_SLOT( moduleChanged( bool ))); TDEAboutData *about = new TDEAboutData(I18N_NOOP( "kcmtwinrules" ), I18N_NOOP( "Window-Specific Settings Configuration Module" ), 0, 0, TDEAboutData::License_GPL, I18N_NOOP( "(c) 2004 KWin and KControl Authors" )); diff --git a/twin/kcmtwin/twinrules/kcm.h b/twin/kcmtwin/twinrules/kcm.h index 5e89a7773..54e044845 100644 --- a/twin/kcmtwin/twinrules/kcm.h +++ b/twin/kcmtwin/twinrules/kcm.h @@ -34,7 +34,7 @@ class KCMRulesList; class KCMRules : public TDECModule { - Q_OBJECT + TQ_OBJECT public: KCMRules( TQWidget *parent, const char *name ); virtual void load(); diff --git a/twin/kcmtwin/twinrules/ruleslist.cpp b/twin/kcmtwin/twinrules/ruleslist.cpp index 8961874ae..a9238c178 100644 --- a/twin/kcmtwin/twinrules/ruleslist.cpp +++ b/twin/kcmtwin/twinrules/ruleslist.cpp @@ -33,22 +33,22 @@ KCMRulesList::KCMRulesList( TQWidget* parent, const char* name ) : KCMRulesListBase( parent, name ) { // connect both current/selected, so that current==selected (stupid TQListBox :( ) - connect( rules_listbox, TQT_SIGNAL( currentChanged( TQListBoxItem* )), - TQT_SLOT( activeChanged( TQListBoxItem*))); - connect( rules_listbox, TQT_SIGNAL( selectionChanged( TQListBoxItem* )), - TQT_SLOT( activeChanged( TQListBoxItem*))); - connect( new_button, TQT_SIGNAL( clicked()), - TQT_SLOT( newClicked())); - connect( modify_button, TQT_SIGNAL( clicked()), - TQT_SLOT( modifyClicked())); - connect( delete_button, TQT_SIGNAL( clicked()), - TQT_SLOT( deleteClicked())); - connect( moveup_button, TQT_SIGNAL( clicked()), - TQT_SLOT( moveupClicked())); - connect( movedown_button, TQT_SIGNAL( clicked()), - TQT_SLOT( movedownClicked())); - connect( rules_listbox, TQT_SIGNAL( doubleClicked ( TQListBoxItem * ) ), - TQT_SLOT( modifyClicked())); + connect( rules_listbox, TQ_SIGNAL( currentChanged( TQListBoxItem* )), + TQ_SLOT( activeChanged( TQListBoxItem*))); + connect( rules_listbox, TQ_SIGNAL( selectionChanged( TQListBoxItem* )), + TQ_SLOT( activeChanged( TQListBoxItem*))); + connect( new_button, TQ_SIGNAL( clicked()), + TQ_SLOT( newClicked())); + connect( modify_button, TQ_SIGNAL( clicked()), + TQ_SLOT( modifyClicked())); + connect( delete_button, TQ_SIGNAL( clicked()), + TQ_SLOT( deleteClicked())); + connect( moveup_button, TQ_SIGNAL( clicked()), + TQ_SLOT( moveupClicked())); + connect( movedown_button, TQ_SIGNAL( clicked()), + TQ_SLOT( movedownClicked())); + connect( rules_listbox, TQ_SIGNAL( doubleClicked ( TQListBoxItem * ) ), + TQ_SLOT( modifyClicked())); load(); } diff --git a/twin/kcmtwin/twinrules/ruleslist.h b/twin/kcmtwin/twinrules/ruleslist.h index f7e7fb541..837ad6840 100644 --- a/twin/kcmtwin/twinrules/ruleslist.h +++ b/twin/kcmtwin/twinrules/ruleslist.h @@ -34,7 +34,7 @@ namespace KWinInternal class KCMRulesList : public KCMRulesListBase { - Q_OBJECT + TQ_OBJECT public: KCMRulesList( TQWidget* parent = NULL, const char* name = NULL ); virtual ~KCMRulesList(); diff --git a/twin/kcmtwin/twinrules/ruleslistbase.ui b/twin/kcmtwin/twinrules/ruleslistbase.ui index f079dcda3..233290e38 100644 --- a/twin/kcmtwin/twinrules/ruleslistbase.ui +++ b/twin/kcmtwin/twinrules/ruleslistbase.ui @@ -29,7 +29,7 @@ <cstring>new_button</cstring> </property> <property name="text"> - <string>&New...</string> + <string>&New…</string> </property> </widget> <widget class="KPushButton" row="1" column="1"> @@ -37,7 +37,7 @@ <cstring>modify_button</cstring> </property> <property name="text"> - <string>&Modify...</string> + <string>&Modify…</string> </property> </widget> <widget class="KPushButton" row="2" column="1"> @@ -47,9 +47,6 @@ <property name="text"> <string>Delete</string> </property> - <property name="accel"> - <string></string> - </property> </widget> <widget class="KPushButton" row="3" column="1"> <property name="name"> diff --git a/twin/kcmtwin/twinrules/ruleswidget.cpp b/twin/kcmtwin/twinrules/ruleswidget.cpp index 334001bf7..116ac8b41 100644 --- a/twin/kcmtwin/twinrules/ruleswidget.cpp +++ b/twin/kcmtwin/twinrules/ruleswidget.cpp @@ -41,9 +41,9 @@ namespace KWinInternal { #define SETUP( var, type ) \ - connect( enable_##var, TQT_SIGNAL( toggled( bool )), rule_##var, TQT_SLOT( setEnabled( bool ))); \ - connect( enable_##var, TQT_SIGNAL( toggled( bool )), this, TQT_SLOT( updateEnable##var())); \ - connect( rule_##var, TQT_SIGNAL( activated( int )), this, TQT_SLOT( updateEnable##var())); \ + connect( enable_##var, TQ_SIGNAL( toggled( bool )), rule_##var, TQ_SLOT( setEnabled( bool ))); \ + connect( enable_##var, TQ_SIGNAL( toggled( bool )), this, TQ_SLOT( updateEnable##var())); \ + connect( rule_##var, TQ_SIGNAL( activated( int )), this, TQ_SLOT( updateEnable##var())); \ TQWhatsThis::add( enable_##var, enableDesc ); \ TQWhatsThis::add( rule_##var, type##RuleDesc ); @@ -550,7 +550,7 @@ void RulesWidget::detectClicked() { assert( detect_dlg == NULL ); detect_dlg = new DetectDialog; - connect( detect_dlg, TQT_SIGNAL( detectionDone( bool )), this, TQT_SLOT( detected( bool ))); + connect( detect_dlg, TQ_SIGNAL( detectionDone( bool )), this, TQ_SLOT( detected( bool ))); detect_dlg->detect( 0 ); } @@ -702,7 +702,7 @@ Rules* RulesDialog::edit( Rules* r, WId window, bool show_hints ) if( window != 0 ) widget->prepareWindowSpecific( window ); if( show_hints ) - TQTimer::singleShot( 0, this, TQT_SLOT( displayHints())); + TQTimer::singleShot( 0, this, TQ_SLOT( displayHints())); exec(); return rules; } diff --git a/twin/kcmtwin/twinrules/ruleswidget.h b/twin/kcmtwin/twinrules/ruleswidget.h index 4d22e1826..4c4ef4be0 100644 --- a/twin/kcmtwin/twinrules/ruleswidget.h +++ b/twin/kcmtwin/twinrules/ruleswidget.h @@ -36,7 +36,7 @@ class DetectDialog; class RulesWidget : public RulesWidgetBase { - Q_OBJECT + TQ_OBJECT public: RulesWidget( TQWidget* parent = NULL, const char* name = NULL ); void setRules( Rules* r ); @@ -97,7 +97,7 @@ class RulesWidget class RulesDialog : public KDialogBase { - Q_OBJECT + TQ_OBJECT public: RulesDialog( TQWidget* parent = NULL, const char* name = NULL ); Rules* edit( Rules* r, WId window, bool show_hints ); @@ -113,7 +113,7 @@ class RulesDialog class EditShortcut : public EditShortcutBase { - Q_OBJECT + TQ_OBJECT public: EditShortcut( TQWidget* parent = NULL, const char* name = NULL ); protected: @@ -124,7 +124,7 @@ class EditShortcut class EditShortcutDialog : public KDialogBase { - Q_OBJECT + TQ_OBJECT public: EditShortcutDialog( TQWidget* parent = NULL, const char* name = NULL ); void setShortcut( const TQString& cut ); @@ -137,7 +137,7 @@ class EditShortcutDialog class ShortcutDialog : public TDEShortcutDialog { - Q_OBJECT + TQ_OBJECT public: ShortcutDialog( const TDEShortcut& cut, TQWidget* parent = NULL, const char* name = NULL ); virtual void accept(); diff --git a/twin/kcmtwin/twinrules/ruleswidgetbase.ui b/twin/kcmtwin/twinrules/ruleswidgetbase.ui index 352a26762..356a99676 100644 --- a/twin/kcmtwin/twinrules/ruleswidgetbase.ui +++ b/twin/kcmtwin/twinrules/ruleswidgetbase.ui @@ -216,9 +216,6 @@ <property name="text"> <string>Edit</string> </property> - <property name="accel"> - <string></string> - </property> </widget> <spacer row="4" column="3" rowspan="1" colspan="2"> <property name="name"> @@ -487,9 +484,6 @@ <property name="text"> <string>Edit</string> </property> - <property name="accel"> - <string></string> - </property> </widget> <spacer row="4" column="3"> <property name="name"> @@ -560,9 +554,6 @@ <property name="text"> <string>Edit</string> </property> - <property name="accel"> - <string></string> - </property> </widget> <spacer row="7" column="3"> <property name="name"> @@ -633,9 +624,6 @@ <property name="text"> <string>Edit</string> </property> - <property name="accel"> - <string></string> - </property> </widget> <spacer row="10" column="3"> <property name="name"> @@ -1869,9 +1857,6 @@ <property name="text"> <string>Shortcut</string> </property> - <property name="accel"> - <string></string> - </property> </widget> <widget class="KComboBox" row="9" column="1"> <item> @@ -1916,7 +1901,7 @@ <cstring>shortcut_edit</cstring> </property> <property name="text"> - <string>Edit...</string> + <string>Edit…</string> </property> </widget> <widget class="KRestrictedLine" row="9" column="2" rowspan="1" colspan="3"> @@ -2292,9 +2277,6 @@ <property name="text"> <string>Strictly obey geometry</string> </property> - <property name="accel"> - <string></string> - </property> </widget> <widget class="KComboBox" row="6" column="1"> <item> @@ -2348,9 +2330,6 @@ <property name="text"> <string>Block global shortcuts</string> </property> - <property name="accel"> - <string></string> - </property> </widget> <widget class="KComboBox" row="7" column="1"> <item> @@ -2530,7 +2509,7 @@ <tabstop>rule_disableglobalshortcuts</tabstop> <tabstop>disableglobalshortcuts</tabstop> </tabstops> -<Q_SLOTS> +<slots> <slot access="protected" specifier="pure virtual">detectClicked()</slot> <slot access="protected" specifier="pure virtual">wmclassMatchChanged()</slot> <slot access="protected" specifier="pure virtual">roleMatchChanged()</slot> @@ -2538,7 +2517,7 @@ <slot access="protected" specifier="pure virtual">extraMatchChanged()</slot> <slot access="protected" specifier="pure virtual">machineMatchChanged()</slot> <slot access="protected" specifier="pure virtual">shortcutEditClicked()</slot> -</Q_SLOTS> +</slots> <layoutdefaults spacing="6" margin="11"/> <layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/> <includes> diff --git a/twin/layers.cpp b/twin/layers.cpp index 143d826d5..adc9bd436 100644 --- a/twin/layers.cpp +++ b/twin/layers.cpp @@ -129,43 +129,50 @@ void Workspace::updateStackingOrder( bool propagate_new_clients ) void Workspace::propagateClients( bool propagate_new_clients ) { Window *cl; // MW we should not assume WId and Window to be compatible - // when passig pointers around. + // when passing pointers around. // restack the windows according to the stacking order -#if 0 - Window* new_stack = new Window[ stacking_order.count() + 2 ]; - int pos = 0; -#endif NET::WindowType t; Window shadow; Window *dock_shadow_stack, *window_stack; int i, numDocks, pos, topmenu_space_pos; - + + // Dock Stack size magic number explanation: + // -> (count * 2) because we might need to also store the shadow window + // for each dock window (Chakra shadow patch, introduced in 9cc1e2c1aa) dock_shadow_stack = new Window[ stacking_order.count() * 2 ]; - window_stack = new Window[ stacking_order.count() * 2 + 2 ]; + + // Window Stack size magic number explanation: + // -> (count * 2) because we might need to store shadow windows (see above) + // -> + 1 for supportWindow + // -> + 1 for topmenu_space + // -> + 8 for active borders + window_stack = new Window[ stacking_order.count() * 2 + 1 + 1 + 8 ]; i = 0; pos = 0; topmenu_space_pos = 1; // not 0, that's supportWindow !!! - // Stack all windows under the support window. The support window is - // not used for anything (besides the NETWM property), and it's not shown, - // but it was lowered after twin startup. Stacking all clients below - // it ensures that no client will be ever shown above override-redirect - // windows (e.g. popups). -#if 0 - new_stack[ pos++ ] = supportWindow->winId(); - int topmenu_space_pos = 1; // not 0, that's supportWindow !!! -#endif + // Stack active windows under the support window. + /* The support window is not used for anything (besides the NETWM property), + * and it's not shown, but it was lowered after TWin startup. + * Stacking all clients below it ensures that no client will be ever shown + * above override-redirect windows (e.g. popups). + */ + for (int i = 0; i < ACTIVE_BORDER_COUNT; ++i) + { + if (active_windows[i] != None) + { + window_stack[pos++] = active_windows[i]; + } + } + + // Stack all windows under the support and active borders windows. window_stack[pos++] = supportWindow->winId(); for( ClientList::ConstIterator it = stacking_order.fromLast(); it != stacking_order.end(); --it ) { -#if 0 - new_stack[ pos++ ] = (*it)->frameId(); - if( (*it)->belongsToLayer() >= DockLayer ) - topmenu_space_pos = pos; -#endif + t = (*it)->windowType(); switch (t) { @@ -202,15 +209,14 @@ void Workspace::propagateClients( bool propagate_new_clients ) new_stack[ topmenu_space_pos ] = topmenu_space->winId(); #endif window_stack[ i ] = window_stack[ i - 1 ]; - window_stack[ topmenu_space_pos ] = topmenu_space->winId(); - ++pos; + window_stack[ topmenu_space_pos ] = topmenu_space->winId(); + ++pos; } #if 0 // TODO isn't it too inefficient to restart always all clients? // TODO don't restack not visible windows? assert( new_stack[ 0 ] = supportWindow->winId()); -#endif -#if 0 + XRestackWindows(tqt_xdisplay(), new_stack, pos); delete [] new_stack; #endif @@ -418,7 +424,7 @@ void Workspace::raiseClientWithinApplication( Client* c ) StackingUpdatesBlocker blocker( this ); // ignore mainwindows - + // first try to put it above the top-most window of the application for( ClientList::Iterator it = unconstrained_stacking_order.fromLast(); it != unconstrained_stacking_order.end(); @@ -590,10 +596,10 @@ ClientList Workspace::constrainedStackingOrder() minimum_layer[ (*it)->group() ] = l; layer[ l ].append( *it ); } - ClientList stacking; + ClientList stacking; for( Layer lay = FirstLayer; lay < NumLayers; - ++lay ) + ++lay ) stacking += layer[ lay ]; #if 0 kdDebug() << "stacking2:" << endl; @@ -751,7 +757,7 @@ void Client::restackWindow( Window /*above TODO */, int detail, NET::RequestSour if( send_event ) sendSyntheticConfigureNotify(); } - + void Client::setKeepAbove( bool b ) { b = rules()->checkKeepAbove( b ); diff --git a/twin/lib/kcommondecoration.cpp b/twin/lib/kcommondecoration.cpp index 54ee415e2..d8a22458b 100644 --- a/twin/lib/kcommondecoration.cpp +++ b/twin/lib/kcommondecoration.cpp @@ -122,8 +122,8 @@ void KCommonDecoration::init() resetLayout(); - connect(this, TQT_SIGNAL(keepAboveChanged(bool) ), TQT_SLOT(keepAboveChange(bool) ) ); - connect(this, TQT_SIGNAL(keepBelowChanged(bool) ), TQT_SLOT(keepBelowChange(bool) ) ); + connect(this, TQ_SIGNAL(keepAboveChanged(bool) ), TQ_SLOT(keepAboveChange(bool) ) ); + connect(this, TQ_SIGNAL(keepBelowChanged(bool) ), TQ_SLOT(keepBelowChange(bool) ) ); updateCaption(); } @@ -203,7 +203,7 @@ void KCommonDecoration::updateLayout() const if (*it) { if (!(*it)->isHidden() ) { moveWidget(x,y, *it); - x += layoutMetric(LM_ButtonWidth, true, ::tqqt_cast<KCommonDecorationButton*>(*it) ); + x += layoutMetric(LM_ButtonWidth, true, ::tqt_cast<KCommonDecorationButton*>(*it) ); elementLayouted = true; } } else { @@ -226,7 +226,7 @@ void KCommonDecoration::updateLayout() const if (*it) { if (!(*it)->isHidden() ) { moveWidget(x,y, *it); - x += layoutMetric(LM_ButtonWidth, true, ::tqqt_cast<KCommonDecorationButton*>(*it) );; + x += layoutMetric(LM_ButtonWidth, true, ::tqt_cast<KCommonDecorationButton*>(*it) );; elementLayouted = true; } } else { @@ -349,9 +349,9 @@ void KCommonDecoration::addButtons(ButtonContainer &btnContainer, const TQString btn = createButton(MenuButton); if (!btn) break; btn->setTipText(i18n("Menu") ); - btn->setRealizeButtons(Qt::LeftButton|Qt::RightButton); - connect(btn, TQT_SIGNAL(pressed()), TQT_SLOT(menuButtonPressed())); - connect(btn, TQT_SIGNAL(released()), this, TQT_SLOT(menuButtonReleased())); + btn->setRealizeButtons(TQt::LeftButton|TQt::RightButton); + connect(btn, TQ_SIGNAL(pressed()), TQ_SLOT(menuButtonPressed())); + connect(btn, TQ_SIGNAL(released()), this, TQ_SLOT(menuButtonReleased())); m_button[MenuButton] = btn; } @@ -366,7 +366,7 @@ void KCommonDecoration::addButtons(ButtonContainer &btnContainer, const TQString btn->setTipText(oad?i18n("Not on all desktops"):i18n("On all desktops") ); btn->setToggleButton(true); btn->setOn( oad ); - connect(btn, TQT_SIGNAL(clicked()), TQT_SLOT(toggleOnAllDesktops())); + connect(btn, TQ_SIGNAL(clicked()), TQ_SLOT(toggleOnAllDesktops())); m_button[OnAllDesktopsButton] = btn; } @@ -377,7 +377,7 @@ void KCommonDecoration::addButtons(ButtonContainer &btnContainer, const TQString btn = createButton(HelpButton); if (!btn) break; btn->setTipText(i18n("Help") ); - connect(btn, TQT_SIGNAL(clicked()), TQT_SLOT(showContextHelp())); + connect(btn, TQ_SIGNAL(clicked()), TQ_SLOT(showContextHelp())); m_button[HelpButton] = btn; } @@ -387,7 +387,7 @@ void KCommonDecoration::addButtons(ButtonContainer &btnContainer, const TQString btn = createButton(MinButton); if (!btn) break; btn->setTipText(i18n("Minimize") ); - connect(btn, TQT_SIGNAL(clicked()), TQT_SLOT(minimize())); + connect(btn, TQ_SIGNAL(clicked()), TQ_SLOT(minimize())); m_button[MinButton] = btn; } @@ -396,12 +396,12 @@ void KCommonDecoration::addButtons(ButtonContainer &btnContainer, const TQString if ((!m_button[MaxButton]) && isMaximizable()){ btn = createButton(MaxButton); if (!btn) break; - btn->setRealizeButtons(Qt::LeftButton|Qt::MidButton|Qt::RightButton); + btn->setRealizeButtons(TQt::LeftButton|TQt::MidButton|TQt::RightButton); const bool max = maximizeMode()==MaximizeFull; btn->setTipText(max?i18n("Restore"):i18n("Maximize") ); btn->setToggleButton(true); btn->setOn( max ); - connect(btn, TQT_SIGNAL(clicked()), TQT_SLOT(slotMaximize())); + connect(btn, TQ_SIGNAL(clicked()), TQ_SLOT(slotMaximize())); m_button[MaxButton] = btn; } @@ -411,7 +411,7 @@ void KCommonDecoration::addButtons(ButtonContainer &btnContainer, const TQString btn = createButton(CloseButton); if (!btn) break; btn->setTipText(i18n("Close") ); - connect(btn, TQT_SIGNAL(clicked()), TQT_SLOT(closeWindow())); + connect(btn, TQ_SIGNAL(clicked()), TQ_SLOT(closeWindow())); m_button[CloseButton] = btn; } @@ -424,7 +424,7 @@ void KCommonDecoration::addButtons(ButtonContainer &btnContainer, const TQString btn->setTipText(above?i18n("Do not keep above others"):i18n("Keep above others") ); btn->setToggleButton(true); btn->setOn( above ); - connect(btn, TQT_SIGNAL(clicked()), TQT_SLOT(slotKeepAbove())); + connect(btn, TQ_SIGNAL(clicked()), TQ_SLOT(slotKeepAbove())); m_button[AboveButton] = btn; } @@ -437,7 +437,7 @@ void KCommonDecoration::addButtons(ButtonContainer &btnContainer, const TQString btn->setTipText(below?i18n("Do not keep below others"):i18n("Keep below others") ); btn->setToggleButton(true); btn->setOn( below ); - connect(btn, TQT_SIGNAL(clicked()), TQT_SLOT(slotKeepBelow())); + connect(btn, TQ_SIGNAL(clicked()), TQ_SLOT(slotKeepBelow())); m_button[BelowButton] = btn; } @@ -450,7 +450,7 @@ void KCommonDecoration::addButtons(ButtonContainer &btnContainer, const TQString btn->setTipText(shaded?i18n("Unshade"):i18n("Shade") ); btn->setToggleButton(true); btn->setOn( shaded ); - connect(btn, TQT_SIGNAL(clicked()), TQT_SLOT(slotShade())); + connect(btn, TQ_SIGNAL(clicked()), TQ_SLOT(slotShade())); m_button[ShadeButton] = btn; } @@ -710,7 +710,7 @@ void KCommonDecoration::resizeWidget(int w, int h, TQWidget *widget) const void KCommonDecoration::mouseDoubleClickEvent(TQMouseEvent *e) { - if( e->button() != Qt::LeftButton ) + if( e->button() != TQt::LeftButton ) return; int tb = layoutMetric(LM_TitleEdgeTop)+layoutMetric(LM_TitleHeight)+layoutMetric(LM_TitleEdgeBottom); @@ -844,24 +844,24 @@ void KCommonDecoration::updateWindowShape() bool KCommonDecoration::eventFilter( TQObject* o, TQEvent* e ) { - if( TQT_BASE_OBJECT(o) != TQT_BASE_OBJECT(widget())) + if( o != widget()) return false; switch( e->type()) { case TQEvent::Resize: - resizeEvent(TQT_TQRESIZEEVENT(e) ); + resizeEvent(static_cast<TQResizeEvent*>(e) ); return true; case TQEvent::Paint: - paintEvent(TQT_TQPAINTEVENT( e )); + paintEvent(static_cast<TQPaintEvent*>( e )); return true; case TQEvent::MouseButtonDblClick: - mouseDoubleClickEvent(TQT_TQMOUSEEVENT( e )); + mouseDoubleClickEvent(static_cast<TQMouseEvent*>( e )); return true; case TQEvent::MouseButtonPress: - processMousePressEvent(TQT_TQMOUSEEVENT( e )); + processMousePressEvent(static_cast<TQMouseEvent*>( e )); return true; case TQEvent::Wheel: - wheelEvent(TQT_TQWHEELEVENT( e )); + wheelEvent(static_cast<TQWheelEvent*>( e )); return true; default: return false; @@ -881,7 +881,7 @@ bool KCommonDecoration::isToolWindow() const TQRect KCommonDecoration::titleRect() const { int r_x, r_y, r_x2, r_y2; - TQT_TQRECT_OBJECT(widget()->rect()).coords(&r_x, &r_y, &r_x2, &r_y2); + widget()->rect().coords(&r_x, &r_y, &r_x2, &r_y2); const int titleEdgeLeft = layoutMetric(LM_TitleEdgeLeft); const int titleEdgeTop = layoutMetric(LM_TitleEdgeTop); const int titleEdgeRight = layoutMetric(LM_TitleEdgeRight); @@ -900,8 +900,8 @@ KCommonDecorationButton::KCommonDecorationButton(ButtonType type, KCommonDecorat : TQButton(parent->widget(), name), m_decoration(parent), m_type(type), - m_realizeButtons(Qt::LeftButton), - m_lastMouse(Qt::NoButton), + m_realizeButtons(TQt::LeftButton), + m_lastMouse(TQt::NoButton), m_isLeft(true) { setCursor(ArrowCursor); @@ -975,7 +975,7 @@ void KCommonDecorationButton::mousePressEvent(TQMouseEvent* e) m_lastMouse = e->button(); // pass on event after changing button to LeftButton TQMouseEvent me(e->type(), e->pos(), e->globalPos(), - (e->button()&m_realizeButtons)?Qt::LeftButton:Qt::NoButton, e->state()); + (e->button()&m_realizeButtons)?TQt::LeftButton:TQt::NoButton, e->state()); TQButton::mousePressEvent(&me); } @@ -985,7 +985,7 @@ void KCommonDecorationButton::mouseReleaseEvent(TQMouseEvent* e) m_lastMouse = e->button(); // pass on event after changing button to LeftButton TQMouseEvent me(e->type(), e->pos(), e->globalPos(), - (e->button()&m_realizeButtons)?Qt::LeftButton:Qt::NoButton, e->state()); + (e->button()&m_realizeButtons)?TQt::LeftButton:TQt::NoButton, e->state()); TQButton::mouseReleaseEvent(&me); } diff --git a/twin/lib/kcommondecoration.h b/twin/lib/kcommondecoration.h index c914628e6..1ef9b1bba 100644 --- a/twin/lib/kcommondecoration.h +++ b/twin/lib/kcommondecoration.h @@ -58,7 +58,7 @@ class KCommonDecorationPrivate; */ class KWIN_EXPORT KCommonDecoration : public KDecoration { - Q_OBJECT + TQ_OBJECT public: KCommonDecoration(KDecorationBridge* bridge, KDecorationFactory* factory); @@ -293,7 +293,7 @@ class KWIN_EXPORT KCommonDecorationButton : public TQButton { friend class KCommonDecoration; - Q_OBJECT + TQ_OBJECT public: diff --git a/twin/lib/kdecoration.cpp b/twin/lib/kdecoration.cpp index b2332c514..b9a8e7a36 100644 --- a/twin/lib/kdecoration.cpp +++ b/twin/lib/kdecoration.cpp @@ -28,7 +28,7 @@ DEALINGS IN THE SOFTWARE. #include <tqapplication.h> #include <tdeglobal.h> #include <assert.h> -#if defined Q_WS_X11 && ! defined K_WS_QTONLY +#if defined TQ_WS_X11 && ! defined K_WS_QTONLY #include <X11/Xlib.h> #include <fixx11h.h> #endif @@ -393,9 +393,9 @@ const TQColorGroup& KDecorationOptions::colorGroup(ColorType type, bool active) int idx = type + (active ? 0 : NUM_COLORS); if(d->cg[idx]) return(*d->cg[idx]); - d->cg[idx] = new TQColorGroup(Qt::black, d->colors[idx], d->colors[idx].light(150), + d->cg[idx] = new TQColorGroup(TQt::black, d->colors[idx], d->colors[idx].light(150), d->colors[idx].dark(), d->colors[idx].dark(120), - Qt::black, TQApplication::palette().active(). + TQt::black, TQApplication::palette().active(). base()); return(*d->cg[idx]); } @@ -436,8 +436,8 @@ bool KDecorationOptions::moveResizeMaximizedWindows() const KDecorationDefines::WindowOperation KDecorationOptions::operationMaxButtonClick( TQt::ButtonState button ) const { - return button == Qt::RightButton? d->OpMaxButtonRightClick : - button == Qt::MidButton? d->OpMaxButtonMiddleClick : + return button == TQt::RightButton? d->OpMaxButtonRightClick : + button == TQt::MidButton? d->OpMaxButtonMiddleClick : d->OpMaxButtonLeftClick; } diff --git a/twin/lib/kdecoration.h b/twin/lib/kdecoration.h index 693007a03..03e1c863e 100644 --- a/twin/lib/kdecoration.h +++ b/twin/lib/kdecoration.h @@ -51,7 +51,7 @@ public: * These values represent positions inside an area */ enum Position - { // without prefix, they'd conflict with Qt::TopLeft etc. :( + { // without prefix, they'd conflict with TQt::TopLeft etc. :( PositionCenter = 0x00, PositionLeft = 0x01, PositionRight = 0x02, @@ -313,7 +313,7 @@ protected: class KWIN_EXPORT KDecoration : public TQObject, public KDecorationDefines { - Q_OBJECT + TQ_OBJECT public: /** * Constructs a KDecoration object. Both the arguments are passed from diff --git a/twin/lib/kdecoration_p.h b/twin/lib/kdecoration_p.h index 2634ea140..b396509b6 100644 --- a/twin/lib/kdecoration_p.h +++ b/twin/lib/kdecoration_p.h @@ -103,7 +103,7 @@ class KDecorationBridge : public KDecorationDefines // not part of public API virtual int currentDesktop() const = 0; virtual TQWidget* initialParentWidget() const = 0; - virtual Qt::WFlags initialWFlags() const = 0; + virtual TQt::WFlags initialWFlags() const = 0; virtual void helperShowHide( bool ) = 0; virtual void grabXServer( bool grab ) = 0; }; diff --git a/twin/lib/kdecoration_plugins_p.cpp b/twin/lib/kdecoration_plugins_p.cpp index 0e2bc0d04..31de52e6d 100644 --- a/twin/lib/kdecoration_plugins_p.cpp +++ b/twin/lib/kdecoration_plugins_p.cpp @@ -42,7 +42,7 @@ KDecorationPlugins::KDecorationPlugins( TDEConfig* cfg ) fact( NULL ), old_library( NULL ), old_fact( NULL ), - pluginStr( "twin3_undefined " ), + pluginStr( "twin_undefined " ), config( cfg ) { } @@ -98,9 +98,6 @@ bool KDecorationPlugins::loadPlugin( TQString nameStr ) TDEConfigGroupSaver saver( config, "Style" ); nameStr = config->readEntry("PluginLib", defaultPlugin ); } - // make sure people can switch between HEAD and twin_iii branch - if( nameStr.startsWith( "twin_" )) - nameStr = "twin3_" + nameStr.mid( 5 ); KLibrary *oldLibrary = library; KDecorationFactory* oldFactory = fact; diff --git a/twin/main.cpp b/twin/main.cpp index 4fd81d245..61fb82847 100644 --- a/twin/main.cpp +++ b/twin/main.cpp @@ -84,10 +84,6 @@ int x11ErrorHandler(Display *d, XErrorEvent *e) Application::Application( ) : TDEApplication( ), owner( screen_number ) { -#ifdef USE_QT4 - // I'm special... - setQuitOnLastWindowClosed(false); -#endif // USE_QT4 TDECmdLineArgs* args = TDECmdLineArgs::parsedArgs(); if (!config()->isImmutable() && args->isSet("lock")) { @@ -150,7 +146,7 @@ Application::Application( ) ::exit(1); } } - connect( &owner, TQT_SIGNAL( lostOwnership()), TQT_SLOT( lostSelection())); + connect( &owner, TQ_SIGNAL( lostOwnership()), TQ_SLOT( lostSelection())); // if there was already twin running, it saved its configuration after loosing the selection -> reread config()->reparseConfiguration(); @@ -198,7 +194,7 @@ Application::~Application() delete Workspace::self(); if( owner.ownerWindow() != None ) // if there was no --replace (no new WM) { - XSetInputFocus( tqt_xdisplay(), PointerRoot, RevertToPointerRoot, GET_QT_X_TIME() ); + XSetInputFocus( tqt_xdisplay(), PointerRoot, RevertToPointerRoot, get_tqt_x_time() ); DCOPRef ref( "kded", "kded" ); if( !ref.send( "loadModule", TQCString( "kdetrayproxy" ))) kdWarning( 176 ) << "Loading of kdetrayproxy failed." << endl; @@ -346,6 +342,8 @@ KDE_EXPORT int kdemain( int argc, char * argv[] ) else appname.sprintf("twin-screen-%d", KWinInternal::screen_number); + TDEGlobal::locale()->insertCatalogue("twin_lib"); + DCOPClient* client = a.dcopClient(); client->registerAs( appname.data(), false); client->setDefaultObject( "KWinInterface" ); diff --git a/twin/main.h b/twin/main.h index d1fb59c6e..f8f27427a 100644 --- a/twin/main.h +++ b/twin/main.h @@ -21,7 +21,7 @@ namespace KWinInternal class Application : public TDEApplication { - Q_OBJECT + TQ_OBJECT public: Application(); ~Application(); diff --git a/twin/manage.cpp b/twin/manage.cpp index ec6a5d675..8b96c070e 100644 --- a/twin/manage.cpp +++ b/twin/manage.cpp @@ -520,9 +520,9 @@ bool Client::manage( Window w, bool isMapped ) if( user_time == CurrentTime || user_time == -1U ) // no known user time, set something old { - user_time = GET_QT_X_TIME() - 1000000; + user_time = get_tqt_x_time() - 1000000; if( user_time == CurrentTime || user_time == -1U ) // let's be paranoid - user_time = GET_QT_X_TIME() - 1000000 + 10; + user_time = get_tqt_x_time() - 1000000 + 10; } updateWorkareaDiffs(); @@ -577,9 +577,9 @@ void Client::embedClient( Window w, const XWindowAttributes &attr ) attr.depth, InputOutput, attr.visual, CWColormap | CWBackPixmap | CWBorderPixel, &swa ); - XDefineCursor( tqt_xdisplay(), frame, tqarrowCursor.handle()); + XDefineCursor( tqt_xdisplay(), frame, TQt::arrowCursor.handle()); // some apps are stupid and don't define their own cursor - set the arrow one for them - XDefineCursor( tqt_xdisplay(), wrapper, tqarrowCursor.handle()); + XDefineCursor( tqt_xdisplay(), wrapper, TQt::arrowCursor.handle()); XReparentWindow( tqt_xdisplay(), client, wrapper, 0, 0 ); XSelectInput( tqt_xdisplay(), frame, KeyPressMask | KeyReleaseMask | diff --git a/twin/options.cpp b/twin/options.cpp index ce35f6d06..46c557b4a 100644 --- a/twin/options.cpp +++ b/twin/options.cpp @@ -31,8 +31,8 @@ namespace KWinInternal #ifndef KCMRULES Options::Options() - : electric_borders( 0 ), - electric_border_delay(0) + : active_borders( 0 ), + active_border_delay(0) { d = new KDecorationOptionsPrivate; d->defaultKWinSettings(); @@ -51,9 +51,11 @@ unsigned long Options::updateSettings() changed |= d->updateKWinSettings( config ); // read decoration settings config->setGroup( "Windows" ); - moveMode = stringToMoveResizeMode( config->readEntry("MoveMode", "Opaque" )); - resizeMode = stringToMoveResizeMode( config->readEntry("ResizeMode", "Opaque" )); + moveMode = stringToMoveResizeMode(config->readEntry("MoveMode", "Opaque")); + resizeMode = stringToMoveResizeMode(config->readEntry("ResizeMode", "Opaque")); + tilingMode = stringToMoveResizeMode(config->readEntry("TilingMode", "Opaque")); show_geometry_tip = config->readBoolEntry("GeometryTip", false); + reset_maximized_window_geometry = config->readBoolEntry("ResetMaximizedWindowGeometry", false); tabboxOutline = config->readBoolEntry("TabboxOutline", true); TQString val; @@ -125,8 +127,17 @@ unsigned long Options::updateSettings() borderSnapZone = config->readNumEntry("BorderSnapZone", 10); windowSnapZone = config->readNumEntry("WindowSnapZone", 10); snapOnlyWhenOverlapping=config->readBoolEntry("SnapOnlyWhenOverlapping",FALSE); - electric_borders = config->readNumEntry("ElectricBorders", 0); - electric_border_delay = config->readNumEntry("ElectricBorderDelay", 150); + + // active borders: compatibility with old option names (Electric*) + active_borders = config->readNumEntry("ActiveBorders", -1); + if (active_borders == -1) { + active_borders = config->readNumEntry("ElectricBorders", 0); + } + active_border_delay = config->readNumEntry("ActiveBorderDelay", -1); + if (active_border_delay == -1) { + active_border_delay = config->readNumEntry("ElectricBorderDelay", 150); + } + active_border_distance = config->readNumEntry("ActiveBorderDistance", 10); OpTitlebarDblClick = windowOperation( config->readEntry("TitlebarDoubleClickCommand", "Shade"), true ); d->OpMaxButtonLeftClick = windowOperation( config->readEntry("MaximizeButtonLeftClickCommand", "Maximize"), true ); @@ -163,7 +174,7 @@ unsigned long Options::updateSettings() CmdWindow1 = mouseCommand(config->readEntry("CommandWindow1","Activate, raise and pass click"), false ); CmdWindow2 = mouseCommand(config->readEntry("CommandWindow2","Activate and pass click"), false ); CmdWindow3 = mouseCommand(config->readEntry("CommandWindow3","Activate and pass click"), false ); - CmdAllModKey = (config->readEntry("CommandAllKey","Alt") == "Meta") ? Qt::Key_Meta : Qt::Key_Alt; + CmdAllModKey = (config->readEntry("CommandAllKey","Alt") == "Meta") ? TQt::Key_Meta : TQt::Key_Alt; CmdAll1 = mouseCommand(config->readEntry("CommandAll1","Move"), false ); CmdAll2 = mouseCommand(config->readEntry("CommandAll2","Toggle raise and lower"), false ); CmdAll3 = mouseCommand(config->readEntry("CommandAll3","Resize"), false ); @@ -308,6 +319,11 @@ bool Options::showGeometryTip() return show_geometry_tip; } +bool Options::resetMaximizedWindowGeometry() + { + return reset_maximized_window_geometry; + } + TQColor &Options::shadowColour(bool active) { return active ? shadow_colour : shadow_inactive_colour; @@ -373,14 +389,19 @@ int Options::shadowYOffset(bool active) return active ? shadow_y_offset : shadow_inactive_y_offset; } -int Options::electricBorders() +int Options::activeBorders() + { + return active_borders; + } + +int Options::activeBorderDelay() { - return electric_borders; + return active_border_delay; } -int Options::electricBorderDelay() +int Options::borderActivationDistance() { - return electric_border_delay; + return active_border_distance; } bool Options::checkIgnoreFocusStealing( const Client* c ) diff --git a/twin/options.h b/twin/options.h index 113e6b9e6..41d1340a7 100644 --- a/twin/options.h +++ b/twin/options.h @@ -147,8 +147,9 @@ class Options : public KDecorationOptions */ enum MoveResizeMode { Transparent, Opaque }; - MoveResizeMode resizeMode; MoveResizeMode moveMode; + MoveResizeMode resizeMode; + MoveResizeMode tilingMode; static MoveResizeMode stringToMoveResizeMode( const TQString& s ); static const char* moveResizeModeToString( MoveResizeMode mode ); @@ -269,6 +270,13 @@ class Options : public KDecorationOptions bool showGeometryTip(); /** + * @returns true if a maximized or tiled window should be reset to its original + * size when dragging it. + * @since R14.1.1 + */ + bool resetMaximizedWindowGeometry(); + + /** * @returns A TQColor representing the colour that window drop shadows should * be. */ @@ -307,18 +315,24 @@ class Options : public KDecorationOptions */ int shadowYOffset(bool active=true); - enum { ElectricDisabled = 0, ElectricMoveOnly = 1, ElectricAlways = 2 }; + enum { ActiveDisabled = 0, + ActiveSwitchOnMove = 1, + ActiveSwitchAlways = 2, + ActiveTileOnly = 3, + ActiveTileMaximize = 4 }; /** - * @returns true if electric borders are enabled. With electric borders + * @returns true if active borders are enabled. With active borders * you can change desktop by moving the mouse pointer towards the edge * of the screen */ - int electricBorders(); + int activeBorders(); + + int borderActivationDistance(); /** - * @returns the activation delay for electric borders in milliseconds. + * @returns the activation delay for active borders in milliseconds. */ - int electricBorderDelay(); + int activeBorderDelay(); bool topMenuEnabled() const { return topmenus; } bool desktopTopMenu() const { return desktop_topmenu; } @@ -373,9 +387,11 @@ class Options : public KDecorationOptions bool CmdAllRevWheel; uint CmdAllModKey; - int electric_borders; - int electric_border_delay; + int active_borders; + int active_border_delay; + int active_border_distance; bool show_geometry_tip; + bool reset_maximized_window_geometry; bool topmenus; bool desktop_topmenu; TQColor shadow_colour; diff --git a/twin/plugins.cpp b/twin/plugins.cpp index 5f20b7018..6df451dc3 100644 --- a/twin/plugins.cpp +++ b/twin/plugins.cpp @@ -23,14 +23,14 @@ PluginMgr::PluginMgr() : KDecorationPlugins( TDEGlobal::config()) { defaultPlugin = (TQPixmap::defaultDepth() > 8) ? - "twin3_plastik" : "twin3_quartz"; + "twin_plastik" : "twin_quartz"; loadPlugin( "" ); // load the plugin specified in cfg file } void PluginMgr::error( const TQString &error_msg ) { tqWarning( "%s", (i18n("TWin: ") + error_msg + - i18n("\nTWin will now exit...")).local8Bit().data() ); + i18n("\nTWin will now exit…")).local8Bit().data() ); exit(1); } diff --git a/twin/popupinfo.cpp b/twin/popupinfo.cpp index 740de7cb6..d86037a84 100644 --- a/twin/popupinfo.cpp +++ b/twin/popupinfo.cpp @@ -39,7 +39,7 @@ PopupInfo::PopupInfo( Workspace* ws, const char *name ) m_shown = false; reset(); reconfigure(); - connect(&m_delayedHideTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(hide())); + connect(&m_delayedHideTimer, TQ_SIGNAL(timeout()), this, TQ_SLOT(hide())); TQFont f = font(); f.setBold( TRUE ); @@ -74,7 +74,7 @@ void PopupInfo::reset() void PopupInfo::paintEvent( TQPaintEvent* ) { TQPainter p( this ); - style().tqdrawPrimitive( TQStyle::PE_Panel, &p, TQRect( 0, 0, width(), height() ), + style().drawPrimitive( TQStyle::PE_Panel, &p, TQRect( 0, 0, width(), height() ), colorGroup(), TQStyle::Style_Default ); paintContents(); } @@ -92,9 +92,9 @@ void PopupInfo::paintContents() p.fillRect( r, colorGroup().brush( TQColorGroup::Background ) ); /* - p.setPen(Qt::white); + p.setPen(TQt::white); p.drawText( r, AlignCenter, m_infoString ); - p.setPen(Qt::black); + p.setPen(TQt::black); r.moveBy( -1, -1 ); p.drawText( r, AlignCenter, m_infoString ); r.moveBy( -1, 0 ); diff --git a/twin/popupinfo.h b/twin/popupinfo.h index 30ff76b30..40bdfe5c8 100644 --- a/twin/popupinfo.h +++ b/twin/popupinfo.h @@ -22,7 +22,7 @@ class Workspace; class PopupInfo : public TQWidget { - Q_OBJECT + TQ_OBJECT public: PopupInfo( Workspace* ws, const char *name=0 ); ~PopupInfo(); diff --git a/twin/rules.cpp b/twin/rules.cpp index 63fc0e37b..7bd2cd469 100644 --- a/twin/rules.cpp +++ b/twin/rules.cpp @@ -1008,7 +1008,7 @@ void Workspace::gotTemporaryRulesMessage( const TQString& message ) Rules* rule = new Rules( message, true ); rules.prepend( rule ); // highest priority first if( !was_temporary ) - TQTimer::singleShot( 60000, this, TQT_SLOT( cleanupTemporaryRules())); + TQTimer::singleShot( 60000, this, TQ_SLOT( cleanupTemporaryRules())); } void Workspace::cleanupTemporaryRules() @@ -1028,7 +1028,7 @@ void Workspace::cleanupTemporaryRules() } } if( has_temporary ) - TQTimer::singleShot( 60000, this, TQT_SLOT( cleanupTemporaryRules())); + TQTimer::singleShot( 60000, this, TQ_SLOT( cleanupTemporaryRules())); } void Workspace::discardUsedWindowRules( Client* c, bool withdrawn ) diff --git a/twin/sm.cpp b/twin/sm.cpp index 53d2a5f29..00cdb6a22 100644 --- a/twin/sm.cpp +++ b/twin/sm.cpp @@ -416,8 +416,8 @@ SessionSaveDoneHelper::SessionSaveDoneHelper() SmProp* p[ 5 ] = { &props[ 0 ], &props[ 1 ], &props[ 2 ], &props[ 3 ], &props[ 4 ] }; SmcSetProperties( conn, 5, p ); notifier = new TQSocketNotifier( IceConnectionNumber( SmcGetIceConnection( conn )), - TQSocketNotifier::Read, TQT_TQOBJECT(this) ); - connect( notifier, TQT_SIGNAL( activated( int )), TQT_SLOT( processData())); + TQSocketNotifier::Read, this ); + connect( notifier, TQ_SIGNAL( activated( int )), TQ_SLOT( processData())); } SessionSaveDoneHelper::~SessionSaveDoneHelper() @@ -59,9 +59,9 @@ enum SMSavePhase }; class SessionSaveDoneHelper - : public QObject + : public TQObject { - Q_OBJECT + TQ_OBJECT public: SessionSaveDoneHelper(); virtual ~SessionSaveDoneHelper(); diff --git a/twin/tabbox.cpp b/twin/tabbox.cpp index d88146f22..feca2d77d 100644 --- a/twin/tabbox.cpp +++ b/twin/tabbox.cpp @@ -53,7 +53,7 @@ TabBox::TabBox( Workspace *ws, const char *name ) m = DesktopMode; // init variables reconfigure(); reset(); - connect(&delayedShowTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(show())); + connect(&delayedShowTimer, TQ_SIGNAL(timeout()), this, TQ_SLOT(show())); XSetWindowAttributes attr; attr.override_redirect = 1; @@ -474,7 +474,7 @@ void TabBox::drawContents( TQPainter * ) p.setPen(colorGroup().text()); p.drawText(x+5 + iconWidth + 8, y, r.width() - 5 - iconWidth - 8, lineHeight, - Qt::AlignLeft | Qt::AlignVCenter | TQt::SingleLine, s); + TQt::AlignLeft | TQt::AlignVCenter | TQt::SingleLine, s); y += lineHeight; } @@ -521,7 +521,7 @@ void TabBox::drawContents( TQPainter * ) // draw desktop-number p.setFont(f); TQString num = TQString::number(iDesktop); - p.drawText(x+5, y+2, iconWidth, iconHeight, Qt::AlignCenter, num); + p.drawText(x+5, y+2, iconWidth, iconHeight, TQt::AlignCenter, num); p.restore(); @@ -532,7 +532,7 @@ void TabBox::drawContents( TQPainter * ) p.setPen(colorGroup().text()); p.drawText(x+5 + iconWidth + 8, y, r.width() - 5 - iconWidth - 8, lineHeight, - Qt::AlignLeft | Qt::AlignVCenter | TQt::SingleLine, + TQt::AlignLeft | TQt::AlignVCenter | TQt::SingleLine, workspace()->desktopName(iDesktop)); // show mini icons from that desktop aligned to each other @@ -708,7 +708,7 @@ void TabBox::delayedShow() void TabBox::handleMouseEvent( XEvent* e ) { - XAllowEvents( tqt_xdisplay(), AsyncPointer, GET_QT_X_TIME() ); + XAllowEvents( tqt_xdisplay(), AsyncPointer, get_tqt_x_time() ); if( e->type != ButtonPress ) return; TQPoint pos( e->xbutton.x_root, e->xbutton.y_root ); @@ -866,7 +866,7 @@ void Workspace::slotWalkThroughWindows() return; if ( options->altTabStyle == Options::CDE || !options->focusPolicyIsReasonable()) { - //XUngrabKeyboard(tqt_xdisplay(), GET_QT_X_TIME()); // need that because of accelerator raw mode + //XUngrabKeyboard(tqt_xdisplay(), get_tqt_x_time()); // need that because of accelerator raw mode // CDE style raise / lower CDEWalkThroughWindows( true ); } @@ -1180,7 +1180,7 @@ void Workspace::tabBoxKeyPress( const KKeyNative& keyX ) if (control_grab || tab_grab) { uint keyQt = keyX.keyCodeQt(); - if ( ((keyQt & 0xffff) == Qt::Key_Escape) + if ( ((keyQt & 0xffff) == TQt::Key_Escape) && !(forward || backward) ) { // if Escape is part of the shortcut, don't cancel closeTabBox(); @@ -1360,7 +1360,7 @@ Client* Workspace::previousStaticClient( Client* c ) const bool Workspace::establishTabBoxGrab() { if( XGrabKeyboard( tqt_xdisplay(), root, FALSE, - GrabModeAsync, GrabModeAsync, GET_QT_X_TIME()) != GrabSuccess ) + GrabModeAsync, GrabModeAsync, get_tqt_x_time()) != GrabSuccess ) return false; // Don't try to establish a global mouse grab using XGrabPointer, as that would prevent // using Alt+Tab while DND (#44972). However force passive grabs on all windows @@ -1376,7 +1376,7 @@ bool Workspace::establishTabBoxGrab() void Workspace::removeTabBoxGrab() { - XUngrabKeyboard(tqt_xdisplay(), GET_QT_X_TIME()); + XUngrabKeyboard(tqt_xdisplay(), get_tqt_x_time()); assert( forced_global_mouse_grab ); forced_global_mouse_grab = false; if( active_client != NULL ) diff --git a/twin/tabbox.h b/twin/tabbox.h index f9e3a8e0f..3fd419ad7 100644 --- a/twin/tabbox.h +++ b/twin/tabbox.h @@ -27,7 +27,7 @@ class Client; class TabBox : public TQFrame { - Q_OBJECT + TQ_OBJECT public: TabBox( Workspace *ws, const char *name=0 ); ~TabBox(); diff --git a/twin/tools/decobenchmark/main.cpp b/twin/tools/decobenchmark/main.cpp index 341b7ce44..d4930ee84 100644 --- a/twin/tools/decobenchmark/main.cpp +++ b/twin/tools/decobenchmark/main.cpp @@ -39,7 +39,7 @@ static TDECmdLineOptions options[] = { - { "+decoration", "Decoration library to use, such as twin3_plastik.", 0 }, + { "+decoration", "Decoration library to use, such as twin_plastik.", 0 }, { "+tests", "Which test should be executed ('all', 'repaint', 'caption', 'resize', 'recreation')", 0 }, { "+repetitions", "Number of test repetitions.", 0 }, { 0, 0, 0 } @@ -130,7 +130,7 @@ int main(int argc, char** argv) DecoBenchApplication app(library, test, count); - TQTimer::singleShot(0, &app, TQT_SLOT(executeTest())); + TQTimer::singleShot(0, &app, TQ_SLOT(executeTest())); app.exec(); } #include "main.moc" diff --git a/twin/tools/decobenchmark/main.h b/twin/tools/decobenchmark/main.h index 41f4ff691..3745697f0 100644 --- a/twin/tools/decobenchmark/main.h +++ b/twin/tools/decobenchmark/main.h @@ -31,7 +31,7 @@ enum Tests { class DecoBenchApplication : public TDEApplication { - Q_OBJECT + TQ_OBJECT public: DecoBenchApplication(const TQString &library, Tests tests, int count); ~DecoBenchApplication(); diff --git a/twin/tools/decobenchmark/preview.cpp b/twin/tools/decobenchmark/preview.cpp index 6034a613e..c706eb5df 100644 --- a/twin/tools/decobenchmark/preview.cpp +++ b/twin/tools/decobenchmark/preview.cpp @@ -188,7 +188,7 @@ TQWidget* KDecorationPreviewBridge::initialParentWidget() const return preview; } -Qt::WFlags KDecorationPreviewBridge::initialWFlags() const +TQt::WFlags KDecorationPreviewBridge::initialWFlags() const { return 0; } diff --git a/twin/tools/decobenchmark/preview.h b/twin/tools/decobenchmark/preview.h index 2138c51b7..38cd08b19 100644 --- a/twin/tools/decobenchmark/preview.h +++ b/twin/tools/decobenchmark/preview.h @@ -30,7 +30,7 @@ class KDecorationPreviewBridge; class KDecorationPreviewOptions; class KDecorationPreview - : public QWidget + : public TQWidget { public: KDecorationPreview( KDecorationPlugins* plugin, TQWidget* parent = NULL, const char* name = NULL ); @@ -101,7 +101,7 @@ class KDecorationPreviewBridge virtual void setKeepBelow( bool ); virtual int currentDesktop() const; virtual TQWidget* initialParentWidget() const; - virtual Qt::WFlags initialWFlags() const; + virtual TQt::WFlags initialWFlags() const; virtual void helperShowHide( bool show ); virtual void grabXServer( bool grab ); private: diff --git a/twin/twinbindings.cpp b/twin/twinbindings.cpp index 5e468d34b..7e918f49f 100644 --- a/twin/twinbindings.cpp +++ b/twin/twinbindings.cpp @@ -1,8 +1,8 @@ #ifndef NOSLOTS # define DEF2( name, descr, key3, key4, fnSlot ) \ - keys->insert( name, i18n(descr), TQString::null, key3, key4, this, TQT_SLOT(fnSlot) ) + keys->insert( name, i18n(descr), TQString::null, key3, key4, this, TQ_SLOT(fnSlot) ) # define DEF( name, key3, key4, fnSlot ) \ - keys->insert( name, i18n(name), TQString::null, key3, key4, this, TQT_SLOT(fnSlot) ) + keys->insert( name, i18n(name), TQString::null, key3, key4, this, TQ_SLOT(fnSlot) ) #else # define DEF2( name, descr, key3, key4, fnSlot ) \ keys->insert( name, i18n(descr), TQString::null, key3, key4 ) @@ -18,29 +18,29 @@ keys->insert( "Program:twin", i18n("System") ); keys->insert( "Group:Navigation", i18n("Navigation") ); - DEF( I18N_NOOP("Walk Through Windows"), ALT+Qt::Key_Tab, ALT+Qt::Key_Tab, slotWalkThroughWindows() ); - DEF( I18N_NOOP("Walk Through Windows (Reverse)"), ALT+SHIFT+Qt::Key_Tab, ALT+SHIFT+Qt::Key_Tab, slotWalkBackThroughWindows() ); - DEF( I18N_NOOP("Walk Through Windows of Same Application"), ALT+Qt::Key_QuoteLeft, ALT+Qt::Key_QuoteLeft, slotWalkThroughApps() ); - DEF( I18N_NOOP("Walk Through Windows of Same Application (Reverse)"), ALT+Qt::Key_AsciiTilde, ALT+Qt::Key_AsciiTilde, slotWalkBackThroughApps() ); - DEF( I18N_NOOP("Walk Through Desktops"), 0, WIN+Qt::Key_Tab, slotWalkThroughDesktops() ); - DEF( I18N_NOOP("Walk Through Desktops (Reverse)"), 0, WIN+SHIFT+Qt::Key_Tab, slotWalkBackThroughDesktops() ); + DEF( I18N_NOOP("Walk Through Windows"), ALT+TQt::Key_Tab, ALT+TQt::Key_Tab, slotWalkThroughWindows() ); + DEF( I18N_NOOP("Walk Through Windows (Reverse)"), ALT+SHIFT+TQt::Key_Tab, ALT+SHIFT+TQt::Key_Tab, slotWalkBackThroughWindows() ); + DEF( I18N_NOOP("Walk Through Windows of Same Application"), ALT+TQt::Key_QuoteLeft, ALT+TQt::Key_QuoteLeft, slotWalkThroughApps() ); + DEF( I18N_NOOP("Walk Through Windows of Same Application (Reverse)"), ALT+TQt::Key_AsciiTilde, ALT+TQt::Key_AsciiTilde, slotWalkBackThroughApps() ); + DEF( I18N_NOOP("Walk Through Desktops"), 0, WIN+TQt::Key_Tab, slotWalkThroughDesktops() ); + DEF( I18N_NOOP("Walk Through Desktops (Reverse)"), 0, WIN+SHIFT+TQt::Key_Tab, slotWalkBackThroughDesktops() ); DEF( I18N_NOOP("Walk Through Desktop List"), 0, 0, slotWalkThroughDesktopList() ); DEF( I18N_NOOP("Walk Through Desktop List (Reverse)"), 0, 0, slotWalkBackThroughDesktopList() ); keys->insert( "Group:Windows", i18n("Windows") ); - DEF( I18N_NOOP("Window Operations Menu"), ALT+Qt::Key_F3, ALT+Qt::Key_Menu, slotWindowOperations() ); + DEF( I18N_NOOP("Window Operations Menu"), ALT+TQt::Key_F3, ALT+TQt::Key_Menu, slotWindowOperations() ); DEF2( "Window Close", I18N_NOOP("Close Window"), - ALT+Qt::Key_F4, "Alt+Escape;Alt+F4", slotWindowClose() ); + ALT+TQt::Key_F4, "Alt+Escape;Alt+F4", slotWindowClose() ); DEF2( "Window Maximize", I18N_NOOP("Maximize Window"), - 0, WIN+Qt::Key_Plus, slotWindowMaximize() ); + 0, WIN+TQt::Key_Plus, slotWindowMaximize() ); DEF2( "Window Maximize Vertical", I18N_NOOP("Maximize Window Vertically"), - 0, WIN+Qt::Key_Bar, slotWindowMaximizeVertical() ); + 0, WIN+TQt::Key_Bar, slotWindowMaximizeVertical() ); DEF2( "Window Maximize Horizontal", I18N_NOOP("Maximize Window Horizontally"), - 0, WIN+Qt::Key_Equal, slotWindowMaximizeHorizontal() ); + 0, WIN+TQt::Key_Equal, slotWindowMaximizeHorizontal() ); DEF2( "Window Minimize", I18N_NOOP("Minimize Window"), - 0, WIN+Qt::Key_Minus, slotWindowMinimize() ); + 0, WIN+TQt::Key_Minus, slotWindowMinimize() ); DEF2( "Window Shade", I18N_NOOP("Shade Window"), - 0, WIN+Qt::Key_Underscore, slotWindowShade() ); + 0, WIN+TQt::Key_Underscore, slotWindowShade() ); DEF2( "Window Move", I18N_NOOP("Move Window"), 0, 0, slotWindowMove() ); DEF2( "Window Resize", I18N_NOOP("Resize Window"), @@ -58,7 +58,7 @@ 0, 0, slotWindowAbove() ); DEF2( "Window Below Other Windows", I18N_NOOP("Keep Window Below Others"), 0, 0, slotWindowBelow() ); - DEF( I18N_NOOP("Activate Window Demanding Attention"), CTRL+ALT+Qt::Key_A, 0, slotActivateAttentionWindow()); + DEF( I18N_NOOP("Activate Window Demanding Attention"), CTRL+ALT+TQt::Key_A, 0, slotActivateAttentionWindow()); DEF( I18N_NOOP("Setup Window Shortcut"), 0, 0, slotSetupWindowShortcut()); DEF2( "Window Pack Right", I18N_NOOP("Pack Window to the Right"), 0, 0, slotWindowPackRight() ); @@ -80,16 +80,16 @@ keys->insert( "Group:Window Desktop", i18n("Window & Desktop") ); DEF2( "Window On All Desktops", I18N_NOOP("Keep Window on All Desktops"), 0, 0, slotWindowOnAllDesktops() ); - DEF( I18N_NOOP("Window to Desktop 1"), 0, WIN+ALT+Qt::Key_F1, slotWindowToDesktop(int) ); - DEF( I18N_NOOP("Window to Desktop 2"), 0, WIN+ALT+Qt::Key_F2, slotWindowToDesktop(int) ); - DEF( I18N_NOOP("Window to Desktop 3"), 0, WIN+ALT+Qt::Key_F3, slotWindowToDesktop(int) ); - DEF( I18N_NOOP("Window to Desktop 4"), 0, WIN+ALT+Qt::Key_F4, slotWindowToDesktop(int) ); - DEF( I18N_NOOP("Window to Desktop 5"), 0, WIN+ALT+Qt::Key_F5, slotWindowToDesktop(int) ); - DEF( I18N_NOOP("Window to Desktop 6"), 0, WIN+ALT+Qt::Key_F6, slotWindowToDesktop(int) ); - DEF( I18N_NOOP("Window to Desktop 7"), 0, WIN+ALT+Qt::Key_F7, slotWindowToDesktop(int) ); - DEF( I18N_NOOP("Window to Desktop 8"), 0, WIN+ALT+Qt::Key_F8, slotWindowToDesktop(int) ); - DEF( I18N_NOOP("Window to Desktop 9"), 0, WIN+ALT+Qt::Key_F9, slotWindowToDesktop(int) ); - DEF( I18N_NOOP("Window to Desktop 10"), 0, WIN+ALT+Qt::Key_F10, slotWindowToDesktop(int) ); + DEF( I18N_NOOP("Window to Desktop 1"), 0, WIN+ALT+TQt::Key_F1, slotWindowToDesktop(int) ); + DEF( I18N_NOOP("Window to Desktop 2"), 0, WIN+ALT+TQt::Key_F2, slotWindowToDesktop(int) ); + DEF( I18N_NOOP("Window to Desktop 3"), 0, WIN+ALT+TQt::Key_F3, slotWindowToDesktop(int) ); + DEF( I18N_NOOP("Window to Desktop 4"), 0, WIN+ALT+TQt::Key_F4, slotWindowToDesktop(int) ); + DEF( I18N_NOOP("Window to Desktop 5"), 0, WIN+ALT+TQt::Key_F5, slotWindowToDesktop(int) ); + DEF( I18N_NOOP("Window to Desktop 6"), 0, WIN+ALT+TQt::Key_F6, slotWindowToDesktop(int) ); + DEF( I18N_NOOP("Window to Desktop 7"), 0, WIN+ALT+TQt::Key_F7, slotWindowToDesktop(int) ); + DEF( I18N_NOOP("Window to Desktop 8"), 0, WIN+ALT+TQt::Key_F8, slotWindowToDesktop(int) ); + DEF( I18N_NOOP("Window to Desktop 9"), 0, WIN+ALT+TQt::Key_F9, slotWindowToDesktop(int) ); + DEF( I18N_NOOP("Window to Desktop 10"), 0, WIN+ALT+TQt::Key_F10, slotWindowToDesktop(int) ); DEF( I18N_NOOP("Window to Desktop 11"), 0, 0, slotWindowToDesktop(int) ); DEF( I18N_NOOP("Window to Desktop 12"), 0, 0, slotWindowToDesktop(int) ); DEF( I18N_NOOP("Window to Desktop 13"), 0, 0, slotWindowToDesktop(int) ); @@ -117,26 +117,26 @@ DEF( I18N_NOOP("Window to Next Screen"), 0, 0, slotWindowToNextScreen() ); keys->insert( "Group:Desktop Switching", i18n("Desktop Switching") ); - DEF( I18N_NOOP("Switch to Desktop 1"), CTRL+Qt::Key_F1, WIN+Qt::Key_F1, slotSwitchToDesktop(int) ); - DEF( I18N_NOOP("Switch to Desktop 2"), CTRL+Qt::Key_F2, WIN+Qt::Key_F2, slotSwitchToDesktop(int) ); - DEF( I18N_NOOP("Switch to Desktop 3"), CTRL+Qt::Key_F3, WIN+Qt::Key_F3, slotSwitchToDesktop(int) ); - DEF( I18N_NOOP("Switch to Desktop 4"), CTRL+Qt::Key_F4, WIN+Qt::Key_F4, slotSwitchToDesktop(int) ); - DEF( I18N_NOOP("Switch to Desktop 5"), CTRL+Qt::Key_F5, WIN+Qt::Key_F5, slotSwitchToDesktop(int) ); - DEF( I18N_NOOP("Switch to Desktop 6"), CTRL+Qt::Key_F6, WIN+Qt::Key_F6, slotSwitchToDesktop(int) ); - DEF( I18N_NOOP("Switch to Desktop 7"), CTRL+Qt::Key_F7, WIN+Qt::Key_F7, slotSwitchToDesktop(int) ); - DEF( I18N_NOOP("Switch to Desktop 8"), CTRL+Qt::Key_F8, WIN+Qt::Key_F8, slotSwitchToDesktop(int) ); - DEF( I18N_NOOP("Switch to Desktop 9"), CTRL+Qt::Key_F9, WIN+Qt::Key_F9, slotSwitchToDesktop(int) ); - DEF( I18N_NOOP("Switch to Desktop 10"), CTRL+Qt::Key_F10, WIN+Qt::Key_F10, slotSwitchToDesktop(int) ); - DEF( I18N_NOOP("Switch to Desktop 11"), CTRL+Qt::Key_F11, 0, slotSwitchToDesktop(int) ); - DEF( I18N_NOOP("Switch to Desktop 12"), CTRL+Qt::Key_F12, 0, slotSwitchToDesktop(int) ); - DEF( I18N_NOOP("Switch to Desktop 13"), CTRL+SHIFT+Qt::Key_F1, 0, slotSwitchToDesktop(int) ); - DEF( I18N_NOOP("Switch to Desktop 14"), CTRL+SHIFT+Qt::Key_F2, 0, slotSwitchToDesktop(int) ); - DEF( I18N_NOOP("Switch to Desktop 15"), CTRL+SHIFT+Qt::Key_F3, 0, slotSwitchToDesktop(int) ); - DEF( I18N_NOOP("Switch to Desktop 16"), CTRL+SHIFT+Qt::Key_F4, 0, slotSwitchToDesktop(int) ); - DEF( I18N_NOOP("Switch to Desktop 17"), CTRL+SHIFT+Qt::Key_F5, 0, slotSwitchToDesktop(int) ); - DEF( I18N_NOOP("Switch to Desktop 18"), CTRL+SHIFT+Qt::Key_F6, 0, slotSwitchToDesktop(int) ); - DEF( I18N_NOOP("Switch to Desktop 19"), CTRL+SHIFT+Qt::Key_F7, 0, slotSwitchToDesktop(int) ); - DEF( I18N_NOOP("Switch to Desktop 20"), CTRL+SHIFT+Qt::Key_F8, 0, slotSwitchToDesktop(int) ); + DEF( I18N_NOOP("Switch to Desktop 1"), CTRL+TQt::Key_F1, WIN+TQt::Key_F1, slotSwitchToDesktop(int) ); + DEF( I18N_NOOP("Switch to Desktop 2"), CTRL+TQt::Key_F2, WIN+TQt::Key_F2, slotSwitchToDesktop(int) ); + DEF( I18N_NOOP("Switch to Desktop 3"), CTRL+TQt::Key_F3, WIN+TQt::Key_F3, slotSwitchToDesktop(int) ); + DEF( I18N_NOOP("Switch to Desktop 4"), CTRL+TQt::Key_F4, WIN+TQt::Key_F4, slotSwitchToDesktop(int) ); + DEF( I18N_NOOP("Switch to Desktop 5"), CTRL+TQt::Key_F5, WIN+TQt::Key_F5, slotSwitchToDesktop(int) ); + DEF( I18N_NOOP("Switch to Desktop 6"), CTRL+TQt::Key_F6, WIN+TQt::Key_F6, slotSwitchToDesktop(int) ); + DEF( I18N_NOOP("Switch to Desktop 7"), CTRL+TQt::Key_F7, WIN+TQt::Key_F7, slotSwitchToDesktop(int) ); + DEF( I18N_NOOP("Switch to Desktop 8"), CTRL+TQt::Key_F8, WIN+TQt::Key_F8, slotSwitchToDesktop(int) ); + DEF( I18N_NOOP("Switch to Desktop 9"), CTRL+TQt::Key_F9, WIN+TQt::Key_F9, slotSwitchToDesktop(int) ); + DEF( I18N_NOOP("Switch to Desktop 10"), CTRL+TQt::Key_F10, WIN+TQt::Key_F10, slotSwitchToDesktop(int) ); + DEF( I18N_NOOP("Switch to Desktop 11"), CTRL+TQt::Key_F11, 0, slotSwitchToDesktop(int) ); + DEF( I18N_NOOP("Switch to Desktop 12"), CTRL+TQt::Key_F12, 0, slotSwitchToDesktop(int) ); + DEF( I18N_NOOP("Switch to Desktop 13"), CTRL+SHIFT+TQt::Key_F1, 0, slotSwitchToDesktop(int) ); + DEF( I18N_NOOP("Switch to Desktop 14"), CTRL+SHIFT+TQt::Key_F2, 0, slotSwitchToDesktop(int) ); + DEF( I18N_NOOP("Switch to Desktop 15"), CTRL+SHIFT+TQt::Key_F3, 0, slotSwitchToDesktop(int) ); + DEF( I18N_NOOP("Switch to Desktop 16"), CTRL+SHIFT+TQt::Key_F4, 0, slotSwitchToDesktop(int) ); + DEF( I18N_NOOP("Switch to Desktop 17"), CTRL+SHIFT+TQt::Key_F5, 0, slotSwitchToDesktop(int) ); + DEF( I18N_NOOP("Switch to Desktop 18"), CTRL+SHIFT+TQt::Key_F6, 0, slotSwitchToDesktop(int) ); + DEF( I18N_NOOP("Switch to Desktop 19"), CTRL+SHIFT+TQt::Key_F7, 0, slotSwitchToDesktop(int) ); + DEF( I18N_NOOP("Switch to Desktop 20"), CTRL+SHIFT+TQt::Key_F8, 0, slotSwitchToDesktop(int) ); DEF( I18N_NOOP("Switch to Next Desktop"), 0, 0, slotSwitchDesktopNext() ); DEF( I18N_NOOP("Switch to Previous Desktop"), 0, 0, slotSwitchDesktopPrevious() ); DEF( I18N_NOOP("Switch One Desktop to the Right"), 0, 0, slotSwitchDesktopRight() ); @@ -154,10 +154,10 @@ DEF( I18N_NOOP("Switch to Next Screen"), 0, 0, slotSwitchToNextScreen() ); keys->insert( "Group:Miscellaneous", i18n("Miscellaneous") ); - DEF( I18N_NOOP("Mouse Emulation"), ALT+Qt::Key_F12, 0, slotMouseEmulation() ); - DEF( I18N_NOOP("Kill Window"), ALT+CTRL+Qt::Key_Escape, WIN+CTRL+Qt::Key_Delete, slotKillWindow() ); - DEF( I18N_NOOP("Window Screenshot"), ALT+Qt::Key_Print, ALT+Qt::Key_Print, slotGrabWindow() ); - DEF( I18N_NOOP("Desktop Screenshot"), CTRL+Qt::Key_Print, WIN+Qt::Key_Print, slotGrabDesktop() ); + DEF( I18N_NOOP("Mouse Emulation"), ALT+TQt::Key_F12, 0, slotMouseEmulation() ); + DEF( I18N_NOOP("Kill Window"), ALT+CTRL+TQt::Key_Escape, WIN+CTRL+TQt::Key_Delete, slotKillWindow() ); + DEF( I18N_NOOP("Window Screenshot"), ALT+TQt::Key_Print, ALT+TQt::Key_Print, slotGrabWindow() ); + DEF( I18N_NOOP("Desktop Screenshot"), CTRL+TQt::Key_Print, WIN+TQt::Key_Print, slotGrabDesktop() ); #ifdef IN_KWIN { TDEGlobalAccel* keys = disable_shortcuts_keys; @@ -169,28 +169,28 @@ /*This belongs in taskbar rather than here, so it'll have to wait until after 2.2 is done. -- ellis -DEF( I18N_NOOP("Switch to Window 1", WIN+Qt::Key_1")); -DEF( I18N_NOOP("Switch to Window 2", WIN+Qt::Key_2")); -DEF( I18N_NOOP("Switch to Window 3", WIN+Qt::Key_3")); -DEF( I18N_NOOP("Switch to Window 4", WIN+Qt::Key_4")); -DEF( I18N_NOOP("Switch to Window 5", WIN+Qt::Key_5")); -DEF( I18N_NOOP("Switch to Window 6", WIN+Qt::Key_6")); -DEF( I18N_NOOP("Switch to Window 7", WIN+Qt::Key_7")); -DEF( I18N_NOOP("Switch to Window 8", WIN+Qt::Key_8")); -DEF( I18N_NOOP("Switch to Window 9", WIN+Qt::Key_9")); +DEF( I18N_NOOP("Switch to Window 1", WIN+TQt::Key_1")); +DEF( I18N_NOOP("Switch to Window 2", WIN+TQt::Key_2")); +DEF( I18N_NOOP("Switch to Window 3", WIN+TQt::Key_3")); +DEF( I18N_NOOP("Switch to Window 4", WIN+TQt::Key_4")); +DEF( I18N_NOOP("Switch to Window 5", WIN+TQt::Key_5")); +DEF( I18N_NOOP("Switch to Window 6", WIN+TQt::Key_6")); +DEF( I18N_NOOP("Switch to Window 7", WIN+TQt::Key_7")); +DEF( I18N_NOOP("Switch to Window 8", WIN+TQt::Key_8")); +DEF( I18N_NOOP("Switch to Window 9", WIN+TQt::Key_9")); #ifdef WITH_LABELS DEF( I18N_NOOP("Window & Taskbar"Group:Window Desktop", 0); #endif -DEF( I18N_NOOP("Window to Taskbar Position 1", WIN+Qt::Key_Alt+1")); -DEF( I18N_NOOP("Window to Taskbar Position 2", WIN+Qt::Key_Alt+2")); -DEF( I18N_NOOP("Window to Taskbar Position 3", WIN+Qt::Key_Alt+3")); -DEF( I18N_NOOP("Window to Taskbar Position 4", WIN+Qt::Key_Alt+4")); -DEF( I18N_NOOP("Window to Taskbar Position 5", WIN+Qt::Key_Alt+5")); -DEF( I18N_NOOP("Window to Taskbar Position 6", WIN+Qt::Key_Alt+6")); -DEF( I18N_NOOP("Window to Taskbar Position 7", WIN+Qt::Key_Alt+7")); -DEF( I18N_NOOP("Window to Taskbar Position 8", WIN+Qt::Key_Alt+8")); -DEF( I18N_NOOP("Window to Taskbar Position 9", WIN+Qt::Key_Alt+9")); +DEF( I18N_NOOP("Window to Taskbar Position 1", WIN+TQt::Key_Alt+1")); +DEF( I18N_NOOP("Window to Taskbar Position 2", WIN+TQt::Key_Alt+2")); +DEF( I18N_NOOP("Window to Taskbar Position 3", WIN+TQt::Key_Alt+3")); +DEF( I18N_NOOP("Window to Taskbar Position 4", WIN+TQt::Key_Alt+4")); +DEF( I18N_NOOP("Window to Taskbar Position 5", WIN+TQt::Key_Alt+5")); +DEF( I18N_NOOP("Window to Taskbar Position 6", WIN+TQt::Key_Alt+6")); +DEF( I18N_NOOP("Window to Taskbar Position 7", WIN+TQt::Key_Alt+7")); +DEF( I18N_NOOP("Window to Taskbar Position 8", WIN+TQt::Key_Alt+8")); +DEF( I18N_NOOP("Window to Taskbar Position 9", WIN+TQt::Key_Alt+9")); */ #undef DEF diff --git a/twin/useractions.cpp b/twin/useractions.cpp index 85e76e4cd..567255fa5 100644 --- a/twin/useractions.cpp +++ b/twin/useractions.cpp @@ -51,13 +51,13 @@ TQPopupMenu* Workspace::clientPopup() popup = new TQPopupMenu; popup->setCheckable( TRUE ); popup->setFont(TDEGlobalSettings::menuFont()); - connect( popup, TQT_SIGNAL( aboutToShow() ), this, TQT_SLOT( clientPopupAboutToShow() ) ); - connect( popup, TQT_SIGNAL( activated(int) ), this, TQT_SLOT( clientPopupActivated(int) ) ); + connect( popup, TQ_SIGNAL( aboutToShow() ), this, TQ_SLOT( clientPopupAboutToShow() ) ); + connect( popup, TQ_SIGNAL( activated(int) ), this, TQ_SLOT( clientPopupActivated(int) ) ); advanced_popup = new TQPopupMenu( popup ); advanced_popup->setCheckable( TRUE ); advanced_popup->setFont(TDEGlobalSettings::menuFont()); - connect( advanced_popup, TQT_SIGNAL( activated(int) ), this, TQT_SLOT( clientPopupActivated(int) ) ); + connect( advanced_popup, TQ_SIGNAL( activated(int) ), this, TQ_SLOT( clientPopupActivated(int) ) ); advanced_popup->insertItem( SmallIconSet( "go-up" ), i18n("Keep &Above Others")+'\t'+keys->shortcut("Window Above Other Windows").seq(0).toString(), Options::KeepAboveOp ); advanced_popup->insertItem( SmallIconSet( "go-down" ), @@ -67,13 +67,13 @@ TQPopupMenu* Workspace::clientPopup() advanced_popup->insertItem( i18n("&No Border")+'\t'+keys->shortcut("Window No Border").seq(0).toString(), Options::NoBorderOp ); advanced_popup->insertItem( i18n("Shad&ow"), Options::ShadowOp ); advanced_popup->insertItem( SmallIconSet("key_bindings"), - i18n("Window &Shortcut...")+'\t'+keys->shortcut("Setup Window Shortcut").seq(0).toString(), Options::SetupWindowShortcutOp ); + i18n("Window &Shortcut…")+'\t'+keys->shortcut("Setup Window Shortcut").seq(0).toString(), Options::SetupWindowShortcutOp ); advanced_popup->insertSeparator(); advanced_popup->insertItem( SmallIconSet( "suspend" ), i18n("&Suspend Application"), Options::SuspendWindowOp ); advanced_popup->insertItem( SmallIconSet( "application-x-executable" ), i18n("&Resume Application"), Options::ResumeWindowOp ); advanced_popup->insertSeparator(); - advanced_popup->insertItem( SmallIconSet( "wizard" ), i18n("&Special Window Settings..."), Options::WindowRulesOp ); - advanced_popup->insertItem( SmallIconSet( "wizard" ), i18n("&Special Application Settings..."), Options::ApplicationRulesOp ); + advanced_popup->insertItem( SmallIconSet( "wizard" ), i18n("&Special Window Settings…"), Options::WindowRulesOp ); + advanced_popup->insertItem( SmallIconSet( "wizard" ), i18n("&Special Application Settings…"), Options::ApplicationRulesOp ); popup->insertItem(i18n("Ad&vanced"), advanced_popup ); desk_popup_index = popup->count(); @@ -83,13 +83,13 @@ TQPopupMenu* Workspace::clientPopup() TQVBox *transBox = new TQVBox(trans_popup); transButton = new TQPushButton(transBox, "transButton"); TQToolTip::add(transButton, i18n("Reset opacity to default value")); - transSlider = new TQSlider(0, 100, 1, 100, Qt::Horizontal, transBox, "transSlider"); + transSlider = new TQSlider(0, 100, 1, 100, TQt::Horizontal, transBox, "transSlider"); TQToolTip::add(transSlider, i18n("Slide this to set the window's opacity")); - connect(transButton, TQT_SIGNAL(clicked()), TQT_SLOT(resetClientOpacity())); - connect(transButton, TQT_SIGNAL(clicked()), trans_popup, TQT_SLOT(hide())); - connect(transSlider, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(setTransButtonText(int))); - connect(transSlider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(setPopupClientOpacity(int))); -// connect(transSlider, TQT_SIGNAL(sliderReleased()), trans_popup, TQT_SLOT(hide())); + connect(transButton, TQ_SIGNAL(clicked()), TQ_SLOT(resetClientOpacity())); + connect(transButton, TQ_SIGNAL(clicked()), trans_popup, TQ_SLOT(hide())); + connect(transSlider, TQ_SIGNAL(valueChanged(int)), TQ_SLOT(setTransButtonText(int))); + connect(transSlider, TQ_SIGNAL(valueChanged(int)), this, TQ_SLOT(setPopupClientOpacity(int))); +// connect(transSlider, TQ_SIGNAL(sliderReleased()), trans_popup, TQ_SLOT(hide())); trans_popup->insertItem(transBox); popup->insertItem(i18n("&Opacity"), trans_popup ); } @@ -105,7 +105,7 @@ TQPopupMenu* Workspace::clientPopup() if (!TDEGlobal::config()->isImmutable() && !kapp->authorizeControlModules(Workspace::configModules(true)).isEmpty()) { - popup->insertItem(SmallIconSet( "configure" ), i18n("Configur&e Window Behavior..."), this, TQT_SLOT( configureWM() )); + popup->insertItem(SmallIconSet( "configure" ), i18n("Configur&e Window Behavior…"), this, TQ_SLOT( configureWM() )); popup->insertSeparator(); } @@ -201,10 +201,10 @@ void Workspace::initDesktopPopup() desk_popup = new TQPopupMenu( popup ); desk_popup->setCheckable( TRUE ); desk_popup->setFont(TDEGlobalSettings::menuFont()); - connect( desk_popup, TQT_SIGNAL( activated(int) ), - this, TQT_SLOT( slotSendToDesktop(int) ) ); - connect( desk_popup, TQT_SIGNAL( aboutToShow() ), - this, TQT_SLOT( desktopPopupAboutToShow() ) ); + connect( desk_popup, TQ_SIGNAL( activated(int) ), + this, TQ_SLOT( slotSendToDesktop(int) ) ); + connect( desk_popup, TQ_SIGNAL( aboutToShow() ), + this, TQ_SLOT( desktopPopupAboutToShow() ) ); popup->insertItem(i18n("To &Desktop"), desk_popup, -1, desk_popup_index ); } @@ -299,7 +299,7 @@ void Workspace::setupWindowShortcut( Client* c ) client_keys->suspend( true ); client_keys_dialog = new ShortcutDialog( c->shortcut()); client_keys_client = c; - connect( client_keys_dialog, TQT_SIGNAL( dialogDone( bool )), TQT_SLOT( setupWindowShortcutDone( bool ))); + connect( client_keys_dialog, TQ_SIGNAL( dialogDone( bool )), TQ_SLOT( setupWindowShortcutDone( bool ))); TQRect r = clientArea( ScreenArea, c ); TQSize size = client_keys_dialog->sizeHint(); TQPoint pos = c->pos() + c->clientPos(); @@ -336,7 +336,7 @@ void Workspace::clientShortcutUpdated( Client* c ) { client_keys->insert( key, key ); client_keys->setShortcut( key, c->shortcut()); - client_keys->setSlot( key, c, TQT_SLOT( shortcutActivated())); + client_keys->setSlot( key, c, TQ_SLOT( shortcutActivated())); client_keys->setActionEnabled( key, true ); } client_keys->updateConnections(); @@ -647,12 +647,70 @@ bool Client::performMouseCommand( Options::MouseCommand command, TQPoint globalP return replay; } -// KDE4 remove me -void Workspace::showWindowMenuAt( unsigned long, int, int ) +void Workspace::showWindowMenuAt( unsigned long window, int x, int y ) { - slotWindowOperations(); + Client *client; + if ((client = findClient(WindowMatchPredicate((WId)window)))) + showWindowMenu( x, y, client ); } +void Workspace::showWindowMenu( unsigned long window ) + { + Client *client; + if ((client = findClient(WindowMatchPredicate((WId)window)))) + { + TQPoint pos = client->pos() + client->clientPos(); + showWindowMenu( pos, client ); + } + } + +void Workspace::tileWindowToBorder(unsigned long w1, int location) { + if (location < ActiveTop || location >= ACTIVE_BORDER_COUNT) return; + + Client *c1 = findClient(WindowMatchPredicate((WId)w1)); + if (!c1) return; + + c1->tileToBorder((ActiveBorder)location); +} + +void Workspace::tileTwoWindowsHorizontally(unsigned long w1, unsigned long w2) { + if (w1 == w2) return; + + Client *c1 = findClient(WindowMatchPredicate((WId)w1)); + Client *c2 = findClient(WindowMatchPredicate((WId)w2)); + if (!c1 || !c2) return; + + c1->tileToBorder(ActiveTop); + c2->tileToBorder(ActiveBottom); +} + +void Workspace::tileTwoWindowsVertically(unsigned long w1, unsigned long w2) { + if (w1 == w2) return; + + Client *c1 = findClient(WindowMatchPredicate((WId)w1)); + Client *c2 = findClient(WindowMatchPredicate((WId)w2)); + if (!c1 || !c2) return; + + c1->tileToBorder(ActiveLeft); + c2->tileToBorder(ActiveRight); +} + +void Workspace::tileFourWindowsInGrid(unsigned long w1, unsigned long w2, unsigned long w3, unsigned long w4) { + if (w1 == w2 || w1 == w3 || w1 == w4 || w2 == w3 || w2 == w4 || w3 == w4) + return; + + Client *c1 = findClient(WindowMatchPredicate((WId)w1)); + Client *c2 = findClient(WindowMatchPredicate((WId)w2)); + Client *c3 = findClient(WindowMatchPredicate((WId)w3)); + Client *c4 = findClient(WindowMatchPredicate((WId)w4)); + if (!c1 || !c2 || !c3 || !c4) return; + + c1->tileToBorder(ActiveTopLeft); + c2->tileToBorder(ActiveTopRight); + c3->tileToBorder(ActiveBottomLeft); + c4->tileToBorder(ActiveBottomRight); +} + void Workspace::slotActivateAttentionWindow() { if( attention_chain.count() > 0 ) @@ -1070,17 +1128,21 @@ void Workspace::showWindowMenu( const TQRect &pos, Client* cl ) active_popup = p; int x = pos.left(); int y = pos.bottom(); - if (y == pos.top()) - p->exec( TQPoint( x, y ) ); + clientPopupAboutToShow(); // needed for sizeHint() to be correct :-/ + + TQRect area = clientArea(ScreenArea, TQPoint(x, y), currentDesktop()); + TQSize hint = p->sizeHint(); + if (x < 0) x = area.right() - hint.width() + x; + if (y < 0) y = area.bottom() - hint.height() + y; + + if (pos.bottom() == pos.top()) + p->exec( TQPoint( x, y ) ); else { - TQRect area = clientArea(ScreenArea, TQPoint(x, y), currentDesktop()); - clientPopupAboutToShow(); // needed for sizeHint() to be correct :-/ - int popupHeight = p->sizeHint().height(); - if (y + popupHeight < area.height()) - p->exec( TQPoint( x, y ) ); - else - p->exec( TQPoint( x, pos.top() - popupHeight ) ); + if (y + hint.height() < area.height()) + p->exec( TQPoint( x, y ) ); + else + p->exec( TQPoint( x, pos.top() - hint.height() ) ); } // active popup may be already changed (e.g. the window shortcut dialog) if( active_popup == p ) diff --git a/twin/utils.cpp b/twin/utils.cpp index e7e5c7d32..bc44eee56 100644 --- a/twin/utils.cpp +++ b/twin/utils.cpp @@ -37,10 +37,6 @@ License. See the file "COPYING" for the exact licensing terms. #include "atoms.h" #include "notifications.h" -#ifdef USE_QT4 -#include <Qt/qx11info_x11.h> -#endif // USE_QT4 - #endif namespace KWinInternal @@ -278,7 +274,7 @@ void updateXTime() XCheckIfEvent( tqt_xdisplay(), &dummy, update_x_time_predicate, NULL ); } assert( next_x_time != CurrentTime ); - SET_QT_X_TIME(next_x_time); + set_tqt_x_time(next_x_time); XEvent ev; // remove the PropertyNotify event from the events queue XWindowEvent( tqt_xdisplay(), w->winId(), PropertyChangeMask, &ev ); } diff --git a/twin/utils.h b/twin/utils.h index e8bc09a46..da2f9c2e3 100644 --- a/twin/utils.h +++ b/twin/utils.h @@ -108,7 +108,28 @@ enum ShadeMode ShadeActivated // "shaded", but visible due to alt+tab to the window }; -class Shape +enum ActiveBorder + { + ActiveTop = 0, + ActiveTopRight, + ActiveRight, + ActiveBottomRight, + ActiveBottom, + ActiveBottomLeft, + ActiveLeft, + ActiveTopLeft, + ACTIVE_BORDER_COUNT, + ActiveNone + }; + +enum ActiveMaximizingMode +{ + ActiveNoMode, + ActiveTilingMode, + ActiveMaximizeMode +}; + +class Shape { public: static bool available() { return twin_shape_version > 0; } @@ -126,12 +147,12 @@ class Shape const int ShapeInput = 2; #endif -class Motif +class Motif { public: static void readFlags( WId w, bool& noborder, bool& resize, bool& move, bool& minimize, bool& maximize, bool& close ); - struct MwmHints + struct MwmHints { ulong flags; ulong functions; @@ -155,7 +176,7 @@ class Motif class KWinSelectionOwner : public TDESelectionOwner { - Q_OBJECT + TQ_OBJECT public: KWinSelectionOwner( int screen ); protected: @@ -227,7 +248,7 @@ KWIN_CHECK_PREDICATE( TruePredicate, cl == cl /*true, avoid warning about 'cl' * template< typename T > Client* findClientInList( const ClientList& list, T predicate ) { - for ( ClientList::ConstIterator it = list.begin(); it != list.end(); ++it) + for ( ClientList::ConstIterator it = list.begin(); it != list.end(); ++it) { if ( predicate( const_cast< const Client* >( *it))) return *it; @@ -256,7 +277,7 @@ void checkNonExistentClients(); class ShortcutDialog : public TDEShortcutDialog { - Q_OBJECT + TQ_OBJECT public: ShortcutDialog( const TDEShortcut& cut ); virtual void accept(); diff --git a/twin/workspace.cpp b/twin/workspace.cpp index 8cddbb72e..23661e6a0 100644 --- a/twin/workspace.cpp +++ b/twin/workspace.cpp @@ -167,13 +167,8 @@ Workspace::Workspace( bool restore ) global_shortcuts_disabled_for_client( false ), root (0), workspaceInit (true), - startup(0), electric_have_borders(false), - electric_current_border(0), - electric_top_border(None), - electric_bottom_border(None), - electric_left_border(None), - electric_right_border(None), - layoutOrientation(Qt::Vertical), + startup(0), + layoutOrientation(TQt::Vertical), layoutX(-1), layoutY(2), workarea(NULL), @@ -194,16 +189,22 @@ Workspace::Workspace( bool restore ) installed_colormap = default_colormap; session.setAutoDelete( TRUE ); - connect( &temporaryRulesMessages, TQT_SIGNAL( gotMessage( const TQString& )), - this, TQT_SLOT( gotTemporaryRulesMessage( const TQString& ))); - connect( &rulesUpdatedTimer, TQT_SIGNAL( timeout()), this, TQT_SLOT( writeWindowRules())); + for (int i = 0; i < ACTIVE_BORDER_COUNT; ++i) + { + active_reserved[i] = 0; + active_windows[i] = None; + } + + connect( &temporaryRulesMessages, TQ_SIGNAL( gotMessage( const TQString& )), + this, TQ_SLOT( gotTemporaryRulesMessage( const TQString& ))); + connect( &rulesUpdatedTimer, TQ_SIGNAL( timeout()), this, TQ_SLOT( writeWindowRules())); updateXTime(); // needed for proper initialization of user_time in Client ctor - delayFocusTimer = 0; - - electric_time_first = GET_QT_X_TIME(); - electric_time_last = GET_QT_X_TIME(); + delayFocusTimer = 0; + + active_time_first = get_tqt_x_time(); + active_time_last = get_tqt_x_time(); if ( restore ) loadSessionInfo(); @@ -258,7 +259,7 @@ Workspace::Workspace( bool restore ) init(); #if (TQT_VERSION-0 >= 0x030200) // XRANDR support - connect( kapp->desktop(), TQT_SIGNAL( resized( int )), TQT_SLOT( desktopResized())); + connect( kapp->desktop(), TQ_SIGNAL( resized( int )), TQ_SLOT( desktopResized())); #endif if (!supportsCompMgr()) { @@ -273,7 +274,7 @@ Workspace::Workspace( bool restore ) if (options->useTranslucency) { kompmgr = new TDEProcess; - connect(kompmgr, TQT_SIGNAL(receivedStderr(TDEProcess*, char*, int)), TQT_SLOT(handleKompmgrOutput(TDEProcess*, char*, int))); + connect(kompmgr, TQ_SIGNAL(receivedStderr(TDEProcess*, char*, int)), TQ_SLOT(handleKompmgrOutput(TDEProcess*, char*, int))); *kompmgr << TDE_COMPOSITOR_BINARY; if (kompmgrpid) { @@ -304,13 +305,17 @@ Workspace::Workspace( bool restore ) void Workspace::init() +{ + if (options->activeBorders() == Options::ActiveSwitchAlways) { - checkElectricBorders(); + reserveActiveBorderSwitching(true); + } + updateActiveBorders(); // not used yet // topDock = 0L; // maximizedWindowCounter = 0; - + supportWindow = new TQWidget; XLowerWindow( tqt_xdisplay(), supportWindow->winId()); // see usage in layers.cpp @@ -422,15 +427,15 @@ void Workspace::init() // now we know how many desktops we'll, thus, we initialise the positioning object initPositioning = new Placement(this); - connect(&reconfigureTimer, TQT_SIGNAL(timeout()), this, - TQT_SLOT(slotReconfigure())); - connect( &updateToolWindowsTimer, TQT_SIGNAL( timeout()), this, TQT_SLOT( slotUpdateToolWindows())); + connect(&reconfigureTimer, TQ_SIGNAL(timeout()), this, + TQ_SLOT(slotReconfigure())); + connect( &updateToolWindowsTimer, TQ_SIGNAL( timeout()), this, TQ_SLOT( slotUpdateToolWindows())); - connect(kapp, TQT_SIGNAL(appearanceChanged()), this, - TQT_SLOT(slotReconfigure())); - connect(kapp, TQT_SIGNAL(settingsChanged(int)), this, - TQT_SLOT(slotSettingsChanged(int))); - connect(kapp, TQT_SIGNAL( kipcMessage( int, int )), this, TQT_SLOT( kipcMessage( int, int ))); + connect(kapp, TQ_SIGNAL(appearanceChanged()), this, + TQ_SLOT(slotReconfigure())); + connect(kapp, TQ_SIGNAL(settingsChanged(int)), this, + TQ_SLOT(slotSettingsChanged(int))); + connect(kapp, TQ_SIGNAL( kipcMessage( int, int )), this, TQ_SLOT( kipcMessage( int, int ))); active_client = NULL; rootInfo->setActiveWindow( None ); @@ -456,7 +461,7 @@ void Workspace::init() unsigned int i, nwins; Window root_return, parent_return, *wins; XQueryTree(tqt_xdisplay(), root, &root_return, &parent_return, &wins, &nwins); - for (i = 0; i < nwins; i++) + for (i = 0; i < nwins; i++) { XWindowAttributes attr; XGetWindowAttributes(tqt_xdisplay(), wins[i], &attr); @@ -464,12 +469,12 @@ void Workspace::init() continue; if( topmenu_space && topmenu_space->winId() == wins[ i ] ) continue; - if (attr.map_state != IsUnmapped) + if (attr.map_state != IsUnmapped) { if ( addSystemTrayWin( wins[i] ) ) continue; Client* c = createClient( wins[i], true ); - if ( c != NULL && root != tqt_xrootwin() ) + if ( c != NULL && root != tqt_xrootwin() ) { // TODO what is this? // TODO may use TQWidget:.create XReparentWindow( tqt_xdisplay(), c->frameId(), root, 0, 0 ); @@ -483,7 +488,6 @@ void Workspace::init() updateStackingOrder( true ); updateClientArea(); - raiseElectricBorders(); // NETWM spec says we have to set it to (0,0) if we don't support it NETPoint* viewports = new NETPoint[ number_of_desktops ]; @@ -514,12 +518,27 @@ void Workspace::init() } if( new_active_client != NULL ) activateClient( new_active_client ); + + // outline windows for active border maximize window mode + outline_left = XCreateWindow(tqt_xdisplay(), rootWin(), 0, 0, 1, 1, 0, + CopyFromParent, CopyFromParent, CopyFromParent, + CWOverrideRedirect, &attr); + outline_right = XCreateWindow(tqt_xdisplay(), rootWin(), 0, 0, 1, 1, 0, + CopyFromParent, CopyFromParent, CopyFromParent, + CWOverrideRedirect, &attr); + outline_top = XCreateWindow(tqt_xdisplay(), rootWin(), 0, 0, 1, 1, 0, + CopyFromParent, CopyFromParent, CopyFromParent, + CWOverrideRedirect, &attr); + outline_bottom = XCreateWindow(tqt_xdisplay(), rootWin(), 0, 0, 1, 1, 0, + CopyFromParent, CopyFromParent, CopyFromParent, + CWOverrideRedirect, &attr); + // SELI TODO this won't work with unreasonable focus policies, // and maybe in rare cases also if the selected client doesn't // want focus workspaceInit = false; // TODO ungrabXServer() - } +} Workspace::~Workspace() { @@ -550,6 +569,12 @@ Workspace::~Workspace() writeWindowRules(); TDEGlobal::config()->sync(); + // destroy outline windows for active border maximize window mode + XDestroyWindow(tqt_xdisplay(), outline_left); + XDestroyWindow(tqt_xdisplay(), outline_right); + XDestroyWindow(tqt_xdisplay(), outline_top); + XDestroyWindow(tqt_xdisplay(), outline_bottom); + delete rootInfo; delete supportWindow; delete mgr; @@ -785,7 +810,7 @@ void Workspace::updateFocusChains( Client* c, FocusChainChange change ) void Workspace::updateOverlappingShadows(unsigned long window) { Client *client; - + if ((client = findClient(WindowMatchPredicate((WId)window)))) // Redraw overlapping shadows without waiting for the specified window // to redraw its own shadow @@ -795,7 +820,7 @@ void Workspace::updateOverlappingShadows(unsigned long window) void Workspace::setShadowed(unsigned long window, bool shadowed) { Client *client; - + if ((client = findClient(WindowMatchPredicate((WId)window)))) client->setShadowed(shadowed); } @@ -891,7 +916,7 @@ void Workspace::updateCurrentTopMenu() } // ... then hide the other ones. Avoids flickers. - for ( ClientList::ConstIterator it = clients.begin(); it != clients.end(); ++it) + for ( ClientList::ConstIterator it = clients.begin(); it != clients.end(); ++it) { if( (*it)->isTopMenu() && (*it) != menubar ) (*it)->hideClient( true ); @@ -1008,7 +1033,7 @@ void Workspace::updateColormap() Colormap cmap = default_colormap; if ( activeClient() && activeClient()->colormap() != None ) cmap = activeClient()->colormap(); - if ( cmap != installed_colormap ) + if ( cmap != installed_colormap ) { XInstallColormap(tqt_xdisplay(), cmap ); installed_colormap = cmap; @@ -1038,6 +1063,11 @@ void Workspace::slotReconfigure() kdDebug(1212) << "Workspace::slotReconfigure()" << endl; reconfigureTimer.stop(); + if (options->activeBorders() == Options::ActiveSwitchAlways) + { + reserveActiveBorderSwitching(false); + } + TDEGlobal::config()->reparseConfiguration(); unsigned long changed = options->updateSettings(); tab_box->reconfigure(); @@ -1068,7 +1098,10 @@ void Workspace::slotReconfigure() forEachClient( CheckBorderSizesProcedure()); } - checkElectricBorders(); + if (options->activeBorders() == Options::ActiveSwitchAlways) + { + reserveActiveBorderSwitching(true); + } if( options->topMenuEnabled() && !managingTopMenus()) { @@ -1155,10 +1188,10 @@ void Workspace::slotReconfigure() if (!kompmgr) { kompmgr = new TDEProcess; - connect(kompmgr, TQT_SIGNAL(receivedStderr(TDEProcess*, char*, int)), TQT_SLOT(handleKompmgrOutput(TDEProcess*, char*, int))); + connect(kompmgr, TQ_SIGNAL(receivedStderr(TDEProcess*, char*, int)), TQ_SLOT(handleKompmgrOutput(TDEProcess*, char*, int))); *kompmgr << TDE_COMPOSITOR_BINARY; } - TQTimer::singleShot( 200, this, TQT_SLOT(startKompmgr()) ); // wait some time to ensure system's ready for restart + TQTimer::singleShot( 200, this, TQ_SLOT(startKompmgr()) ); // wait some time to ensure system's ready for restart } } else @@ -1195,7 +1228,7 @@ void Workspace::loadDesktopSettings() desktop_focus_chain.resize( n ); // make it +1, so that it can be accessed as [1..numberofdesktops] focus_chain.resize( n + 1 ); - for(int i = 1; i <= n; i++) + for(int i = 1; i <= n; i++) { TQString s = c->readEntry(TQString("Name_%1").arg(i), i18n("Desktop %1").arg(i)); @@ -1215,21 +1248,21 @@ void Workspace::saveDesktopSettings() TDEConfigGroupSaver saver(c,groupname); c->writeEntry("Number", number_of_desktops ); - for(int i = 1; i <= number_of_desktops; i++) + for(int i = 1; i <= number_of_desktops; i++) { TQString s = desktopName( i ); TQString defaultvalue = i18n("Desktop %1").arg(i); - if ( s.isEmpty() ) + if ( s.isEmpty() ) { s = defaultvalue; rootInfo->setDesktopName( i, s.utf8().data() ); } - if (s != defaultvalue) + if (s != defaultvalue) { c->writeEntry( TQString("Name_%1").arg(i), s ); } - else + else { TQString currentvalue = c->readEntry(TQString("Name_%1").arg(i)); if (currentvalue != defaultvalue) @@ -1267,10 +1300,10 @@ void Workspace::doNotManage( TQString title ) */ bool Workspace::isNotManaged( const TQString& title ) { - for ( TQStringList::Iterator it = doNotManageList.begin(); it != doNotManageList.end(); ++it ) + for ( TQStringList::Iterator it = doNotManageList.begin(); it != doNotManageList.end(); ++it ) { TQRegExp r( (*it) ); - if (r.search(title) != -1) + if (r.search(title) != -1) { doNotManageList.remove( it ); return TRUE; @@ -1282,7 +1315,7 @@ bool Workspace::isNotManaged( const TQString& title ) /*! Refreshes all the client windows */ -void Workspace::refresh() +void Workspace::refresh() { TQWidget w; w.setGeometry( TQApplication::desktop()->geometry() ); @@ -1319,7 +1352,7 @@ void ObscuringWindows::create( Client* c ) Window obs_win; XWindowChanges chngs; int mask = CWSibling | CWStackMode; - if( cached->count() > 0 ) + if( cached->count() > 0 ) { cached->remove( obs_win = cached->first()); chngs.x = c->x(); @@ -1328,7 +1361,7 @@ void ObscuringWindows::create( Client* c ) chngs.height = c->height(); mask |= CWX | CWY | CWWidth | CWHeight; } - else + else { XSetWindowAttributes a; a.background_pixmap = None; @@ -1349,7 +1382,7 @@ ObscuringWindows::~ObscuringWindows() max_cache_size = TQMAX( max_cache_size, obscuring_windows.count() + 4 ) - 1; for( TQValueList<Window>::ConstIterator it = obscuring_windows.begin(); it != obscuring_windows.end(); - ++it ) + ++it ) { XUnmapWindow( tqt_xdisplay(), *it ); if( cached->count() < max_cache_size ) @@ -1377,7 +1410,7 @@ bool Workspace::setCurrentDesktop( int new_desktop ) StackingUpdatesBlocker blocker( this ); int old_desktop = current_desktop; - if (new_desktop != current_desktop) + if (new_desktop != current_desktop) { ++block_showing_desktop; /* @@ -1416,7 +1449,7 @@ bool Workspace::setCurrentDesktop( int new_desktop ) } if (desktopHasCompositing) { - // If composition is in use then we cannot hide the old windows before showing the new ones, + // If composition is in use then we cannot hide the old windows before showing the new ones, // unless you happen to like the "flicker annoyingly to desktop" effect... :-P XSync( tqt_xdisplay(), false); // Make absolutely certain all new windows are shown before hiding the old ones for ( ClientList::ConstIterator it = stacking_order.begin(); it != stacking_order.end(); ++it) { @@ -1439,7 +1472,7 @@ bool Workspace::setCurrentDesktop( int new_desktop ) --block_focus; Client* c = 0; - if ( options->focusPolicyIsReasonable()) + if ( options->focusPolicyIsReasonable()) { // Search in focus chain if ( movingClient != NULL && active_client == movingClient @@ -1448,7 +1481,7 @@ bool Workspace::setCurrentDesktop( int new_desktop ) { c = active_client; // the requestFocus below will fail, as the client is already active } - if ( !c ) + if ( !c ) { for( ClientList::ConstIterator it = focus_chain[currentDesktop()].fromLast(); it != focus_chain[currentDesktop()].end(); @@ -1475,9 +1508,9 @@ bool Workspace::setCurrentDesktop( int new_desktop ) if( c != active_client ) setActiveClient( NULL, Allowed ); - if ( c ) + if ( c ) requestFocus( c ); - else + else focusToNull(); updateCurrentTopMenu(); @@ -1520,10 +1553,10 @@ int Workspace::desktopToRight( int desktop ) const int x,y; calcDesktopLayout(x,y); int dt = desktop-1; - if (layoutOrientation == Qt::Vertical) + if (layoutOrientation == TQt::Vertical) { dt += y; - if ( dt >= numberOfDesktops() ) + if ( dt >= numberOfDesktops() ) { if ( options->rollOverDesktops ) dt -= numberOfDesktops(); @@ -1534,7 +1567,7 @@ int Workspace::desktopToRight( int desktop ) const else { int d = (dt % x) + 1; - if ( d >= x ) + if ( d >= x ) { if ( options->rollOverDesktops ) d -= x; @@ -1551,10 +1584,10 @@ int Workspace::desktopToLeft( int desktop ) const int x,y; calcDesktopLayout(x,y); int dt = desktop-1; - if (layoutOrientation == Qt::Vertical) + if (layoutOrientation == TQt::Vertical) { dt -= y; - if ( dt < 0 ) + if ( dt < 0 ) { if ( options->rollOverDesktops ) dt += numberOfDesktops(); @@ -1565,7 +1598,7 @@ int Workspace::desktopToLeft( int desktop ) const else { int d = (dt % x) - 1; - if ( d < 0 ) + if ( d < 0 ) { if ( options->rollOverDesktops ) d += x; @@ -1582,10 +1615,10 @@ int Workspace::desktopUp( int desktop ) const int x,y; calcDesktopLayout(x,y); int dt = desktop-1; - if (layoutOrientation == Qt::Horizontal) + if (layoutOrientation == TQt::Horizontal) { dt -= x; - if ( dt < 0 ) + if ( dt < 0 ) { if ( options->rollOverDesktops ) dt += numberOfDesktops(); @@ -1596,7 +1629,7 @@ int Workspace::desktopUp( int desktop ) const else { int d = (dt % y) - 1; - if ( d < 0 ) + if ( d < 0 ) { if ( options->rollOverDesktops ) d += y; @@ -1613,10 +1646,10 @@ int Workspace::desktopDown( int desktop ) const int x,y; calcDesktopLayout(x,y); int dt = desktop-1; - if (layoutOrientation == Qt::Horizontal) + if (layoutOrientation == TQt::Horizontal) { dt += x; - if ( dt >= numberOfDesktops() ) + if ( dt >= numberOfDesktops() ) { if ( options->rollOverDesktops ) dt -= numberOfDesktops(); @@ -1627,7 +1660,7 @@ int Workspace::desktopDown( int desktop ) const else { int d = (dt % y) + 1; - if ( d >= y ) + if ( d >= y ) { if ( options->rollOverDesktops ) d -= y; @@ -1655,7 +1688,7 @@ void Workspace::setNumberOfDesktops( int n ) // if increasing the number, do the resizing now, // otherwise after the moving of windows to still existing desktops - if( old_number_of_desktops < number_of_desktops ) + if( old_number_of_desktops < number_of_desktops ) { rootInfo->setNumberOfDesktops( number_of_desktops ); NETPoint* viewports = new NETPoint[ number_of_desktops ]; @@ -1667,17 +1700,17 @@ void Workspace::setNumberOfDesktops( int n ) // if the number of desktops decreased, move all // windows that would be hidden to the last visible desktop - if( old_number_of_desktops > number_of_desktops ) + if( old_number_of_desktops > number_of_desktops ) { for( ClientList::ConstIterator it = clients.begin(); it != clients.end(); - ++it) + ++it) { if( !(*it)->isOnAllDesktops() && (*it)->desktop() > numberOfDesktops()) sendClientToDesktop( *it, numberOfDesktops(), true ); } } - if( old_number_of_desktops > number_of_desktops ) + if( old_number_of_desktops > number_of_desktops ) { rootInfo->setNumberOfDesktops( number_of_desktops ); NETPoint* viewports = new NETPoint[ number_of_desktops ]; @@ -1717,7 +1750,7 @@ void Workspace::sendClientToDesktop( Client* c, int desk, bool dont_activate ) else restackClientUnderActive( c ); } - else + else { raiseClient( c ); } @@ -1813,7 +1846,7 @@ void Workspace::updateDesktopLayout() { // rootInfo->desktopLayoutCorner(); // I don't find this worth bothering, feel free to layoutOrientation = ( rootInfo->desktopLayoutOrientation() == NET::OrientationHorizontal - ? Qt::Horizontal : Qt::Vertical ); + ? TQt::Horizontal : TQt::Vertical ); layoutX = rootInfo->desktopLayoutColumnsRows().width(); layoutY = rootInfo->desktopLayoutColumnsRows().height(); if( layoutX == 0 && layoutY == 0 ) // not given, set default layout @@ -1904,7 +1937,7 @@ void Workspace::propagateSystemTrayWins() Window *cl = new Window[ systemTrayWins.count()]; int i = 0; - for ( SystemTrayWindowList::ConstIterator it = systemTrayWins.begin(); it != systemTrayWins.end(); ++it ) + for ( SystemTrayWindowList::ConstIterator it = systemTrayWins.begin(); it != systemTrayWins.end(); ++it ) { cl[i++] = (*it).win; } @@ -1920,7 +1953,7 @@ void Workspace::killWindowId( Window window_to_kill ) return; Window window = window_to_kill; Client* client = NULL; - for(;;) + for(;;) { client = findClient( FrameIdMatchPredicate( window )); if( client != NULL ) // found the client @@ -2053,12 +2086,12 @@ void Workspace::sendTakeActivity( Client* c, Time timestamp, long flags ) */ void Workspace::slotGrabWindow() { - if ( active_client ) + if ( active_client ) { TQPixmap snapshot = TQPixmap::grabWindow( active_client->frameId() ); //No XShape - no work. - if( Shape::available()) + if( Shape::available()) { //As the first step, get the mask from XShape. int count, order; @@ -2068,7 +2101,7 @@ void Workspace::slotGrabWindow() //ShapeBounding - ShapeClipping is defined to be the border. //Since the border area is part of the window, we use bounding // to limit our work region - if (rects) + if (rects) { //Create a TQRegion from the rectangles describing the bounding mask. TQRegion contents; @@ -2087,9 +2120,9 @@ void Workspace::slotGrabWindow() //Construct a bitmap mask from the rectangles TQBitmap mask( snapshot.width(), snapshot.height()); TQPainter p(&mask); - p.fillRect(0, 0, mask.width(), mask.height(), Qt::color1); + p.fillRect(0, 0, mask.width(), mask.height(), TQt::color1); for (uint pos = 0; pos < maskedAwayRects.count(); pos++) - p.fillRect(maskedAwayRects[pos], Qt::color0); + p.fillRect(maskedAwayRects[pos], TQt::color0); p.end(); snapshot.setMask(mask); } @@ -2119,9 +2152,9 @@ void Workspace::slotGrabDesktop() void Workspace::slotMouseEmulation() { - if ( mouse_emulation ) + if ( mouse_emulation ) { - XUngrabKeyboard(tqt_xdisplay(), GET_QT_X_TIME()); + XUngrabKeyboard(tqt_xdisplay(), get_tqt_x_time()); mouse_emulation = FALSE; return; } @@ -2129,7 +2162,7 @@ void Workspace::slotMouseEmulation() if ( XGrabKeyboard(tqt_xdisplay(), root, FALSE, GrabModeAsync, GrabModeAsync, - GET_QT_X_TIME()) == GrabSuccess ) + get_tqt_x_time()) == GrabSuccess ) { mouse_emulation = TRUE; mouse_emulation_state = 0; @@ -2151,7 +2184,7 @@ WId Workspace::getMouseEmulationWindow() uint state; Window w; Client * c = 0; - do + do { w = child; if (!c) @@ -2173,19 +2206,19 @@ unsigned int Workspace::sendFakedMouseEvent( TQPoint pos, WId w, MouseEmulation if ( !w ) return state; TQWidget* widget = TQWidget::find( w ); - if ( (!widget || widget->inherits(TQTOOLBUTTON_OBJECT_NAME_STRING) ) && !findClient( WindowMatchPredicate( w )) ) + if ( (!widget || widget->inherits("TQToolButton") ) && !findClient( WindowMatchPredicate( w )) ) { int x, y; Window xw; XTranslateCoordinates( tqt_xdisplay(), tqt_xrootwin(), w, pos.x(), pos.y(), &x, &y, &xw ); - if ( type == EmuMove ) + if ( type == EmuMove ) { // motion notify events XEvent e; e.type = MotionNotify; e.xmotion.window = w; e.xmotion.root = tqt_xrootwin(); e.xmotion.subwindow = w; - e.xmotion.time = GET_QT_X_TIME(); + e.xmotion.time = get_tqt_x_time(); e.xmotion.x = x; e.xmotion.y = y; e.xmotion.x_root = pos.x(); @@ -2194,14 +2227,14 @@ unsigned int Workspace::sendFakedMouseEvent( TQPoint pos, WId w, MouseEmulation e.xmotion.is_hint = NotifyNormal; XSendEvent( tqt_xdisplay(), w, TRUE, ButtonMotionMask, &e ); } - else + else { XEvent e; e.type = type == EmuRelease ? ButtonRelease : ButtonPress; e.xbutton.window = w; e.xbutton.root = tqt_xrootwin(); e.xbutton.subwindow = w; - e.xbutton.time = GET_QT_X_TIME(); + e.xbutton.time = get_tqt_x_time(); e.xbutton.x = x; e.xbutton.y = y; e.xbutton.x_root = pos.x(); @@ -2210,9 +2243,9 @@ unsigned int Workspace::sendFakedMouseEvent( TQPoint pos, WId w, MouseEmulation e.xbutton.button = button; XSendEvent( tqt_xdisplay(), w, TRUE, ButtonPressMask, &e ); - if ( type == EmuPress ) + if ( type == EmuPress ) { - switch ( button ) + switch ( button ) { case 2: state |= Button2Mask; @@ -2225,9 +2258,9 @@ unsigned int Workspace::sendFakedMouseEvent( TQPoint pos, WId w, MouseEmulation break; } } - else + else { - switch ( button ) + switch ( button ) { case 2: state &= ~Button2Mask; @@ -2261,7 +2294,7 @@ bool Workspace::keyPressMouseEmulation( XKeyEvent& ev ) int delta = is_control?1:is_alt?32:8; TQPoint pos = TQCursor::pos(); - switch ( kc ) + switch ( kc ) { case XK_Left: case XK_KP_Left: @@ -2306,16 +2339,16 @@ bool Workspace::keyPressMouseEmulation( XKeyEvent& ev ) case XK_Return: case XK_space: case XK_KP_Enter: - case XK_KP_Space: + case XK_KP_Space: { - if ( !mouse_emulation_state ) + if ( !mouse_emulation_state ) { // nothing was pressed, fake a LMB click mouse_emulation_window = getMouseEmulationWindow(); mouse_emulation_state = sendFakedMouseEvent( pos, mouse_emulation_window, EmuPress, Button1, mouse_emulation_state ); mouse_emulation_state = sendFakedMouseEvent( pos, mouse_emulation_window, EmuRelease, Button1, mouse_emulation_state ); } - else + else { // release all if ( mouse_emulation_state & Button1Mask ) mouse_emulation_state = sendFakedMouseEvent( pos, mouse_emulation_window, EmuRelease, Button1, mouse_emulation_state ); @@ -2327,7 +2360,7 @@ bool Workspace::keyPressMouseEmulation( XKeyEvent& ev ) } // fall through case XK_Escape: - XUngrabKeyboard(tqt_xdisplay(), GET_QT_X_TIME()); + XUngrabKeyboard(tqt_xdisplay(), get_tqt_x_time()); mouse_emulation = FALSE; return TRUE; default: @@ -2357,292 +2390,393 @@ void Workspace::delayFocus() requestFocus( delayfocus_client ); cancelDelayFocus(); } - + void Workspace::requestDelayFocus( Client* c ) { delayfocus_client = c; delete delayFocusTimer; delayFocusTimer = new TQTimer( this ); - connect( delayFocusTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( delayFocus() ) ); + connect( delayFocusTimer, TQ_SIGNAL( timeout() ), this, TQ_SLOT( delayFocus() ) ); delayFocusTimer->start( options->delayFocusInterval, TRUE ); } - + void Workspace::cancelDelayFocus() { delete delayFocusTimer; delayFocusTimer = 0; } -// Electric Borders -//========================================================================// -// Electric Border Window management. Electric borders allow a user -// to change the virtual desktop by moving the mouse pointer to the -// borders. Technically this is done with input only windows. Since -// electric borders can be switched on and off, we have these two -// functions to create and destroy them. -void Workspace::checkElectricBorders( bool force ) +/* Active (Electric) Borders + * ======================================================================== + * Active Border Window management. Active borders allow a user to switch + * to another virtual desktop or activate other features by moving + * the mouse pointer to the borders or corners of the workspace. + * Technically this is done with input only windows. + */ +void Workspace::updateActiveBorders() { - if( force ) - destroyBorderWindows(); - - electric_current_border = 0; - + active_time_first = get_tqt_x_time(); + active_time_last = get_tqt_x_time(); + active_time_last_trigger = get_tqt_x_time(); + active_current_border = ActiveNone; TQRect r = TQApplication::desktop()->geometry(); - electricTop = r.top(); - electricBottom = r.bottom(); - electricLeft = r.left(); - electricRight = r.right(); + activeTop = r.top(); + activeBottom = r.bottom(); + activeLeft = r.left(); + activeRight = r.right(); - if (options->electricBorders() == Options::ElectricAlways) - createBorderWindows(); - else - destroyBorderWindows(); + for (int pos = 0; pos < ACTIVE_BORDER_COUNT; ++pos) + { + if (active_reserved[pos] == 0) + { + if (active_windows[pos] != None) + { + XDestroyWindow( tqt_xdisplay(), active_windows[pos] ); + } + active_windows[pos] = None; + continue; + } + + if (active_windows[pos] != None) + { + continue; + } + + XSetWindowAttributes attributes; + attributes.override_redirect = True; + attributes.event_mask = EnterWindowMask; + unsigned long valuemask = CWOverrideRedirect | CWEventMask; + int xywh[ ACTIVE_BORDER_COUNT ][ 4 ] = + { + { r.left() + 1, r.top(), r.width() - 2, 1 }, // top + { r.right(), r.top(), 1, 1 }, // topright + { r.right(), r.top() + 1, 1, r.height() - 2 }, // etc. + { r.right(), r.bottom(), 1, 1 }, + { r.left() + 1, r.bottom(), r.width() - 2, 1 }, + { r.left(), r.bottom(), 1, 1 }, + { r.left(), r.top() + 1, 1, r.height() - 2 }, + { r.left(), r.top(), 1, 1 } + }; + active_windows[pos] = XCreateWindow(tqt_xdisplay(), tqt_xrootwin(), + xywh[pos][0], xywh[pos][1], + xywh[pos][2], xywh[pos][3], + 0, CopyFromParent, InputOnly, + CopyFromParent, valuemask, + &attributes); + XMapWindow(tqt_xdisplay(), active_windows[pos]); + + // Set XdndAware on the windows, so that DND enter events are received (#86998) + Atom version = 4; // XDND version + XChangeProperty(tqt_xdisplay(), active_windows[pos], + atoms->xdnd_aware, XA_ATOM, 32, PropModeReplace, + (unsigned char*)&version, 1); } +} -void Workspace::createBorderWindows() +void Workspace::destroyActiveBorders() +{ + for (int pos = 0; pos < ACTIVE_BORDER_COUNT; ++pos) + { + if (active_windows[ pos ] != None) + { + XDestroyWindow( tqt_xdisplay(), active_windows[ pos ] ); + } + active_windows[ pos ] = None; + } +} + +void Workspace::reserveActiveBorderSwitching( bool reserve ) +{ + for (int pos = 0; pos < ACTIVE_BORDER_COUNT; ++pos) { - if ( electric_have_borders ) + if (reserve) + { + reserveActiveBorder(static_cast<ActiveBorder>(pos)); + } + else + { + unreserveActiveBorder(static_cast<ActiveBorder>(pos)); + } + } +} + +void Workspace::reserveActiveBorder( ActiveBorder border ) +{ + if (border == ActiveNone) return; - electric_have_borders = true; + if (active_reserved[border]++ == 0) + TQTimer::singleShot(0, this, TQ_SLOT(updateActiveBorders())); +} - TQRect r = TQApplication::desktop()->geometry(); - XSetWindowAttributes attributes; - unsigned long valuemask; - attributes.override_redirect = True; - attributes.event_mask = ( EnterWindowMask | LeaveWindowMask ); - valuemask= (CWOverrideRedirect | CWEventMask | CWCursor ); - attributes.cursor = XCreateFontCursor(tqt_xdisplay(), - XC_sb_up_arrow); - electric_top_border = XCreateWindow (tqt_xdisplay(), tqt_xrootwin(), - 0,0, - r.width(),1, - 0, - CopyFromParent, InputOnly, - CopyFromParent, - valuemask, &attributes); - XMapWindow(tqt_xdisplay(), electric_top_border); - - attributes.cursor = XCreateFontCursor(tqt_xdisplay(), - XC_sb_down_arrow); - electric_bottom_border = XCreateWindow (tqt_xdisplay(), tqt_xrootwin(), - 0,r.height()-1, - r.width(),1, - 0, - CopyFromParent, InputOnly, - CopyFromParent, - valuemask, &attributes); - XMapWindow(tqt_xdisplay(), electric_bottom_border); - - attributes.cursor = XCreateFontCursor(tqt_xdisplay(), - XC_sb_left_arrow); - electric_left_border = XCreateWindow (tqt_xdisplay(), tqt_xrootwin(), - 0,0, - 1,r.height(), - 0, - CopyFromParent, InputOnly, - CopyFromParent, - valuemask, &attributes); - XMapWindow(tqt_xdisplay(), electric_left_border); - - attributes.cursor = XCreateFontCursor(tqt_xdisplay(), - XC_sb_right_arrow); - electric_right_border = XCreateWindow (tqt_xdisplay(), tqt_xrootwin(), - r.width()-1,0, - 1,r.height(), - 0, - CopyFromParent, InputOnly, - CopyFromParent, - valuemask, &attributes); - XMapWindow(tqt_xdisplay(), electric_right_border); - // Set XdndAware on the windows, so that DND enter events are received (#86998) - Atom version = 4; // XDND version - XChangeProperty( tqt_xdisplay(), electric_top_border, atoms->xdnd_aware, XA_ATOM, - 32, PropModeReplace, ( unsigned char* )&version, 1 ); - XChangeProperty( tqt_xdisplay(), electric_bottom_border, atoms->xdnd_aware, XA_ATOM, - 32, PropModeReplace, ( unsigned char* )&version, 1 ); - XChangeProperty( tqt_xdisplay(), electric_left_border, atoms->xdnd_aware, XA_ATOM, - 32, PropModeReplace, ( unsigned char* )&version, 1 ); - XChangeProperty( tqt_xdisplay(), electric_right_border, atoms->xdnd_aware, XA_ATOM, - 32, PropModeReplace, ( unsigned char* )&version, 1 ); - } - - -// Electric Border Window management. Electric borders allow a user -// to change the virtual desktop by moving the mouse pointer to the -// borders. Technically this is done with input only windows. Since -// electric borders can be switched on and off, we have these two -// functions to create and destroy them. -void Workspace::destroyBorderWindows() - { - if( !electric_have_borders) - return; +void Workspace::unreserveActiveBorder( ActiveBorder border ) +{ + if (border == ActiveNone) + return; - electric_have_borders = false; + assert(active_reserved[ border ] > 0); + if (--active_reserved[ border ] == 0) + TQTimer::singleShot(0, this, TQ_SLOT(updateActiveBorders())); +} - if(electric_top_border) - XDestroyWindow(tqt_xdisplay(),electric_top_border); - if(electric_bottom_border) - XDestroyWindow(tqt_xdisplay(),electric_bottom_border); - if(electric_left_border) - XDestroyWindow(tqt_xdisplay(),electric_left_border); - if(electric_right_border) - XDestroyWindow(tqt_xdisplay(),electric_right_border); +void Workspace::checkActiveBorder(const TQPoint &pos, Time now) +{ + Time treshold_set = options->activeBorderDelay(); // set timeout + Time treshold_trigger = 250; // Minimum time between triggers + Time treshold_reset = 250; // reset timeout + int activation_distance = options->borderActivationDistance(); - electric_top_border = None; - electric_bottom_border = None; - electric_left_border = None; - electric_right_border = None; + bool have_borders = false; + for (int i = 0; i < ACTIVE_BORDER_COUNT; ++i) + { + if (active_windows[ i ] != None) + { + have_borders = true; + } } + if (!have_borders) { + return; + } + + // Mouse should not move more than this many pixels + int distance_reset = activation_distance + 10; -void Workspace::clientMoved(const TQPoint &pos, Time now) + // Leave active maximizing mode when window moved away + if (active_current_border != ActiveNone && + (pos.x() > activeLeft + distance_reset) && + (pos.x() < activeRight - distance_reset) && + (pos.y() > activeTop + distance_reset) && + (pos.y() < activeBottom - distance_reset)) { - if (options->electricBorders() == Options::ElectricDisabled) - return; + if (movingClient && + (options->activeBorders() == Options::ActiveTileMaximize || + options->activeBorders() == Options::ActiveTileOnly)) + { + movingClient->cancelActiveBorderMaximizing(); + return; + } + } + + // These checks take activation distance into account, creating a + // virtual "activation band" for easier border/corner activation. + bool active_left = pos.x() < activeLeft + activation_distance; + bool active_right = pos.x() > activeRight - activation_distance; + bool active_top = pos.y() < activeTop + activation_distance; + bool active_bottom = pos.y() > activeBottom - activation_distance; - if ((pos.x() != electricLeft) && - (pos.x() != electricRight) && - (pos.y() != electricTop) && - (pos.y() != electricBottom)) + if (!active_left && !active_right && !active_top && !active_bottom) return; - Time treshold_set = options->electricBorderDelay(); // set timeout - Time treshold_reset = 250; // reset timeout - int distance_reset = 30; // Mouse should not move more than this many pixels + // These checks are used to make corner activation easier: we assume + // a 25% zone on the edge of each border where instead of half size + // tiling we perform quarter size tiling. The rest 50% is left for + // normal half size tiling. + // These options make sense only for the tiling mode. + int active_width_quart = (activeRight - activeLeft) / 4; + int active_height_quart = (activeBottom - activeTop) / 4; - int border = 0; - if (pos.x() == electricLeft) - border = 1; - else if (pos.x() == electricRight) - border = 2; - else if (pos.y() == electricTop) - border = 3; - else if (pos.y() == electricBottom) - border = 4; + bool active_qleft = false; + bool active_qright = false; + bool active_qtop = false; + bool active_qbottom = false; + if (options->activeBorders() == Options::ActiveTileMaximize || + options->activeBorders() == Options::ActiveTileOnly) + { + active_qleft = pos.x() < activeLeft + active_width_quart; + active_qright = pos.x() > activeRight - active_width_quart; + active_qtop = pos.y() < activeTop + active_height_quart; + active_qbottom = pos.y() > activeBottom - active_height_quart; + } - if ((electric_current_border == border) && - (timestampDiff(electric_time_last, now) < treshold_reset) && - ((pos-electric_push_point).manhattanLength() < distance_reset)) - { - electric_time_last = now; + ActiveBorder border = ActiveNone; + if ((active_left && active_qtop) || (active_top && active_qleft)) + { + border = ActiveTopLeft; + } + else if ((active_right && active_qtop) || (active_top && active_qright)) + { + border = ActiveTopRight; + } + else if ((active_left && active_qbottom) || (active_bottom && active_qleft)) + { + border = ActiveBottomLeft; + } + else if ((active_right && active_qbottom) || (active_bottom && active_qright)) + { + border = ActiveBottomRight; + } + else if (active_left) + { + border = ActiveLeft; + } + else if (active_right) + { + border = ActiveRight; + } + else if (active_top) + { + border = ActiveTop; + } + else if (active_bottom) + { + border = ActiveBottom; + } + else + { + // Should never happen + abort(); + } - if (timestampDiff(electric_time_first, now) > treshold_set) - { - electric_current_border = 0; + if( active_windows[border] == None ) + { + return; + } - TQRect r = TQApplication::desktop()->geometry(); - int offset; + if ((active_current_border == border) && + (timestampDiff(active_time_last, now) < treshold_reset) && + (timestampDiff(active_time_last_trigger, now) > treshold_trigger) && + ((pos-active_push_point).manhattanLength() < distance_reset)) + { + active_time_last = now; + if (timestampDiff(active_time_first, now) > treshold_set) + { + active_time_last_trigger = now; + active_current_border = ActiveNone; + bool isSide = (border == ActiveTop || border == ActiveRight || + border == ActiveBottom || border == ActiveLeft); - int desk_before = currentDesktop(); - switch(border) + if (movingClient) + { + // Desktop switching + if (options->activeBorders() == Options::ActiveSwitchAlways || + options->activeBorders() == Options::ActiveSwitchOnMove) { - case 1: - slotSwitchDesktopLeft(); - if (currentDesktop() != desk_before) - { - offset = r.width() / 5; - TQCursor::setPos(r.width() - offset, pos.y()); - } - break; + activeBorderSwitchDesktop(border, pos); + return; // Don't reset cursor position + } - case 2: - slotSwitchDesktopRight(); - if (currentDesktop() != desk_before) - { - offset = r.width() / 5; - TQCursor::setPos(offset, pos.y()); - } - break; + // Tiling maximize + else if (options->activeBorders() == Options::ActiveTileMaximize && + border == ActiveTop && movingClient->isMaximizable()) + { + if (!movingClient->isResizable()) return; + movingClient->setActiveBorderMode(ActiveMaximizeMode); + movingClient->setActiveBorder(ActiveNone); + movingClient->setActiveBorderMaximizing(true); + } - case 3: - slotSwitchDesktopUp(); - if (currentDesktop() != desk_before) - { - offset = r.height() / 5; - TQCursor::setPos(pos.x(), r.height() - offset); - } - break; + // Tiling + else if ((options->activeBorders() == Options::ActiveTileMaximize || + options->activeBorders() == Options::ActiveTileOnly)) + { + if (!movingClient->isResizable()) return; + movingClient->setActiveBorderMode(ActiveTilingMode); + movingClient->setActiveBorder(border); + movingClient->setActiveBorderMaximizing(true); + } - case 4: - slotSwitchDesktopDown(); - if (currentDesktop() != desk_before) - { - offset = r.height() / 5; - TQCursor::setPos(pos.x(), offset); - } - break; + else + { + return; // Don't reset cursor position + } + } + else + { + // Desktop switching + if (options->activeBorders() == Options::ActiveSwitchAlways && isSide) + { + activeBorderSwitchDesktop(border, pos); + return; // Don't reset cursor position } - return; } } - else - { - electric_current_border = border; - electric_time_first = now; - electric_time_last = now; - electric_push_point = pos; - } + } + else + { + active_current_border = border; + active_time_first = now; + active_time_last = now; + active_push_point = pos; + } - int mouse_warp = 1; + if ((options->activeBorders() == Options::ActiveSwitchAlways && !movingClient) || + activation_distance < 2) + { + // Reset the pointer to find out whether the user is really pushing + // (ordered according to enum ActiveBorder minus ActiveNone) + const int xdiff[ ACTIVE_BORDER_COUNT ] = { 0, -1, -1, -1, 0, 1, 1, 1 }; + const int ydiff[ ACTIVE_BORDER_COUNT ] = { 1, 1, 0, -1, -1, -1, 0, 1 }; + TQCursor::setPos(pos.x() + xdiff[border], pos.y() + ydiff[border]); + } +} - // reset the pointer to find out wether the user is really pushing - switch( border) - { - case 1: TQCursor::setPos(pos.x()+mouse_warp, pos.y()); break; - case 2: TQCursor::setPos(pos.x()-mouse_warp, pos.y()); break; - case 3: TQCursor::setPos(pos.x(), pos.y()+mouse_warp); break; - case 4: TQCursor::setPos(pos.x(), pos.y()-mouse_warp); break; - } +void Workspace::activeBorderSwitchDesktop(ActiveBorder border, const TQPoint& _pos) +{ + TQPoint pos = _pos; + TQRect r = TQApplication::desktop()->geometry(); + const int offset = 5; + + int desk_before = currentDesktop(); + if (border == ActiveLeft || border == ActiveTopLeft || border == ActiveBottomLeft) + { + slotSwitchDesktopLeft(); + pos.setX(r.width() - offset); + } + if (border == ActiveRight || border == ActiveTopRight || border == ActiveBottomRight) + { + slotSwitchDesktopRight(); + pos.setX(offset); } -// this function is called when the user entered an electric border + if (border == ActiveTop || border == ActiveTopLeft || border == ActiveTopRight) + { + slotSwitchDesktopUp(); + pos.setY(r.height() - offset); + } + if (border == ActiveBottom || border == ActiveBottomLeft || border == ActiveBottomRight) + { + slotSwitchDesktopDown(); + pos.setY(offset); + } + + if (currentDesktop() != desk_before) + { + TQCursor::setPos(pos); + } +} + +// this function is called when the user entered an active border // with the mouse. It may switch to another virtual desktop -bool Workspace::electricBorder(XEvent *e) +bool Workspace::activeBorderEvent(XEvent *e) +{ + if (e->type == EnterNotify) { - if( !electric_have_borders ) - return false; - if( e->type == EnterNotify ) - { - if( e->xcrossing.window == electric_top_border || - e->xcrossing.window == electric_left_border || - e->xcrossing.window == electric_bottom_border || - e->xcrossing.window == electric_right_border) - // the user entered an electric border - { - clientMoved( TQPoint( e->xcrossing.x_root, e->xcrossing.y_root ), e->xcrossing.time ); - return true; - } - } - if( e->type == ClientMessage ) + for (int i = 0; i < ACTIVE_BORDER_COUNT; ++i) { - if( e->xclient.message_type == atoms->xdnd_position - && ( e->xclient.window == electric_top_border - || e->xclient.window == electric_bottom_border - || e->xclient.window == electric_left_border - || e->xclient.window == electric_right_border )) - { - updateXTime(); - clientMoved( TQPoint( e->xclient.data.l[2]>>16, e->xclient.data.l[2]&0xffff), GET_QT_X_TIME() ); - return true; + if (active_windows[i] != None && e->xcrossing.window == active_windows[i]) + { // the user entered an active border + checkActiveBorder(TQPoint(e->xcrossing.x_root, e->xcrossing.y_root), e->xcrossing.time); + return true; } } - return false; } - -// electric borders (input only windows) have to be always on the -// top. For that reason kwm calls this function always after some -// windows have been raised. -void Workspace::raiseElectricBorders() + if (e->type == ClientMessage) { - - if(electric_have_borders) + if (e->xclient.message_type == atoms->xdnd_position) { - XRaiseWindow(tqt_xdisplay(), electric_top_border); - XRaiseWindow(tqt_xdisplay(), electric_left_border); - XRaiseWindow(tqt_xdisplay(), electric_bottom_border); - XRaiseWindow(tqt_xdisplay(), electric_right_border); + for (int i = 0; i < ACTIVE_BORDER_COUNT; ++i) + { + if (active_windows[i] != None && e->xclient.window == active_windows[i]) + { + updateXTime(); + checkActiveBorder(TQPoint(e->xclient.data.l[2]>>16, e->xclient.data.l[2]&0xffff), get_tqt_x_time()); + return true; + } + } } } + return false; +} void Workspace::addTopMenu( Client* c ) { @@ -2678,12 +2812,12 @@ void Workspace::lostTopMenuSelection() { // kdDebug() << "lost TopMenu selection" << endl; // make sure this signal is always set when not owning the selection - disconnect( topmenu_watcher, TQT_SIGNAL( lostOwner()), this, TQT_SLOT( lostTopMenuOwner())); - connect( topmenu_watcher, TQT_SIGNAL( lostOwner()), this, TQT_SLOT( lostTopMenuOwner())); + disconnect( topmenu_watcher, TQ_SIGNAL( lostOwner()), this, TQ_SLOT( lostTopMenuOwner())); + connect( topmenu_watcher, TQ_SIGNAL( lostOwner()), this, TQ_SLOT( lostTopMenuOwner())); if( !managing_topmenus ) return; - connect( topmenu_watcher, TQT_SIGNAL( lostOwner()), this, TQT_SLOT( lostTopMenuOwner())); - disconnect( topmenu_selection, TQT_SIGNAL( lostOwnership()), this, TQT_SLOT( lostTopMenuSelection())); + connect( topmenu_watcher, TQ_SIGNAL( lostOwner()), this, TQ_SLOT( lostTopMenuOwner())); + disconnect( topmenu_selection, TQ_SIGNAL( lostOwnership()), this, TQ_SLOT( lostTopMenuSelection())); managing_topmenus = false; delete topmenu_space; topmenu_space = NULL; @@ -2712,8 +2846,8 @@ void Workspace::setupTopMenuHandling() { if( managing_topmenus ) return; - connect( topmenu_selection, TQT_SIGNAL( lostOwnership()), this, TQT_SLOT( lostTopMenuSelection())); - disconnect( topmenu_watcher, TQT_SIGNAL( lostOwner()), this, TQT_SLOT( lostTopMenuOwner())); + connect( topmenu_selection, TQ_SIGNAL( lostOwnership()), this, TQ_SLOT( lostTopMenuSelection())); + disconnect( topmenu_watcher, TQ_SIGNAL( lostOwner()), this, TQ_SLOT( lostTopMenuOwner())); managing_topmenus = true; topmenu_space = new TQWidget; Window stack[ 2 ]; @@ -2758,7 +2892,7 @@ bool Workspace::checkStartupNotification( Window w, TDEStartupInfoId& id, TDESta */ void Workspace::focusToNull() { - XSetInputFocus(tqt_xdisplay(), null_focus_window, RevertToPointerRoot, GET_QT_X_TIME() ); + XSetInputFocus(tqt_xdisplay(), null_focus_window, RevertToPointerRoot, get_tqt_x_time() ); } void Workspace::helperDialog( const TQString& message, const Client* c ) @@ -2824,7 +2958,7 @@ void Workspace::startKompmgr() } else { // Try again a bit later! - TQTimer::singleShot( 200, this, TQT_SLOT(startKompmgr()) ); + TQTimer::singleShot( 200, this, TQ_SLOT(startKompmgr()) ); return; } pid_t kompmgrpid = getCompositorPID(); @@ -2852,12 +2986,12 @@ void Workspace::startKompmgr() char selection_name[ 100 ]; sprintf( selection_name, "_NET_WM_CM_S%d", DefaultScreen( tqt_xdisplay())); kompmgr_selection = new TDESelectionOwner( selection_name ); - connect( kompmgr_selection, TQT_SIGNAL( lostOwnership()), TQT_SLOT( stopKompmgr())); + connect( kompmgr_selection, TQ_SIGNAL( lostOwnership()), TQ_SLOT( stopKompmgr())); kompmgr_selection->claim( true ); - connect(kompmgr, TQT_SIGNAL(processExited(TDEProcess*)), TQT_SLOT(restartKompmgr(TDEProcess*))); + connect(kompmgr, TQ_SIGNAL(processExited(TDEProcess*)), TQ_SLOT(restartKompmgr(TDEProcess*))); options->useTranslucency = TRUE; //allowKompmgrRestart = FALSE; - //TQTimer::singleShot( 60000, this, TQT_SLOT(unblockKompmgrRestart()) ); + //TQTimer::singleShot( 60000, this, TQ_SLOT(unblockKompmgrRestart()) ); TQByteArray ba; TQDataStream arg(ba, IO_WriteOnly); arg << ""; @@ -2873,7 +3007,7 @@ void Workspace::stopKompmgr() } delete kompmgr_selection; kompmgr_selection = NULL; - kompmgr->disconnect(this, TQT_SLOT(restartKompmgr(TDEProcess*))); + kompmgr->disconnect(this, TQ_SLOT(restartKompmgr(TDEProcess*))); options->useTranslucency = FALSE; if (popup){ delete popup; popup = 0L; } // to add/remove opacity slider kompmgr->kill(SIGKILL); @@ -2902,7 +3036,7 @@ void Workspace::unblockKompmgrRestart() } void Workspace::restartKompmgr( TDEProcess *proc ) -// this is for inernal purpose (crashhandling) only, usually you want to use workspace->stopKompmgr(); TQTimer::singleShot(200, workspace, TQT_SLOT(startKompmgr())); +// this is for inernal purpose (crashhandling) only, usually you want to use workspace->stopKompmgr(); TQTimer::singleShot(200, workspace, TQ_SLOT(startKompmgr())); { bool crashed; if (proc->signalled()) { // looks like kompmgr may have crashed @@ -2951,7 +3085,7 @@ void Workspace::restartKompmgr( TDEProcess *proc ) else { allowKompmgrRestart = FALSE; - TQTimer::singleShot( 60000, this, TQT_SLOT(unblockKompmgrRestart()) ); + TQTimer::singleShot( 60000, this, TQ_SLOT(unblockKompmgrRestart()) ); } } } @@ -2978,7 +3112,7 @@ void Workspace::handleKompmgrOutput( TDEProcess* , char *buffer, int buflen) else return; //skip others // kompmgr startup failed or succeeded, release connection kompmgr->closeStderr(); - disconnect(kompmgr, TQT_SIGNAL(receivedStderr(TDEProcess*, char*, int)), this, TQT_SLOT(handleKompmgrOutput(TDEProcess*, char*, int))); + disconnect(kompmgr, TQ_SIGNAL(receivedStderr(TDEProcess*, char*, int)), this, TQ_SLOT(handleKompmgrOutput(TDEProcess*, char*, int))); if( !message.isEmpty()) { TDEProcess proc; @@ -2988,8 +3122,7 @@ void Workspace::handleKompmgrOutput( TDEProcess* , char *buffer, int buflen) proc.start(TDEProcess::DontCare); } } - - + void Workspace::setOpacity(unsigned long winId, unsigned int opacityPercent) { if (opacityPercent > 100) opacityPercent = 100; diff --git a/twin/workspace.h b/twin/workspace.h index e88e68c85..9c5e55203 100644 --- a/twin/workspace.h +++ b/twin/workspace.h @@ -72,7 +72,7 @@ typedef TQValueList<SystemTrayWindow> SystemTrayWindowList; class Workspace : public TQObject, public KWinInterface, public KDecorationDefines { - Q_OBJECT + TQ_OBJECT public: Workspace( bool restore = FALSE ); virtual ~Workspace(); @@ -156,7 +156,10 @@ class Workspace : public TQObject, public KWinInterface, public KDecorationDefin void clientHidden( Client* ); void clientAttentionChanged( Client* c, bool set ); - void clientMoved(const TQPoint &pos, Time time); + void checkActiveBorder(const TQPoint &pos, Time time); + void reserveActiveBorder(ActiveBorder border); + void unreserveActiveBorder(ActiveBorder border); + void reserveActiveBorderSwitching(bool reserve); /** * Returns the current virtual desktop of this workspace @@ -167,7 +170,7 @@ class Workspace : public TQObject, public KWinInterface, public KDecorationDefin */ int numberOfDesktops() const; void setNumberOfDesktops( int n ); - + int activeScreen() const; int numScreens() const; void checkActiveScreen( const Client* c ); @@ -201,8 +204,13 @@ class Workspace : public TQObject, public KWinInterface, public KDecorationDefin void windowToNextDesktop( Client* c ); void sendClientToScreen( Client* c, int screen ); - // KDE4 remove me - and it's also in the DCOP interface :( void showWindowMenuAt( unsigned long id, int x, int y ); + void showWindowMenu( unsigned long id ); + + void tileWindowToBorder(unsigned long w1, int location); + void tileTwoWindowsHorizontally(unsigned long w1, unsigned long w2); + void tileTwoWindowsVertically(unsigned long w1, unsigned long w2); + void tileFourWindowsInGrid(unsigned long w1, unsigned long w2, unsigned long w3, unsigned long w4); void kDestopResized(); /** @@ -254,7 +262,7 @@ class Workspace : public TQObject, public KWinInterface, public KDecorationDefin void sendPingToWindow( Window w, Time timestamp ); // called from Client::pingWindow() void sendTakeActivity( Client* c, Time timestamp, long flags ); // called from Client::takeActivity() - + bool kompmgrIsRunning(); void setOpacity(unsigned long winId, unsigned int opacityPercent); void setShadowSize(unsigned long winId, unsigned int shadowSizePercent); @@ -273,7 +281,7 @@ class Workspace : public TQObject, public KWinInterface, public KDecorationDefin void focusToNull(); // SELI public? enum FocusChainChange { FocusChainMakeFirst, FocusChainMakeLast, FocusChainUpdate }; void updateFocusChains( Client* c, FocusChainChange change ); - + bool forcedGlobalMouseGrab() const; void clientShortcutUpdated( Client* c ); bool shortcutAvailable( const TDEShortcut& cut, Client* ignore = NULL ) const; @@ -302,7 +310,7 @@ class Workspace : public TQObject, public KWinInterface, public KDecorationDefin void requestDelayFocus( Client* ); void updateFocusMousePosition( const TQPoint& pos ); TQPoint focusMousePosition() const; - + void toggleTopDockShadows(bool on); public slots: @@ -387,7 +395,7 @@ class Workspace : public TQObject, public KWinInterface, public KDecorationDefin void setupWindowShortcutDone( bool ); void updateClientArea(); - + // kompmgr, also dcop void startKompmgr(); @@ -406,6 +414,7 @@ class Workspace : public TQObject, public KWinInterface, public KDecorationDefin void cleanupTemporaryRules(); void writeWindowRules(); void kipcMessage( int id, int data ); + void updateActiveBorders(); // kompmgr void setPopupClientOpacity(int v); void resetClientOpacity(); @@ -486,15 +495,13 @@ class Workspace : public TQObject, public KWinInterface, public KDecorationDefin void tabBoxKeyPress( const KKeyNative& keyX ); void tabBoxKeyRelease( const XKeyEvent& ev ); - // electric borders - void checkElectricBorders( bool force = false ); - void createBorderWindows(); - void destroyBorderWindows(); - bool electricBorder(XEvent * e); - void raiseElectricBorders(); + // active borders + void destroyActiveBorders(); + bool activeBorderEvent(XEvent *e); + void activeBorderSwitchDesktop(ActiveBorder border, const TQPoint& pos); // ------------------ - + void helperDialog( const TQString& message, const Client* c ); void calcDesktopLayout(int &x, int &y) const; @@ -550,7 +557,7 @@ class Workspace : public TQObject, public KWinInterface, public KDecorationDefin ClientList global_focus_chain; // this one is only for things like tabbox's MRU ClientList should_get_focus; // last is most recent ClientList attention_chain; - + bool showing_desktop; ClientList showing_desktop_clients; int block_showing_desktop; @@ -617,21 +624,19 @@ class Workspace : public TQObject, public KWinInterface, public KDecorationDefin TDEStartupInfo* startup; - bool electric_have_borders; - int electric_current_border; - WId electric_top_border; - WId electric_bottom_border; - WId electric_left_border; - WId electric_right_border; - int electricLeft; - int electricRight; - int electricTop; - int electricBottom; - Time electric_time_first; - Time electric_time_last; - TQPoint electric_push_point; - - Qt::Orientation layoutOrientation; + ActiveBorder active_current_border; + Window active_windows[ ACTIVE_BORDER_COUNT ]; + int activeLeft; + int activeRight; + int activeTop; + int activeBottom; + Time active_time_first; + Time active_time_last; + Time active_time_last_trigger; + TQPoint active_push_point; + int active_reserved[ ACTIVE_BORDER_COUNT ]; // corners/edges used by something + + TQt::Orientation layoutOrientation; int layoutX; int layoutY; @@ -654,7 +659,7 @@ class Workspace : public TQObject, public KWinInterface, public KDecorationDefin bool forced_global_mouse_grab; friend class StackingUpdatesBlocker; friend class Client; - + //kompmgr TQSlider *transSlider; TQPushButton *transButton; @@ -663,7 +668,11 @@ class Workspace : public TQObject, public KWinInterface, public KDecorationDefin int maximizedWindowCounter; int topDockShadowSize;*/ //end - + + Window outline_left; + Window outline_right; + Window outline_top; + Window outline_bottom; signals: void kompmgrStarted(); void kompmgrStopped(); |