From 2ee99ab520931c5efe91123c85ba10064a45e95d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Fri, 25 Mar 2016 20:03:28 +0100 Subject: Initial TQt conversion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- kickermenu-3.3/menuapplet.cpp | 102 +++++++++++++++++++++--------------------- 1 file changed, 51 insertions(+), 51 deletions(-) (limited to 'kickermenu-3.3/menuapplet.cpp') diff --git a/kickermenu-3.3/menuapplet.cpp b/kickermenu-3.3/menuapplet.cpp index 205ed63..e508c48 100644 --- a/kickermenu-3.3/menuapplet.cpp +++ b/kickermenu-3.3/menuapplet.cpp @@ -24,17 +24,17 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define _MENUAPPLET_CPP_ -#include // avoid X11 #define's +#include // avoid X11 #define's #include "menuapplet.h" #include -#include +#include #include -#include +#include #include #include -#include +#include #include #include #include @@ -45,9 +45,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. /* KMenuBar from KDE3.1 and older won't work very well with this applet. - This is because QMenuBar tries really hard to keep its preffered size, + This is because TQMenuBar tries really hard to keep its preffered size, se even if the X window for the menubar has the size enforced by this - applet, Qt thinks it has the size Qt wants. This results in parts + applet, TQt thinks it has the size TQt wants. This results in parts of the menubar not being repainted. Also, old KMenuBar always forced with to be the width of the screen, so even if the menubar has only few entries, this applet will still indicate the menubar doesn't @@ -57,11 +57,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -extern Time qt_x_time; +extern Time tqt_x_time; extern "C" { - KPanelApplet* init( QWidget* parent_P, const QString& configFile_P ) + KPanelApplet* init( TQWidget* parent_P, const TQString& configFile_P ) { KGlobal::locale()->insertCatalogue("kmenuapplet"); return new KickerMenuApplet::Applet( configFile_P, parent_P ); @@ -78,7 +78,7 @@ const long SUPPORTED_WINDOW_TYPES = NET::NormalMask | NET::DesktopMask | NET::Do | NET::ToolbarMask | NET::MenuMask | NET::DialogMask | NET::OverrideMask | NET::TopMenuMask | NET::UtilityMask | NET::SplashMask; -Applet::Applet( const QString& configFile_P, QWidget* parent_P ) +Applet::Applet( const TQString& configFile_P, TQWidget* parent_P ) : KPanelApplet( configFile_P, Stretch, 0, parent_P, "menuapplet" ), DCOPObject( "menuapplet" ), module( NULL ), @@ -91,8 +91,8 @@ Applet::Applet( const QString& configFile_P, QWidget* parent_P ) { // for windowindicator setBackgroundOrigin(AncestorOrigin); - QIntDict(97); //allowing 97 entries - should be enough, if not - who cares: just a label and hashtables are slightly faster than lists... - windowIndicator = new QMenuBar(this); + TQIntDict(97); //allowing 97 entries - should be enough, if not - who cares: just a label and hashtables are slightly faster than lists... + windowIndicator = new TQMenuBar(this); windowList = new KWindowListMenu(windowIndicator); connect(windowList, SIGNAL(aboutToShow()), this, SLOT(initPopup())); windowIndicator->insertItem( "KDE", windowList, 0); @@ -138,13 +138,13 @@ void Applet::windowRemoved(WId w_P) void Applet::windowAdded( WId w_P ) { - QString* title; - NETWinInfo info( qt_xdisplay(), w_P, qt_xrootwin(), NET::WMWindowType); + TQString* title; + NETWinInfo info( tqt_xdisplay(), w_P, tqt_xrootwin(), NET::WMWindowType); XClassHint classHint; - if (!windowTitleDict[w_P] && w_P != qt_xrootwin() && XGetClassHint( qt_xdisplay(), w_P, &classHint ) ) + if (!windowTitleDict[w_P] && w_P != tqt_xrootwin() && XGetClassHint( tqt_xdisplay(), w_P, &classHint ) ) { // much better way to get a nice name! - title = new QString( classHint.res_class ); + title = new TQString( classHint.res_class ); XFree( classHint.res_name ); XFree( classHint.res_class ); windowTitleDict.insert(w_P, title); @@ -152,10 +152,10 @@ void Applet::windowAdded( WId w_P ) else { //fallback // for windowindicator - if (!windowTitleDict[w_P] && w_P != qt_xrootwin()){ + if (!windowTitleDict[w_P] && w_P != tqt_xrootwin()){ KWin::WindowInfo tmpInfo = KWin::windowInfo( w_P, NET::WMName ); //generate title: - title = new QString(tmpInfo.name()); + title = new TQString(tmpInfo.name()); if (title->contains("K3b")){ // hack, weil herr trueg zwar ein erstklassiges brennprogramm schreiben, sich aber leider nicht an windowmanager konventionen halten kan... ;) *title = "K3b"; @@ -181,7 +181,7 @@ void Applet::windowAdded( WId w_P ) if( transient_for == None ) return; MenuEmbed* embed; - if( transient_for == qt_xrootwin()) + if( transient_for == tqt_xrootwin()) embed = new MenuEmbed( transient_for, true, this ); else { @@ -214,12 +214,12 @@ void Applet::windowAdded( WId w_P ) void Applet::activeWindowChanged( WId w_P ) { // kdDebug() << "active:" << w_P << endl; - QFont tmpFont; + TQFont tmpFont; for( WId window = w_P; window != None; window = tryTransientFor( window )) { - for( QValueList< MenuEmbed* >::ConstIterator it = menus.begin(); + for( TQValueList< MenuEmbed* >::ConstIterator it = menus.begin(); it != menus.end(); ++it ) { @@ -228,7 +228,7 @@ void Applet::activeWindowChanged( WId w_P ) tmpFont = (*it)->font(); tmpFont.setBold(true); windowIndicator->setFont(tmpFont); - QString *newTitle = windowTitleDict[w_P]; + TQString *newTitle = windowTitleDict[w_P]; newTitle ? windowIndicator->changeItem(0, *newTitle): windowIndicator->changeItem(0, "KDE"); @@ -254,7 +254,7 @@ void Applet::activeWindowChanged( WId w_P ) } if( try_desktop ) { - for( QValueList< MenuEmbed* >::ConstIterator it = menus.begin(); + for( TQValueList< MenuEmbed* >::ConstIterator it = menus.begin(); it != menus.end(); ++it ) { @@ -263,7 +263,7 @@ void Applet::activeWindowChanged( WId w_P ) tmpFont = (*it)->font(); tmpFont.setBold(true); windowIndicator->setFont(tmpFont); - QString *newTitle = windowTitleDict[w_P]; + TQString *newTitle = windowTitleDict[w_P]; newTitle ? windowIndicator->changeItem(0, *newTitle): windowIndicator->changeItem(0, "KDE"); @@ -277,7 +277,7 @@ void Applet::activeWindowChanged( WId w_P ) } } } - QString *newTitle = windowTitleDict[w_P]; + TQString *newTitle = windowTitleDict[w_P]; newTitle ? windowIndicator->changeItem(0, *newTitle): windowIndicator->changeItem(0, "KDE"); @@ -305,16 +305,16 @@ void Applet::activateMenu( MenuEmbed* embed_P ) moveMenu( NULL ); } -bool Applet::eventFilter( QObject* obj_P, QEvent* ev_P ) +bool Applet::eventFilter( TQObject* obj_P, TQEvent* ev_P ) { - if( ev_P->type() == QEvent::Resize && obj_P == active_menu ) + if( ev_P->type() == TQEvent::Resize && obj_P == active_menu ) moveMenu( NULL ); return false; } void Applet::growClicked() { - moveMenu( static_cast< const QWidget* >( sender())); + moveMenu( static_cast< const TQWidget* >( sender())); } void Applet::updateGrowIndicators() @@ -338,7 +338,7 @@ void Applet::updateGrowIndicators() grow_indicator_right.hide(); } -void Applet::moveMenu( const QWidget* indicator_P ) +void Applet::moveMenu( const TQWidget* indicator_P ) { if( active_menu == NULL ) { @@ -378,14 +378,14 @@ WId Applet::tryTransientFor( WId w_P ) if( info.state() & NET::Modal ) return None;*/ WId ret = KWin::transientFor( w_P ); - if( ret == qt_xrootwin()) + if( ret == tqt_xrootwin()) ret = None; return ret; } void Applet::menuLost( MenuEmbed* embed ) { - for( QValueList< MenuEmbed* >::Iterator it = menus.begin(); + for( TQValueList< MenuEmbed* >::Iterator it = menus.begin(); it != menus.end(); ++it ) { @@ -406,9 +406,9 @@ void Applet::menuLost( MenuEmbed* embed ) } } -void Applet::resizeEvent( QResizeEvent* ev ) +void Applet::resizeEvent( TQResizeEvent* ev ) { - for( QValueList< MenuEmbed* >::ConstIterator it = menus.begin(); + for( TQValueList< MenuEmbed* >::ConstIterator it = menus.begin(); it != menus.end(); ++it ) (*it)->setFixedSize( width() - windowIndicator->width()-1 ,height()); @@ -416,7 +416,7 @@ void Applet::resizeEvent( QResizeEvent* ev ) moveMenu( NULL ); } -void Applet::paletteChange(const QPalette & /* oldPalette */) +void Applet::paletteChange(const TQPalette & /* oldPalette */) { if( active_menu != NULL ) { @@ -428,7 +428,7 @@ void Applet::paletteChange(const QPalette & /* oldPalette */) void Applet::claimSelection() { assert( selection == NULL ); - selection = new KSelectionOwner( makeSelectionAtom(), DefaultScreen( qt_xdisplay())); + selection = new KSelectionOwner( makeSelectionAtom(), DefaultScreen( tqt_xdisplay())); // force taking the selection, but don't kill previous owner if( selection->claim( true, false )) { @@ -440,8 +440,8 @@ void Applet::claimSelection() connect( module, SIGNAL( windowRemoved( WId )), this, SLOT( windowRemoved( WId ))); connect( module, SIGNAL( activeWindowChanged( WId )), this, SLOT( activeWindowChanged( WId ))); - QValueList< WId > windows = module->windows(); - for( QValueList< WId >::ConstIterator it = windows.begin(); + TQValueList< WId > windows = module->windows(); + for( TQValueList< WId >::ConstIterator it = windows.begin(); it != windows.end(); ++it ) windowAdded( *it ); @@ -456,7 +456,7 @@ void Applet::lostSelection() if( selection == NULL ) return; // kdDebug() << "lost selection" << endl; - for( QValueList< MenuEmbed* >::ConstIterator it = menus.begin(); + for( TQValueList< MenuEmbed* >::ConstIterator it = menus.begin(); it != menus.end(); ++it ) delete (*it); // delete all MenuEmbed's = release all menus @@ -464,7 +464,7 @@ void Applet::lostSelection() active_menu = NULL; if( selection_watcher == NULL ) { - selection_watcher = new KSelectionWatcher( makeSelectionAtom(), DefaultScreen( qt_xdisplay())); + selection_watcher = new KSelectionWatcher( makeSelectionAtom(), DefaultScreen( tqt_xdisplay())); connect( selection_watcher, SIGNAL( lostOwner()), this, SLOT( claimSelection())); } delete module; @@ -481,9 +481,9 @@ void Applet::readSettings() desktop_menu = cfg.readBoolEntry( "ShowMenubar", false ); cfg.setGroup( "KDE" ); if( cfg.readBoolEntry( "macStyle", false ) || desktop_menu ) - QToolTip::remove( this ); + TQToolTip::remove( this ); else - QToolTip::add( this, i18n( + TQToolTip::add( this, i18n( "You do not appear to have enabled the standalone menubar; " "enable it in the Behavior control module for desktop." )); if( !isDisabled() && active_menu == NULL ) @@ -513,11 +513,11 @@ static void initAtoms() { char nm[ 100 ]; - sprintf( nm, "_KDE_TOPMENU_OWNER_S%d", DefaultScreen( qt_xdisplay())); + sprintf( nm, "_KDE_TOPMENU_OWNER_S%d", DefaultScreen( tqt_xdisplay())); char nm2[] = "_KDE_TOPMENU_MINSIZE"; char* names[ 2 ] = { nm, nm2 }; Atom atoms[ 2 ]; - XInternAtoms( qt_xdisplay(), names, 2, False, atoms ); + XInternAtoms( tqt_xdisplay(), names, 2, False, atoms ); selection_atom = atoms[ 0 ]; msg_type_atom = atoms[ 1 ]; } @@ -530,7 +530,7 @@ Atom Applet::makeSelectionAtom() } MenuEmbed::MenuEmbed( WId mainwindow_P, bool desktop_P, - QWidget* parent_P, const char* name_P ) + TQWidget* parent_P, const char* name_P ) : QXEmbed( parent_P, name_P ), main_window( mainwindow_P ), desktop( desktop_P ) @@ -552,7 +552,7 @@ bool MenuEmbed::x11Event( XEvent* ev_P ) && ev_P->xconfigurerequest.value_mask & ( CWWidth | CWHeight )) { XConfigureRequestEvent& ev = ev_P->xconfigurerequest; - QSize new_size = size(); + TQSize new_size = size(); if( ev.value_mask & CWWidth ) new_size.setWidth( ev.width ); if( ev.value_mask & CWHeight ) @@ -565,7 +565,7 @@ bool MenuEmbed::x11Event( XEvent* ev_P ) // int x, y; // unsigned int w, h, d, b; // Window root; -// XGetGeometry( qt_xdisplay(), embeddedWinId(), &root, &x, &y, &w, &h, &b, &d ); +// XGetGeometry( tqt_xdisplay(), embeddedWinId(), &root, &x, &y, &w, &h, &b, &d ); // kdDebug() << "RES3:" << width() << ":" << height() << ":" << w << ":" << h << endl; return true; } @@ -574,12 +574,12 @@ bool MenuEmbed::x11Event( XEvent* ev_P ) void MenuEmbed::sendSyntheticConfigureNotifyEvent() { - QPoint globalPos = mapToGlobal(QPoint(0,0)); + TQPoint globalPos = mapToGlobal(TQPoint(0,0)); if (embeddedWinId()) { XConfigureEvent c; memset(&c, 0, sizeof(c)); c.type = ConfigureNotify; - c.display = qt_xdisplay(); + c.display = tqt_xdisplay(); c.send_event = True; c.event = embeddedWinId(); c.window = winId(); @@ -590,7 +590,7 @@ void MenuEmbed::sendSyntheticConfigureNotifyEvent() c.border_width = 0; c.above = None; c.override_redirect = 0; - XSendEvent( qt_xdisplay(), c.event, TRUE, StructureNotifyMask, (XEvent*)&c ); + XSendEvent( tqt_xdisplay(), c.event, TRUE, StructureNotifyMask, (XEvent*)&c ); } } @@ -603,18 +603,18 @@ void MenuEmbed::setMinimumSize( int w, int h ) { // kdDebug() << "RES2:" << width() << ":" << height() << ":" << minimumWidth() << ":" << minimumHeight() << endl; XEvent ev; - ev.xclient.display = qt_xdisplay(); + ev.xclient.display = tqt_xdisplay(); ev.xclient.type = ClientMessage; ev.xclient.window = embeddedWinId(); assert( msg_type_atom != None ); ev.xclient.message_type = msg_type_atom; ev.xclient.format = 32; - ev.xclient.data.l[0] = qt_x_time; + ev.xclient.data.l[0] = tqt_x_time; ev.xclient.data.l[1] = minimumWidth(); ev.xclient.data.l[2] = minimumHeight(); ev.xclient.data.l[3] = 0; ev.xclient.data.l[4] = 0; - XSendEvent( qt_xdisplay(), embeddedWinId(), False, NoEventMask, &ev ); + XSendEvent( tqt_xdisplay(), embeddedWinId(), False, NoEventMask, &ev ); } } -- cgit v1.2.1