diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-11-07 21:50:33 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-11-07 21:50:33 -0600 |
commit | 0b6057404f65218182ab27a9483a21065ef61fca (patch) | |
tree | b8b06dfa2deb965bebfbe131a772124e3e693a96 /twin/kcmtwin | |
parent | 43d99cc2477266cb9072e179137f0e8485370b3d (diff) | |
download | tdebase-0b6057404f65218182ab27a9483a21065ef61fca.tar.gz tdebase-0b6057404f65218182ab27a9483a21065ef61fca.zip |
Rename kwin to twin (Part 2 of 2)
Diffstat (limited to 'twin/kcmtwin')
47 files changed, 13508 insertions, 0 deletions
diff --git a/twin/kcmtwin/CMakeLists.txt b/twin/kcmtwin/CMakeLists.txt new file mode 100644 index 000000000..e0ca44195 --- /dev/null +++ b/twin/kcmtwin/CMakeLists.txt @@ -0,0 +1,16 @@ +################################################# +# +# (C) 2010-2011 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +add_subdirectory( twinoptions ) +add_subdirectory( twindecoration ) +add_subdirectory( twinrules ) + +install( FILES showdesktop.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} ) diff --git a/twin/kcmtwin/Makefile.am b/twin/kcmtwin/Makefile.am new file mode 100644 index 000000000..1f371dd46 --- /dev/null +++ b/twin/kcmtwin/Makefile.am @@ -0,0 +1,3 @@ +SUBDIRS = twinoptions twindecoration twinrules + +xdg_apps_DATA = showdesktop.desktop
\ No newline at end of file diff --git a/twin/kcmtwin/showdesktop.desktop b/twin/kcmtwin/showdesktop.desktop new file mode 100644 index 000000000..3c59bf0c9 --- /dev/null +++ b/twin/kcmtwin/showdesktop.desktop @@ -0,0 +1,132 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=Show Desktop +Name[af]=Vertoon Werkskerm +Name[ar]=أعرض سطح المكتب +Name[be]=Паказаць працоўны стол +Name[bg]=Показване на работния плот +Name[bn]=ডেস্কটপ দেখাও +Name[br]=Diskouez ar burev +Name[bs]=Prikaži desktop +Name[ca]=Mostra l'escriptori +Name[cs]=Zobrazit plochu +Name[csb]=Pòkôże pùlt +Name[da]=Vis desktop +Name[de]=Zugriff auf Arbeitsfläche +Name[el]=Εμφάνιση επιφάνειας εργασίας +Name[eo]=Montri Tabulon +Name[es]=Mostrar escritorio +Name[et]=Näita töölauda +Name[eu]=Erakutsi mahaigaina +Name[fa]=نمایش رومیزی +Name[fi]=Näytä työpöytä +Name[fr]=Afficher le bureau +Name[fy]=Buroblêd sjen litte +Name[ga]=Taispeáin an Deasc +Name[gl]=Escritório +Name[he]=הצג שולחן עבודה +Name[hr]=Prikaži radnu površinu +Name[hu]=A munkaasztal megjelenítése +Name[is]=Sýna skjáborð +Name[it]=Mostra il desktop +Name[ja]=デスクトップを表示 +Name[ka]=სამუშაო დაფის ჩვენება +Name[kk]=Үстелге ауысу +Name[km]=បង្ហាញផ្ទៃតុ +Name[ko]=데스크톱 1로 바꾸기 +Name[lt]=Rodyti darbastalį +Name[mk]=Прикажи работна површина +Name[nb]=Vis skrivebord +Name[nds]=Schriefdischwieser +Name[ne]=डेस्कटप देखाउनुहोस् +Name[nl]=Bureaublad tonen +Name[nn]=Vis skrivebord +Name[pa]=ਵੇਹੜਾ ਵੇਖਾਓ +Name[pl]=Pokaż pulpit +Name[pt]=Mostrar o Ecrã +Name[pt_BR]=Mostrar Área de Trabalho +Name[ro]=Arată desktop +Name[ru]=Свернуть все окна +Name[rw]=Kwerekana Ibiro +Name[se]=Čájet čállinbeavddi +Name[sk]=Ukáže pracovnú plochu +Name[sl]=Prikaži namizje +Name[sr]=Прикажи радну површину +Name[sr@Latn]=Prikaži radnu površinu +Name[sv]=Visa skrivbord +Name[te]=రంగస్థలాన్ని చూపు +Name[tg]=Намоиши мизи корӣ +Name[th]=แสดงพื้นที่หน้าจอ +Name[tr]=Masaüstünü Göster +Name[tt]=Östäl Kürsätü +Name[uk]=Показати стільницю +Name[uz]=Ish stoli +Name[uz@cyrillic]=Иш столи +Name[vi]=Hiển thị Màn hình nền +Name[wa]=Mostrer l' sicribanne +Name[zh_CN]=显示桌面 +Name[zh_TW]=顯示桌面 +Comment=A button that gives quick access to the desktop when pressed +Comment[af]='n Knoppie wat vinnige toegang tot die werkskerm gee wanneer dit gedruk word +Comment[ar]=زرّ يسمح بالوصول السريع إلى سطح المكتب عند ضغطه +Comment[be]=Кнопка, якая дае хуткі доступ да працоўнага стала +Comment[bg]=Бутон за бърз достъп до работния плот +Comment[bn]=একটা বাটন যেটি চাপলে ডেস্কটপ ফাঁকা করে দেখানো হবে +Comment[bs]=Dugme koje sklanja sve prozore sa ekrana i prikazuje desktop +Comment[ca]=Un botó que dóna accés ràpid a l'escriptori en prémer-hi +Comment[cs]=Tlačítko s rychlým přístupem k pracovní ploše +Comment[csb]=Knąpa chùtczégò przistãpù do pùltu +Comment[da]=En knap der giver hurtig adgang til desktoppen når den trykkes ned +Comment[de]=Dieser Knopf ermöglicht den schnellen Zugriff auf die Arbeitsfläche +Comment[el]=Ένα κουμπί που όταν πατηθεί δίνει γρήγορη πρόσβαση στην επιφάνεια εργασίας +Comment[eo]=Butono kiu ebligas rapid aliron al labortabulo kiam premita +Comment[es]=Muestra rápidamente el escritorio al pulsarlo +Comment[et]=Nupp, mis võimaldab ühe klõpsuga kiiresti pääseda otse töölauale +Comment[eu]=Zapatzean mahagainera sarbide bizkorra ematen duen botoia +Comment[fa]=دکمهای که وقتی فشار داده شد، امکان دستیابی سریع به رومیزی را میدهد. +Comment[fi]=Painike, jota painamalla pääsee nopeasti työpöydälle +Comment[fr]=Un bouton, qui, en étant cliqué, donne un accès rapide au bureau +Comment[fy]=In knop hokker flugge tagong ta it buroblêd jout +Comment[gl]=Un botón que dá aceso rápido ao escritório cando se preme +Comment[he]=כפתור הנותן גישה מהירה לשולחן העבודה כאשר נלחץ +Comment[hr]=Gumb koji omogućuje brz pristup radnoj površini +Comment[hu]=Ezzel a gombbal gyorsan elérhető a munkaasztal +Comment[is]=Hnappur sem veitir hraðan aðgang að skjáborðinu +Comment[it]=Un pulsante che da accesso rapido al desktop quando viene premuto +Comment[ja]=デスクトップに素早くアクセスするためのボタン +Comment[kk]=Бір басып үстелге қатынау батырмасы +Comment[km]=ប៊ូតុងដែលផ្តល់ការចូលដំណើរការរហ័សទៅផ្ទៃតុ ពេលចុច +Comment[lt]=Mygtukas, kurį nuspaudus suteikiama greita prieiga prie darbastalio +Comment[mk]=Копче што дава брз пристап кон работната површина кога е притиснато +Comment[nb]=En knapp som gir deg rask tilgang til skrivebordet +Comment[nds]=Disse Knoop laat Een direktemang op den Schriefdisch togriepen +Comment[ne]=थिचेको बेलामा डेस्कटपमा द्रुत पहुँच प्रदान गर्ने बटन +Comment[nl]=Een knop die snelle toegang tot het bureaublad geeft +Comment[nn]=Ein knapp som gir deg rask tilgang til skrivebordet +Comment[pa]=ਇੱਕ ਬਟਨ, ਜੋ ਕਿ ਦਬਾਉਣ ਉਪਰੰਤ ਤੁਹਾਨੂ ਵੇਹੜਾ ਉਪਲੱਬਧ ਕਰਵਾਉਦਾ ਹੈ +Comment[pl]=Przycisk szybkiego dostępu do pulpitu +Comment[pt]=Um botão que dá acesso rápido ao ecrã, quando for carregado +Comment[pt_BR]=Um botão que fornece acesso rápido para a área de trabalho, quando pressionado +Comment[ro]=Un buton care permite acces rapid la desktop la apăsare +Comment[ru]=Кнопка перехода на заданный рабочий стол +Comment[rw]=Buto itanga ukugera vuba ku biro igihe ikanzwe +Comment[se]=Boallu mii čiehká buot lásiid mat leat čállinbeavddis go dan coahkkala +Comment[sk]=Tlačidlo pre rýchly prístup na pracovnú plochu +Comment[sl]=Klik tega gumba omogoča hiter dostop do namizja +Comment[sr]=Дугме које по притиску даје брз приступ радној површини +Comment[sr@Latn]=Dugme koje po pritisku daje brz pristup radnoj površini +Comment[sv]=En knapp som ger snabb åtkomst till skrivbordet när den klickas +Comment[th]=ปุ่มที่กดแล้วจะแสดงพื้นที่หน้าจออย่างรวดเร็ว +Comment[tr]=Tıklandığı zaman masaüstüne hızlı erişim sağlar +Comment[tt]=Östäl eçtälegenä tiz ireşergä birüçe töymä +Comment[uk]=Кнопка, яка при натисканні надає швидкий доступ до стільниці +Comment[uz]=Ish stoliga qisqa yoʻl +Comment[uz@cyrillic]=Иш столига қисқа йўл +Comment[vi]=Một nút cho phép bạn truy cập ngay đến màn hình nền mỗi khi ấn vào +Comment[wa]=On boton ki dene raddimint accès å scribanne cwand il est tchôkî +Comment[zh_CN]=按下可快速访问桌面的按钮 +Comment[zh_TW]=按下去能快速顯示桌面的按鈕 +Exec=dcop kdesktop KDesktopIface toggleShowDesktop +Icon=desktop +Type=Application +Categories=Qt;KDE;X-KDE-settings-desktop;
\ No newline at end of file diff --git a/twin/kcmtwin/twindecoration/CMakeLists.txt b/twin/kcmtwin/twindecoration/CMakeLists.txt new file mode 100644 index 000000000..5fbdb3653 --- /dev/null +++ b/twin/kcmtwin/twindecoration/CMakeLists.txt @@ -0,0 +1,37 @@ +################################################# +# +# (C) 2010-2011 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include_directories( + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/twin/lib + ${TDE_INCLUDE_DIR} + ${TQT_INCLUDE_DIRS} +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + +##### other data ################################ + +install( FILES twindecoration.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} ) + + +##### kcm_twindecoration (module) ############### + +tde_add_kpart( kcm_twindecoration AUTOMOC + SOURCES + twindecoration.cpp buttons.cpp + twindecorationIface.skel preview.cpp + LINK tdecorations-shared tdeui-shared Xext + DESTINATION ${PLUGIN_INSTALL_DIR} +) diff --git a/twin/kcmtwin/twindecoration/Makefile.am b/twin/kcmtwin/twindecoration/Makefile.am new file mode 100644 index 000000000..021c1ac3e --- /dev/null +++ b/twin/kcmtwin/twindecoration/Makefile.am @@ -0,0 +1,18 @@ +INCLUDES = -I$(srcdir)/../../lib $(all_includes) + +kde_module_LTLIBRARIES = kcm_twindecoration.la + +kcm_twindecoration_la_SOURCES = twindecoration.cpp buttons.cpp twindecorationIface.skel preview.cpp +noinst_HEADERS = twindecoration.h twindecorationIface.h buttons.h preview.h + +kcm_twindecoration_la_LDFLAGS = \ + -module -avoid-version $(all_libraries) -no-undefined + +kcm_twindecoration_la_LIBADD = $(LIB_TDEUI) ../../lib/libtdecorations.la + +METASOURCES = AUTO + +messages: + $(XGETTEXT) *.cpp -o $(podir)/kcmtwindecoration.pot + +xdg_apps_DATA = twindecoration.desktop diff --git a/twin/kcmtwin/twindecoration/buttons.cpp b/twin/kcmtwin/twindecoration/buttons.cpp new file mode 100644 index 000000000..2c450aed1 --- /dev/null +++ b/twin/kcmtwin/twindecoration/buttons.cpp @@ -0,0 +1,883 @@ +/* + This is the new twindecoration kcontrol module + + Copyright (c) 2004, Sandro Giessl <sandro@giessl.com> + Copyright (c) 2001 + Karol Szwed <gallium@kde.org> + http://gallium.n3.net/ + + Supports new twin configuration plugins, and titlebar button position + modification via dnd interface. + + Based on original "twintheme" (Window Borders) + Copyright (C) 2001 Rik Hemsley (rikkus) <rik@kde.org> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +*/ + +#include <tqheader.h> +#include <tqpainter.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqstyle.h> + +#include <kdebug.h> + +#include <kdialog.h> +#include <klocale.h> +#include <kglobalsettings.h> + +#include <kdecorationfactory.h> + +#include "buttons.h" +#include "pixmaps.h" + + +#define BUTTONDRAGMIMETYPE "application/x-kde_twindecoration_buttons" +ButtonDrag::ButtonDrag( Button btn, TQWidget* parent, const char* name) + : TQStoredDrag( BUTTONDRAGMIMETYPE, parent, name) +{ + TQByteArray data; + TQDataStream stream(data, IO_WriteOnly); + stream << btn.name; + stream << btn.icon; + stream << btn.type.tqunicode(); + stream << (int) btn.duplicate; + stream << (int) btn.supported; + setEncodedData( data ); +} + + +bool ButtonDrag::canDecode( TQDropEvent* e ) +{ + return e->provides( BUTTONDRAGMIMETYPE ); +} + +bool ButtonDrag::decode( TQDropEvent* e, Button& btn ) +{ + TQByteArray data = e->data( BUTTONDRAGMIMETYPE ); + if ( data.size() ) + { + e->accept(); + TQDataStream stream(data, IO_ReadOnly); + stream >> btn.name; + stream >> btn.icon; + ushort type; + stream >> type; + btn.type = TQChar(type); + int duplicate; + stream >> duplicate; + btn.duplicate = duplicate; + int supported; + stream >> supported; + btn.supported = supported; + return TRUE; + } + return FALSE; +} + + +Button::Button() +{ +} + +Button::Button(const TQString& n, const TQBitmap& i, TQChar t, bool d, bool s) + : name(n), + icon(i), + type(t), + duplicate(d), + supported(s) +{ +} + +Button::~Button() +{ +} + +// helper function to deal with the Button's bitmaps more easily... +TQPixmap bitmapPixmap(const TQBitmap& bm, const TQColor& color) +{ + TQPixmap pm(bm.size() ); + pm.setMask(bm); + TQPainter p(&pm); + p.setPen(color); + p.drawPixmap(0,0,bm); + p.end(); + return pm; +} + + +ButtonSource::ButtonSource(TQWidget *parent, const char* name) + : KListView(parent, name) +{ + tqsetSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Expanding); + + setResizeMode(TQListView::AllColumns); + setDragEnabled(true); + setAcceptDrops(true); + setDropVisualizer(false); + setSorting(-1); + header()->setClickEnabled(false); + header()->hide(); + + addColumn(i18n("Buttons") ); +} + +ButtonSource::~ButtonSource() +{ +} + +TQSize ButtonSource::tqsizeHint() const +{ + // make the tqsizeHint height a bit smaller than the one of TQListView... + + if ( cachedSizeHint().isValid() ) + return cachedSizeHint(); + + constPolish(); + + TQSize s( header()->tqsizeHint() ); + + if ( verticalScrollBar()->isVisible() ) + s.setWidth( s.width() + tqstyle().tqpixelMetric(TQStyle::PM_ScrollBarExtent) ); + s += TQSize(frameWidth()*2,frameWidth()*2); + + // size hint: 4 lines of text... + s.setHeight( s.height() + fontMetrics().lineSpacing()*3 ); + + setCachedSizeHint( s ); + + return s; +} + +void ButtonSource::hideAllButtons() +{ + TQListViewItemIterator it(this); + while (it.current() ) { + it.current()->tqsetVisible(false); + ++it; + } +} + +void ButtonSource::showAllButtons() +{ + TQListViewItemIterator it(this); + while (it.current() ) { + it.current()->tqsetVisible(true); + ++it; + } +} + +void ButtonSource::showButton( TQChar btn ) +{ + TQListViewItemIterator it(this); + while (it.current() ) { + ButtonSourceItem *item = dynamic_cast<ButtonSourceItem*>(it.current() ); + if (item && item->button().type == btn) { + it.current()->tqsetVisible(true); + return; + } + ++it; + } +} + +void ButtonSource::hideButton( TQChar btn ) +{ + TQListViewItemIterator it(this); + while (it.current() ) { + ButtonSourceItem *item = dynamic_cast<ButtonSourceItem*>(it.current() ); + if (item && item->button().type == btn && !item->button().duplicate) { + it.current()->tqsetVisible(false); + return; + } + ++it; + } +} + +bool ButtonSource::acceptDrag(TQDropEvent* e) const +{ + return acceptDrops() && ButtonDrag::canDecode(e); +} + +TQDragObject *ButtonSource::dragObject() +{ + ButtonSourceItem *i = dynamic_cast<ButtonSourceItem*>(selectedItem() ); + + if (i) { + ButtonDrag *bd = new ButtonDrag(i->button(), viewport(), "button_drag"); + bd->setPixmap(bitmapPixmap(i->button().icon, tqcolorGroup().foreground() )); + return bd; + } + + return 0; +} + +ButtonDropSiteItem::ButtonDropSiteItem(const Button& btn) + : m_button(btn) +{ +} + +ButtonDropSiteItem::~ButtonDropSiteItem() +{ +} + +Button ButtonDropSiteItem::button() +{ + return m_button; +} + +int ButtonDropSiteItem::width() +{ +// return m_button.icon.width(); + return 20; +} + +int ButtonDropSiteItem::height() +{ +// return m_button.icon.height(); + return 20; +} + +void ButtonDropSiteItem::draw(TQPainter *p, const TQColorGroup& cg, TQRect r) +{ +// p->fillRect(r, cg.base() ); + if (m_button.supported) + p->setPen(cg.foreground() ); + else + p->setPen(cg.mid() ); + TQBitmap &i = m_button.icon; + p->drawPixmap(r.left()+(r.width()-i.width())/2, r.top()+(r.height()-i.height())/2, i); +} + + +ButtonDropSite::ButtonDropSite( TQWidget* parent, const char* name ) + : TQFrame( parent, name ), + m_selected(0) +{ + setAcceptDrops( TRUE ); + setFrameShape( WinPanel ); + setFrameShadow( Raised ); + setMinimumHeight( 26 ); + setMaximumHeight( 26 ); + setMinimumWidth( 250 ); // Ensure buttons will fit +} + +ButtonDropSite::~ButtonDropSite() +{ + clearLeft(); + clearRight(); +} + +void ButtonDropSite::clearLeft() +{ + while (!buttonsLeft.isEmpty() ) { + ButtonDropSiteItem *item = buttonsLeft.first(); + if (removeButton(item) ) { + emit buttonRemoved(item->button().type); + delete item; + } + } +} + +void ButtonDropSite::clearRight() +{ + while (!buttonsRight.isEmpty() ) { + ButtonDropSiteItem *item = buttonsRight.first(); + if (removeButton(item) ) { + emit buttonRemoved(item->button().type); + delete item; + } + } +} + +void ButtonDropSite::dragMoveEvent( TQDragMoveEvent* e ) +{ + TQPoint p = e->pos(); + if (leftDropArea().contains(p) || rightDropArea().contains(p) || buttonAt(p) ) { + e->accept(); + + // 2 pixel wide drop visualizer... + TQRect r = contentsRect(); + int x = -1; + if (leftDropArea().contains(p) ) { + x = leftDropArea().left(); + } else if (rightDropArea().contains(p) ) { + x = rightDropArea().right()+1; + } else { + ButtonDropSiteItem *item = buttonAt(p); + if (item) { + if (p.x() < item->rect.left()+item->rect.width()/2 ) { + x = item->rect.left(); + } else { + x = item->rect.right()+1; + } + } + } + if (x != -1) { + TQRect tmpRect(x, r.y(), 2, r.height() ); + if (tmpRect != m_oldDropVisualizer) { + cleanDropVisualizer(); + m_oldDropVisualizer = tmpRect; + update(tmpRect); + } + } + + } else { + e->ignore(); + + cleanDropVisualizer(); + } +} + +void ButtonDropSite::cleanDropVisualizer() +{ + if (m_oldDropVisualizer.isValid()) + { + TQRect rect = m_oldDropVisualizer; + m_oldDropVisualizer = TQRect(); // rect is invalid + update(rect); + } +} + +void ButtonDropSite::dragEnterEvent( TQDragEnterEvent* e ) +{ + if ( ButtonDrag::canDecode( e ) ) + e->accept(); +} + +void ButtonDropSite::dragLeaveEvent( TQDragLeaveEvent* /* e */ ) +{ + cleanDropVisualizer(); +} + +void ButtonDropSite::dropEvent( TQDropEvent* e ) +{ + cleanDropVisualizer(); + + TQPoint p = e->pos(); + + // collect information where to insert the dropped button + ButtonList *buttonList = 0; + ButtonList::iterator buttonPosition; + + if (leftDropArea().contains(p) ) { + buttonList = &buttonsLeft; + buttonPosition = buttonsLeft.end(); + } else if (rightDropArea().contains(p) ) { + buttonList = &buttonsRight; + buttonPosition = buttonsRight.begin(); + } else { + ButtonDropSiteItem *aboveItem = buttonAt(p); + if (!aboveItem) + return; // invalid drop. hasn't occured _over_ a button (or left/right dropArea), return... + + ButtonList::iterator it; + if (!getItemIterator(aboveItem, buttonList, it) ) { + // didn't find the aboveItem. unlikely to happen since buttonAt() already seems to have found + // something valid. anyway... + return; + } + + // got the list and the aboveItem position. now determine if the item should be inserted + // before aboveItem or after aboveItem. + TQRect aboveItemRect = aboveItem->rect; + if (!aboveItemRect.isValid() ) + return; + + if (p.x() < aboveItemRect.left()+aboveItemRect.width()/2 ) { + // insert before the item + buttonPosition = it; + } else { + if (it != buttonList->end() ) + buttonPosition = ++it; + else + buttonPosition = it; // already at the end(), can't increment the iterator! + } + } + + // know where to insert the button. now see if we can use an existing item (drag within the widget = move) + // orneed to create a new one + ButtonDropSiteItem *buttonItem = 0; + if (e->source() == this && m_selected) { + ButtonList *oldList = 0; + ButtonList::iterator oldPos; + if (getItemIterator(m_selected, oldList, oldPos) ) { + if (oldPos == buttonPosition) + return; // button didn't change its position during the drag... + + oldList->remove(oldPos); + buttonItem = m_selected; + } else { + return; // m_selected not found, return... + } + } else { + // create new button from the drop object... + Button btn; + if (ButtonDrag::decode(e, btn) ) { + buttonItem = new ButtonDropSiteItem(btn); + } else { + return; // something has gone wrong while we were trying to decode the drop event + } + } + + // now the item can actually be inserted into the list! :) + (*buttonList).insert(buttonPosition, buttonItem); + emit buttonAdded(buttonItem->button().type); + emit changed(); + recalcItemGeometry(); + update(); +} + +bool ButtonDropSite::getItemIterator(ButtonDropSiteItem *item, ButtonList* &list, ButtonList::iterator &iterator) +{ + if (!item) + return false; + + ButtonList::iterator it = buttonsLeft.find(item); // try the left list first... + if (it == buttonsLeft.end() ) { + it = buttonsRight.find(item); // try the right list... + if (it == buttonsRight.end() ) { + return false; // item hasn't been found in one of the list, return... + } else { + list = &buttonsRight; + iterator = it; + } + } else { + list = &buttonsLeft; + iterator = it; + } + + return true; +} + +TQRect ButtonDropSite::leftDropArea() +{ + // return a 10 pixel drop area... + TQRect r = contentsRect(); + + int leftButtonsWidth = calcButtonListWidth(buttonsLeft); + return TQRect(r.left()+leftButtonsWidth, r.top(), 10, r.height() ); +} + +TQRect ButtonDropSite::rightDropArea() +{ + // return a 10 pixel drop area... + TQRect r = contentsRect(); + + int rightButtonsWidth = calcButtonListWidth(buttonsRight); + return TQRect(r.right()-rightButtonsWidth-10, r.top(), 10, r.height() ); +} + +void ButtonDropSite::mousePressEvent( TQMouseEvent* e ) +{ + // TODO: only start the real drag after some drag distance + m_selected = buttonAt(e->pos() ); + if (m_selected) { + ButtonDrag *bd = new ButtonDrag(m_selected->button(), this); + bd->setPixmap(bitmapPixmap(m_selected->button().icon, tqcolorGroup().foreground() ) ); + bd->dragMove(); + } +} + +void ButtonDropSite::resizeEvent(TQResizeEvent*) +{ + recalcItemGeometry(); +} + +void ButtonDropSite::recalcItemGeometry() +{ + TQRect r = contentsRect(); + + // update the geometry of the items in the left button list + int offset = r.left(); + for (ButtonList::const_iterator it = buttonsLeft.begin(); it != buttonsLeft.end(); ++it) { + int w = (*it)->width(); + (*it)->rect = TQRect(offset, r.top(), w, (*it)->height() ); + offset += w; + } + + // the right button list... + offset = r.right() - calcButtonListWidth(buttonsRight); + for (ButtonList::const_iterator it = buttonsRight.begin(); it != buttonsRight.end(); ++it) { + int w = (*it)->width(); + (*it)->rect = TQRect(offset, r.top(), w, (*it)->height() ); + offset += w; + } +} + +ButtonDropSiteItem *ButtonDropSite::buttonAt(TQPoint p) { + // try to find the item in the left button list + for (ButtonList::const_iterator it = buttonsLeft.begin(); it != buttonsLeft.end(); ++it) { + if ( (*it)->rect.contains(p) ) { + return *it; + } + } + + // try to find the item in the right button list + for (ButtonList::const_iterator it = buttonsRight.begin(); it != buttonsRight.end(); ++it) { + if ( (*it)->rect.contains(p) ) { + return *it; + } + } + + return 0; +} + +bool ButtonDropSite::removeButton(ButtonDropSiteItem *item) { + if (!item) + return false; + + // try to remove the item from the left button list + if (buttonsLeft.remove(item) >= 1) { + return true; + } + + // try to remove the item from the right button list + if (buttonsRight.remove(item) >= 1) { + return true; + } + + return false; +} + +int ButtonDropSite::calcButtonListWidth(const ButtonList& btns) +{ + int w = 0; + for (ButtonList::const_iterator it = btns.begin(); it != btns.end(); ++it) { + w += (*it)->width(); + } + + return w; +} + +bool ButtonDropSite::removeSelectedButton() +{ + bool succ = removeButton(m_selected); + if (succ) { + emit buttonRemoved(m_selected->button().type); + emit changed(); + delete m_selected; + m_selected = 0; + recalcItemGeometry(); + update(); // tqrepaint... + } + + return succ; +} + +void ButtonDropSite::drawButtonList(TQPainter *p, const ButtonList& btns, int offset) +{ + for (ButtonList::const_iterator it = btns.begin(); it != btns.end(); ++it) { + TQRect tqitemRect = (*it)->rect; + if (tqitemRect.isValid() ) { + (*it)->draw(p, tqcolorGroup(), tqitemRect); + } + offset += (*it)->width(); + } +} + +void ButtonDropSite::drawContents( TQPainter* p ) +{ + int leftoffset = calcButtonListWidth( buttonsLeft ); + int rightoffset = calcButtonListWidth( buttonsRight ); + int offset = 3; + + TQRect r = contentsRect(); + + // Shrink by 1 + r.moveBy(1 + leftoffset, 1); + r.setWidth( r.width() - 2 - leftoffset - rightoffset ); + r.setHeight( r.height() - 2 ); + + drawButtonList( p, buttonsLeft, offset ); + + TQColor c1( 0x0A, 0x5F, 0x89 ); // KDE 2 titlebar default colour + p->fillRect( r, c1 ); + p->setPen( Qt::white ); + p->setFont( TQFont( KGlobalSettings::generalFont().family(), 12, TQFont::Bold) ); + p->drawText( r, AlignLeft | AlignVCenter, i18n("KDE") ); + + offset = geometry().width() - 3 - rightoffset; + drawButtonList( p, buttonsRight, offset ); + + if (m_oldDropVisualizer.isValid() ) + { + p->fillRect(m_oldDropVisualizer, Dense4Pattern); + } +} + +ButtonSourceItem::ButtonSourceItem(TQListView * parent, const Button& btn) + : TQListViewItem(parent), + m_button(btn), + m_dirty(true) +{ + setButton(btn); +} + +ButtonSourceItem::~ButtonSourceItem() +{ +} + +void ButtonSourceItem::paintCell(TQPainter *p, const TQColorGroup &cg, int column, int width, int align) +{ + // we need the color group cg, so to the work here, not in setButton... + if (m_dirty) { + if (m_button.supported) { + setPixmap(0, bitmapPixmap(m_button.icon, cg.foreground() ) ); + } else { + setPixmap(0, bitmapPixmap(m_button.icon, cg.mid() ) ); + } + m_dirty = false; + } + + if (m_button.supported) { + TQListViewItem::paintCell(p,cg,column,width,align); + } else { + // grey out unsupported buttons + TQColorGroup cg2 = cg; + cg2.setColor(TQColorGroup::Text, cg.mid() ); + TQListViewItem::paintCell(p,cg2,column,width,align); + } +} + +void ButtonSourceItem::setButton(const Button& btn) +{ + m_button = btn; + m_dirty = true; // update the pixmap when in paintCell()... + if (btn.supported) { + setText(0, btn.name); + } else { + setText(0, i18n("%1 (unavailable)").arg(btn.name) ); + } +} + +Button ButtonSourceItem::button() const +{ + return m_button; +} + + +ButtonPositionWidget::ButtonPositionWidget(TQWidget *parent, const char* name) + : TQWidget(parent,name), + m_factory(0) +{ + TQVBoxLayout *layout = new TQVBoxLayout(this, 0, KDialog::spacingHint() ); + tqsetSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Maximum); + + TQLabel* label = new TQLabel( this ); + m_dropSite = new ButtonDropSite( this ); + label->tqsetAlignment( int( TQLabel::WordBreak ) ); + label->setText( i18n( "To add or remove titlebar buttons, simply <i>drag</i> items " + "between the available item list and the titlebar preview. Similarly, " + "drag items within the titlebar preview to re-position them.") ); + m_buttonSource = new ButtonSource(this, "button_source"); + + layout->addWidget(label); + 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, TQT_SIGNAL(changed()), TQT_SIGNAL(changed()) ); + + // insert all possible buttons into the source (backwards to keep the preferred order...) + bool dummy; + new ButtonSourceItem(m_buttonSource, getButton('R', dummy) ); + new ButtonSourceItem(m_buttonSource, getButton('L', dummy) ); + new ButtonSourceItem(m_buttonSource, getButton('B', dummy) ); + new ButtonSourceItem(m_buttonSource, getButton('F', dummy) ); + new ButtonSourceItem(m_buttonSource, getButton('X', dummy) ); + new ButtonSourceItem(m_buttonSource, getButton('A', dummy) ); + new ButtonSourceItem(m_buttonSource, getButton('I', dummy) ); + new ButtonSourceItem(m_buttonSource, getButton('H', dummy) ); + new ButtonSourceItem(m_buttonSource, getButton('S', dummy) ); + new ButtonSourceItem(m_buttonSource, getButton('M', dummy) ); + new ButtonSourceItem(m_buttonSource, getButton('_', dummy) ); +} + +ButtonPositionWidget::~ButtonPositionWidget() +{ +} + +void ButtonPositionWidget::setDecorationFactory(KDecorationFactory *factory) +{ + if (!factory) + return; + + m_factory = factory; + + // get the list of supported buttons + if (m_factory->supports(KDecorationDefines::AbilityAnnounceButtons) ) { + TQString supportedButtons; + + if (m_factory->supports(KDecorationDefines::AbilityButtonMenu) ) + supportedButtons.append('M'); + if (m_factory->supports(KDecorationDefines::AbilityButtonOnAllDesktops) ) + supportedButtons.append('S'); + if (m_factory->supports(KDecorationDefines::AbilityButtonSpacer) ) + supportedButtons.append('_'); + if (m_factory->supports(KDecorationDefines::AbilityButtonHelp) ) + supportedButtons.append('H'); + if (m_factory->supports(KDecorationDefines::AbilityButtonMinimize) ) + supportedButtons.append('I'); + if (m_factory->supports(KDecorationDefines::AbilityButtonMaximize) ) + supportedButtons.append('A'); + if (m_factory->supports(KDecorationDefines::AbilityButtonClose) ) + supportedButtons.append('X'); + if (m_factory->supports(KDecorationDefines::AbilityButtonAboveOthers) ) + supportedButtons.append('F'); + if (m_factory->supports(KDecorationDefines::AbilityButtonBelowOthers) ) + supportedButtons.append('B'); + if (m_factory->supports(KDecorationDefines::AbilityButtonShade) ) + supportedButtons.append('L'); + if (m_factory->supports(KDecorationDefines::AbilityButtonResize) ) + supportedButtons.append('R'); + + m_supportedButtons = supportedButtons; + } else { + // enable only buttons available before AbilityButton* introduction + m_supportedButtons = "MSHIAX_"; + } + + // update the button lists... + // 1. set status on the source items... + TQListViewItemIterator it(m_buttonSource); + while (it.current() ) { + ButtonSourceItem *i = dynamic_cast<ButtonSourceItem*>(it.current() ); + if (i) { + Button b = i->button(); + b.supported = m_supportedButtons.contains(b.type); + i->setButton(b); + } + ++it; + } + // 2. rebuild the drop site items... + setButtonsLeft(buttonsLeft() ); + setButtonsRight(buttonsRight() ); +} + +Button ButtonPositionWidget::getButton(TQChar type, bool& success) { + success = true; + + if (type == 'R') { + TQBitmap bmp(resize_width, resize_height, resize_bits, true); + bmp.setMask(bmp); + return Button(i18n("Resize"), bmp, 'R', false, m_supportedButtons.contains('R') ); + } else if (type == 'L') { + TQBitmap bmp(shade_width, shade_height, shade_bits, true); + bmp.setMask(bmp); + return Button(i18n("Shade"), bmp, 'L', false, m_supportedButtons.contains('L') ); + } else if (type == 'B') { + TQBitmap bmp(keepbelowothers_width, keepbelowothers_height, keepbelowothers_bits, true); + bmp.setMask(bmp); + return Button(i18n("Keep Below Others"), bmp, 'B', false, m_supportedButtons.contains('B') ); + } else if (type == 'F') { + TQBitmap bmp(keepaboveothers_width, keepaboveothers_height, keepaboveothers_bits, true); + bmp.setMask(bmp); + return Button(i18n("Keep Above Others"), bmp, 'F', false, m_supportedButtons.contains('F') ); + } else if (type == 'X') { + TQBitmap bmp(close_width, close_height, close_bits, true); + bmp.setMask(bmp); + return Button(i18n("Close"), bmp, 'X', false, m_supportedButtons.contains('X') ); + } else if (type == 'A') { + TQBitmap bmp(maximize_width, maximize_height, maximize_bits, true); + bmp.setMask(bmp); + return Button(i18n("Maximize"), bmp, 'A', false, m_supportedButtons.contains('A') ); + } else if (type == 'I') { + TQBitmap bmp(minimize_width, minimize_height, minimize_bits, true); + bmp.setMask(bmp); + return Button(i18n("Minimize"), bmp, 'I', false, m_supportedButtons.contains('I') ); + } else if (type == 'H') { + TQBitmap bmp(help_width, help_height, help_bits, true); + bmp.setMask(bmp); + return Button(i18n("Help"), bmp, 'H', false, m_supportedButtons.contains('H') ); + } else if (type == 'S') { + TQBitmap bmp(onalldesktops_width, onalldesktops_height, onalldesktops_bits, true); + bmp.setMask(bmp); + return Button(i18n("On All Desktops"), bmp, 'S', false, m_supportedButtons.contains('S') ); + } else if (type == 'M') { + TQBitmap bmp(menu_width, menu_height, menu_bits, true); + bmp.setMask(bmp); + return Button(i18n("Menu"), bmp, 'M', false, m_supportedButtons.contains('M') ); + } else if (type == '_') { + TQBitmap bmp(spacer_width, spacer_height, spacer_bits, true); + bmp.setMask(bmp); + return Button(i18n("--- spacer ---"), bmp, '_', true, m_supportedButtons.contains('_') ); + } else { + success = false; + return Button(); + } +} + +TQString ButtonPositionWidget::buttonsLeft() const +{ + ButtonList btns = m_dropSite->buttonsLeft; + TQString btnString = ""; + for (ButtonList::const_iterator it = btns.begin(); it != btns.end(); ++it) { + btnString.append( (*it)->button().type ); + } + return btnString; +} + +TQString ButtonPositionWidget::buttonsRight() const +{ + ButtonList btns = m_dropSite->buttonsRight; + TQString btnString = ""; + for (ButtonList::const_iterator it = btns.begin(); it != btns.end(); ++it) { + btnString.append( (*it)->button().type ); + } + return btnString; +} + +void ButtonPositionWidget::setButtonsLeft(const TQString &buttons) +{ + // to keep the button lists consistent, first remove all left buttons, then add buttons again... + m_dropSite->clearLeft(); + + for (uint i = 0; i < buttons.length(); ++i) { + bool succ = false; + Button btn = getButton(buttons[i], succ); + if (succ) { + m_dropSite->buttonsLeft.append(new ButtonDropSiteItem(btn) ); + m_buttonSource->hideButton(btn.type); + } + } + m_dropSite->recalcItemGeometry(); + m_dropSite->update(); +} + +void ButtonPositionWidget::setButtonsRight(const TQString &buttons) +{ + // to keep the button lists consistent, first remove all left buttons, then add buttons again... + m_dropSite->clearRight(); + + for (uint i = 0; i < buttons.length(); ++i) { + bool succ = false; + Button btn = getButton(buttons[i], succ); + if (succ) { + m_dropSite->buttonsRight.append(new ButtonDropSiteItem(btn) ); + m_buttonSource->hideButton(btn.type); + } + } + m_dropSite->recalcItemGeometry(); + m_dropSite->update(); +} + +#include "buttons.moc" +// vim: ts=4 +// kate: space-indent off; tab-width 4; diff --git a/twin/kcmtwin/twindecoration/buttons.h b/twin/kcmtwin/twindecoration/buttons.h new file mode 100644 index 000000000..088d3414d --- /dev/null +++ b/twin/kcmtwin/twindecoration/buttons.h @@ -0,0 +1,227 @@ +/* + This is the new twindecoration kcontrol module + + Copyright (c) 2004, Sandro Giessl <sandro@giessl.com> + Copyright (c) 2001 + Karol Szwed <gallium@kde.org> + http://gallium.n3.net/ + + Supports new twin configuration plugins, and titlebar button position + modification via dnd interface. + + Based on original "twintheme" (Window Borders) + Copyright (C) 2001 Rik Hemsley (rikkus) <rik@kde.org> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +*/ + +#ifndef __BUTTONS_H_ +#define __BUTTONS_H_ + +#include <tqbitmap.h> +#include <tqevent.h> +#include <tqdragobject.h> +#include <tqlistbox.h> + +#include <klistview.h> + +class KDecorationFactory; + +/** + * This class holds the button data. + */ +class Button +{ + public: + Button(); + Button(const TQString& name, const TQBitmap& icon, TQChar type, bool duplicate, bool supported); + virtual ~Button(); + + TQString name; + TQBitmap icon; + TQChar type; + bool duplicate; + bool supported; +}; + +class ButtonDrag : public TQStoredDrag +{ + public: + ButtonDrag( Button btn, TQWidget* parent, const char* name=0 ); + ~ButtonDrag() {}; + + static bool canDecode( TQDropEvent* e ); + static bool decode( TQDropEvent* e, Button& btn ); +}; + +/** + * This is plugged into ButtonDropSite + */ +class ButtonDropSiteItem +{ + public: + ButtonDropSiteItem(const Button& btn); + ~ButtonDropSiteItem(); + + Button button(); + + TQRect rect; + int width(); + int height(); + + void draw(TQPainter *p, const TQColorGroup& cg, TQRect rect); + + private: + Button m_button; +}; + +/** + * This is plugged into ButtonSource + */ +class ButtonSourceItem : public TQListViewItem +{ + public: + ButtonSourceItem(TQListView * parent, const Button& btn); + virtual ~ButtonSourceItem(); + + void paintCell(TQPainter *p, const TQColorGroup &cg, int column, int width, int align); + + void setButton(const Button& btn); + Button button() const; + private: + Button m_button; + bool m_dirty; +}; + +/** + * Implements the button drag source list view + */ +class ButtonSource : public KListView +{ + Q_OBJECT + + public: + ButtonSource(TQWidget *parent = 0, const char* name = 0); + virtual ~ButtonSource(); + + TQSize tqsizeHint() const; + + void hideAllButtons(); + void showAllButtons(); + + public slots: + void hideButton(TQChar btn); + void showButton(TQChar btn); + + protected: + bool acceptDrag(TQDropEvent* e) const; + virtual TQDragObject *dragObject(); +}; + +typedef TQValueList<ButtonDropSiteItem*> ButtonList; + +/** + * This class renders and handles the demo titlebar dropsite + */ +class ButtonDropSite: public TQFrame +{ + Q_OBJECT + + public: + ButtonDropSite( TQWidget* parent=0, const char* name=0 ); + ~ButtonDropSite(); + + // Allow external classes access our buttons - ensure buttons are + // not duplicated however. + ButtonList buttonsLeft; + ButtonList buttonsRight; + void clearLeft(); + void clearRight(); + + signals: + void buttonAdded(TQChar btn); + void buttonRemoved(TQChar btn); + void changed(); + + public slots: + bool removeSelectedButton(); ///< This slot is called after we drop on the item listbox... + void recalcItemGeometry(); ///< Call this whenever the item list changes... updates the items' rect property + + protected: + void resizeEvent(TQResizeEvent*); + void dragEnterEvent( TQDragEnterEvent* e ); + void dragMoveEvent( TQDragMoveEvent* e ); + void dragLeaveEvent( TQDragLeaveEvent* e ); + void dropEvent( TQDropEvent* e ); + void mousePressEvent( TQMouseEvent* e ); ///< Starts dragging a button... + + void drawContents( TQPainter* p ); + ButtonDropSiteItem *buttonAt(TQPoint p); + bool removeButton(ButtonDropSiteItem *item); + int calcButtonListWidth(const ButtonList& buttons); ///< Computes the total space the buttons will take in the titlebar + void drawButtonList(TQPainter *p, const ButtonList& buttons, int offset); + + TQRect leftDropArea(); + TQRect rightDropArea(); + + private: + /** + * Try to find the item. If found, set its list and iterator and return true, else return false + */ + bool getItemIterator(ButtonDropSiteItem *item, ButtonList* &list, ButtonList::iterator &iterator); + + void cleanDropVisualizer(); + TQRect m_oldDropVisualizer; + + ButtonDropSiteItem *m_selected; +}; + +class ButtonPositionWidget : public TQWidget +{ + Q_OBJECT + + public: + ButtonPositionWidget(TQWidget *parent = 0, const char* name = 0); + ~ButtonPositionWidget(); + + /** + * set the factory, so the class e.g. knows which buttons are supported by the client + */ + void setDecorationFactory(KDecorationFactory *factory); + + TQString buttonsLeft() const; + TQString buttonsRight() const; + void setButtonsLeft(const TQString &buttons); + void setButtonsRight(const TQString &buttons); + + signals: + void changed(); + + private: + void clearButtonList(const ButtonList& btns); + Button getButton(TQChar type, bool& success); + + ButtonDropSite* m_dropSite; + ButtonSource *m_buttonSource; + + KDecorationFactory *m_factory; + TQString m_supportedButtons; +}; + + +#endif +// vim: ts=4 +// kate: space-indent off; tab-width 4; diff --git a/twin/kcmtwin/twindecoration/pixmaps.h b/twin/kcmtwin/twindecoration/pixmaps.h new file mode 100644 index 000000000..710e01425 --- /dev/null +++ b/twin/kcmtwin/twindecoration/pixmaps.h @@ -0,0 +1,110 @@ +/* + This is the new twindecoration kcontrol module + + Copyright (c) 2004, Sandro Giessl <sandro@giessl.com> + Copyright (c) 2001 + Karol Szwed <gallium@kde.org> + http://gallium.n3.net/ + + Supports new twin configuration plugins, and titlebar button position + modification via dnd interface. + + Based on original "twintheme" (Window Borders) + Copyright (C) 2001 Rik Hemsley (rikkus) <rik@kde.org> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +*/ + +// Button icon bitmap data which is hopefully generic enough to be recognized by everyone. + +// close.xbm: +#define close_width 12 +#define close_height 12 +static unsigned char close_bits[] = { + 0x00, 0x00, 0x06, 0x06, 0x0e, 0x07, 0x9c, 0x03, 0xf8, 0x01, 0xf0, 0x00, + 0xf0, 0x00, 0xf8, 0x01, 0x9c, 0x03, 0x0e, 0x07, 0x06, 0x06, 0x00, 0x00 }; + +// help.xbm: +#define help_width 12 +#define help_height 12 +static unsigned char help_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0xfc, 0x01, 0x8c, 0x01, 0xc0, 0x01, + 0xe0, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, 0x60, 0x00, 0x00, 0x00 }; + +// keepaboveothers.xbm: +#define keepaboveothers_width 12 +#define keepaboveothers_height 12 +static unsigned char keepaboveothers_bits[] = { + 0x00, 0x00, 0x60, 0x00, 0xf0, 0x00, 0xf8, 0x01, 0x60, 0x00, 0xfe, 0x07, + 0xfe, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +// keepbelowothers.xbm: +#define keepbelowothers_width 12 +#define keepbelowothers_height 12 +static unsigned char keepbelowothers_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x07, + 0xfe, 0x07, 0x60, 0x00, 0xf8, 0x01, 0xf0, 0x00, 0x60, 0x00, 0x00, 0x00 }; + +// maximize.xbm: +#define maximize_width 12 +#define maximize_height 12 +static unsigned char maximize_bits[] = { + 0x00, 0x00, 0xfe, 0x07, 0xfe, 0x07, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, + 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0xfe, 0x07, 0x00, 0x00 }; + +// menu.xbm: +#define menu_width 12 +#define menu_height 12 +static unsigned char menu_bits[] = { + 0x00, 0x00, 0xfc, 0x03, 0xf4, 0x02, 0x04, 0x02, 0xf4, 0x02, 0x04, 0x02, + 0xf4, 0x02, 0x04, 0x02, 0xf4, 0x02, 0x04, 0x02, 0xfc, 0x03, 0x00, 0x00 }; + +// minimize.xbm: +#define minimize_width 12 +#define minimize_height 12 +static unsigned char minimize_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x07, 0xfe, 0x07, 0x00, 0x00 }; + +// onalldesktops.xbm: +#define onalldesktops_width 12 +#define onalldesktops_height 12 +static unsigned char onalldesktops_bits[] = { + 0x00, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0xfe, 0x07, + 0xfe, 0x07, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x00, 0x00 }; + +// resize.xbm: +#define resize_width 12 +#define resize_height 12 +static unsigned char resize_bits[] = { + 0x00, 0x00, 0xfe, 0x07, 0x42, 0x04, 0x42, 0x04, 0x42, 0x04, 0x42, 0x04, + 0x7e, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0xfe, 0x07, 0x00, 0x00 }; + +// shade.xbm: +#define shade_width 12 +#define shade_height 12 +static unsigned char shade_bits[] = { + 0x00, 0x00, 0xfe, 0x07, 0xfe, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + +// spacer.xbm: +#define spacer_width 12 +#define spacer_height 12 +static unsigned char spacer_bits[] = { + 0x00, 0x00, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x54, 0x03, + 0xac, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x00, 0x00 }; + +// vim: ts=4 diff --git a/twin/kcmtwin/twindecoration/preview.cpp b/twin/kcmtwin/twindecoration/preview.cpp new file mode 100644 index 000000000..ee8c59c75 --- /dev/null +++ b/twin/kcmtwin/twindecoration/preview.cpp @@ -0,0 +1,507 @@ +/* + * + * Copyright (c) 2003 Lubos Lunak <l.lunak@kde.org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "preview.h" + +#include <kapplication.h> +#include <klocale.h> +#include <kconfig.h> +#include <kglobal.h> +#include <tqlabel.h> +#include <tqstyle.h> +#include <kiconloader.h> + +#include <X11/Xlib.h> +#include <X11/extensions/shape.h> + +#include <kdecorationfactory.h> +#include <kdecoration_plugins_p.h> + +// FRAME the preview doesn't update to reflect the changes done in the kcm + +KDecorationPreview::KDecorationPreview( TQWidget* parent, const char* name ) + : TQWidget( parent, name ) + { + options = new KDecorationPreviewOptions; + + bridge[Active] = new KDecorationPreviewBridge( this, true ); + bridge[Inactive] = new KDecorationPreviewBridge( this, false ); + + deco[Active] = deco[Inactive] = NULL; + + no_preview = new TQLabel( i18n( "No preview available.\n" + "Most probably there\n" + "was a problem loading the plugin." ), this ); + + no_preview->tqsetAlignment( AlignCenter ); + + setMinimumSize( 100, 100 ); + no_preview->resize( size()); + } + +KDecorationPreview::~KDecorationPreview() + { + for ( int i = 0; i < NumWindows; i++ ) + { + delete deco[i]; + delete bridge[i]; + } + delete options; + } + +bool KDecorationPreview::recreateDecoration( KDecorationPlugins* plugins ) + { + for ( int i = 0; i < NumWindows; i++ ) + { + delete deco[i]; // deletes also window + deco[i] = plugins->createDecoration( bridge[i] ); + deco[i]->init(); + } + + if( deco[Active] == NULL || deco[Inactive] == NULL ) + { + return false; + } + + positionPreviews(); + deco[Inactive]->widget()->show(); + deco[Active]->widget()->show(); + + return true; + } + +void KDecorationPreview::enablePreview() + { + no_preview->hide(); + } + +void KDecorationPreview::disablePreview() + { + delete deco[Active]; + delete deco[Inactive]; + deco[Active] = deco[Inactive] = NULL; + no_preview->show(); + } + +void KDecorationPreview::resizeEvent( TQResizeEvent* e ) + { + TQWidget::resizeEvent( e ); + positionPreviews(); + } + +void KDecorationPreview::positionPreviews() + { + int titleBarHeight, leftBorder, rightBorder, xoffset, + dummy1, dummy2, dummy3; + TQRect geometry; + TQSize size; + + no_preview->resize( this->size() ); + + if ( !deco[Active] || !deco[Inactive] ) + return; + + // don't have more than one reference to the same dummy variable in one borders() call. + deco[Active]->borders( dummy1, dummy2, titleBarHeight, dummy3 ); + deco[Inactive]->borders( leftBorder, rightBorder, dummy1, dummy2 ); + + titleBarHeight = kMin( int( titleBarHeight * .9 ), 30 ); + xoffset = kMin( kMax( 10, TQApplication::reverseLayout() + ? leftBorder : rightBorder ), 30 ); + + // Resize the active window + size = TQSize( width() - xoffset, height() - titleBarHeight ) + .expandedTo( deco[Active]->tqminimumSize() ); + geometry = TQRect( TQPoint( 0, titleBarHeight ), size ); + deco[Active]->widget()->setGeometry( TQStyle::tqvisualRect( geometry, this ) ); + + // Resize the inactive window + size = TQSize( width() - xoffset, height() - titleBarHeight ) + .expandedTo( deco[Inactive]->tqminimumSize() ); + geometry = TQRect( TQPoint( xoffset, 0 ), size ); + deco[Inactive]->widget()->setGeometry( TQStyle::tqvisualRect( geometry, this ) ); + } + +void KDecorationPreview::setPreviewMask( const TQRegion& reg, int mode, bool active ) + { + TQWidget *widget = active ? deco[Active]->widget() : deco[Inactive]->widget(); + + // FRAME duped from client.cpp + if( mode == Unsorted ) + { + XShapeCombineRegion( qt_xdisplay(), widget->winId(), ShapeBounding, 0, 0, + reg.handle(), ShapeSet ); + } + else + { + TQMemArray< TQRect > rects = reg.tqrects(); + XRectangle* xrects = new XRectangle[ rects.count() ]; + for( unsigned int i = 0; + i < rects.count(); + ++i ) + { + xrects[ i ].x = rects[ i ].x(); + xrects[ i ].y = rects[ i ].y(); + xrects[ i ].width = rects[ i ].width(); + xrects[ i ].height = rects[ i ].height(); + } + XShapeCombineRectangles( qt_xdisplay(), widget->winId(), ShapeBounding, 0, 0, + xrects, rects.count(), ShapeSet, mode ); + delete[] xrects; + } + if( active ) + mask = reg; // keep tqshape of the active window for unobscuredRegion() + } + +TQRect KDecorationPreview::windowGeometry( bool active ) const + { + TQWidget *widget = active ? deco[Active]->widget() : deco[Inactive]->widget(); + return widget->geometry(); + } + +void KDecorationPreview::setTempBorderSize(KDecorationPlugins* plugin, KDecorationDefines::BorderSize size) + { + options->setCustomBorderSize(size); + if (plugin->factory()->reset(KDecorationDefines::SettingBorder) ) + { + // can't handle the change, recreate decorations then + recreateDecoration(plugin); + } + else + { + // handles the update, only update position... + positionPreviews(); + } + } + +void KDecorationPreview::setTempButtons(KDecorationPlugins* plugin, bool customEnabled, const TQString &left, const TQString &right) + { + options->setCustomTitleButtonsEnabled(customEnabled); + options->setCustomTitleButtons(left, right); + if (plugin->factory()->reset(KDecorationDefines::SettingButtons) ) + { + // can't handle the change, recreate decorations then + recreateDecoration(plugin); + } + else + { + // handles the update, only update position... + positionPreviews(); + } + } + +TQRegion KDecorationPreview::unobscuredRegion( bool active, const TQRegion& r ) const + { + if( active ) // this one is not obscured + return r; + else + { + // copied from KWin core's code + TQRegion ret = r; + TQRegion r2 = mask; + if( r2.isEmpty()) + r2 = TQRegion( windowGeometry( true )); + r2.translate( windowGeometry( true ).x() - windowGeometry( false ).x(), + windowGeometry( true ).y() - windowGeometry( false ).y()); + ret -= r2; + return ret; + } + } + +KDecorationPreviewBridge::KDecorationPreviewBridge( KDecorationPreview* p, bool a ) + : preview( p ), active( a ) + { + } + +TQWidget* KDecorationPreviewBridge::initialParentWidget() const + { + return preview; + } + +Qt::WFlags KDecorationPreviewBridge::initialWFlags() const + { + return 0; + } + +bool KDecorationPreviewBridge::isActive() const + { + return active; + } + +bool KDecorationPreviewBridge::isCloseable() const + { + return true; + } + +bool KDecorationPreviewBridge::isMaximizable() const + { + return true; + } + +KDecoration::MaximizeMode KDecorationPreviewBridge::maximizeMode() const + { + return KDecoration::MaximizeRestore; + } + +bool KDecorationPreviewBridge::isMinimizable() const + { + return true; + } + +bool KDecorationPreviewBridge::providesContextHelp() const + { + return true; + } + +int KDecorationPreviewBridge::desktop() const + { + return 1; + } + +bool KDecorationPreviewBridge::isModal() const + { + return false; + } + +bool KDecorationPreviewBridge::isShadeable() const + { + return true; + } + +bool KDecorationPreviewBridge::isShade() const + { + return false; + } + +bool KDecorationPreviewBridge::isSetShade() const + { + return false; + } + +bool KDecorationPreviewBridge::keepAbove() const + { + return false; + } + +bool KDecorationPreviewBridge::keepBelow() const + { + return false; + } + +bool KDecorationPreviewBridge::isMovable() const + { + return true; + } + +bool KDecorationPreviewBridge::isResizable() const + { + return true; + } + +NET::WindowType KDecorationPreviewBridge::windowType( unsigned long ) const + { + return NET::Normal; + } + +TQIconSet KDecorationPreviewBridge::icon() const + { + return TQIconSet( KGlobal::iconLoader()->loadIcon( "xapp", KIcon::NoGroup, 16 ), + KGlobal::iconLoader()->loadIcon( "xapp", KIcon::NoGroup, 32 )); + } + +TQString KDecorationPreviewBridge::caption() const + { + return active ? i18n( "Active Window" ) : i18n( "Inactive Window" ); + } + +void KDecorationPreviewBridge::processMousePressEvent( TQMouseEvent* ) + { + } + +void KDecorationPreviewBridge::showWindowMenu( const TQRect &) + { + } + +void KDecorationPreviewBridge::showWindowMenu( TQPoint ) + { + } + +void KDecorationPreviewBridge::performWindowOperation( WindowOperation ) + { + } + +void KDecorationPreviewBridge::setMask( const TQRegion& reg, int mode ) + { + preview->setPreviewMask( reg, mode, active ); + } + +bool KDecorationPreviewBridge::isPreview() const + { + return true; + } + +TQRect KDecorationPreviewBridge::geometry() const + { + return preview->windowGeometry( active ); + } + +TQRect KDecorationPreviewBridge::iconGeometry() const + { + return TQRect(); + } + +TQRegion KDecorationPreviewBridge::unobscuredRegion( const TQRegion& r ) const + { + return preview->unobscuredRegion( active, r ); + } + +TQWidget* KDecorationPreviewBridge::workspaceWidget() const + { + return preview; + } + +WId KDecorationPreviewBridge::windowId() const + { + return 0; // no decorated window + } + +void KDecorationPreviewBridge::closeWindow() + { + } + +void KDecorationPreviewBridge::maximize( MaximizeMode ) + { + } + +void KDecorationPreviewBridge::minimize() + { + } + +void KDecorationPreviewBridge::showContextHelp() + { + } + +void KDecorationPreviewBridge::setDesktop( int ) + { + } + +void KDecorationPreviewBridge::titlebarDblClickOperation() + { + } + +void KDecorationPreviewBridge::titlebarMouseWheelOperation( int ) + { + } + +void KDecorationPreviewBridge::setShade( bool ) + { + } + +void KDecorationPreviewBridge::setKeepAbove( bool ) + { + } + +void KDecorationPreviewBridge::setKeepBelow( bool ) + { + } + +int KDecorationPreviewBridge::currentDesktop() const + { + return 1; + } + +void KDecorationPreviewBridge::helperShowHide( bool ) + { + } + +void KDecorationPreviewBridge::grabXServer( bool ) + { + } + +KDecorationPreviewOptions::KDecorationPreviewOptions() + { + customBorderSize = BordersCount; // invalid + customButtonsChanged = false; // invalid + customButtons = true; + customTitleButtonsLeft = TQString::null; // invalid + customTitleButtonsRight = TQString::null; // invalid + + d = new KDecorationOptionsPrivate; + d->defaultKWinSettings(); + updateSettings(); + } + +KDecorationPreviewOptions::~KDecorationPreviewOptions() + { + delete d; + } + +unsigned long KDecorationPreviewOptions::updateSettings() + { + KConfig cfg( "twinrc", true ); + unsigned long changed = 0; + changed |= d->updateKWinSettings( &cfg ); + + // set custom border size/buttons + if (customBorderSize != BordersCount) + d->border_size = customBorderSize; + if (customButtonsChanged) + d->custom_button_positions = customButtons; + if (customButtons) { + if (!customTitleButtonsLeft.isNull() ) + d->title_buttons_left = customTitleButtonsLeft; + if (!customTitleButtonsRight.isNull() ) + d->title_buttons_right = customTitleButtonsRight; + } else { + d->title_buttons_left = "MS"; + d->title_buttons_right = "HIAX"; + } + + return changed; + } + +void KDecorationPreviewOptions::setCustomBorderSize(BorderSize size) + { + customBorderSize = size; + + updateSettings(); + } + +void KDecorationPreviewOptions::setCustomTitleButtonsEnabled(bool enabled) +{ + customButtonsChanged = true; + customButtons = enabled; + + updateSettings(); +} + +void KDecorationPreviewOptions::setCustomTitleButtons(const TQString &left, const TQString &right) + { + customTitleButtonsLeft = left; + customTitleButtonsRight = right; + + updateSettings(); + } + +bool KDecorationPreviewPlugins::provides( Requirement ) + { + return false; + } + +#include "preview.moc" diff --git a/twin/kcmtwin/twindecoration/preview.h b/twin/kcmtwin/twindecoration/preview.h new file mode 100644 index 000000000..2a753db69 --- /dev/null +++ b/twin/kcmtwin/twindecoration/preview.h @@ -0,0 +1,150 @@ +/* + * + * Copyright (c) 2003 Lubos Lunak <l.lunak@kde.org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef KWINDECORATION_PREVIEW_H +#define KWINDECORATION_PREVIEW_H + +#include <tqwidget.h> +#include <kdecoration_p.h> +#include <kdecoration_plugins_p.h> + +class TQLabel; + +class KDecorationPreviewBridge; +class KDecorationPreviewOptions; + +class KDecorationPreview + : public TQWidget + { + Q_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 + // and an inactive window. + enum Windows { Inactive = 0, Active, NumWindows }; + + KDecorationPreview( TQWidget* parent = NULL, const char* name = NULL ); + virtual ~KDecorationPreview(); + bool recreateDecoration( KDecorationPlugins* plugin ); + void enablePreview(); + void disablePreview(); + void setPreviewMask( const TQRegion&, int, bool ); + TQRegion unobscuredRegion( bool, const TQRegion& ) const; + TQRect windowGeometry( bool ) const; + void setTempBorderSize(KDecorationPlugins* plugin, KDecorationDefines::BorderSize size); + void setTempButtons(KDecorationPlugins* plugin, bool customEnabled, const TQString &left, const TQString &right); + protected: + virtual void resizeEvent( TQResizeEvent* ); + private: + void positionPreviews(); + KDecorationPreviewOptions* options; + KDecorationPreviewBridge* bridge[NumWindows]; + KDecoration* deco[NumWindows]; + TQLabel* no_preview; + TQRegion mask; + }; + +class KDecorationPreviewBridge + : public KDecorationBridge + { + public: + KDecorationPreviewBridge( KDecorationPreview* preview, bool active ); + virtual bool isActive() const; + virtual bool isCloseable() const; + virtual bool isMaximizable() const; + virtual MaximizeMode maximizeMode() const; + virtual bool isMinimizable() const; + virtual bool providesContextHelp() const; + virtual int desktop() const; + virtual bool isModal() const; + virtual bool isShadeable() const; + virtual bool isShade() const; + virtual bool isSetShade() const; + virtual bool keepAbove() const; + virtual bool keepBelow() const; + virtual bool isMovable() const; + virtual bool isResizable() const; + virtual NET::WindowType windowType( unsigned long supported_types ) const; + virtual TQIconSet icon() const; + virtual TQString caption() const; + virtual void processMousePressEvent( TQMouseEvent* ); + virtual void showWindowMenu( const TQRect &); + virtual void showWindowMenu( TQPoint ); + virtual void performWindowOperation( WindowOperation ); + virtual void setMask( const TQRegion&, int ); + virtual bool isPreview() const; + virtual TQRect geometry() const; + virtual TQRect iconGeometry() const; + virtual TQRegion unobscuredRegion( const TQRegion& r ) const; + virtual TQWidget* workspaceWidget() const; + virtual WId windowId() const; + virtual void closeWindow(); + virtual void maximize( MaximizeMode mode ); + virtual void minimize(); + virtual void showContextHelp(); + virtual void setDesktop( int desktop ); + virtual void titlebarDblClickOperation(); + virtual void titlebarMouseWheelOperation( int delta ); + virtual void setShade( bool set ); + virtual void setKeepAbove( bool ); + virtual void setKeepBelow( bool ); + virtual int currentDesktop() const; + virtual TQWidget* initialParentWidget() const; + virtual Qt::WFlags initialWFlags() const; + virtual void helperShowHide( bool show ); + virtual void grabXServer( bool grab ); + private: + KDecorationPreview* preview; + bool active; + }; + +class KDecorationPreviewOptions + : public KDecorationOptions + { + public: + KDecorationPreviewOptions(); + virtual ~KDecorationPreviewOptions(); + virtual unsigned long updateSettings(); + + void setCustomBorderSize(BorderSize size); + void setCustomTitleButtonsEnabled(bool enabled); + void setCustomTitleButtons(const TQString &left, const TQString &right); + + private: + BorderSize customBorderSize; + bool customButtonsChanged; + bool customButtons; + TQString customTitleButtonsLeft; + TQString customTitleButtonsRight; + }; + +class KDecorationPreviewPlugins + : public KDecorationPlugins + { + public: + KDecorationPreviewPlugins( KConfig* cfg ); + virtual bool provides( Requirement ); + }; + +inline KDecorationPreviewPlugins::KDecorationPreviewPlugins( KConfig* cfg ) + : KDecorationPlugins( cfg ) + { + } + +#endif diff --git a/twin/kcmtwin/twindecoration/twindecoration.cpp b/twin/kcmtwin/twindecoration/twindecoration.cpp new file mode 100644 index 000000000..4ef509e5a --- /dev/null +++ b/twin/kcmtwin/twindecoration/twindecoration.cpp @@ -0,0 +1,840 @@ +/* + This is the new twindecoration kcontrol module + + Copyright (c) 2001 + Karol Szwed <gallium@kde.org> + http://gallium.n3.net/ + + Supports new twin configuration plugins, and titlebar button position + modification via dnd interface. + + Based on original "twintheme" (Window Borders) + Copyright (C) 2001 Rik Hemsley (rikkus) <rik@kde.org> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +*/ + +#include <assert.h> +#include <math.h> + +#include <tqdir.h> +#include <tqfileinfo.h> +#include <tqlayout.h> +#include <tqwhatsthis.h> +#include <tqgroupbox.h> +#include <tqcheckbox.h> +#include <tqtabwidget.h> +#include <tqvbox.h> +#include <tqlabel.h> +#include <tqfile.h> +#include <tqslider.h> +#include <tqspinbox.h> + +#include <kapplication.h> +#include <kcolorbutton.h> +#include <kcombobox.h> +#include <kdebug.h> +#include <kdesktopfile.h> +#include <kstandarddirs.h> +#include <kglobal.h> +#include <klocale.h> +#include <kdialog.h> +#include <kgenericfactory.h> +#include <kaboutdata.h> +#include <dcopclient.h> + +#include "twindecoration.h" +#include "preview.h" +#include <kdecoration_plugins_p.h> +#include <kdecorationfactory.h> + +// KCModule plugin interface +// ========================= +typedef KGenericFactory<KWinDecorationModule, TQWidget> KWinDecoFactory; +K_EXPORT_COMPONENT_FACTORY( kcm_twindecoration, KWinDecoFactory("kcmtwindecoration") ) + +KWinDecorationModule::KWinDecorationModule(TQWidget* parent, const char* name, const TQStringList &) + : DCOPObject("KWinClientDecoration"), + KCModule(KWinDecoFactory::instance(), parent, name), + twinConfig("twinrc"), + pluginObject(0) +{ + twinConfig.setGroup("Style"); + plugins = new KDecorationPreviewPlugins( &twinConfig ); + + TQVBoxLayout* layout = new TQVBoxLayout(this, 0, KDialog::spacingHint()); + +// Save this for later... +// cbUseMiniWindows = new TQCheckBox( i18n( "Render mini &titlebars for all windows"), checkGroup ); +// TQWhatsThis::add( cbUseMiniWindows, i18n( "Note that this option is not available on all styles yet!" ) ); + + tabWidget = new TQTabWidget( this ); + layout->addWidget( tabWidget ); + + // Page 1 (General Options) + TQWidget *pluginPage = new TQWidget( tabWidget ); + + TQVBoxLayout* pluginLayout = new TQVBoxLayout(pluginPage, KDialog::marginHint(), KDialog::spacingHint()); + + // decoration chooser + decorationList = new KComboBox( pluginPage ); + TQString whatsThis = i18n("Select the window decoration. This is the look and feel of both " + "the window borders and the window handle."); + TQWhatsThis::add(decorationList, whatsThis); + pluginLayout->addWidget(decorationList); + + TQGroupBox *pluginSettingsGrp = new TQGroupBox( i18n("Decoration Options"), pluginPage ); + pluginSettingsGrp->setColumnLayout( 0, Qt::Vertical ); + pluginSettingsGrp->setFlat( true ); + pluginSettingsGrp->layout()->setMargin( 0 ); + pluginSettingsGrp->layout()->setSpacing( KDialog::spacingHint() ); + pluginLayout->addWidget( pluginSettingsGrp ); + + pluginLayout->addStretch(); + + // Border size chooser + lBorder = new TQLabel (i18n("B&order size:"), pluginSettingsGrp); + cBorder = new TQComboBox(pluginSettingsGrp); + lBorder->setBuddy(cBorder); + TQWhatsThis::add( cBorder, i18n( "Use this combobox to change the border size of the decoration." )); + lBorder->hide(); + cBorder->hide(); + TQHBoxLayout *borderSizeLayout = new TQHBoxLayout(pluginSettingsGrp->tqlayout() ); + borderSizeLayout->addWidget(lBorder); + borderSizeLayout->addWidget(cBorder); + borderSizeLayout->addStretch(); + + pluginConfigWidget = new TQVBox(pluginSettingsGrp); + pluginSettingsGrp->tqlayout()->add( pluginConfigWidget ); + + // Page 2 (Button Selector) + TQWidget* buttonPage = new TQWidget( tabWidget ); + TQVBoxLayout* buttonLayout = new TQVBoxLayout(buttonPage, KDialog::marginHint(), KDialog::spacingHint()); + + cbShowToolTips = new TQCheckBox( + i18n("&Show window button tooltips"), buttonPage ); + TQWhatsThis::add( cbShowToolTips, + i18n( "Enabling this checkbox will show window button tooltips. " + "If this checkbox is off, no window button tooltips will be shown.")); + + cbUseCustomButtonPositions = new TQCheckBox( + i18n("Use custom titlebar button &positions"), buttonPage ); + TQWhatsThis::add( cbUseCustomButtonPositions, + i18n( "The appropriate settings can be found in the \"Buttons\" Tab; " + "please note that this option is not available on all styles yet." ) ); + + buttonLayout->addWidget( cbShowToolTips ); + buttonLayout->addWidget( cbUseCustomButtonPositions ); + + // Add nifty dnd button modification widgets + buttonPositionWidget = new ButtonPositionWidget(buttonPage, "button_position_widget"); + buttonPositionWidget->setDecorationFactory(plugins->factory() ); + TQHBoxLayout* buttonControlLayout = new TQHBoxLayout(buttonLayout); + buttonControlLayout->addSpacing(20); + buttonControlLayout->addWidget(buttonPositionWidget); +// buttonLayout->addStretch(); + + // preview + TQVBoxLayout* previewLayout = new TQVBoxLayout(layout, KDialog::spacingHint() ); + previewLayout->setMargin( KDialog::marginHint() ); + + preview = new KDecorationPreview( this ); + previewLayout->addWidget(preview); + + preview->tqsetSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Expanding); + tabWidget->tqsetSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Maximum); + + // Page 3 (Window Shadows) + TQHBox *inactiveShadowColourHBox, *shadowColourHBox; + TQHBox *inactiveShadowOpacityHBox, *shadowOpacityHBox; + TQHBox *inactiveShadowXOffsetHBox, *shadowXOffsetHBox; + TQHBox *inactiveShadowYOffsetHBox, *shadowYOffsetHBox; + TQHBox *inactiveShadowThicknessHBox, *shadowThicknessHBox; + TQLabel *inactiveShadowColourLabel, *shadowColourLabel; + TQLabel *inactiveShadowOpacityLabel, *shadowOpacityLabel; + TQLabel *inactiveShadowXOffsetLabel, *shadowXOffsetLabel; + TQLabel *inactiveShadowYOffsetLabel, *shadowYOffsetLabel; + TQLabel *inactiveShadowThicknessLabel, *shadowThicknessLabel; + + shadowPage = new TQVBox(tabWidget); + shadowPage->setSpacing(KDialog::spacingHint()); + shadowPage->setMargin(KDialog::marginHint()); + + cbWindowShadow = new TQCheckBox( + i18n("&Draw a drop shadow under windows"), shadowPage); + TQWhatsThis::add(cbWindowShadow, + 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, + i18n("Active Window Shadow"), shadowPage); + inactiveShadowSettings = new TQGroupBox(1, Qt::Horizontal, + i18n("Inactive Window Shadows"), shadowPage); + whichShadowSettings = new TQGroupBox(3, Qt::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())); + cbShadowOverrides = new TQCheckBox(i18n("O&verride windows"), + whichShadowSettings); + connect(cbShadowOverrides, TQT_SIGNAL(toggled(bool)), + TQT_SLOT(slotSelectionChanged())); + cbShadowTopMenus = new TQCheckBox(i18n("&Top menu"), + whichShadowSettings); + connect(cbShadowTopMenus, TQT_SIGNAL(toggled(bool)), + TQT_SLOT(slotSelectionChanged())); + cbInactiveShadow = new TQCheckBox( + i18n("Draw shadow under &inactive windows"), inactiveShadowSettings); + connect(cbInactiveShadow, TQT_SIGNAL(toggled(bool)), + TQT_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())); + + 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())); + + shadowOpacityHBox = new TQHBox(activeShadowSettings); + shadowOpacityHBox->setSpacing(KDialog::spacingHint()); + shadowOpacityLabel = new TQLabel(i18n("Maximum opacity:"), shadowOpacityHBox); + shadowOpacitySlider = new TQSlider(1, 100, 10, 50, Qt::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())); + + inactiveShadowOpacityHBox = new TQHBox(inactiveShadowSettings); + inactiveShadowOpacityHBox->setSpacing(KDialog::spacingHint()); + inactiveShadowOpacityLabel = new TQLabel(i18n("Maximum opacity:"), + inactiveShadowOpacityHBox); + inactiveShadowOpacitySlider = new TQSlider(1, 100, 10, 50, Qt::Horizontal, + inactiveShadowOpacityHBox); + inactiveShadowOpacitySlider->setTickmarks(TQSlider::Below); + inactiveShadowOpacitySlider->setTickInterval(10); + inactiveShadowOpacitySpinBox = new TQSpinBox(1, 100, 1, + inactiveShadowOpacityHBox); + inactiveShadowOpacitySpinBox->setSuffix(" %"); + connect(inactiveShadowOpacitySlider, TQT_SIGNAL(valueChanged(int)), + inactiveShadowOpacitySpinBox, + TQT_SLOT(setValue(int))); + connect(inactiveShadowOpacitySpinBox, TQT_SIGNAL(valueChanged(int)), + inactiveShadowOpacitySlider, + TQT_SLOT(setValue(int))); + connect(inactiveShadowOpacitySlider, TQT_SIGNAL(valueChanged(int)), + TQT_SLOT(slotSelectionChanged())); + + shadowXOffsetHBox = new TQHBox(activeShadowSettings); + shadowXOffsetHBox->setSpacing(KDialog::spacingHint()); + shadowXOffsetLabel = new TQLabel( + i18n("Offset rightward (may be negative):"), + shadowXOffsetHBox); + shadowXOffsetSpinBox = new TQSpinBox(-1024, 1024, 1, shadowXOffsetHBox); + shadowXOffsetSpinBox->setSuffix(i18n(" pixels")); + connect(shadowXOffsetSpinBox, TQT_SIGNAL(valueChanged(int)), + TQT_SLOT(slotSelectionChanged())); + + inactiveShadowXOffsetHBox = new TQHBox(inactiveShadowSettings); + inactiveShadowXOffsetHBox->setSpacing(KDialog::spacingHint()); + inactiveShadowXOffsetLabel = new TQLabel( + i18n("Offset rightward (may be negative):"), + inactiveShadowXOffsetHBox); + inactiveShadowXOffsetSpinBox = new TQSpinBox(-1024, 1024, 1, + inactiveShadowXOffsetHBox); + inactiveShadowXOffsetSpinBox->setSuffix(i18n(" pixels")); + connect(inactiveShadowXOffsetSpinBox, TQT_SIGNAL(valueChanged(int)), + TQT_SLOT(slotSelectionChanged())); + + shadowYOffsetHBox = new TQHBox(activeShadowSettings); + shadowYOffsetHBox->setSpacing(KDialog::spacingHint()); + shadowYOffsetLabel = new TQLabel( + i18n("Offset downward (may be negative):"), + shadowYOffsetHBox); + shadowYOffsetSpinBox = new TQSpinBox(-1024, 1024, 1, shadowYOffsetHBox); + shadowYOffsetSpinBox->setSuffix(i18n(" pixels")); + connect(shadowYOffsetSpinBox, TQT_SIGNAL(valueChanged(int)), + TQT_SLOT(slotSelectionChanged())); + + inactiveShadowYOffsetHBox = new TQHBox(inactiveShadowSettings); + inactiveShadowYOffsetHBox->setSpacing(KDialog::spacingHint()); + inactiveShadowYOffsetLabel = new TQLabel( + i18n("Offset downward (may be negative):"), + inactiveShadowYOffsetHBox); + inactiveShadowYOffsetSpinBox = new TQSpinBox(-1024, 1024, 1, + inactiveShadowYOffsetHBox); + inactiveShadowYOffsetSpinBox->setSuffix(i18n(" pixels")); + connect(inactiveShadowYOffsetSpinBox, TQT_SIGNAL(valueChanged(int)), + TQT_SLOT(slotSelectionChanged())); + + shadowThicknessHBox = new TQHBox(activeShadowSettings); + shadowThicknessHBox->setSpacing(KDialog::spacingHint()); + shadowThicknessLabel = new TQLabel( + i18n("Thickness to either side of window:"), + shadowThicknessHBox); + shadowThicknessSpinBox = new TQSpinBox(1, 100, 1, + shadowThicknessHBox); + shadowThicknessSpinBox->setSuffix(i18n(" pixels")); + connect(shadowThicknessSpinBox, TQT_SIGNAL(valueChanged(int)), + TQT_SLOT(slotSelectionChanged())); + + inactiveShadowThicknessHBox = new TQHBox(inactiveShadowSettings); + inactiveShadowThicknessHBox->setSpacing(KDialog::spacingHint()); + inactiveShadowThicknessLabel = new TQLabel( + i18n("Thickness to either side of window:"), + inactiveShadowThicknessHBox); + inactiveShadowThicknessSpinBox = new TQSpinBox(1, 100, 1, + inactiveShadowThicknessHBox); + inactiveShadowThicknessSpinBox->setSuffix(i18n(" pixels")); + connect(inactiveShadowThicknessSpinBox, TQT_SIGNAL(valueChanged(int)), + TQT_SLOT(slotSelectionChanged())); + + // Load all installed decorations into memory + // Set up the decoration lists and other UI settings + findDecorations(); + createDecorationList(); + readConfig( &twinConfig ); + resetPlugin( &twinConfig ); + + tabWidget->insertTab( pluginPage, i18n("&Window Decoration") ); + tabWidget->insertTab( buttonPage, i18n("&Buttons") ); + tabWidget->insertTab( shadowPage, i18n("&Shadows") ); + + 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()) ); + + // Allow twin dcop signal to update our selection list + connectDCOPSignal("twin", 0, "dcopResetAllClients()", "dcopUpdateClientList()", false); + + KAboutData *about = + new KAboutData(I18N_NOOP("kcmtwindecoration"), + I18N_NOOP("Window Decoration Control Module"), + 0, 0, KAboutData::License_GPL, + I18N_NOOP("(c) 2001 Karol Szwed")); + about->addAuthor("Karol Szwed", 0, "gallium@kde.org"); + setAboutData(about); +} + + +KWinDecorationModule::~KWinDecorationModule() +{ + delete preview; // needs to be destroyed before plugins + delete plugins; +} + + +// Find all theme desktop files in all 'data' dirs owned by twin. +// And insert these into a DecorationInfo structure +void KWinDecorationModule::findDecorations() +{ + TQStringList dirList = KGlobal::dirs()->findDirs("data", "twin"); + TQStringList::ConstIterator it; + + for (it = dirList.begin(); it != dirList.end(); it++) + { + TQDir d(*it); + if (d.exists()) + for (TQFileInfoListIterator it(*d.entryInfoList()); it.current(); ++it) + { + TQString filename(it.current()->absFilePath()); + if (KDesktopFile::isDesktopFile(filename)) + { + KDesktopFile desktopFile(filename); + TQString libName = desktopFile.readEntry("X-KDE-Library"); + + if (!libName.isEmpty() && libName.startsWith( "twin3_" )) + { + DecorationInfo di; + di.name = desktopFile.readName(); + di.libraryName = libName; + decorations.append( di ); + } + } + } + } +} + + +// Fills the decorationList with a list of available twin decorations +void KWinDecorationModule::createDecorationList() +{ + TQValueList<DecorationInfo>::ConstIterator it; + + // Sync with twin hardcoded KDE2 style which has no desktop item + TQStringList decorationNames; + decorationNames.append( i18n("KDE 2") ); + for (it = decorations.begin(); it != decorations.end(); ++it) + { + decorationNames.append((*it).name); + } + decorationNames.sort(); + decorationList->insertStringList(decorationNames); +} + + +// Reset the decoration plugin to what the user just selected +void KWinDecorationModule::slotChangeDecoration( const TQString & text) +{ + KConfig twinConfig("twinrc"); + twinConfig.setGroup("Style"); + + // Let the user see config options for the currently selected decoration + resetPlugin( &twinConfig, text ); +} + + +// This is the selection handler setting +void KWinDecorationModule::slotSelectionChanged() +{ + emit KCModule::changed(true); +} + +static const char* const border_names[ KDecorationDefines::BordersCount ] = + { + I18N_NOOP( "Tiny" ), + I18N_NOOP( "Normal" ), + I18N_NOOP( "Large" ), + I18N_NOOP( "Very Large" ), + I18N_NOOP( "Huge" ), + I18N_NOOP( "Very Huge" ), + I18N_NOOP( "Oversized" ) + }; + +int KWinDecorationModule::borderSizeToIndex( BorderSize size, TQValueList< BorderSize > sizes ) +{ + int pos = 0; + for( TQValueList< BorderSize >::ConstIterator it = sizes.begin(); + it != sizes.end(); + ++it, ++pos ) + if( size <= *it ) + break; + return pos; +} + +KDecorationDefines::BorderSize KWinDecorationModule::indexToBorderSize( int index, + TQValueList< BorderSize > sizes ) +{ + TQValueList< BorderSize >::ConstIterator it = sizes.begin(); + for(; + it != sizes.end(); + ++it, --index ) + if( index == 0 ) + break; + return *it; +} + +void KWinDecorationModule::slotBorderChanged( int size ) +{ + if( lBorder->isHidden()) + return; + emit KCModule::changed( true ); + TQValueList< BorderSize > sizes; + if( plugins->factory() != NULL ) + sizes = plugins->factory()->borderSizes(); + assert( sizes.count() >= 2 ); + border_size = indexToBorderSize( size, sizes ); + + // update preview + preview->setTempBorderSize(plugins, border_size); +} + +void KWinDecorationModule::slotButtonsChanged() +{ + // update preview + preview->setTempButtons(plugins, cbUseCustomButtonPositions->isChecked(), buttonPositionWidget->buttonsLeft(), buttonPositionWidget->buttonsRight() ); +} + +TQString KWinDecorationModule::decorationName( TQString& libName ) +{ + TQString decoName; + + TQValueList<DecorationInfo>::Iterator it; + for( it = decorations.begin(); it != decorations.end(); ++it ) + if ( (*it).libraryName == libName ) + { + decoName = (*it).name; + break; + } + + return decoName; +} + + +TQString KWinDecorationModule::decorationLibName( const TQString& name ) +{ + TQString libName; + + // Find the corresponding library name to that of + // the current plugin name + TQValueList<DecorationInfo>::Iterator it; + for( it = decorations.begin(); it != decorations.end(); ++it ) + if ( (*it).name == name ) + { + libName = (*it).libraryName; + break; + } + + if (libName.isEmpty()) + libName = "twin_default"; // KDE 2 + + return libName; +} + + +// Loads/unloads and inserts the decoration config plugin into the +// pluginConfigWidget, allowing for dynamic configuration of decorations +void KWinDecorationModule::resetPlugin( KConfig* conf, const TQString& currentDecoName ) +{ + // Config names are "twin_icewm_config" + // for "twin3_icewm" twin client + + TQString oldName = styleToConfigLib( oldLibraryName ); + + TQString currentName; + if (!currentDecoName.isEmpty()) + currentName = decorationLibName( currentDecoName ); // Use what the user selected + else + currentName = currentLibraryName; // Use what was read from readConfig() + + if( plugins->loadPlugin( currentName ) + && preview->recreateDecoration( plugins )) + preview->enablePreview(); + else + preview->disablePreview(); + plugins->destroyPreviousPlugin(); + + checkSupportedBorderSizes(); + + // inform buttonPositionWidget about the new factory... + buttonPositionWidget->setDecorationFactory(plugins->factory() ); + + currentName = styleToConfigLib( currentName ); + + // Delete old plugin widget if it exists + delete pluginObject; + pluginObject = 0; + + // Use klibloader for library manipulation + KLibLoader* loader = KLibLoader::self(); + + // Free the old library if possible + if (!oldLibraryName.isNull()) + loader->unloadLibrary( TQFile::encodeName(oldName) ); + + KLibrary* library = loader->library( TQFile::encodeName(currentName) ); + if (library != NULL) + { + void* alloc_ptr = library->symbol("allocate_config"); + + if (alloc_ptr != NULL) + { + allocatePlugin = (TQObject* (*)(KConfig* conf, TQWidget* parent))alloc_ptr; + 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(KConfig*)), pluginObject, TQT_SLOT(load(KConfig*)) ); + connect( this, TQT_SIGNAL(pluginSave(KConfig*)), pluginObject, TQT_SLOT(save(KConfig*)) ); + connect( this, TQT_SIGNAL(pluginDefaults()), pluginObject, TQT_SLOT(defaults()) ); + pluginConfigWidget->show(); + return; + } + } + + pluginConfigWidget->hide(); +} + + +// Reads the twin config settings, and sets all UI controls to those settings +// Updating the config plugin if required +void KWinDecorationModule::readConfig( KConfig* conf ) +{ + // General tab + // ============ + cbShowToolTips->setChecked( conf->readBoolEntry("ShowToolTips", true )); +// cbUseMiniWindows->setChecked( conf->readBoolEntry("MiniWindowBorders", false)); + + // Find the corresponding decoration name to that of + // the current plugin library name + + oldLibraryName = currentLibraryName; + currentLibraryName = conf->readEntry("PluginLib", + ((TQPixmap::defaultDepth() > 8) ? "twin_plastik" : "twin_quartz")); + TQString decoName = decorationName( currentLibraryName ); + + // If we are using the "default" kde client, use the "default" entry. + if (decoName.isEmpty()) + decoName = i18n("KDE 2"); + + int numDecos = decorationList->count(); + for (int i = 0; i < numDecos; ++i) + { + if (decorationList->text(i) == decoName) + { + decorationList->setCurrentItem(i); + break; + } + } + + // Buttons tab + // ============ + bool customPositions = conf->readBoolEntry("CustomButtonPositions", false); + cbUseCustomButtonPositions->setChecked( customPositions ); + buttonPositionWidget->setEnabled( customPositions ); + // Menu and onAllDesktops buttons are default on LHS + buttonPositionWidget->setButtonsLeft( conf->readEntry("ButtonsOnLeft", "MS") ); + // Help, Minimize, Maximize and Close are default on RHS + buttonPositionWidget->setButtonsRight( conf->readEntry("ButtonsOnRight", "HIAX") ); + + int bsize = conf->readNumEntry( "BorderSize", BorderNormal ); + if( bsize >= BorderTiny && bsize < BordersCount ) + border_size = static_cast< BorderSize >( bsize ); + else + border_size = BorderNormal; + checkSupportedBorderSizes(); + + // Shadows tab + // =========== + bool shadowEnabled = conf->readBoolEntry("ShadowEnabled", false); + cbWindowShadow->setChecked(shadowEnabled); + activeShadowSettings->setEnabled(shadowEnabled); + inactiveShadowSettings->setEnabled(shadowEnabled); + whichShadowSettings->setEnabled(shadowEnabled); + shadowColourButton->setColor(conf->readColorEntry("ShadowColour", &TQt::black)); + shadowOpacitySlider->setValue((int)ceil(conf->readDoubleNumEntry("ShadowOpacity", 0.70) * 100)); + shadowXOffsetSpinBox->setValue(conf->readNumEntry("ShadowXOffset", 0)); + shadowYOffsetSpinBox->setValue(conf->readNumEntry("ShadowYOffset", 10)); + cbShadowDocks->setChecked(conf->readBoolEntry("ShadowDocks", false)); + cbShadowOverrides->setChecked(conf->readBoolEntry("ShadowOverrides", false)); + cbShadowTopMenus->setChecked(conf->readBoolEntry("ShadowTopMenus", false)); + shadowThicknessSpinBox->setValue(conf->readNumEntry("ShadowThickness", 10)); + cbInactiveShadow->setChecked(conf->readBoolEntry("InactiveShadowEnabled", false)); + inactiveShadowColourButton->setColor(conf->readColorEntry("InactiveShadowColour", &TQt::black)); + inactiveShadowOpacitySlider->setValue((int)ceil(conf->readDoubleNumEntry("InactiveShadowOpacity", 0.70) * 100)); + inactiveShadowXOffsetSpinBox->setValue(conf->readNumEntry("InactiveShadowXOffset", 0)); + inactiveShadowYOffsetSpinBox->setValue(conf->readNumEntry("InactiveShadowYOffset", 5)); + inactiveShadowThicknessSpinBox->setValue(conf->readNumEntry("InactiveShadowThickness", 5)); + + emit KCModule::changed(false); +} + + +// Writes the selected user configuration to the twin config file +void KWinDecorationModule::writeConfig( KConfig* conf ) +{ + TQString name = decorationList->currentText(); + TQString libName = decorationLibName( name ); + + KConfig twinConfig("twinrc"); + twinConfig.setGroup("Style"); + + // General settings + conf->writeEntry("PluginLib", libName); + conf->writeEntry("CustomButtonPositions", cbUseCustomButtonPositions->isChecked()); + conf->writeEntry("ShowToolTips", cbShowToolTips->isChecked()); +// conf->writeEntry("MiniWindowBorders", cbUseMiniWindows->isChecked()); + + // Button settings + conf->writeEntry("ButtonsOnLeft", buttonPositionWidget->buttonsLeft() ); + conf->writeEntry("ButtonsOnRight", buttonPositionWidget->buttonsRight() ); + conf->writeEntry("BorderSize", border_size ); + + // Shadow settings + conf->writeEntry("ShadowEnabled", cbWindowShadow->isChecked()); + conf->writeEntry("ShadowColour", shadowColourButton->color()); + conf->writeEntry("ShadowOpacity", shadowOpacitySlider->value() / 100.0); + conf->writeEntry("ShadowXOffset", shadowXOffsetSpinBox->value()); + conf->writeEntry("ShadowYOffset", shadowYOffsetSpinBox->value()); + conf->writeEntry("ShadowThickness", shadowThicknessSpinBox->value()); + conf->writeEntry("ShadowDocks", cbShadowDocks->isChecked()); + conf->writeEntry("ShadowOverrides", cbShadowOverrides->isChecked()); + conf->writeEntry("ShadowTopMenus", cbShadowTopMenus->isChecked()); + conf->writeEntry("InactiveShadowEnabled", cbInactiveShadow->isChecked()); + conf->writeEntry("InactiveShadowColour", inactiveShadowColourButton->color()); + conf->writeEntry("InactiveShadowOpacity", + inactiveShadowOpacitySlider->value() / 100.0); + conf->writeEntry("InactiveShadowXOffset", + inactiveShadowXOffsetSpinBox->value()); + conf->writeEntry("InactiveShadowYOffset", + inactiveShadowYOffsetSpinBox->value()); + conf->writeEntry("InactiveShadowThickness", + inactiveShadowThicknessSpinBox->value()); + + oldLibraryName = currentLibraryName; + currentLibraryName = libName; + + // We saved, so tell kcmodule that there have been no new user changes made. + emit KCModule::changed(false); +} + + +void KWinDecorationModule::dcopUpdateClientList() +{ + // Changes the current active ListBox item, and + // Loads a new plugin configuration tab if required. + KConfig twinConfig("twinrc"); + twinConfig.setGroup("Style"); + + readConfig( &twinConfig ); + resetPlugin( &twinConfig ); +} + + +// Virutal functions required by KCModule +void KWinDecorationModule::load() +{ + KConfig twinConfig("twinrc"); + twinConfig.setGroup("Style"); + + // Reset by re-reading the config + readConfig( &twinConfig ); + resetPlugin( &twinConfig ); +} + + +void KWinDecorationModule::save() +{ + KConfig twinConfig("twinrc"); + twinConfig.setGroup("Style"); + + writeConfig( &twinConfig ); + emit pluginSave( &twinConfig ); + + twinConfig.sync(); + resetKWin(); + // resetPlugin() will get called via the above DCOP function +} + + +void KWinDecorationModule::defaults() +{ + // Set the KDE defaults + cbUseCustomButtonPositions->setChecked( false ); + buttonPositionWidget->setEnabled( false ); + cbShowToolTips->setChecked( true ); + cbWindowShadow->setChecked( false ); +// cbUseMiniWindows->setChecked( false); +// Don't set default for now +// decorationList->setSelected( +// decorationList->findItem( i18n("KDE 2") ), true ); // KDE classic client + + buttonPositionWidget->setButtonsLeft("MS"); + buttonPositionWidget->setButtonsRight("HIAX"); + + border_size = BorderNormal; + checkSupportedBorderSizes(); + + shadowColourButton->setColor(Qt::black); + shadowOpacitySlider->setValue(70); + shadowXOffsetSpinBox->setValue(0); + shadowYOffsetSpinBox->setValue(10); + shadowThicknessSpinBox->setValue(10); + cbShadowDocks->setChecked(false); + cbShadowOverrides->setChecked(false); + cbShadowTopMenus->setChecked(false); + cbInactiveShadow->setChecked(false); + inactiveShadowColourButton->setColor(Qt::black); + inactiveShadowOpacitySlider->setValue(70); + inactiveShadowXOffsetSpinBox->setValue(0); + inactiveShadowYOffsetSpinBox->setValue(5); + inactiveShadowThicknessSpinBox->setValue(5); + + // Set plugin defaults + emit pluginDefaults(); +} + +void KWinDecorationModule::checkSupportedBorderSizes() +{ + TQValueList< BorderSize > sizes; + if( plugins->factory() != NULL ) + sizes = plugins->factory()->borderSizes(); + if( sizes.count() < 2 ) { + lBorder->hide(); + cBorder->hide(); + } else { + cBorder->clear(); + for (TQValueList<BorderSize>::const_iterator it = sizes.begin(); it != sizes.end(); ++it) { + BorderSize size = *it; + cBorder->insertItem(i18n(border_names[size]), borderSizeToIndex(size,sizes) ); + } + int pos = borderSizeToIndex( border_size, sizes ); + lBorder->show(); + cBorder->show(); + cBorder->setCurrentItem(pos); + slotBorderChanged( pos ); + } +} + +TQString KWinDecorationModule::styleToConfigLib( TQString& styleLib ) +{ + if( styleLib.startsWith( "twin3_" )) + return "twin_" + styleLib.mid( 6 ) + "_config"; + else + return styleLib + "_config"; +} + +TQString KWinDecorationModule::quickHelp() const +{ + return i18n( "<h1>Window Manager Decoration</h1>" + "<p>This module allows you to choose the window border decorations, " + "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>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>" ); +} + + +void KWinDecorationModule::resetKWin() +{ + bool ok = kapp->dcopClient()->send("twin*", "KWinInterface", + "reconfigure()", TQByteArray()); + if (!ok) + kdDebug() << "kcmtwindecoration: Could not reconfigure twin" << endl; +} + +#include "twindecoration.moc" +// vim: ts=4 +// kate: space-indent off; tab-width 4; + diff --git a/twin/kcmtwin/twindecoration/twindecoration.desktop b/twin/kcmtwin/twindecoration/twindecoration.desktop new file mode 100644 index 000000000..dc1e55ef6 --- /dev/null +++ b/twin/kcmtwin/twindecoration/twindecoration.desktop @@ -0,0 +1,231 @@ +[Desktop Entry] +Exec=kcmshell twindecoration +Icon=kcmkwm +Type=Application +DocPath=kcontrol/twindecoration/index.html + +X-KDE-ModuleType=Library +X-KDE-Library=twindecoration +X-KDE-FactoryName=twindecoration + +Name=Window Decorations +Name[af]=Venster Versierings +Name[ar]=زخرفة النافذة +Name[be]=Дэкарацыі вокнаў +Name[bg]=Декорация +Name[bn]=উইণ্ডো সাজসজ্জা +Name[br]=Kinkladur ar prenester +Name[bs]=Ukrasi prozora +Name[ca]=Decoració de les finestres +Name[cs]=Dekorace oken +Name[csb]=Dekòracëje òkna +Name[cy]=Addurniadau Ffenestr +Name[da]=Vinduesdekorationer +Name[de]=Fensterdekorationen +Name[el]=Διακοσμήσεις παραθύρων +Name[eo]=Fenestro-ornamaĵo +Name[es]=Decoración de ventanas +Name[et]=Akna dekoratsioonid +Name[eu]=Leihoaren dekorazioak +Name[fa]=تزئینات پنجره +Name[fi]=Ikkunoiden kehykset +Name[fr]=Décoration des fenêtres +Name[fy]=Finsterdekoraasjes +Name[gl]=Decoracións das Fiestras +Name[he]=קישוטי חלונות +Name[hi]=विंडो सजावट +Name[hr]=Ukrasi prozora +Name[hu]=Ablakkeret-stílus +Name[id]=Dekorasi Jendela +Name[is]=Gluggaskreytingar +Name[it]=Decorazioni finestra +Name[ja]=ウィンドウ装飾 +Name[ka]=ფანჯრის დეკორაცია +Name[kk]=Терезе безендіруі +Name[km]=ការតុបតែងបង្អួច +Name[ko]=창 종료 도구 +Name[lo]=ການຕົກແຕ່ງຫນ້າຕ່າງ +Name[lt]=Langų išvaizda +Name[lv]=Loga Dekorācijas +Name[mk]=Декорации на прозорците +Name[mn]=Цонхны засал +Name[mt]=Dekorazzjoni tal-Windows +Name[nb]=Vinduspynt +Name[nds]=Finsterdekoratschoon +Name[ne]=सञ्झ्याल सजावट +Name[nl]=Vensterdecoraties +Name[nn]=Vindaugsdekorasjonar +Name[nso]=Dikgabiso tsa Window +Name[pa]=ਝਰੋਖਾ ਸਜਾਵਟ +Name[pl]=Dekoracje okna +Name[pt]=Decorações das Janelas +Name[pt_BR]=Decorações da Janela +Name[ro]=Decorări +Name[ru]=Декорации окон +Name[rw]=Imitako y'Idirishya +Name[se]=Lásehearvvat +Name[sk]=Dekorácie okien +Name[sl]=Okraski oken +Name[sr]=Декорација прозора +Name[sr@Latn]=Dekoracija prozora +Name[ss]=Kuhlotjiswa kweliwindi +Name[sv]=Fönsterdekoration +Name[ta]=சாளர அலங்கரிப்புகள் +Name[tg]=Декоратсияҳои тиреза +Name[th]=ตกแต่งหน้าต่าง +Name[tr]=Pencere Dekorasyonları +Name[tt]=Täräzä Bizäge +Name[uk]=Обрамлення вікон +Name[uz]=Oynaning bezaklari +Name[uz@cyrillic]=Ойнанинг безаклари +Name[ven]=U khavhisedza ha windo +Name[vi]=Trang trí Cửa sổ +Name[wa]=Gåliotaedjes des purneas +Name[xh]=Izihombiso zeWindow +Name[zh_CN]=窗口装饰 +Name[zh_TW]=視窗裝飾 +Name[zu]=Imihlobiso ye-window + +Comment=Configure the look and feel of window titles +Comment[af]=Stel die uitdrukking en gevoek van venster titels op +Comment[ar]=إعداد شكل و ملمس عنوان النافذة +Comment[be]=Настаўленні вонкавага выгляду загалоўкаў вокнаў +Comment[bg]=Настройване външния вид на прозорците +Comment[bn]=উইণ্ডো শিরোনামের চেহারা কনফিগার করুন +Comment[br]=Kefluniañ neuz ha feson titloù ar prenester +Comment[bs]=Ovdje možete podesiti izgled i ponašanje naslova prozora +Comment[ca]=Configura l'aspecte i efecte dels títols de la finestra +Comment[cs]=Nastavení vzhledu a dekorací oken +Comment[csb]=Kònfigùracëjô wëzdrzatkù ë ùchòwaniô titlowi lëstwë òknów +Comment[cy]=Ffurfweddu golwg a theimlad teitlau ffenestri +Comment[da]=Indstil udseendet af vinduestitler +Comment[de]=Das Erscheinungsbild von Fenstertiteln festlegen +Comment[el]=Ρυθμίστε την εμφάνιση και την αίσθηση των τίτλων παραθύρου +Comment[eo]=Agordu la fenestrajn titolojn +Comment[es]=Configuración del aspecto y comportamiento de los títulos de las ventanas +Comment[et]=Akna tiitliribade välimuse ja tunnetuse seadistamine +Comment[eu]=Konfiguratu leihoaren izenburuen itxura +Comment[fa]=پیکربندی ظاهر و احساس عنوان پنجرهها +Comment[fi]=Muokkaa ikkunoiden kehysten ulkonäköä +Comment[fr]=Configuration de l'apparence du titre des fenêtres +Comment[fy]=Hjir kinne jo it uterlik en gedrach fan finstertitels ynstelle +Comment[gl]=Configurar a apariencia dos títulos das fiestras +Comment[he]=שינוי הגדרות המראה והתחושה של כותרות חלונות +Comment[hi]=विंडो शीर्षकों के रूप आकार को कॉन्फ़िगर करें +Comment[hr]=Konfiguriranje izgleda naslova prozora +Comment[hu]=Az ablakok címsorának megjelenési beállításai +Comment[is]=Stilla viðmót gluggatitla +Comment[it]=Configura l'aspetto e il comportamento dei titoli delle finestre +Comment[ja]=ウィンドウのタイトルバーの外観を設定 +Comment[ka]=ფანჯრის სათაურის იერსახის კონფიგურაცია +Comment[kk]=Терезе айдарының безендіруін баптау +Comment[km]=កំណត់រចនាសម្ព័ន្ធរូបរាងរបស់ចំណងជើងបង្អួច +Comment[ko]=창 제목 표시줄의 모습과 느낌 설정 +Comment[lo]=ປັດແຕ່ງລັກສະນະແລະຄວາມຮູ້ສືກໃນການໃຊ້ງານຂອງບາວເຊີ Konqueror +Comment[lt]=Konfigūruoti langų antraščių išvaizdą ir elgseną +Comment[lv]=Konfigurē loga virsrakstu izskatu un izturēšanos +Comment[mk]=Конфигурирајте го изгледот и чувството на насловите на прозорците +Comment[mn]=Цонхны толгойн харагдалтыг тохируулах +Comment[mt]=Ikkonfigura d-dehra u l-użu tat-titli tal-windows +Comment[nb]=Her kan du sette opp hvordan nettleseren Konqueror skal virke og se ut +Comment[nds]=Dat Utsehn vun de Finstertiteln instellen +Comment[ne]=सञ्झ्याल शीर्षकहरूको हेराइ र बुझाइ कन्फिगर गर्नुहोस् +Comment[nl]=Hier kunt u het uiterlijk en gedrag van venstertitels instellen +Comment[nn]=Set opp utsjånaden på vindaugstitlar +Comment[nso]=Beakanya pogego le maikutlo a maina a window +Comment[pa]=ਝਰੋਖਾ ਸਿਰਲੇਖਾਂ ਦੇ ਰੰਗ-ਰੂਪ ਦੀ ਸੰਰਚਨਾ +Comment[pl]=Konfiguracja wyglądu i zachowania belek tytułowych okien +Comment[pt]=Configuração da aparência e comportamento dos títulos das janelas +Comment[pt_BR]=Configura a aparência dos títulos de janelas +Comment[ro]=Configurează aspectul titlului ferestrelor +Comment[ru]=Настройка внешнего вида заголовков окон +Comment[rw]=Kuboneza imboneko n'ukumva kw'imitwe y'idirishya +Comment[se]=Heivet lásenamahusaid fárdda +Comment[sk]=Nastavenie vzhľadu titulkov okien +Comment[sl]=Nastavite videz in delovanje naslovnih vrstic okna. +Comment[sr]=Подешавање изгледа и осећаја насловних линија прозора +Comment[sr@Latn]=Podešavanje izgleda i osećaja naslovnih linija prozora +Comment[sv]=Anpassa namnlisternas utseende och känsla +Comment[ta]=சாளரம் மற்றும் தலைப்பின் காட்சிவகையை மாற்று +Comment[tg]=Танзими намо ва ҳиси унвони тиреза +Comment[th]=ปรับแต่งลักษณะรูปแบบและสัมผัสสึกของแถบหัวเรื่องหน้าต่าง +Comment[tr]=Pencere başlıklarını görünümlerini yapılandır +Comment[tt]=Täräzä başlığınıñ küreneşen caylaw +Comment[uk]=Налаштування вигляду та поведінки заголовків вікон +Comment[uz]=Oyna sarlavhasining tashqi koʻrinishini moslash +Comment[uz@cyrillic]=Ойна сарлавҳасининг ташқи кўринишини мослаш +Comment[ven]=Dzudzanyani mbonalelo na zwipfi zwa buronza ya inithanete ino pfi Konqueror +Comment[vi]=Cấu hình cảm nhận cho tên cửa sổ +Comment[wa]=Apontyî li rivnance eyet l' dujhance des tites des purneas +Comment[xh]=Qwalasela inkangeleko nemvakalelo yezihloko zeWindow +Comment[zh_CN]=配置窗口标题的观感 +Comment[zh_TW]=設定視窗標題列的外觀與感覺 +Comment[zu]=Hlanganisela ukubona kanye nokuzwa kwezihloko zama-window + +Keywords=twin,window,manager,border,style,theme,look,feel,layout,button,handle,edge,kwm,decoration +Keywords[ar]=twin,نافذة,مسيير,الحافة,الشكل,سمة,مظهر,ملمس,تصميم,زر,معامل,مدبر,kwm,زخرفات +Keywords[az]=twin,pəncərə,idarəçi,kənar,tərz,örtü,görünüş,toxuma,yer,düymə,applet,kənar,kwm,dekorasiya,bəzək +Keywords[be]=Акно,Кіраўнік,Мяжа,Стыль,Тэма,Вонкавы выгляд,Кнопкі,Апрацоўшчык,Край,Дэкарацыя,twin,window,manager,border,style,theme,look,feel,layout,button,handle,edge,kwm,decoration +Keywords[bg]=прозорец, декорация, заглавие, бутони, меню, twin, window, manager, border, style, theme, look, feel, layout, button, handle, edge, kwm, decoration +Keywords[ca]=twin,finestra,gestor,vora,estil,tema,aspecte,comportament,disposició,botó,nansa,marges,kwm,decoració +Keywords[cs]=twin,okno,správce,okraj,styl,motiv,vzhled,rozvržení,tlačítko,úchytka,hrana,kwm,dekorace +Keywords[csb]=twin,òkno,menedżer,zberk,sztél,téma,wëzdrzatk,ùchòwanié,ùstôw,knąpa,ùchwët,rańt,kwm,dekòracëjô +Keywords[cy]=twin,ffenestr,trefnydd,ymyl,arddull,thema,golwg,teimlad,haenlun,botwm,carn,kwm,addurniad +Keywords[da]=twin,vindue,håndtering,kant,stil,tema,udseende,fornemmelse,layout,knap,håndtag,kant,kwm,dekoration +Keywords[de]=KWin,Kwm,Fenster,Manager,Rahmen,Design,Stile,Themes,Optik,Erscheinungsbild,Layout,Knöpfe,Ränder,Dekorationen +Keywords[el]=twin,παράθυρο,διαχειριστής,περίγραμμα,στυλ,θέμα,εμφάνιση,αίσθηση,διάταξη,κουμπί,χειρισμός,άκρο,kwm,διακόσμηση +Keywords[eo]=twin,fenestro,administrilo,rando,stilo,etoso,aspekto,konduto,aranĝo,butono,eĝo,kwm,ornamo +Keywords[es]=twin,ventana,gestor,borde,estilo,tema,aspecto,comportamiento,disposición,botón,asa,esquina,kwm,decoración +Keywords[et]=twin,aken,haldur,piire,stiil,teema,välimus,kasutamine,nupud,serv,kwm,dekoratsioon +Keywords[eu]=twin,leihoa,kudeatzailea,ertza,estiloa,gaia,itxura,antolaketa,botoia, maneiatzailea,ertzea,kwm,dekorazioa +Keywords[fa]=twin، پنجره، مدیر، لبه، سبک، چهره، ظاهر، احساس، طرحبندی، دکمه، گرداندن، لبه، kwm، تزئین +Keywords[fi]=twin,ikkuna,ikkunaohjelma,ikkunoinnin hallintaohjelma,tausta,tyyli,teema,ulkonäkö,tuntuma,ulkoasu,painike,kahva,kulma,kwm,kehys +Keywords[fr]=twin,fenêtre,gestionnaire,bordure,style,thème,apparence,ergonomie,disposition,bouton,poignée,bord,kwm,décoration +Keywords[fy]=twin,window,manager,rand,stijl,theme,tema,look,uiterlijk,gedrag,feel,layout,opmaak,button,knoppen,handle,rand,kwm,decoratie,windowmanager,venster,vensterbeheer,finster,râne,kader,styltema,uterlik,gedrach,finsterbehear +Keywords[ga]=twin,fuinneog,bainisteoir,imlíne,stíl,téama,leagan amach,cnaipe,hanla,ciumhais,kwm,maisiúchán +Keywords[gl]=twin,fiestra,xestor,beira,estilo,tema,apariencia,formato,botón,xestión,esquina,kwm,decoración +Keywords[he]=מנהל חלונות,חלונות,מנהל,גבול,מסגרת,סגנון,ערכה,ערכת נושא,מראה,תחושה,פריסה,תצוגה,כפתור,ידית,קצה,קישוט, twin,window,manager,border,style,theme,look,feel,layout,button,handle, edge,kwm,decoration +Keywords[hi]=के-विन,विंडो,प्रबंधक,बार्डर,शैली,प्रसंग,रूप,अनुभव,ले-आउट,बटन,हैंडल,किनारा,केडबल्यूएम,सजावट +Keywords[hr]=twin,window,manager,border,style,theme,look,feel,layout,button,handle,edge,kwm,decoration,prozor,upravljanje,obrub,stil,tema,izgled,raspored,gumb,rukovanje,rub,ukras +Keywords[hu]=KWin,ablak,kezelő,szegély,stílus,téma,kinézet,megjelenés,elrendezés,nyomógomb,fogantyú,perem,kwm,ablakstílus +Keywords[is]=twin,gluggi,gluggastjóri,gluggar,kantar,rammi,skreyting,þema,stíll,útlit,takki,kwm,skraut +Keywords[it]=twin,finestra,window manager,bordo,stile,tema,aspetto,pulsante,maniglia,bordo,kwm,decorazione +Keywords[ja]=twin,ウィンドウ,マネージャ,枠,スタイル,テーマ,ルック,外観,レイアウト,ボタン,ハンドル,エッジ,kwm,装飾 +Keywords[km]=twin,បង្អួច,កម្មវិធីគ្រប់គ្រង,ស៊ុម,រចនាប័ទ្ម,ស្បែក,មុខងារ,ប្លង់,ប៊ូតុង,ការប្រើ,គែម,kwm,ការតុបតែង +Keywords[lt]=twin,window,manager,border,style,theme,look,feel,layout,buttons,handle,edge,kwm,decoration,langas,tvarkyklė,rėmelis,stilius,tema,žiūrėti,jausti,išdėstymas,mygtukai,kraštas,dekoracija +Keywords[lv]=twin, logs, menedžeris, rāmis, stils, tēma, skats, gars, izkārtojums, poga, rokturis, stūris, kwm, dekorācija +Keywords[mk]=twin,window,manager,border,style,theme,look,feel,layout,button,handle,edge,kwm,decoration,прозорец,менаџер,граница,стил,тема,изглед,чувство,распоред,копче,рачка,раб,декорација +Keywords[mn]=KWin,Kwm,Цонх,Manager,Хүрээ,Design,Хэлбэр,Загвар, Optik,Харагдалт,Layout,Товч,Өнцөг,Засал +Keywords[mt]=twin, window, manager, border, bordura, stil, tema, apparenza, style, theme, look, feel, layout, tqassim, użu, button, handle, edge, kwm, decoration +Keywords[nb]=twin,vindu,vindusstyring,styrer,ramme,stil,tema,utseende,layout,knapp,kant,kwm,pynt,dekorasjon +Keywords[nds]=twin,Finster,Finsterpleger,manager,Rahmen,Stil,Muster,look,feel,layout,Knoop,Greep,Rand,kwm,Dekoratschoon +Keywords[ne]=के विन,सञ्झ्याल, प्रबन्धक, किनारा, शैली, विषयवस्तु, हेराइ, बुझाइ, सजावट, बटन, ह्यान्डल, छेउ,kwm, सजावट +Keywords[nl]=twin,window,manager,rand,stijl,theme,thema,look,uiterlijk,gedrag,feel, layout,opmaak,button,knoppen,handle,rand,kwm,decoratie,windowmanager,venster,vensterbeheer +Keywords[nn]=twin,vindauge,kant,bord,stil,tema,utsjånad,bunad,knapp,handtak,kwm,dekorasjon +Keywords[nso]=twin,window,molaodi,mollwane,mokgwa,molaetsa,tebelego,maikutlo,peakanyo,setobetswa,moswaro,nthla,kwm,kgabiso +Keywords[pa]=twin,handle,edge,kwm,decoration,ਝਰੋਖਾ,ਮੈਨੇਜਰ,ਹਾਸ਼ੀਆ,ਸ਼ੈਲੀ,ਸਰੂਪ,ਦਿੱਖ,ਖਾਕਾ,ਬਟਨ,ਹੈਂਡਲ,ਸਜਾਵਟ +Keywords[pl]=twin,okno,menedżer,brzeg,styl,motyw,wygląd,zachowanie,układ,przycisk,uchwyt,krawędź,kwm,dekoracja +Keywords[pt]=twin,janela,gestor,contorno,estilo,tema,aparência,comportamento,visual,botão,pega,extremo,kwm,decoração +Keywords[pt_BR]=twin,janela,gerenciador,borda,estilo,tema,aparência,aparência,botão, gerenciador,borda,kwm,decoração +Keywords[ro]=twin,fereastră,manager,margine,stil,tematică,aspect,comportament,format,buton,kwm,decorare +Keywords[rw]=twin,idirishya,muyobozi,impera,imisusire,insanganyamatsiko,imboneko,kumva,imigaragarire,buto,ikirindi,impera,kwm,ugutaaka +Keywords[se]=twin,láse,gieđahalli,ravda,stiila,fáddá,fárda,dovdu,hápmi,boallu,geavja,ravda,kwm,hearva +Keywords[sk]=twin,okno,správa,okraj,štýl,téma,vzhľad,rozloženie,tlačidlo,hrana,kwm,dekorácia,oblasť +Keywords[sl]=twin,okno,upravitelj,rob,meja,slog,stil,tema,pogled,občutek,gumb,ročaj,rob,kwm,okrasek +Keywords[sr]=twin,window,manager,border,style,theme,look,feel,layout,button,handle,edge,kwm,decoration,прозор,менаџер,оквир,стил,тема,изглед,дугме,хватаљка,декорација +Keywords[sr@Latn]=twin,window,manager,border,style,theme,look,feel,layout,button,handle,edge,kwm,decoration,prozor,menadžer,okvir,stil,tema,izgled,dugme,hvataljka,dekoracija +Keywords[sv]=twin,fönster,hanterare,kant,stil,tema,utseende,känsla,layout,knapp,hantera,kant,kwm,dekoration +Keywords[ta]=twin,சாளரம்,மேலாளர்,விளிம்பு,பாணி,தலைப்பு,பார்வை,உணர்தல்,உருவரை,விசை,கையாள்,முனை,kwm,அலங்கரிப்பு +Keywords[th]=twin,หน้าต่าง,ตัวจัดการ,กรอบ,ลักษณะ,ชุดตกแต่ง,มองเห็น,รู้สึก,การจัดวาง,ปุ่ม,ที่จับ,ขอบ,kwm,การตกแต่ง +Keywords[tr]=twin,pencere,yönetici,kenar,stil,tema,görünüş,doku,yerleşim,düğme,tutamaç,kenar,kwm,dekorasyon +Keywords[uk]=twin,вікно,менеджер,границя,стиль,тема,вигляд,поведінка,розклад,кнопка,handle,край,kwm,обрамлення +Keywords[uz]=twin,kwm,bezak,oyna,boshqaruvchi,usul,tashqi koʻrinish +Keywords[uz@cyrillic]=twin,kwm,безак,ойна,бошқарувчи,усул,ташқи кўриниш +Keywords[ven]=twin,windo,mulanguli,mukanoni,tshitaela,thero,sedza,upfa,vhuvha,bathene,fara,mafhedziselo,kwn,u khavhisedza +Keywords[vi]=twin,cửa sổ,quản lý,bờ,kiểu,sắc thái,ngoại hình,cảm nhận,sắp xếp,nút,điều khiển,cạnh,kwm,trang trí +Keywords[wa]=twin,kpurnea,purnea,manaedjeu,boird,stîle,tinme,rivnance,layout;loukance,boton,apougnî,costé,kwm,gåliotaedje +Keywords[xh]=twin,window,umphathi,umda,uhlobo,umxholo wokuxoxwa,jonga,yiva,beka,iqhosha,umqheba,umda,kwm,uhombiso +Keywords[zh_CN]=twin,window,manager,border,style,theme,look,feel,layout,button,handle,edge,kwm,decoration,窗口,管理器,边框,样式,主题,观感,布局,按钮,处理,边缘,装饰 +Keywords[zh_TW]=twin,window,manager,border,style,theme,look,feel,layout,button,handle,edge,kwm,decoration,視窗,管理員,邊框,風格,佈景主題,外觀,感覺,佈局,按鈕,邊緣,裝飾 +Keywords[zu]=twin,i-window,imenenja,umngcele,isitayela,bona,izwa, isendlalelo,inkinobho,isibambo,unqenqema,kwm,umhlobiso +Categories=Qt;KDE;X-KDE-settings-looknfeel; diff --git a/twin/kcmtwin/twindecoration/twindecoration.h b/twin/kcmtwin/twindecoration/twindecoration.h new file mode 100644 index 000000000..f6b535024 --- /dev/null +++ b/twin/kcmtwin/twindecoration/twindecoration.h @@ -0,0 +1,148 @@ +/* + This is the new twindecoration kcontrol module + + Copyright (c) 2001 + Karol Szwed <gallium@kde.org> + http://gallium.n3.net/ + + Supports new twin configuration plugins, and titlebar button position + modification via dnd interface. + + Based on original "twintheme" (Window Borders) + Copyright (C) 2001 Rik Hemsley (rikkus) <rik@kde.org> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +*/ + +#ifndef KWINDECORATION_H +#define KWINDECORATION_H + +#include <kcmodule.h> +#include <dcopobject.h> +#include <buttons.h> +#include <kconfig.h> +#include <klibloader.h> + +#include <kdecoration.h> + +#include "twindecorationIface.h" + +class KComboBox; +class TQCheckBox; +class TQLabel; +class TQTabWidget; +class TQVBox; +class TQSlider; + +class KDecorationPlugins; +class KDecorationPreview; + +// Stores themeName and its corresponding library Name +struct DecorationInfo +{ + TQString name; + TQString libraryName; +}; + + +class KWinDecorationModule : public KCModule, virtual public KWinDecorationIface, public KDecorationDefines +{ + Q_OBJECT + + public: + KWinDecorationModule(TQWidget* parent, const char* name, const TQStringList &); + ~KWinDecorationModule(); + + virtual void load(); + virtual void save(); + virtual void defaults(); + + TQString quickHelp() const; + + virtual void dcopUpdateClientList(); + + signals: + void pluginLoad( KConfig* conf ); + void pluginSave( KConfig* conf ); + void pluginDefaults(); + + protected slots: + // Allows us to turn "save" on + void slotSelectionChanged(); + void slotChangeDecoration( const TQString & ); + void slotBorderChanged( int ); + void slotButtonsChanged(); + + private: + void readConfig( KConfig* conf ); + void writeConfig( KConfig* conf ); + void findDecorations(); + void createDecorationList(); + void updateSelection(); + TQString decorationLibName( const TQString& name ); + TQString decorationName ( TQString& libName ); + static TQString styleToConfigLib( TQString& styleLib ); + void resetPlugin( KConfig* conf, const TQString& currentDecoName = TQString::null ); + void resetKWin(); + void checkSupportedBorderSizes(); + static int borderSizeToIndex( BorderSize size, TQValueList< BorderSize > sizes ); + static BorderSize indexToBorderSize( int index, TQValueList< BorderSize > sizes ); + + TQTabWidget* tabWidget; + + // Page 1 + KComboBox* decorationList; + TQValueList<DecorationInfo> decorations; + + KDecorationPreview* preview; + KDecorationPlugins* plugins; + KConfig twinConfig; + + TQCheckBox* cbUseCustomButtonPositions; + // TQCheckBox* cbUseMiniWindows; + TQCheckBox* cbShowToolTips; + TQLabel* lBorder; + TQComboBox* cBorder; + BorderSize border_size; + + TQObject* pluginObject; + TQWidget* pluginConfigWidget; + TQString currentLibraryName; + TQString oldLibraryName; + TQObject* (*allocatePlugin)( KConfig* conf, TQWidget* parent ); + + // Page 2 + ButtonPositionWidget *buttonPositionWidget; + TQVBox* buttonPage; + + // Page 3 + TQVBox *shadowPage; + KColorButton *inactiveShadowColourButton, *shadowColourButton; + TQCheckBox *cbShadowDocks, *cbShadowOverrides, *cbShadowTopMenus; + TQCheckBox *cbInactiveShadow, *cbWindowShadow; + TQGroupBox *activeShadowSettings, *inactiveShadowSettings; + TQGroupBox *whichShadowSettings; + TQSlider *inactiveShadowOpacitySlider, *shadowOpacitySlider; + TQSpinBox *inactiveShadowOpacitySpinBox, *shadowOpacitySpinBox; + TQSpinBox *inactiveShadowXOffsetSpinBox, *shadowXOffsetSpinBox; + TQSpinBox *inactiveShadowYOffsetSpinBox, *shadowYOffsetSpinBox; + TQSpinBox *inactiveShadowThicknessSpinBox, *shadowThicknessSpinBox; +}; + + +#endif +// vim: ts=4 +// kate: space-indent off; tab-width 4; diff --git a/twin/kcmtwin/twindecoration/twindecorationIface.h b/twin/kcmtwin/twindecoration/twindecorationIface.h new file mode 100644 index 000000000..f50082648 --- /dev/null +++ b/twin/kcmtwin/twindecoration/twindecorationIface.h @@ -0,0 +1,44 @@ +/* + This is the new twindecoration kcontrol module + + Copyright (c) 2001 + Karol Szwed (gallium) <karlmail@usa.net> + http://gallium.n3.net/ + + Supports new twin configuration plugins, and titlebar button position + modification via dnd interface. + + Based on original "twintheme" (Window Borders) + Copyright (C) 2001 Rik Hemsley (rikkus) <rik@kde.org> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +*/ + +#ifndef __KWINDECORATIONIFACE_H +#define __KWINDECORATIONIFACE_H + +#include <dcopobject.h> + +class KWinDecorationIface: virtual public DCOPObject +{ + K_DCOP + public: + + k_dcop: + virtual void dcopUpdateClientList()=0; +}; + +#endif diff --git a/twin/kcmtwin/twinoptions/AUTHORS b/twin/kcmtwin/twinoptions/AUTHORS new file mode 100644 index 000000000..0615c59db --- /dev/null +++ b/twin/kcmtwin/twinoptions/AUTHORS @@ -0,0 +1,12 @@ +Please use http://bugs.kde.org to report bugs. +The following authors may have retired by the time you read this :-) + +KWM Configuration Module: + + Pat Dowler (dowler@pt1B1106.FSH.UVic.CA) + + Bernd Wuebben <wuebben@kde.org> + +Conversion to kcontrol applet: + + Matthias Hoelzer (hoelzer@physik.uni-wuerzburg.de) diff --git a/twin/kcmtwin/twinoptions/CMakeLists.txt b/twin/kcmtwin/twinoptions/CMakeLists.txt new file mode 100644 index 000000000..591883e21 --- /dev/null +++ b/twin/kcmtwin/twinoptions/CMakeLists.txt @@ -0,0 +1,40 @@ +################################################# +# +# (C) 2010-2011 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include_directories( + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_BINARY_DIR} + ${TDE_INCLUDE_DIR} + ${TQT_INCLUDE_DIRS} +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + + +##### other data ################################ + +install( FILES twinoptions.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} ) + +install( FILES + twinactions.desktop twinadvanced.desktop twinfocus.desktop + twinmoving.desktop twintranslucency.desktop + DESTINATION ${APPS_INSTALL_DIR}/.hidden ) + + +##### kcm_twinoptions (module) ################## + +tde_add_kpart( kcm_twinoptions AUTOMOC + SOURCES windows.cpp mouse.cpp main.cpp + LINK tdeui-shared + DESTINATION ${PLUGIN_INSTALL_DIR} +) diff --git a/twin/kcmtwin/twinoptions/ChangeLog b/twin/kcmtwin/twinoptions/ChangeLog new file mode 100644 index 000000000..0b923864c --- /dev/null +++ b/twin/kcmtwin/twinoptions/ChangeLog @@ -0,0 +1,51 @@ +1999-03-06 Mario Weilguni <mweilguni@kde.org> + + * changes for Qt 2.0 + +1998-11-29 Alex Zepeda <garbanzo@hooked.net> + + * pics/Makefile.am, pics/mini/Makefile.am: Install icons from their + "proper" subdirectories. + +1998-11-20 Cristian Tibirna <ctibirna@gch.ulaval.ca> + + * advanced.[cpp,h]: fixed bugs. Mostly a disgusting one: + no lists saving for the special options (Decor, Focus a.o.) + +1998-11-09 Cristian Tibirna <ctibirna@gch.ulaval.ca> + + * advanced.[cpp,h] : new tab for some of the last of the + kwm's options which remained out of the GUI config: + CtrlTab, TraverseAll, AltTabeMode, Button3Grab and + the filter lists for decorations, focus, stickyness, + session management ignore ( I kinda disklike the solution + I got for the latest) + +1998-11-06 Cristian Tibirna <ctibirna@gch.ulaval.ca> + + * titlebar.[cpp,h] : added title alignment config + +1998-10-23 Cristian Tibirna <ctibirna@gch.ulaval.ca> + + * titlebar.cpp: completed what Matthias started (took out + useless checks) + * widows.cpp: make autoRaise toggling clearer + +1998-10-22 Matthias Ettrich <ettrich@kde.org> + + * titlebar.cpp: less options on titlebar doubleclick + +1998-10-21 Cristian Tibirna <ctibirna@gch.ulaval.ca> + + * desktop.[cpp,h]: now with consistent layout use + resizeEvent() deleted + +1998-10-19 Cristian Tibirna <ctibirna@gch.ulaval.ca> + + * windows.[cpp,h]: now with consistent layout use + resizeEvent() deleted + +1998-10-18 Cristian Tibirna <ctibirna@gch.ulaval.ca> + + * titlebar.[cpp,h]: fixed the (in)activetitleebar pixmap selection + 1998-10-21 (still buggy, don't quite understand why) diff --git a/twin/kcmtwin/twinoptions/Makefile.am b/twin/kcmtwin/twinoptions/Makefile.am new file mode 100644 index 000000000..d2b4e6583 --- /dev/null +++ b/twin/kcmtwin/twinoptions/Makefile.am @@ -0,0 +1,18 @@ +METASOURCES = AUTO +INCLUDES = $(all_includes) + +kde_module_LTLIBRARIES = kcm_twinoptions.la + +kcm_twinoptions_la_SOURCES = windows.cpp mouse.cpp main.cpp +kcm_twinoptions_la_LDFLAGS = -module -avoid-version $(all_libraries) -no-undefined +kcm_twinoptions_la_LIBADD = $(LIB_TDEUI) + +noinst_HEADERS = windows.h mouse.h + +messages: + $(XGETTEXT) *.cpp -o $(podir)/kcmkwm.pot + +twin_kcmtwin_options_data_DATA = twinactions.desktop twinadvanced.desktop twinfocus.desktop twinmoving.desktop twintranslucency.desktop +twin_kcmtwin_options_datadir = $(kde_appsdir)/.hidden + +xdg_apps_DATA = twinoptions.desktop diff --git a/twin/kcmtwin/twinoptions/main.cpp b/twin/kcmtwin/twinoptions/main.cpp new file mode 100644 index 000000000..a10269eca --- /dev/null +++ b/twin/kcmtwin/twinoptions/main.cpp @@ -0,0 +1,262 @@ +/* + * + * Copyright (c) 2001 Waldo Bastian <bastian@kde.org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include <tqlayout.h> + +#include <dcopclient.h> + +#include <kapplication.h> +#include <kglobal.h> +#include <klocale.h> +#include <kconfig.h> +#include <kgenericfactory.h> +#include <kaboutdata.h> +#include <kdialog.h> + +#include "mouse.h" +#include "windows.h" + +#include "main.h" + +extern "C" +{ + KDE_EXPORT KCModule *create_twinfocus(TQWidget *parent, const char *name) + { + //CT there's need for decision: kwm or twin? + KGlobal::locale()->insertCatalogue("kcmkwm"); + KConfig *c = new KConfig("twinrc", false, true); + return new KFocusConfig(true, c, parent, name); + } + + KDE_EXPORT KCModule *create_twinactions(TQWidget *parent, const char *name) + { + //CT there's need for decision: kwm or twin? + KGlobal::locale()->insertCatalogue("kcmkwm"); + return new KActionsOptions( parent, name); + } + + KDE_EXPORT KCModule *create_twinmoving(TQWidget *parent, const char *name) + { + //CT there's need for decision: kwm or twin? + KGlobal::locale()->insertCatalogue("kcmkwm"); + KConfig *c = new KConfig("twinrc", false, true); + return new KMovingConfig(true, c, parent, name); + } + + KDE_EXPORT KCModule *create_twinadvanced(TQWidget *parent, const char *name) + { + //CT there's need for decision: kwm or twin? + KGlobal::locale()->insertCatalogue("kcmkwm"); + KConfig *c = new KConfig("twinrc", false, true); + return new KAdvancedConfig(true, c, parent, name); + } + + KDE_EXPORT KCModule *create_twintranslucency(TQWidget *parent, const char *name) + { + //CT there's need for decision: kwm or twin? + KGlobal::locale()->insertCatalogue("kcmkwm"); + KConfig *c = new KConfig("twinrc", false, true); + return new KTranslucencyConfig(true, c, parent, name); + } + + KDE_EXPORT KCModule *create_twinoptions ( TQWidget *parent, const char* name) + { + //CT there's need for decision: kwm or twin? + KGlobal::locale()->insertCatalogue("kcmkwm"); + return new KWinOptions( parent, name); + } +} + +KWinOptions::KWinOptions(TQWidget *parent, const char *name) + : KCModule(parent, name) +{ + mConfig = new KConfig("twinrc", false, true); + + TQVBoxLayout *layout = new TQVBoxLayout(this); + tab = new TQTabWidget(this); + layout->addWidget(tab); + + mFocus = new KFocusConfig(false, mConfig, this, "KWin Focus Config"); + mFocus->layout()->setMargin( KDialog::marginHint() ); + tab->addTab(mFocus, i18n("&Focus")); + connect(mFocus, TQT_SIGNAL(changed(bool)), this, TQT_SLOT(moduleChanged(bool))); + + mTitleBarActions = new KTitleBarActionsConfig(false, mConfig, this, "KWin TitleBar Actions"); + mTitleBarActions->layout()->setMargin( KDialog::marginHint() ); + tab->addTab(mTitleBarActions, i18n("&Titlebar Actions")); + connect(mTitleBarActions, TQT_SIGNAL(changed(bool)), this, TQT_SLOT(moduleChanged(bool))); + + mWindowActions = new KWindowActionsConfig(false, mConfig, this, "KWin 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))); + + mMoving = new KMovingConfig(false, mConfig, this, "KWin Moving"); + mMoving->layout()->setMargin( KDialog::marginHint() ); + tab->addTab(mMoving, i18n("&Moving")); + connect(mMoving, TQT_SIGNAL(changed(bool)), this, TQT_SLOT(moduleChanged(bool))); + + mAdvanced = new KAdvancedConfig(false, mConfig, this, "KWin Advanced"); + mAdvanced->layout()->setMargin( KDialog::marginHint() ); + tab->addTab(mAdvanced, i18n("Ad&vanced")); + connect(mAdvanced, TQT_SIGNAL(changed(bool)), this, TQT_SLOT(moduleChanged(bool))); + + mTranslucency = new KTranslucencyConfig(false, mConfig, this, "KWin Translucency"); + mTranslucency->layout()->setMargin( KDialog::marginHint() ); + tab->addTab(mTranslucency, i18n("&Translucency")); + connect(mTranslucency, TQT_SIGNAL(changed(bool)), this, TQT_SLOT(moduleChanged(bool))); + + KAboutData *about = + new KAboutData(I18N_NOOP("kcmtwinoptions"), I18N_NOOP("Window Behavior Configuration Module"), + 0, 0, KAboutData::License_GPL, + I18N_NOOP("(c) 1997 - 2002 KWin and KControl Authors")); + + about->addAuthor("Matthias Ettrich",0,"ettrich@kde.org"); + about->addAuthor("Waldo Bastian",0,"bastian@kde.org"); + about->addAuthor("Cristian Tibirna",0,"tibirna@kde.org"); + about->addAuthor("Matthias Kalle Dalheimer",0,"kalle@kde.org"); + about->addAuthor("Daniel Molkentin",0,"molkentin@kde.org"); + about->addAuthor("Wynn Wilkes",0,"wynnw@caldera.com"); + about->addAuthor("Pat Dowler",0,"dowler@pt1B1106.FSH.UVic.CA"); + about->addAuthor("Bernd Wuebben",0,"wuebben@kde.org"); + about->addAuthor("Matthias Hoelzer-Kluepfel",0,"hoelzer@kde.org"); + setAboutData(about); +} + +KWinOptions::~KWinOptions() +{ + delete mConfig; +} + +void KWinOptions::load() +{ + mConfig->reparseConfiguration(); + mFocus->load(); + mTitleBarActions->load(); + mWindowActions->load(); + mMoving->load(); + mAdvanced->load(); + mTranslucency->load(); + emit KCModule::changed( false ); +} + + +void KWinOptions::save() +{ + mFocus->save(); + mTitleBarActions->save(); + mWindowActions->save(); + mMoving->save(); + mAdvanced->save(); + mTranslucency->save(); + + emit KCModule::changed( false ); + // Send signal to twin + mConfig->sync(); + if ( !kapp->dcopClient()->isAttached() ) + kapp->dcopClient()->attach(); + kapp->dcopClient()->send("twin*", "", "reconfigure()", TQString("")); +} + + +void KWinOptions::defaults() +{ + mFocus->defaults(); + mTitleBarActions->defaults(); + mWindowActions->defaults(); + mMoving->defaults(); + mAdvanced->defaults(); + mTranslucency->defaults(); +} + +TQString KWinOptions::quickHelp() const +{ + return i18n("<h1>Window Behavior</h1> Here you can customize the way windows behave when being" + " moved, resized or clicked on. You can also specify a focus policy as well as a placement" + " policy for new windows." + " <p>Please note that this configuration will not take effect if you do not use" + " KWin as your window manager. If you do use a different window manager, please refer to its documentation" + " for how to customize window behavior."); +} + +void KWinOptions::moduleChanged(bool state) +{ + emit KCModule::changed(state); +} + + +KActionsOptions::KActionsOptions(TQWidget *parent, const char *name) + : KCModule(parent, name) +{ + mConfig = new KConfig("twinrc", false, true); + + TQVBoxLayout *layout = new TQVBoxLayout(this); + tab = new TQTabWidget(this); + layout->addWidget(tab); + + mTitleBarActions = new KTitleBarActionsConfig(false, mConfig, this, "KWin TitleBar Actions"); + mTitleBarActions->layout()->setMargin( KDialog::marginHint() ); + tab->addTab(mTitleBarActions, i18n("&Titlebar Actions")); + connect(mTitleBarActions, TQT_SIGNAL(changed(bool)), this, TQT_SLOT(moduleChanged(bool))); + + mWindowActions = new KWindowActionsConfig(false, mConfig, this, "KWin 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))); +} + +KActionsOptions::~KActionsOptions() +{ + delete mConfig; +} + +void KActionsOptions::load() +{ + mTitleBarActions->load(); + mWindowActions->load(); + emit KCModule::changed( false ); +} + + +void KActionsOptions::save() +{ + mTitleBarActions->save(); + mWindowActions->save(); + + emit KCModule::changed( false ); + // Send signal to twin + mConfig->sync(); + if ( !kapp->dcopClient()->isAttached() ) + kapp->dcopClient()->attach(); + kapp->dcopClient()->send("twin*", "", "reconfigure()", TQString("")); +} + + +void KActionsOptions::defaults() +{ + mTitleBarActions->defaults(); + mWindowActions->defaults(); +} + +void KActionsOptions::moduleChanged(bool state) +{ + emit KCModule::changed(state); +} + +#include "main.moc" diff --git a/twin/kcmtwin/twinoptions/main.h b/twin/kcmtwin/twinoptions/main.h new file mode 100644 index 000000000..2465c6766 --- /dev/null +++ b/twin/kcmtwin/twinoptions/main.h @@ -0,0 +1,100 @@ +/* + * main.h + * + * Copyright (c) 2001 Waldo Bastian <bastian@kde.org> + * + * Requires the Qt widget libraries, available at no cost at + * http://www.troll.no/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + + +#ifndef __MAIN_H__ +#define __MAIN_H__ + +#include <tqtabwidget.h> +#include <kcmodule.h> + +class KConfig; +class KFocusConfig; +class KTitleBarActionsConfig; +class KWindowActionsConfig; +class KAdvancedConfig; +class KTranslucencyConfig; + +class KWinOptions : public KCModule +{ + Q_OBJECT + +public: + + KWinOptions(TQWidget *parent, const char *name); + virtual ~KWinOptions(); + + void load(); + void save(); + void defaults(); + TQString quickHelp() const; + + +protected slots: + + void moduleChanged(bool state); + + +private: + + TQTabWidget *tab; + + KFocusConfig *mFocus; + KTitleBarActionsConfig *mTitleBarActions; + KWindowActionsConfig *mWindowActions; + KMovingConfig *mMoving; + KAdvancedConfig *mAdvanced; + KTranslucencyConfig *mTranslucency; + + KConfig *mConfig; +}; + +class KActionsOptions : public KCModule +{ + Q_OBJECT + +public: + + KActionsOptions(TQWidget *parent, const char *name); + virtual ~KActionsOptions(); + + void load(); + void save(); + void defaults(); + +protected slots: + + void moduleChanged(bool state); + + +private: + + TQTabWidget *tab; + + KTitleBarActionsConfig *mTitleBarActions; + KWindowActionsConfig *mWindowActions; + + KConfig *mConfig; +}; + +#endif diff --git a/twin/kcmtwin/twinoptions/mouse.cpp b/twin/kcmtwin/twinoptions/mouse.cpp new file mode 100644 index 000000000..30692d87f --- /dev/null +++ b/twin/kcmtwin/twinoptions/mouse.cpp @@ -0,0 +1,856 @@ +/* + * + * Copyright (c) 1998 Matthias Ettrich <ettrich@kde.org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include <tqlabel.h> +#include <tqcombobox.h> +#include <tqwhatsthis.h> +#include <tqlayout.h> +#include <tqvgroupbox.h> +#include <tqgrid.h> +#include <tqsizepolicy.h> +#include <tqbitmap.h> +#include <tqhgroupbox.h> +#include <tqtooltip.h> + +#include <dcopclient.h> +#include <klocale.h> +#include <kapplication.h> +#include <kconfig.h> +#include <kdialog.h> +#include <kglobalsettings.h> +#include <kseparator.h> + +#include <X11/X.h> +#include <X11/Xlib.h> +#include <X11/Xutil.h> + +#include <stdlib.h> + +#include "mouse.h" +#include "mouse.moc" + + +namespace { + +char const * const cnf_Max[] = { + "MaximizeButtonLeftClickCommand", + "MaximizeButtonMiddleClickCommand", + "MaximizeButtonRightClickCommand", +}; + +char const * const tbl_Max[] = { + "Maximize", + "Maximize (vertical only)", + "Maximize (horizontal only)", + "" }; + +TQPixmap maxButtonPixmaps[3]; + +void createMaxButtonPixmaps() +{ + char const * maxButtonXpms[][3 + 13] = { + {0, 0, 0, + "...............", + ".......#.......", + "......###......", + ".....#####.....", + "..#....#....#..", + ".##....#....##.", + "###############", + ".##....#....##.", + "..#....#....#..", + ".....#####.....", + "......###......", + ".......#.......", + "..............."}, + {0, 0, 0, + "...............", + ".......#.......", + "......###......", + ".....#####.....", + ".......#.......", + ".......#.......", + ".......#.......", + ".......#.......", + ".......#.......", + ".....#####.....", + "......###......", + ".......#.......", + "..............."}, + {0, 0, 0, + "...............", + "...............", + "...............", + "...............", + "..#.........#..", + ".##.........##.", + "###############", + ".##.........##.", + "..#.........#..", + "...............", + "...............", + "...............", + "..............."}, + }; + + TQString baseColor(". c " + KGlobalSettings::baseColor().name()); + TQString textColor("# c " + KGlobalSettings::textColor().name()); + for (int t = 0; t < 3; ++t) + { + maxButtonXpms[t][0] = "15 13 2 1"; + maxButtonXpms[t][1] = baseColor.ascii(); + maxButtonXpms[t][2] = textColor.ascii(); + maxButtonPixmaps[t] = TQPixmap(maxButtonXpms[t]); + maxButtonPixmaps[t].setMask(maxButtonPixmaps[t].createHeuristicMask()); + } +} + +} // namespace + +void KTitleBarActionsConfig::paletteChanged() +{ + createMaxButtonPixmaps(); + for (int b = 0; b < 3; ++b) + for (int t = 0; t < 3; ++t) + coMax[b]->changeItem(maxButtonPixmaps[t], t); + +} + +KTitleBarActionsConfig::KTitleBarActionsConfig (bool _standAlone, KConfig *_config, TQWidget * parent, const char *) + : KCModule(parent, "kcmkwm"), config(_config), standAlone(_standAlone) +{ + TQString strWin1, strWin2, strWin3, strAllKey, strAll1, strAll2, strAll3; + TQVBoxLayout *layout = new TQVBoxLayout(this, 0, KDialog::spacingHint()); + TQGrid *grid; + TQGroupBox *box; + TQLabel *label; + TQString strMouseButton1, strMouseButton3, strMouseWheel; + TQString txtButton1, txtButton3, txtButton4; + TQStringList items; + bool leftHandedMouse = ( KGlobalSettings::mouseSettings().handed == KGlobalSettings::KMouseSettings::LeftHanded); + +/** Titlebar doubleclick ************/ + + TQHBoxLayout *hlayout = new TQHBoxLayout(layout); + + label = new TQLabel(i18n("&Titlebar double-click:"), this); + hlayout->addWidget(label); + TQWhatsThis::add( label, i18n("Here you can customize mouse click behavior when double clicking on the" + " titlebar of a window.") ); + + TQComboBox* combo = new TQComboBox(this); + combo->insertItem(i18n("Maximize")); + combo->insertItem(i18n("Maximize (vertical only)")); + combo->insertItem(i18n("Maximize (horizontal only)")); + combo->insertItem(i18n("Minimize")); + combo->insertItem(i18n("Shade")); + combo->insertItem(i18n("Lower")); + combo->insertItem(i18n("On All Desktops")); + combo->insertItem(i18n("Nothing")); + combo->tqsetSizePolicy(TQSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::Fixed)); + connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + hlayout->addWidget(combo); + coTiDbl = combo; + TQWhatsThis::add(combo, i18n("Behavior on <em>double</em> click into the titlebar.")); + + label->setBuddy(combo); + +/** Mouse Wheel Events **************/ + TQHBoxLayout *hlayoutW = new TQHBoxLayout(layout); + strMouseWheel = i18n("Titlebar wheel event:"); + label = new TQLabel(strMouseWheel, this); + hlayoutW->addWidget(label); + txtButton4 = i18n("Handle mouse wheel events"); + TQWhatsThis::add( label, txtButton4); + + // Titlebar and frame mouse Wheel + TQComboBox* comboW = new TQComboBox(this); + comboW->insertItem(i18n("Raise/Lower")); + comboW->insertItem(i18n("Shade/Unshade")); + comboW->insertItem(i18n("Maximize/Restore")); + comboW->insertItem(i18n("Keep Above/Below")); + comboW->insertItem(i18n("Move to Previous/Next Desktop")); + comboW->insertItem(i18n("Change Opacity")); + comboW->insertItem(i18n("Nothing")); + comboW->tqsetSizePolicy(TQSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::Fixed)); + connect(comboW, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + hlayoutW->addWidget(comboW); + coTiAct4 = comboW; + TQWhatsThis::add(comboW, txtButton4); + label->setBuddy(comboW); + +/** Titlebar and frame **************/ + + box = new TQVGroupBox( i18n("Titlebar && Frame"), this, "Titlebar and Frame"); + box->layout()->setMargin(KDialog::marginHint()); + box->layout()->setSpacing(KDialog::spacingHint()); + layout->addWidget(box); + 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); + + + new TQLabel(grid); // dummy + + strMouseButton1 = i18n("Left button:"); + txtButton1 = i18n("In this row you can customize left click behavior when clicking into" + " the titlebar or the frame."); + + strMouseButton3 = i18n("Right button:"); + txtButton3 = i18n("In this row you can customize right click behavior when clicking into" + " the titlebar or the frame." ); + + if ( leftHandedMouse ) + { + tqSwap(strMouseButton1, strMouseButton3); + tqSwap(txtButton1, txtButton3); + } + + label = new TQLabel(strMouseButton1, grid); + TQWhatsThis::add( label, txtButton1); + + label = new TQLabel(i18n("Middle button:"), grid); + TQWhatsThis::add( label, i18n("In this row you can customize middle click behavior when clicking into" + " the titlebar or the frame.") ); + + label = new TQLabel(strMouseButton3, grid); + TQWhatsThis::add( label, txtButton3); + + + label = new TQLabel(i18n("Active"), grid); + label->tqsetAlignment(AlignCenter); + 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; + + txtButton1 = i18n("Behavior on <em>left</em> click into the titlebar or frame of an " + "<em>active</em> window."); + + txtButton3 = i18n("Behavior on <em>right</em> click into the titlebar or frame of an " + "<em>active</em> window."); + + // Be nice to left handed users + if ( leftHandedMouse ) tqSwap(txtButton1, txtButton3); + + 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())); + 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())); + coTiAct3 = combo; + TQWhatsThis::add(combo, txtButton3 ); + + txtButton1 = i18n("Behavior on <em>left</em> click into the titlebar or frame of an " + "<em>inactive</em> window."); + + txtButton3 = i18n("Behavior on <em>right</em> click into the titlebar or frame of an " + "<em>inactive</em> window."); + + // Be nice to left handed users + if ( leftHandedMouse ) tqSwap(txtButton1, txtButton3); + + label = new TQLabel(i18n("Inactive"), grid); + label->tqsetAlignment(AlignCenter); + TQWhatsThis::add( label, i18n("In this column you can customize mouse clicks into the titlebar" + " or the frame of an inactive window.") ); + + items.clear(); + items << i18n("Activate & Raise") + << i18n("Activate & Lower") + << i18n("Activate") + << i18n("Shade") + << i18n("Operations Menu") + << i18n("Raise") + << i18n("Lower") + << i18n("Nothing"); + + combo = new TQComboBox(grid); + combo->insertStringList(items); + connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + coTiInAct1 = combo; + TQWhatsThis::add(combo, txtButton1); + + combo = new TQComboBox(grid); + combo->insertStringList(items); + connect(combo, TQT_SIGNAL(activated(int)), TQT_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())); + coTiInAct3 = combo; + TQWhatsThis::add(combo, txtButton3); + +/** Maximize Button ******************/ + + box = new TQHGroupBox(i18n("Maximize Button"), this, "Maximize Button"); + box->layout()->setMargin(KDialog::marginHint()); + box->layout()->setSpacing(KDialog::spacingHint()); + layout->addWidget(box); + TQWhatsThis::add( box, + i18n("Here you can customize behavior when clicking on the maximize button.") ); + + TQString strMouseButton[] = { + i18n("Left button:"), + i18n("Middle button:"), + i18n("Right button:")}; + + TQString txtButton[] = { + i18n("Behavior on <em>left</em> click onto the maximize button." ), + i18n("Behavior on <em>middle</em> click onto the maximize button." ), + i18n("Behavior on <em>right</em> click onto the maximize button." )}; + + if ( leftHandedMouse ) // Be nice to lefties + { + tqSwap(strMouseButton[0], strMouseButton[2]); + tqSwap(txtButton[0], txtButton[2]); + } + + createMaxButtonPixmaps(); + for (int b = 0; b < 3; ++b) + { + if (b != 0) new TQWidget(box); // Spacer + + TQLabel * label = new TQLabel(strMouseButton[b], box); + TQWhatsThis::add( label, txtButton[b] ); + label ->tqsetSizePolicy( TQSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Minimum )); + + 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())); + TQWhatsThis::add( coMax[b], txtButton[b] ); + coMax[b]->tqsetSizePolicy( TQSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Minimum )); + } + + connect(kapp, TQT_SIGNAL(kdisplayPaletteChanged()), TQT_SLOT(paletteChanged())); + + layout->addStretch(); + + load(); +} + +KTitleBarActionsConfig::~KTitleBarActionsConfig() +{ + if (standAlone) + delete config; +} + +// do NOT change the texts below, they are written to config file +// and are not shown in the GUI +// they have to match the order of items in GUI elements though +const char* const tbl_TiDbl[] = { + "Maximize", + "Maximize (vertical only)", + "Maximize (horizontal only)", + "Minimize", + "Shade", + "Lower", + "OnAllDesktops", + "Nothing", + "" }; + +const char* const tbl_TiAc[] = { + "Raise", + "Lower", + "Operations menu", + "Toggle raise and lower", + "Nothing", + "Shade", + "" }; + +const char* const tbl_TiInAc[] = { + "Activate and raise", + "Activate and lower", + "Activate", + "Shade", + "Operations menu", + "Raise", + "Lower", + "Nothing", + "" }; + +const char* const tbl_Win[] = { + "Activate, raise and pass click", + "Activate and pass click", + "Activate", + "Activate and raise", + "" }; + +const char* const tbl_AllKey[] = { + "Meta", + "Alt", + "" }; + +const char* const tbl_All[] = { + "Move", + "Activate, raise and move", + "Toggle raise and lower", + "Resize", + "Raise", + "Lower", + "Minimize", + "Nothing", + "" }; + +const char* tbl_TiWAc[] = { + "Raise/Lower", + "Shade/Unshade", + "Maximize/Restore", + "Above/Below", + "Previous/Next Desktop", + "Change Opacity", + "Nothing", + "" }; + +const char* tbl_AllW[] = { + "Raise/Lower", + "Shade/Unshade", + "Maximize/Restore", + "Above/Below", + "Previous/Next Desktop", + "Change Opacity", + "Nothing", + "" }; + +static const char* tbl_num_lookup( const char* const arr[], int pos ) +{ + for( int i = 0; + arr[ i ][ 0 ] != '\0' && pos >= 0; + ++i ) + { + if( pos == 0 ) + return arr[ i ]; + --pos; + } + abort(); // should never happen this way +} + +static int tbl_txt_lookup( const char* const arr[], const char* txt ) +{ + int pos = 0; + for( int i = 0; + arr[ i ][ 0 ] != '\0'; + ++i ) + { + if( qstricmp( txt, arr[ i ] ) == 0 ) + return pos; + ++pos; + } + return 0; +} + +void KTitleBarActionsConfig::setComboText( TQComboBox* combo, const char*txt ) +{ + if( combo == coTiDbl ) + combo->setCurrentItem( tbl_txt_lookup( tbl_TiDbl, txt )); + else if( combo == coTiAct1 || combo == coTiAct2 || combo == coTiAct3 ) + combo->setCurrentItem( tbl_txt_lookup( tbl_TiAc, txt )); + else if( combo == coTiInAct1 || combo == coTiInAct2 || combo == coTiInAct3 ) + combo->setCurrentItem( tbl_txt_lookup( tbl_TiInAc, txt )); + else if( combo == coTiAct4 ) + combo->setCurrentItem( tbl_txt_lookup( tbl_TiWAc, txt )); + else if( combo == coMax[0] || combo == coMax[1] || combo == coMax[2] ) + { + combo->setCurrentItem( tbl_txt_lookup( tbl_Max, txt )); + static_cast<ToolTipComboBox *>(combo)->changed(); + } + else + abort(); +} + +const char* KTitleBarActionsConfig::functionTiDbl( int i ) +{ + return tbl_num_lookup( tbl_TiDbl, i ); +} + +const char* KTitleBarActionsConfig::functionTiAc( int i ) +{ + return tbl_num_lookup( tbl_TiAc, i ); +} + +const char* KTitleBarActionsConfig::functionTiInAc( int i ) +{ + return tbl_num_lookup( tbl_TiInAc, i ); +} + +const char* KTitleBarActionsConfig::functionTiWAc(int i) +{ + return tbl_num_lookup( tbl_TiWAc, i ); +} + +const char* KTitleBarActionsConfig::functionMax( int i ) +{ + return tbl_num_lookup( tbl_Max, i ); +} + +void KTitleBarActionsConfig::load() +{ + config->setGroup("Windows"); + setComboText(coTiDbl, config->readEntry("TitlebarDoubleClickCommand","Shade").ascii()); + for (int t = 0; t < 3; ++t) + setComboText(coMax[t],config->readEntry(cnf_Max[t], tbl_Max[t]).ascii()); + + config->setGroup( "MouseBindings"); + setComboText(coTiAct1,config->readEntry("CommandActiveTitlebar1","Raise").ascii()); + setComboText(coTiAct2,config->readEntry("CommandActiveTitlebar2","Lower").ascii()); + setComboText(coTiAct3,config->readEntry("CommandActiveTitlebar3","Operations menu").ascii()); + setComboText(coTiAct4,config->readEntry("CommandTitlebarWheel","Nothing").ascii()); + setComboText(coTiInAct1,config->readEntry("CommandInactiveTitlebar1","Activate and raise").ascii()); + setComboText(coTiInAct2,config->readEntry("CommandInactiveTitlebar2","Activate and lower").ascii()); + setComboText(coTiInAct3,config->readEntry("CommandInactiveTitlebar3","Operations menu").ascii()); +} + +void KTitleBarActionsConfig::save() +{ + config->setGroup("Windows"); + config->writeEntry("TitlebarDoubleClickCommand", functionTiDbl( coTiDbl->currentItem() ) ); + for (int t = 0; t < 3; ++t) + config->writeEntry(cnf_Max[t], functionMax(coMax[t]->currentItem())); + + config->setGroup("MouseBindings"); + config->writeEntry("CommandActiveTitlebar1", functionTiAc(coTiAct1->currentItem())); + config->writeEntry("CommandActiveTitlebar2", functionTiAc(coTiAct2->currentItem())); + config->writeEntry("CommandActiveTitlebar3", functionTiAc(coTiAct3->currentItem())); + config->writeEntry("CommandInactiveTitlebar1", functionTiInAc(coTiInAct1->currentItem())); + config->writeEntry("CommandTitlebarWheel", functionTiWAc(coTiAct4->currentItem())); + config->writeEntry("CommandInactiveTitlebar2", functionTiInAc(coTiInAct2->currentItem())); + config->writeEntry("CommandInactiveTitlebar3", functionTiInAc(coTiInAct3->currentItem())); + + if (standAlone) + { + config->sync(); + if ( !kapp->dcopClient()->isAttached() ) + kapp->dcopClient()->attach(); + kapp->dcopClient()->send("twin*", "", "reconfigure()", TQString("")); + } +} + +void KTitleBarActionsConfig::defaults() +{ + setComboText(coTiDbl, "Shade"); + setComboText(coTiAct1,"Raise"); + setComboText(coTiAct2,"Lower"); + setComboText(coTiAct3,"Operations menu"); + setComboText(coTiAct4,"Nothing"); + setComboText(coTiInAct1,"Activate and raise"); + setComboText(coTiInAct2,"Activate and lower"); + setComboText(coTiInAct3,"Operations menu"); + for (int t = 0; t < 3; ++t) + setComboText(coMax[t], tbl_Max[t]); +} + + +KWindowActionsConfig::KWindowActionsConfig (bool _standAlone, KConfig *_config, TQWidget * parent, const char *) + : KCModule(parent, "kcmkwm"), config(_config), standAlone(_standAlone) +{ + TQString strWin1, strWin2, strWin3, strAllKey, strAll1, strAll2, strAll3, strAllW; + TQVBoxLayout *layout = new TQVBoxLayout(this, 0, KDialog::spacingHint()); + TQGrid *grid; + TQGroupBox *box; + TQLabel *label; + TQString strMouseButton1, strMouseButton3; + TQString txtButton1, txtButton3; + TQStringList items; + bool leftHandedMouse = ( KGlobalSettings::mouseSettings().handed == KGlobalSettings::KMouseSettings::LeftHanded); + +/** Inactive inner window ******************/ + + box = new TQVGroupBox(i18n("Inactive Inner Window"), this, "Inactive Inner Window"); + box->layout()->setMargin(KDialog::marginHint()); + box->layout()->setSpacing(KDialog::spacingHint()); + layout->addWidget(box); + 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); + + strMouseButton1 = i18n("Left button:"); + txtButton1 = i18n("In this row you can customize left click behavior when clicking into" + " the titlebar or the frame."); + + strMouseButton3 = i18n("Right button:"); + txtButton3 = i18n("In this row you can customize right click behavior when clicking into" + " the titlebar or the frame." ); + + if ( leftHandedMouse ) + { + tqSwap(strMouseButton1, strMouseButton3); + tqSwap(txtButton1, txtButton3); + } + + strWin1 = i18n("In this row you can customize left click behavior when clicking into" + " an inactive inner window ('inner' means: not titlebar, not frame)."); + + strWin3 = i18n("In this row you can customize right click behavior when clicking into" + " an inactive inner window ('inner' means: not titlebar, not frame)."); + + // Be nice to lefties + if ( leftHandedMouse ) tqSwap(strWin1, strWin3); + + label = new TQLabel(strMouseButton1, grid); + TQWhatsThis::add( label, strWin1 ); + + label = new TQLabel(i18n("Middle button:"), grid); + strWin2 = i18n("In this row you can customize middle click behavior when clicking into" + " an inactive inner window ('inner' means: not titlebar, not frame)."); + TQWhatsThis::add( label, strWin2 ); + + label = new TQLabel(strMouseButton3, grid); + TQWhatsThis::add( label, strWin3 ); + + items.clear(); + items << i18n("Activate, Raise & Pass Click") + << i18n("Activate & Pass Click") + << i18n("Activate") + << i18n("Activate & Raise"); + + TQComboBox* combo = new TQComboBox(grid); + combo->insertStringList(items); + connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + coWin1 = combo; + TQWhatsThis::add( combo, strWin1 ); + + combo = new TQComboBox(grid); + combo->insertStringList(items); + connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + coWin2 = combo; + TQWhatsThis::add( combo, strWin2 ); + + combo = new TQComboBox(grid); + combo->insertStringList(items); + connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + coWin3 = combo; + TQWhatsThis::add( combo, strWin3 ); + + +/** Inner window, titlebar and frame **************/ + + box = new TQVGroupBox(i18n("Inner Window, Titlebar && Frame"), this, "Inner Window, Titlebar and Frame"); + box->layout()->setMargin(KDialog::marginHint()); + box->layout()->setSpacing(KDialog::spacingHint()); + layout->addWidget(box); + TQWhatsThis::add( box, i18n("Here you can customize KDE's behavior when clicking somewhere into" + " a window while pressing a modifier key.")); + + grid = new TQGrid(5, Qt::Vertical, box); + + // Labels + label = new TQLabel(i18n("Modifier key:"), grid); + + strAllKey = i18n("Here you select whether holding the Meta key or Alt key " + "will allow you to perform the following actions."); + TQWhatsThis::add( label, strAllKey ); + + + strMouseButton1 = i18n("Modifier key + left button:"); + strAll1 = i18n("In this row you can customize left click behavior when clicking into" + " the titlebar or the frame."); + + strMouseButton3 = i18n("Modifier key + right button:"); + strAll3 = i18n("In this row you can customize right click behavior when clicking into" + " the titlebar or the frame." ); + + if ( leftHandedMouse ) + { + tqSwap(strMouseButton1, strMouseButton3); + tqSwap(strAll1, strAll3); + } + + label = new TQLabel(strMouseButton1, grid); + TQWhatsThis::add( label, strAll1); + + label = new TQLabel(i18n("Modifier key + middle button:"), grid); + strAll2 = i18n("Here you can customize KDE's behavior when middle clicking into a window" + " while pressing the modifier key."); + TQWhatsThis::add( label, strAll2 ); + + label = new TQLabel(strMouseButton3, grid); + TQWhatsThis::add( label, strAll3); + + label = new TQLabel(i18n("Modifier key + mouse wheel:"), grid); + strAllW = i18n("Here you can customize KDE's behavior when scrolling with the mouse wheel" + " in a window while pressing the modifier key."); + TQWhatsThis::add( label, strAllW); + + // Combo's + combo = new TQComboBox(grid); + combo->insertItem(i18n("Meta")); + combo->insertItem(i18n("Alt")); + connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + coAllKey = combo; + TQWhatsThis::add( combo, strAllKey ); + + items.clear(); + items << i18n("Move") + << i18n("Activate, Raise and Move") + << i18n("Toggle Raise & Lower") + << i18n("Resize") + << i18n("Raise") + << i18n("Lower") + << i18n("Minimize") + << i18n("Nothing"); + + combo = new TQComboBox(grid); + combo->insertStringList(items); + connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + coAll1 = combo; + TQWhatsThis::add( combo, strAll1 ); + + combo = new TQComboBox(grid); + combo->insertStringList(items); + connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + coAll2 = combo; + TQWhatsThis::add( combo, strAll2 ); + + combo = new TQComboBox(grid); + combo->insertStringList(items); + connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); + coAll3 = combo; + TQWhatsThis::add( combo, strAll3 ); + + combo = new TQComboBox(grid); + combo->insertItem(i18n("Raise/Lower")); + combo->insertItem(i18n("Shade/Unshade")); + combo->insertItem(i18n("Maximize/Restore")); + combo->insertItem(i18n("Keep Above/Below")); + 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())); + coAllW = combo; + TQWhatsThis::add( combo, strAllW ); + + layout->addStretch(); + + load(); +} + +KWindowActionsConfig::~KWindowActionsConfig() +{ + if (standAlone) + delete config; +} + +void KWindowActionsConfig::setComboText( TQComboBox* combo, const char*txt ) +{ + if( combo == coWin1 || combo == coWin2 || combo == coWin3 ) + combo->setCurrentItem( tbl_txt_lookup( tbl_Win, txt )); + else if( combo == coAllKey ) + combo->setCurrentItem( tbl_txt_lookup( tbl_AllKey, txt )); + else if( combo == coAll1 || combo == coAll2 || combo == coAll3 ) + combo->setCurrentItem( tbl_txt_lookup( tbl_All, txt )); + else if( combo == coAllW ) + combo->setCurrentItem( tbl_txt_lookup( tbl_AllW, txt )); + else + abort(); +} + +const char* KWindowActionsConfig::functionWin( int i ) +{ + return tbl_num_lookup( tbl_Win, i ); +} + +const char* KWindowActionsConfig::functionAllKey( int i ) +{ + return tbl_num_lookup( tbl_AllKey, i ); +} + +const char* KWindowActionsConfig::functionAll( int i ) +{ + return tbl_num_lookup( tbl_All, i ); +} + +const char* KWindowActionsConfig::functionAllW(int i) +{ + return tbl_num_lookup( tbl_AllW, i ); +} + +void KWindowActionsConfig::load() +{ + config->setGroup( "MouseBindings"); + setComboText(coWin1,config->readEntry("CommandWindow1","Activate, raise and pass click").ascii()); + setComboText(coWin2,config->readEntry("CommandWindow2","Activate and pass click").ascii()); + setComboText(coWin3,config->readEntry("CommandWindow3","Activate and pass click").ascii()); + setComboText(coAllKey,config->readEntry("CommandAllKey","Alt").ascii()); + setComboText(coAll1,config->readEntry("CommandAll1","Move").ascii()); + setComboText(coAll2,config->readEntry("CommandAll2","Toggle raise and lower").ascii()); + setComboText(coAll3,config->readEntry("CommandAll3","Resize").ascii()); + setComboText(coAllW,config->readEntry("CommandAllWheel","Nothing").ascii()); +} + +void KWindowActionsConfig::save() +{ + config->setGroup("MouseBindings"); + config->writeEntry("CommandWindow1", functionWin(coWin1->currentItem())); + config->writeEntry("CommandWindow2", functionWin(coWin2->currentItem())); + config->writeEntry("CommandWindow3", functionWin(coWin3->currentItem())); + config->writeEntry("CommandAllKey", functionAllKey(coAllKey->currentItem())); + config->writeEntry("CommandAll1", functionAll(coAll1->currentItem())); + config->writeEntry("CommandAll2", functionAll(coAll2->currentItem())); + config->writeEntry("CommandAll3", functionAll(coAll3->currentItem())); + config->writeEntry("CommandAllWheel", functionAllW(coAllW->currentItem())); + + if (standAlone) + { + config->sync(); + if ( !kapp->dcopClient()->isAttached() ) + kapp->dcopClient()->attach(); + kapp->dcopClient()->send("twin*", "", "reconfigure()", TQString("")); + } +} + +void KWindowActionsConfig::defaults() +{ + setComboText(coWin1,"Activate, raise and pass click"); + setComboText(coWin2,"Activate and pass click"); + setComboText(coWin3,"Activate and pass click"); + setComboText(coAllKey,"Alt"); + setComboText (coAll1,"Move"); + setComboText(coAll2,"Toggle raise and lower"); + setComboText(coAll3,"Resize"); + setComboText(coAllW,"Nothing"); +} diff --git a/twin/kcmtwin/twinoptions/mouse.h b/twin/kcmtwin/twinoptions/mouse.h new file mode 100644 index 000000000..49591e5d8 --- /dev/null +++ b/twin/kcmtwin/twinoptions/mouse.h @@ -0,0 +1,137 @@ +/* + * mouse.h + * + * Copyright (c) 1998 Matthias Ettrich <ettrich@kde.org> + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef __KKWMMOUSECONFIG_H__ +#define __KKWMMOUSECONFIG_H__ + +class KConfig; + +#include <tqwidget.h> +#include <kcmodule.h> +#include <tqcombobox.h> +#include <tqtooltip.h> + + +class ToolTipComboBox: public TQComboBox +{ + Q_OBJECT + +public: + ToolTipComboBox(TQWidget * owner, char const * const * toolTips_) + : TQComboBox(owner) + , toolTips(toolTips_) {} + +public slots: + void changed() {TQToolTip::add( this, i18n(toolTips[currentItem()]) );} + +protected: + char const * const * toolTips; +}; + + + +class KTitleBarActionsConfig : public KCModule +{ + Q_OBJECT + +public: + + KTitleBarActionsConfig( bool _standAlone, KConfig *_config, TQWidget *parent=0, const char* name=0 ); + ~KTitleBarActionsConfig( ); + + void load(); + void save(); + void defaults(); + +public slots: + void changed() { emit KCModule::changed(true); } + +private: + TQComboBox* coTiDbl; + + TQComboBox* coTiAct1; + TQComboBox* coTiAct2; + TQComboBox* coTiAct3; + TQComboBox* coTiAct4; + TQComboBox* coTiInAct1; + TQComboBox* coTiInAct2; + TQComboBox* coTiInAct3; + + ToolTipComboBox * coMax[3]; + + KConfig *config; + bool standAlone; + + const char* functionTiDbl(int); + const char* functionTiAc(int); + const char* functionTiWAc(int); + const char* functionTiInAc(int); + const char* functionMax(int); + + void setComboText(TQComboBox* combo, const char* text); + const char* fixup( const char* s ); + +private slots: + void paletteChanged(); + +}; + +class KWindowActionsConfig : public KCModule +{ + Q_OBJECT + +public: + + KWindowActionsConfig( bool _standAlone, KConfig *_config, TQWidget *parent=0, const char* name=0 ); + ~KWindowActionsConfig( ); + + void load(); + void save(); + void defaults(); + +public slots: + void changed() { emit KCModule::changed(true); } + +private: + TQComboBox* coWin1; + TQComboBox* coWin2; + TQComboBox* coWin3; + + TQComboBox* coAllKey; + TQComboBox* coAll1; + TQComboBox* coAll2; + TQComboBox* coAll3; + TQComboBox* coAllW; + + KConfig *config; + bool standAlone; + + const char* functionWin(int); + const char* functionAllKey(int); + const char* functionAll(int); + const char* functionAllW(int); + + void setComboText(TQComboBox* combo, const char* text); + const char* fixup( const char* s ); +}; + +#endif + diff --git a/twin/kcmtwin/twinoptions/twinactions.desktop b/twin/kcmtwin/twinoptions/twinactions.desktop new file mode 100644 index 000000000..8f0b7b0ba --- /dev/null +++ b/twin/kcmtwin/twinoptions/twinactions.desktop @@ -0,0 +1,233 @@ +[Desktop Entry] +Icon=kcmkwm +Type=Application +Exec=kcmshell twinactions +DocPath=kcontrol/windowmanagement/index.html#action-actions + +X-KDE-ModuleType=Library +X-KDE-Library=twinoptions +X-KDE-FactoryName=twinactions + +Name=Actions +Name[af]=Aksies +Name[ar]=الأفعال +Name[be]=Дзеянні +Name[bg]=Действия +Name[bn]=কাজ +Name[br]=Oberoù +Name[bs]=Akcije +Name[ca]=Accions +Name[cs]=Činnosti +Name[csb]=Dzejaniô +Name[cy]=Gweithredoedd +Name[da]=Handlinger +Name[de]=Aktionen +Name[el]=Ενέργειες +Name[eo]=Agoj +Name[es]=Acciones +Name[et]=Tegevused +Name[eu]=Ekintzak +Name[fa]=کنشها +Name[fi]=Toiminnot +Name[fo]=Tiltøk +Name[fy]=Aksjes +Name[ga]=Gníomhartha +Name[gl]=Accións +Name[he]=פעולות +Name[hi]=क्रियाएँ +Name[hr]=Aktivnosti +Name[hu]=Műveletek +Name[is]=Aðgerðir +Name[it]=Azioni +Name[ja]=動作 +Name[ka]=ქცევა +Name[kk]=Амалдар +Name[km]=អំពើ +Name[ko]=동작 +Name[lo]=ແອບພີເຄຊັ້ນ +Name[lt]=Veiksmai +Name[lv]=Darbības +Name[mk]=Акции +Name[mn]=Үйлдлүүл +Name[ms]=Tindakan +Name[mt]=Azzjonijiet +Name[nb]=Handlinger +Name[nds]=Akschonen +Name[ne]=कार्य +Name[nl]=Acties +Name[nn]=Handlingar +Name[nso]=Dikgato +Name[pa]=ਕਾਰਵਾਈਆਂ +Name[pl]=Czynności +Name[pt]=Acções +Name[pt_BR]=Ações +Name[ro]=Acțiuni +Name[ru]=Действия +Name[rw]=Ibikorwa +Name[se]=Doaimmat +Name[sk]=Akcie +Name[sl]=Dejanja +Name[sr]=Акције +Name[sr@Latn]=Akcije +Name[ss]=Tento +Name[sv]=Åtgärder +Name[ta]=செயல்கள் +Name[te]=చర్యలు +Name[tg]=Амалиёт +Name[th]=การกระทำ +Name[tr]=Eylemler +Name[tt]=Ğämällär +Name[uk]=Дії +Name[uz]=Amallar +Name[uz@cyrillic]=Амаллар +Name[ven]=Nyito +Name[vi]=Gõ phím +Name[wa]=Accions +Name[xh]=Iintshukumo +Name[zh_CN]=动作 +Name[zh_TW]=動作 +Name[zu]=Iminyakazo + +Comment=Configure keyboard and mouse settings +Comment[af]=Konfigureer sleutelbord en muis instellings +Comment[ar]=إعداد لوحة المفاتيح و الفأرة +Comment[be]=Настаўленні клавіятуры і мышы +Comment[bg]=Настройване на действията с клавиатурата и мишката +Comment[bn]=কীবোর্ড এবং মাউস সেটিংস কনফিগার করুন +Comment[br]=Kefluniañ ar stokellaoueg hag al logodenn +Comment[bs]=Podesite postavke tastature i miša +Comment[ca]=Aquí podeu configurar l'arranjament del teclat i del ratolí +Comment[cs]=Nastavení klávesnice a myši +Comment[csb]=Kònfigùracëjô nastôwù klawiaturë ë mëszë +Comment[cy]=Ffurfweddu gosodiadau bysellfwrdd a llygoden +Comment[da]=Indstil tastatur og museopsætning +Comment[de]=Einstellungen für Tastatur und Maus festlegen +Comment[el]=Ρυθμίστε το πληκτρολόγιο και το ποντίκι +Comment[eo]=Agordu la klavaron kaj la muson +Comment[es]=Configuración del teclado y del ratón +Comment[et]=Klaviatuuri ja hiire seadistamine +Comment[eu]=Konfiguratu teklatua eta saguaren ezarpenak +Comment[fa]=پیکربندی تنظیمات صفحه کلید و موشی +Comment[fi]=Muokkaa näppäimistön ja hiiren asetuksia +Comment[fr]=Configuration des réglages du clavier et de la souris +Comment[fy]=Hjir kinne jo de ynstellings fan toetseboerd en mûs ynstelle +Comment[ga]=Cumraigh socruithe an mhéarchláir agus na luiche +Comment[gl]=Configurar as opcións do teclado e o rato +Comment[he]=שינוי הגדרות המקלדת והעכבר +Comment[hi]=कुंजीपट तथा माउस विन्यास कॉन्फ़िगर करें +Comment[hr]=Konfiguriranje postavki tipkovnice i miša +Comment[hu]=A billentyűzet- és egérkezelés beállításai +Comment[is]=Stilla lyklaborð og mús +Comment[it]=Configura le impostazioni della tastiera e del mouse +Comment[ja]=キーボードとマウスの設定 +Comment[ka]=კლავიატურის და თაგუნას პარამეტრების კონფიგურაცია +Comment[kk]=Перенетақта мен тышқанның параметрлерін баптау +Comment[km]=កំណត់រចនាសម្ព័ន្ធការកំណត់ក្ដារចុច និងកណ្ដុរ +Comment[ko]=키보드와 마우스 설정 +Comment[lo]=ປັບແຕ່ງການຕັ້ງຄ່າລະບົບດັດສະນີ +Comment[lt]=Konfigūruoti klaviatūros ir pelės nustatymus +Comment[lv]=Šeit Jūs varat konfigurēt tastatūras un peles parametrus +Comment[mk]=Конфигурирајте ги поставувањата на тастатурата и глушецот +Comment[mn]=Гар ба Хулгана тохируулах +Comment[mt]=Ikkonfigura t-tastiera u l-maws +Comment[nb]=Innstillinger for tastatur og mus +Comment[nds]=Tastatuur un Muus instellen +Comment[ne]=कुञ्जीपाटी र माउस सेटिङ कन्फिगर गर्नुहोस् +Comment[nl]=Hier kunt u de instellingen van toetsenbord en muis instellen +Comment[nn]=Innstillingar for tastatur og mus +Comment[nso]=Beakanya dipeakanyo tsa legotlo le keyboard +Comment[pa]=ਕੀਬੋਰਡ ਅਤੇ ਮਾਊਸ ਸੈਟਿੰਗ ਦੀ ਸੰਰਚਨਾ +Comment[pl]=Konfiguracja ustawień klawiatury i myszy +Comment[pt]=Configuração das opções do teclado e do rato +Comment[pt_BR]=Configura as preferências de teclado e mouse +Comment[ro]=Configurează setările de tastatură și mouse +Comment[ru]=Настройка параметров клавиатуры и мыши +Comment[rw]= Kuboneza mwandikisho n'amagenamiterere imbeba +Comment[se]=Heivet boallobeavddi ja sáhpána +Comment[sk]=Nastavenie klávesnice a myši +Comment[sl]=Nastavitve tipkovnice in miške +Comment[sr]=Подешавање поставки тастатуре и миша +Comment[sr@Latn]=Podešavanje postavki tastature i miša +Comment[sv]=Anpassa inställningar för tangentbord och mus +Comment[ta]=விசைப்பலகையையும் சுட்டியையும் வடிவமை +Comment[tg]=Танзимоти забонак ва муш +Comment[th]=ปรับแต่งค่าแป้นพิมพ์และเม้าส์ +Comment[tr]=Klavye ve fare ayarlarını buradan yapabilirsiniz +Comment[tt]=Töylek belän küse eşläwen caylaw +Comment[uk]=Налаштування клавіатури та мишки +Comment[uz]=Sichqoncha va tugmatagni moslash +Comment[uz@cyrillic]=Сичқонча ва тугматагни мослаш +Comment[ven]=Dzudzanyani mavhekanyele a mausu na khiibodo +Comment[vi]=Cấu hình bàn phím và chuột +Comment[wa]=Apontiaedjes del sori eyet del taprece +Comment[xh]=Qwalasela izicwangciso zebhodi yezitshixho neze mouse +Comment[zh_CN]=配置键盘和鼠标设置 +Comment[zh_TW]=設定鍵盤與滑鼠的設定值 +Comment[zu]=Hlanganisela izilungiselelo zebhodi yokhiye kanye neze-mouse + +Keywords=shade,maximise,maximize,minimize,minimise,lower,operations menu,titlebar,resize +Keywords[ar]=ظلل,كبر كبّر,صغر صغّر,خفض,عمليات,قائمة,تغيير القياس,تظليل,تكبير,تصغير,الى الأسفل,قائمة العمليات,شريط العنوان,تحجيم +Keywords[be]=Згарнуць,Найбольшыць,Найменшыць,Змяніць памер,Меню аперацыяў,Меню дзеянняў,Загаловак,shade,maximise,maximize,minimize,minimise,lower,operations menu,titlebar,resize +Keywords[bg]=сгъване, максимизиране, минимизиране, заглавие, промяна, размер, shade, maximise, maximize, minimize, minimise, lower, operations menu, titlebar, resize +Keywords[ca]=plegar,maximitzar,minimitzar,passar al davant,operaciones del menú, barra del títol,redimensionar +Keywords[cs]=zarolování,maximalizace,minimalizace,nabídka činností,titulek,změna velikosti +Keywords[csb]=ceniô,maksymalizacëjô,minimalizacëjô,niżi,menu dzejaniów,titlowô lëstew,zmiana miarë +Keywords[cy]=arliwio,ehangu,lleihau,iselhau,dewislen gweithrediadau, bar y teitl, ail-feintio +Keywords[da]=skyg,maksimér,minimér,sænk,operationsmenu,titellinje,ændr størrelse +Keywords[de]=Fensterheber,Maximieren,Minimieren,Nach oben/unten,Titelleiste,Größe ändern +Keywords[el]=τύλιγμα,μεγιστοποίηση,μεγιστοποίηση,ελαχιστοποίηση,ελαχιστοποίηση,κατέβασμα,μενού χειρισμών,μπάρα τίτλου,αλλαγή μεγέθους +Keywords[eo]=maksimigi,minimumigi,menuo,titolo,grandecŝanĝi,grandigi +Keywords[es]=recoger,maximizar,minimizar,pasar al frente,pasar atrás,operaciones,menñu barra de título,redimensionarmenu,titlebar,resize +Keywords[et]=varjamine,maksimeerimine,minimeerimine,toimingute menüü,langetamine,tõstmine,tiitliriba,suuruse muutmine +Keywords[eu]=bildu,maximizatu,minimizatu,atzera eraman,eragiketak, menua,titulu-barra,tamaina aldatu +Keywords[fa]=سایه، بیشینهسازی، بیشینهسازی، کمینهسازی، کمینهسازی، پایینتر، گزینگان عملیات، میله عنوان، تغییر اندازه +Keywords[fi]=varjosta,suurenna,pienennä,laske,toimintovalikko,otsikkopalkki,vaihda kokoa +Keywords[fr]=fondu,maximiser,enrouler,réduire,abaisser, menu des opérations,barre de titre,redimensionner +Keywords[fy]=shade,oprollen,maximaliseren,minimaliseren,naar achtergrond,lower,menu,titelbalk,grootte wijzigen,oprôlje,maksimalisearje,minimalisearje,nei eftergrûn,grutte +Keywords[ga]=scáthaigh,uasmhéadaigh,íosmhéadaigh,íoslaghdaigh,laghdaigh,roghchlár oibríochta,barra teidil,athraigh méid +Keywords[gl]=sombra,maximizar,maximizar,minimizar,baixar,menú de operacións,barra de título,redimensionar +Keywords[he]=גלילה,הגדלה,מזעור,שליחה לרקע,תפריט פעולות,שורת כותרת,שינוי גודל,shade,maximise,maximize,minimize,minimise,lower,operations menu,titlebar,resize +Keywords[hi]=शेड,अधिकतम,बड़ा,न्यूनतम,छोटा,नीचे,ऑपरेशन्स मेन्यू,शीर्षक-पट्टी,नयाआकार +Keywords[hr]=shade,maximise,maximize,minimize,minimise,lower,operations menu,titlebar,resize,sjena,maksimiziranje,minimiziranje,postupci izbornika,naslov,naslovna traka,promjena veličine +Keywords[hu]=felgördítés,maximalizálás,maximalizált,minimalizálás,minimalizált,hátraengedés,műveletek menü,címsor,átméretezés +Keywords[is]=rúlla upp,skyggja,hámarka,lágmarka,sökkva,aðgerðavalmynd, titilrönd,breyta stærð +Keywords[it]=arrotola,massimizza,ingrandisci,minimizza,alza,abbassa,menu operazioni, barra del titolo,titolo,ridimensiona,sposta +Keywords[ja]=シェード,最大化,最小化,後面へ,操作メニュー,タイトルバー,サイズ変更,リサイズ +Keywords[km]=ស្រមោល,ពង្រីកអតិបរមា,បង្រួមអប្បបរមា,បន្ទាប់ចុះក្រោម,ម៉ឺនុយប្រតិបត្តិការ,របារចំណងជើង,ប្ដូរទំហំ +Keywords[lt]=shade,maximise,maximize,minimize,minimise,lower,operations menu,titlebar,resize, išdidinti,sumažinti,paslėpti, operacijų meniu,antraštės juosta,pakeisti dydį +Keywords[lv]=ēnot,maksimizēt,maksimizē,minimizet,minimizē,zemāks,darbības izvēlne,virsraksta josla,mainīt izmēru +Keywords[mk]=shade,maximise,maximize,minimize,minimise,lower,operations menu,titlebar,resize,засени,рашири,спушти,мени со операции,насловна лента,промени големина +Keywords[mn]=Цонхны сүүдэр,Томсгох,Жижигсгэх,Дээшээ/доошоо, Толгойн самбар,Хэмжээ өөрчилөх, Үйлдэл цэс +Keywords[mt]=shade,maximise,maximize,minimize,minimise,lower,operations menu,titlebar,resize,massimizza,minimma,baxxi,ċekken,kabbar,daqqas +Keywords[nb]=rulle opp,maksimere,minimere,endre størrelse,operasjoner,meny,tittel,skalere,vindu, tittellinje +Keywords[nds]=inrullen,maximeren,minimeren,utrullen,Akschonenmenü,Titelbalken,Grött ännern +Keywords[ne]=छायाँ, बढाउनु, बढाउनु, घटाउनु, घटाउनु,भन्दा तल, सञ्चालन मेनु, शीर्षकपट्टी, रिसाइज +Keywords[nl]= shade,oprollen,maximaliseren,minimaliseren,naar achtergrond,lower,menu,tibelbalk,grootte wijzigen +Keywords[nn]=rull opp,maksimer,minimer,senk,hev,operasjonsmeny,tittellinje,endra storleik,vindauge +Keywords[nso]=ntshofatsa,oketsa,oketsa,fokotsa,fokotsa,isa fase,menu wa diphethagatso,bar ya leina,popoleswa +Keywords[pa]=shade,maximise,maximize,minimize,minimise,lower,operations menu,titlebar,resize,ਨਿਊਨਤਮ,ਅਧਿਕਤਮ,ਕਾਰਵਾਈ ਮੇਨੂ,ਮੁੜ-ਅਕਾਰ +Keywords[pl]=cień,maksymalizacja,minimalizacja,niżej,menu działań,belka tutułowa, zmiana rozmiaru +Keywords[pt]=enrolar,maximizar,minimizar,baixar,menu de operações,barra de título,dimensionar +Keywords[pt_BR]=esconder,maximizar,minimizar,menor,menu de operações,barra de operações,redimensionar +Keywords[ro]=derulare,maximizare,minimizare,meniul de operații,bara de titlu,redimensionare +Keywords[rw]=igicucu,kugira kinini,kugira gito,kugira gito,ntoya,ibikubiyemo by'ibikorwa,umwanyabikoresho,ihindurangero +Keywords[se]=rulle bajáš,maksimere,minimere,vuolit,dáhpáhusat,fállu,fálut,namahusholga,namahus,skálere +Keywords[sk]=zabalenie,maximalizácia,minimalizácia,presun dozadu,presun dopredu,operácie menu,titulok,zmena veľkosti +Keywords[sl]=zvij,raztegni,povečaj,pomanjšaj,razpni,menu operacij,naslovna vrstica,velikost +Keywords[sr]=shade,maximise,maximize,minimize,minimise,lower,operations menu,titlebar,resize,намотавање,максимизуј,минимизуј,ниже,мени операција,насловна линија,промена величине +Keywords[sr@Latn]=shade,maximise,maximize,minimize,minimise,lower,operations menu,titlebar,resize,namotavanje,maksimizuj,minimizuj,niže,meni operacija,naslovna linija,promena veličine +Keywords[sv]=rulla upp,maximera,minimera,sänk,åtgärdsmeny,namnlist,ändra storlek +Keywords[ta]=நிழல், பெரிதாக்கு,பெரிதாக்கு,சிறிதாக்கு, சிறிதாக்கு, குறைந்த,செயல்கள் பட்டி,தலைப்பு பட்டி, அளவை மாற்று +Keywords[th]=พับเก็บ,ขยายเต็มจอ,ย่อเล็กสุด,อยู่ด้านล่าง,เมนูปฏิบัติการ,แถบหัวเรื่อง,ปรับขนาด +Keywords[tr]=topla,küçült,büyüt,indir,işlemler,araç çubuğu +Keywords[tt]=shade,maximise,maximize,minimize,minimise,lower,operations saylaq,titlebar,resize +Keywords[uk]=згорнути,мінімізувати,максимізувати,опустити, меню операцій,смужка титулу,зміна розміру +Keywords[uz]=soyalash,yoyish,yigʻish,orqaga,amallar menyusi,sarlavha,resize +Keywords[uz@cyrillic]=соялаш,ёйиш,йиғиш,орқага,амаллар менюси,сарлавҳа,resize +Keywords[ven]=kovhekana,engedza,engedza,fhungudza,fhungudza,fhasi,mashumele a menu, bara ya thoho,uitulula saizi +Keywords[vi]=cuốn,phóng to,phóng to,thu nhỏ,thu nhỏ,hạ thấp,các thao tác trên thực đơn,tên thanh,thay đổi cỡ +Keywords[wa]=ombe,ombion,å pus grand,, pus ptit,djivêyes des operåcions,bår di tite,candjî li grandeu +Keywords[xh]=umthunzi,yandisa,yandisa,ncipisa nciphisa,yehlisa,menu zemisebenzi,iba yewonga,yenza ubungakanani kwakhona +Keywords[zh_CN]=shade,maximise,maximize,minimize,minimise,lower,operations menu,titlebar,resize,卷起,最大化,最小化,降低,操作菜单,标题栏,缩放 +Keywords[zh_TW]=shade,maximise,maximize,minimize,minimise,lower,operations menu,titlebar,resize,收起,最大化,最小化,降下,操作選單,標題列,重設大小 +Keywords[zu]=umthunzi,khulisa,khulisa,nciphisa,nciphisa,okungezansi, imenu yemisebenzi,ibha yesihloko,shintsha usayizi diff --git a/twin/kcmtwin/twinoptions/twinadvanced.desktop b/twin/kcmtwin/twinoptions/twinadvanced.desktop new file mode 100644 index 000000000..541f93e7f --- /dev/null +++ b/twin/kcmtwin/twinoptions/twinadvanced.desktop @@ -0,0 +1,232 @@ +[Desktop Entry] +Icon=kcmkwm +Type=Application +Exec=kcmshell twinadvanced +DocPath=kcontrol/windowmanagement/index.html#action-advanced + +X-KDE-ModuleType=Library +X-KDE-Library=twinoptions +X-KDE-FactoryName=twinadvanced + +Name=Advanced +Name[af]=Gevorderde +Name[ar]=متقدم +Name[be]=Адмысловыя +Name[bg]=Допълнителни +Name[bn]=অগ্রসর +Name[br]=Barek +Name[bs]=Napredno +Name[ca]=Avançat +Name[cs]=Pokročilé +Name[csb]=Awansowóné +Name[cy]=Uwch +Name[da]=Avanceret +Name[de]=Erweitert +Name[el]=Προχωρημένα +Name[eo]=Pliaj +Name[es]=Avanzado +Name[et]=Muu +Name[eu]=Aurreratua +Name[fa]=پیشرفته +Name[fi]=Lisäasetukset +Name[fo]=Tilkomið +Name[fr]=Avancé +Name[fy]=Avansearre +Name[ga]=Casta +Name[gl]=Avanzado +Name[he]=מתקדם +Name[hi]=विस्तृत +Name[hr]=Napredno +Name[hu]=Speciális +Name[is]=Ítarlegt +Name[it]=Avanzate +Name[ja]=詳細 +Name[ka]=დამატებით +Name[kk]=Қосымша +Name[km]=កម្រិតខ្ពស់ +Name[ko]=고급 +Name[lo]=ັຝຣັ່ງ +Name[lt]=Sudėtingiau +Name[lv]=Paplašināts +Name[mk]=Напредни +Name[mn]=Өргөтгөсөн +Name[ms]=Lanjutan +Name[mt]=Avvanzat +Name[nb]=Avansert +Name[nds]=Verwiedert +Name[ne]=उन्नत +Name[nl]=Geavanceerd +Name[nn]=Avansert +Name[nso]=Beetswepele +Name[pa]=ਤਕਨੀਕੀ +Name[pl]=Zaawansowane +Name[pt]=Avançado +Name[pt_BR]=Avançado +Name[ro]=Avansat +Name[ru]=Дополнительно +Name[rw]=Bihanitse +Name[se]=Viiddiduvvon +Name[sk]=Pokročilé +Name[sl]=Napredno +Name[sr]=Напредно +Name[sr@Latn]=Napredno +Name[ss]=Sembili +Name[sv]=Avancerat +Name[ta]=உயர்நிலை +Name[te]=ఆధునిక +Name[tg]=Пешрафта +Name[th]=เพิ่มเติม +Name[tr]=Gelişmiş +Name[tt]=Kiñäytep +Name[uk]=Додатково +Name[uz]=Qoʻshimcha +Name[uz@cyrillic]=Қўшимча +Name[ven]=Zwa khwinesa +Name[vi]=Nâng cao +Name[wa]=Sipepieus +Name[xh]=Ebhekisa phambili +Name[zh_CN]=高级 +Name[zh_TW]=進階 +Name[zu]=Okwezinga eliphezulu + +Comment=Configure advanced window management features +Comment[af]=Konfigureer gevorderde venster bestuuring funksies +Comment[ar]=تهيئة ميزات النوافذ المتقدمة +Comment[be]=Настаўленне адмысловых здольнасцяў кіравання вокнамі +Comment[bg]=Настройване допълнителните параметри на прозорците +Comment[bn]=উইণ্ডো ম্যানেজমেন্টের ক্ষুদ্রাতিক্ষুদ্র বৈশিষ্ট্য কনফিগার করুন +Comment[bs]=Podesite napredne mogućnosti upravljanja prozorima +Comment[ca]=Aquí podeu configurar les característiques avançades de la gestió de finestres +Comment[cs]=Nastavení pokročilých vlastností správce oken +Comment[csb]=Kònfigùracëjô awansowónëch òptacëji sprôwianiô òknama +Comment[cy]=Ffurfweddu Nodweddion Uwch Trefnu Ffenestri +Comment[da]=Indstil avancerede vindueshåndteringsegenskaber +Comment[de]=Erweiterte Fensterverwaltung einrichten +Comment[el]=Ρυθμίστε προχωρημένα χαρακτηριστικά της διαχείρισης παραθύρων +Comment[eo]=Agordu la pli bonajn fenestroadministrilecojn +Comment[es]=Configuración de las propiedades avanzadas del gestor de ventanas +Comment[et]=Aknahalduri seadistamine +Comment[eu]=Konfiguratu leiho kudeaketaren ezaugarri aurreratuak +Comment[fa]=پیکربندی ویژگیهای مدیریت پنجرۀ پیشرفته +Comment[fi]=Muokkaa ikkunoinnin ominaisuuksien lisäasetuksia +Comment[fr]=Configuration des fonctionnalités de gestion avancée des fenêtres +Comment[fy]=Hjir kinne jo de avansearre finsterbehearmooglikheden ynstelle +Comment[ga]=Cumraigh ardghnéithe bhainisteoireacht na bhfuinneog +Comment[gl]=Configurar as características avanzadas da xestión de fiestras +Comment[he]=שינוי הגדרות מתקדמות של ניהול חלונות +Comment[hi]=विस्तृत विंडो प्रबंधन विशेषता कॉन्फ़िगर करें +Comment[hr]=Konfiguriranje naprednih svojstava upravitelja prozora +Comment[hu]=Az ablakkezelés speciális beállításai +Comment[is]=Stilla ítarlegri hegðan setustjóra +Comment[it]=Configura le funzioni avanzate del gestore delle finestre +Comment[ja]=ウィンドウ管理機能の詳細設定 +Comment[ka]=ფანჯრების მენეჯერის დამატებითი ფუნქციების კონფიგურაცია +Comment[kk]=Терезе басқаруының қосымша параметрлерін баптау +Comment[km]=កំណត់រចនាសម្ព័ន្ធលក្ខណៈពិសេសការគ្រប់គ្រងបង្អួចកម្រិតខ្ពស់ +Comment[ko]=고급 창 관리자 기능 설정하기 +Comment[lo]=ທ່ານສາມາດປັບແຕ່ງການທຳງານຂອງເຄື່ອງມືຈັດການເຊສຊົນໄດ້ທີ່ນີ້ +Comment[lt]=Konfigūruoti sudėtingesnes langų tvarkymo savybes +Comment[lv]=Šeit Jūs varat konfigurēt logu pārvaldīšanas iespējas +Comment[mk]=Конфигурирајте ги напредните можности за менаџмент на прозорците +Comment[mn]=Өргөтгөсөн цонхны удирдлага тохируулах +Comment[mt]=Setings avvanzati tal-immaniġġjar tal-windows +Comment[nb]=Tilpass avansert vindusbehandling +Comment[nds]=Verwiederte Finsterinstellen +Comment[ne]=उन्नत सञ्झ्याल व्यवस्थापन आकृति कन्फिगर गर्नुहोस् +Comment[nl]=Hier kunt u de geavanceerde vensterbeheermogelijkheden instellen +Comment[nn]=Set opp avanserte vindaugshandsamarfunksjonar +Comment[nso]=Beakanya dika tseo di beetswego pele tsa taolo ya window +Comment[pa]=ਤਕਨੀਕੀ ਝਰੋਖਾ ਪਰਬੰਧਨ ਫੀਚਰ ਸੰਰਚਨਾ +Comment[pl]=Konfiguracja zaawansowanych opcji zarządzania oknami +Comment[pt]=Configuração das funcionalidades de gestão de janelas avançadas +Comment[pt_BR]=Configura as características avançadas de gerenciamento de janela +Comment[ro]=Configurează caracteristicile de management al ferestrelor +Comment[ru]=Настройка дополнительных функций менеджера окон +Comment[rw]=Kuboneza ibijyanye n'ubuyobozi buhanitse bw'idirishya +Comment[se]=Heivet viiddiduvvon lásegieđahanfunkšuvnnaid +Comment[sk]=Nastavenie pokročilých možností správy okien +Comment[sl]=Nastavitve dodatnih možnosti upravljanja oken +Comment[sr]=Подешавање напредних могућности управљања прозорима +Comment[sr@Latn]=Podešavanje naprednih mogućnosti upravljanja prozorima +Comment[sv]=Anpassa avancerade fönsterhanteringsfunktioner +Comment[ta]=மேம்பட்ட சாளர மேலாளரின் தன்மைகளை வடிவமை +Comment[tg]=Танзими мудирияти пешрафтаи тирезаҳо +Comment[th]=ปรับแต่งคุณสมบัติเพิ่มเติมของการจัดการหน้าต่าง +Comment[tr]=Gelişmiş pencere yönetim özelliklerini yapılandır +Comment[tt]=Täräzä idäräçeneñ östämä çaraların caylaw +Comment[uk]=Налаштування додаткових можливостей керування вікнами +Comment[uz]=Oyna boshqaruvning koʻshimcha imkoniyatlarini moslash +Comment[uz@cyrillic]=Ойна бошқарувнинг кўшимча имкониятларини мослаш +Comment[ven]=Dzudzanyani zwitenwa zwa vhulanguli ha khwinesa +Comment[vi]=Cấu hình các tính năng quản lý cửa sổ nâng cao +Comment[wa]=Apontiaedje des spepieusès fonccionålités do manaedjaedje des purneas +Comment[xh]=Qwalasela imisebenzi esemqoka ebhekisa phambili yophatho lwe window +Comment[zh_CN]=配置高级窗口管理特性 +Comment[zh_TW]=設定進階視窗管理功能 +Comment[zu]=Hlanganisela amalungu okuphathwa kwe-window yezinga eliphezulu + +Keywords=shading,border,hover,active borders +Keywords[af]=shading,border,hover,active grense +Keywords[ar]=shading,border,hover,active borders,تظليل,حافة,الحواف النشطة +Keywords[be]=Згортванне,Мяжа,Актыўныя межы,Актыўныя краі,shading,border,hover,active borders +Keywords[bg]=рамка, сянка, фокус, активиране, shading, border, hover, active borders +Keywords[ca]=plegat,vora,desplegat automàtic,vores actives +Keywords[cs]=zarolování,vyrolování,okraj,přejezd myší,aktivní okraje +Keywords[csb]=cenienié,grańce,przesëwanié nad,aktiwné grańce +Keywords[cy]=arliwio,ymyl,hofran,ymylon weithgar +Keywords[da]=skygning,kant,svæv,aktive kanter +Keywords[de]=Umrandung,Aktive Ränder,Schweben,Fensterheber +Keywords[el]=τύλιγμα,περίγραμμα,hover,ενεργά όρια +Keywords[eo]=bordo,ombro,ŝvebo +Keywords[es]=recogiendo,borde,ratón sobre,bordes activos +Keywords[et]=varjamine,piire,hover,aktiivsed piirded +Keywords[eu]=biltzen,ertza,gainean,ertz aktiboak +Keywords[fa]=سایهزنی، لبه، پلکیدن، لبههای فعال +Keywords[fi]=varjostus,kehys,kellunta,aktiiviset kehykset +Keywords[fr]=bordures,cacher,couvrir,bordures actives +Keywords[fy]=oprollen,oprôlje,afrollen,ôfrôlje,hoover,actieve randen,aktive rânen,randen magnetisch,magnetische randen +Keywords[ga]=scáthú,imlíne,foluain,imlínte beo +Keywords[gl]=sombra,beira,beiras activas,flotar +Keywords[he]=גלילה,מסגרת,גבול,ריחוף,גבולות פעילים,shading,border,hover,active borders +Keywords[hi]=शेडिंग,किनारा,हावर,सक्रिय किनारे +Keywords[hr]=shading,border,hover,active borders,osjenčavanje,obrubi,lebdjeće,aktivni obrubi +Keywords[hu]=árnyékolás,szegély,lebegés,aktív szegélyek +Keywords[is]=rúlla upp,skyggja,rammi,svif,hover,virkir rammar +Keywords[it]=arrotola,bordi,passaggio del mouse,bordi attivi +Keywords[ja]=畳む,境界,復元,アクティブ境界 +Keywords[km]=ស្រមោល,ស៊ុម,សំកាំង,ស៊ុមសកម្ម +Keywords[lt]=shading,border,hover,active borders, tik antraštės juosta, rėmelis, aktyvūs rėmeliai +Keywords[lv]=ēnošana,mala,hover,aktīvās malas +Keywords[mk]=shading,border,hover,active borders,засенчување,граница,лебди,активни граници +Keywords[mn]=Сүүдэр,Идэвхитэй хүрээ,Арьс,Хүрээ +Keywords[mt]=shading,border,hover,active borders,bordura +Keywords[nb]=rull opp,sveve over,ramme,aktive rammer,kant +Keywords[nds]=Inrullen,Utrullen,Rahmen,hover,aktiven Rahmen +Keywords[ne]=छायाँ, किनारा, होभर, सक्रिय किनारा +Keywords[nl]=oprollen,afrollen,rand,hoover,actieve randen,randen magnetisch,magnetische randen +Keywords[nn]=rull opp,ramme,vindaugsramme,vindauge,mus over,aktive kantar +Keywords[nso]=ntshofatsa,mollwane,hover,mellwane yeo e berekago +Keywords[pl]=cieniowanie,granice,przesuwanie ponad,aktywne granice +Keywords[pt]=enrolamento,contorno,passar por cima,contornos activos +Keywords[pt_BR]=ocultamento,borda,pairar,bordas ativas +Keywords[ro]=strîngere,margine,margini active +Keywords[rw]=ubwijime,urubibi,kureremba,imbibi zikora +Keywords[se]=shading,border,hover,active borders,aktiivalaš láse,láse,aktiivalaš ravddat +Keywords[sk]=zabalenie,okraj,presun,aktívne okraje +Keywords[sl]=senčenje,rob,meja,lebdenje,aktivni robovi +Keywords[sr]=намотавање,ивица,лебдење,активне ивице +Keywords[sr@Latn]=namotavanje,ivica,lebdenje,aktivne ivice +Keywords[sv]=skuggning,kant,sväva,aktiva kanter +Keywords[ta]=நிழலிடுதல்,விளிம்பு,ஹோவர், செயலில் உள்ள விளிம்புகள் +Keywords[th]=พับเก็บ,กรอบ,อยู่เหนือ,กรอบที่ทำงาน +Keywords[tr]=toplama,sınır,etkin kenarlıklar +Keywords[uk]=згортання,рамка,проходження,активні рамки +Keywords[uz]=soyalash,chegara,aktiv chegaralar,hover +Keywords[uz@cyrillic]=соялаш,чегара,актив чегаралар,hover +Keywords[ven]=murunzi,mukano,hover,mikano i tshilaho +Keywords[vi]=che phủ,bờ,lượn,bờ hoạt động +Keywords[wa]=ombe,ombraedje,boird,costé,hover,ovrants boirds +Keywords[xh]=ulwenziwo lwesithuba,umda,ixhonyiwe,imida esebenzayo +Keywords[zh_CN]=shading,border,hover,active borders,卷起,边框,悬停,激活边框 +Keywords[zh_TW]=shading,border,hover,active borders,收起,邊框,停留,作用中邊框 +Keywords[zu]=ukusitha,umngcele,didizela,imingcele enyakazayo diff --git a/twin/kcmtwin/twinoptions/twinfocus.desktop b/twin/kcmtwin/twinoptions/twinfocus.desktop new file mode 100644 index 000000000..541c82501 --- /dev/null +++ b/twin/kcmtwin/twinoptions/twinfocus.desktop @@ -0,0 +1,222 @@ +[Desktop Entry] +Icon=kcmkwm +Type=Application +Exec=kcmshell twinfocus +DocPath=kcontrol/windowmanagement/index.html#action-focus + +X-KDE-ModuleType=Library +X-KDE-Library=twinoptions +X-KDE-FactoryName=twinfocus + +Name=Focus +Name[af]=Fokus +Name[ar]=التركيز +Name[be]=Фокус +Name[bg]=Фокус +Name[bn]=ফোকাস +Name[br]=Fokus +Name[bs]=Fokus +Name[cs]=Zaměření +Name[csb]=Zrëszanié +Name[cy]=Canolbwynt +Name[da]=Fokus +Name[de]=Aktivierung +Name[el]=Εστίαση +Name[eo]=Fokuso +Name[es]=Foco +Name[et]=Fookus +Name[eu]=Fokua +Name[fa]=کانون +Name[fi]=Kohdistus +Name[ga]=Fócas +Name[gl]=Foco +Name[he]=התמקדות +Name[hi]=फ़ोकस +Name[hr]=Fokus +Name[hu]=Fókuszálás +Name[id]=Fokus +Name[is]=Virkni +Name[ja]=フォーカス +Name[ka]=ფოკუსი +Name[kk]=Назар +Name[km]=ផ្ដោតអារម្មណ៍ +Name[ko]=초점 +Name[lo]=ຫີນ +Name[lt]=Fokusas +Name[lv]=Fokuss +Name[mk]=Фокусирање +Name[mn]=Идэвхижүүлэх +Name[ms]=Fokus +Name[nb]=Fokus +Name[nds]=Fokus +Name[ne]=फोकस +Name[nn]=Fokus +Name[nso]=Tebeledisiso +Name[pa]=ਕੇਂਦਰ +Name[pl]=Ognisko +Name[pt]=Foco +Name[pt_BR]=Foco +Name[ru]=Фокус +Name[rw]=Igaragaza rikeye +Name[se]=Fohkus +Name[sk]=Fokus +Name[sl]=Fokus +Name[sr]=Фокус +Name[sr@Latn]=Fokus +Name[sv]=Fokus +Name[ta]=முனைப்படுத்து +Name[te]=ఫొకస్ +Name[tg]=Марказ +Name[th]=โฟกัส +Name[tr]=Odaklama +Name[tt]=Eş Üzäge +Name[uk]=Фокус +Name[uz]=Fokus +Name[uz@cyrillic]=Фокус +Name[ven]=U thetshelesa +Name[vi]=Chọn +Name[zh_CN]=焦点 +Name[zh_TW]=焦點 +Name[zu]=Ukunaka + +Comment=Configure the window focus policy +Comment[af]=Konfigureer die venster fokus beleid +Comment[ar]=قم بإعداد سياسة التركيز على النوافذ +Comment[be]=Настаўленні выкарыстання фокусу +Comment[bg]=Настройване активирането на прозорците +Comment[bn]=উইণ্ডো ফোকাস পলিসি কনফিগার করুন +Comment[br]=Kefluniañ politikerez fokus ar prenestr +Comment[bs]=Podesite politiku fokusa prozora +Comment[ca]=Aquí podeu configurar la política del focus +Comment[cs]=Nastavení způsobu zaměřování oken +Comment[csb]=Kònfigùracëjô zrëszaniô òknów +Comment[cy]=Ffurfweddu'r polisi canolbyntio ffenestri +Comment[da]=Indstil vinduers fokuspolitik +Comment[de]=Fensteraktivierung einrichten +Comment[el]=Ρυθμίστε τον τρόπο εστίασης των παραθύρων +Comment[eo]=Agordu la fenestran fokusdirektivon +Comment[es]=Configuración de la política de enfocado de ventanas +Comment[et]=Akendele fookuse andmise reeglid +Comment[eu]=Konfiguratu leihoen fokuaren portaera +Comment[fa]=پیکربندی خط مشی کانون پنجره +Comment[fi]=Ikkunoiden kohdistustapa +Comment[fr]=Configuration de la politique de focus des fenêtres +Comment[fy]=Hjir kinne jo it fokusbeliid fan finsters ynstelle +Comment[ga]=Cumraigh an polasaí um fhócas fuinneoige +Comment[gl]=Configurar política de outorgación do foco ás fiestras +Comment[he]=קביעת מדיניות ההתמקדות של חלונות +Comment[hi]=विंडो फ़ोकस पॉलिसी कॉन्फ़िगर करें +Comment[hr]=Konfiguriranje pravila za fokusiranje prozora +Comment[hu]=Az ablakok fókuszálási jellemzőinek beállításai +Comment[is]=Stilla virkni stefnu +Comment[it]=Configura la politica del focus delle finestre +Comment[ja]=ウィンドウのフォーカスポリシーの設定 +Comment[kk]=Терезедегі назар тартібін баптау +Comment[km]=កំណត់រចនាសម្ព័ន្ធគោលការណ៍ផ្ដោតអារម្មណ៍របស់បង្អួច +Comment[ko]=창 초점 정책 설정하기 +Comment[lo]=ປັກອີນສອດສ່ອງຊີພີຍູ +Comment[lt]=Konfigūruoti langų fokusavimo taisykles +Comment[lv]=Konfigurē logu fokusēšanās politiku +Comment[mk]=Конфигурирајте ја политиката на фокусирање на прозорците +Comment[mn]=Цонх идэвхижүүлэлт тохируулах +Comment[mt]=Ikkonfigura kif jieħdu l-focus il-windows +Comment[nb]=Tilpass praksisen for vindusfokus +Comment[nds]=Regeln för den Finsterfokus instellen +Comment[ne]=सञ्झ्याल फोकस नीति कन्फिगर गर्नुहोस् +Comment[nl]=Hier kunt u het vensterfocusbeleid instellen +Comment[nn]=Set opp praksisen for vindaugsfokus +Comment[nso]=Beakanya molao wa tebeledisiso ya window +Comment[pa]=ਝਰੋਖਾ ਕੇਂਦਰ ਨੀਤੀ ਸੰਰਚਨਾ +Comment[pl]=Konfiguracja przenoszenia ogniska +Comment[pt]=Configuração da política de foco (primeiro plano) das janelas +Comment[pt_BR]=Configura a política de foco de janela +Comment[ro]=Configurează politica de focus a ferestrelor +Comment[ru]=Настройка политики фокусирования окон +Comment[rw]=Kuboneza politiki y'igaragazarikeye ry'idirishya +Comment[se]=Heivet lásefohkusa doaibmanvuogi +Comment[sk]=Nastavenie politiky aktivácie okien +Comment[sl]=Nastavitve ravnanja s fokusom okna +Comment[sr]=Подешавање начина фокусирања прозора +Comment[sr@Latn]=Podešavanje načina fokusiranja prozora +Comment[sv]=Anpassa policy för fönsterfokus +Comment[ta]=சாளர துவக்க முறையை வடிவமை +Comment[tg]=Танзими сиёсати маркази тиреза +Comment[th]=ปรับแต่งรูปแบบการได้รับโฟกัสของหน้าต่าง +Comment[tr]=Pencere odaklama yöntemini yapılandır +Comment[tt]=Täräzä terelätü tärtiben caylaw +Comment[uk]=Налаштування поведінку фокусу вікна +Comment[uz]=Oynani fokuslash qoidasini moslash +Comment[uz@cyrillic]=Ойнани фокуслаш қоидасини мослаш +Comment[ven]=Dzudzanyani wa muano wa window +Comment[vi]=Cấu hình cách chọn cửa sổ +Comment[wa]=Aponteye li dujhance di focus di purnea +Comment[xh]=Qwalasela inkqubo yobekiso lwe window +Comment[zh_CN]=配置窗口焦点策略 +Comment[zh_TW]=設定視窗焦點政策 +Comment[zu]=Hlanganisela umthetho wokunaka kwe-window + +Keywords=focus,placement,auto raise,raise,click raise,keyboard,CDE,alt-tab,all desktop +Keywords[af]=focus,placement,auto raise,raise,click raise,keyboard,CDE,alt-tab,all werkskerm +Keywords[be]=Фокус,Рамяшчэнне,Клавіятура,Усе працоўныя сталы,focus,placement,auto raise,raise,click raise,keyboard,CDE,alt-tab,all desktop +Keywords[bg]=фокус, активиране, автоматично, щракане, focus, placement, auto raise, raise, click raise, keyboard, CDE, alt-tab, all desktop +Keywords[ca]=focus,emplaçament,elevar automàticament,elevar,elevar en clicar,teclat,CDE,alt-tab,tot l'escriptori +Keywords[cs]=zaměření,umísťování,automatické zdvižení,klávesnice,CDE,Alt-Tab,plochy +Keywords[csb]=focus, ùmieszczanié, aùtomatné przenoszenié,pòdnoszenié,pòdnoszenié przë klëkniãcô,klawiatura,CDE,alt-tab,wszëtczé biurka,wszëtczé pùltë +Keywords[cy]=canolbwynt,lleoliad,hunan-godi,codi,codi ar ?l clic,allweddell,CDE,alt-tab,penbwrdd cyfan +Keywords[da]=fokus,placering,autohæv,hæv,klikhæv,tastatur,CDE,alt-tab,alle desktoppe +Keywords[de]=Fokus,Aktivierung,Platzierung,Autom. Aktivierung,Nach oben/unten, Klick,Tastatur,CDE +Keywords[el]=εστίαση,τοποθέτηση,αυτόματη ανύψωση,ανύψωση,ανύψωση με πάτημα,πληκτρολόγιο,CDE,alt-tab,all desktop +Keywords[eo]=fokuso,lokado,aŭto-altigo,altigo,kliki,kilk altigo,klavaro,CDE,alt-tab,ĉiuj tabuloj +Keywords[es]=foco,ubicación,auto psara al frente,pasar al frente,pulsar,teclado,CDE,alt-tab,todo el escritorio +Keywords[et]=fookus,asetus,klikk,klõps,klaviatuur,CDE,alt-tab +Keywords[eu]=fokua,kokapena,auto aurrera ekarri,aurrera ekarri,klik eta aurrera eraman,teklatua,CDE,alt-tab,mahaigain guztiak +Keywords[fa]=کانون، جایدهی، بالا بردن خودکار، بالا بردن، بالا بردن فشار، صفحه کلید، CDE، دگرساز-جهش، همۀ رومیزیها +Keywords[fi]=fokus,sijoitus,automaattinosto,napsautusnosto,näppäimistö,CDE +Keywords[fr]=focus,placement,auto élévation,élévation,clic clavier,CDE,alt-tab,tous les bureaux +Keywords[fy]=focus,fokus,finster,aandacht,oandacht,plaatsing,pleatsing,voorgrond,foargrûn,achtergrond,eftergrûn,klikken,toetsenbord,toetseboerd,CDE,alt-tab,alle bureaubladen,alle buroblêden +Keywords[ga]=fócas,láithriú,uathardaigh,ardaigh,gliogardaigh,méarchlár,CDE,alt-tab,gach deasc +Keywords[gl]=foco,emprazamento,auto subir,subir,premer para subir,teclado,CDE,alt-tab,todo o escritório +Keywords[he]=התמקדות,מיקום,הבאה אוטומטית לחזית,הבאה לחזית,לחיצה להבאה לחזית,מקלדת,כל שולחנות העבודה, focus,placement,auto raise,raise, click raise,keyboard,CDE,alt-tab,all desktop +Keywords[hi]=फ़ोकस, स्थिति,स्वतः ऊपर उठाएँ,ऊपर उठाएँ,क्लिक ऊपर उठाएँ,कुंजीपट,सीडीई,ऑल्ट-टेब,सभी डेस्कटॉप +Keywords[hr]=focus,placement,auto raise,raise,click raise,keyboard,CDE,alt-tab,all desktop,fokus,smještaj,automatska pojava,pojava,pojava klikanjem,tipkovnica,sve radne površine +Keywords[hu]=fókusz,elhelyezés,automatikus előrehozás,előrehozás,előrehozás kattintásra,billentyűzet,CDE,Alt+Tab,minden munkaasztal +Keywords[id]=fokus,penempatan,auto raise,raise,click raise,keyboard,CDE,alt-tab,all desktop +Keywords[is]=fókus,staðsetning,fleyta upp sjálfkrafa, fleyta upp,smellur fleytir upp,lyklaborð,CDE,alt-tab,öll skjáborð +Keywords[it]=focus,piazzamento,alza automaticamente,alza,clic per alzare,tastiera, CDE,alt-tab,tutti i desktop +Keywords[ja]=フォーカス,配置,自動的に前面に,前面に,クリックして前面に,キーボード,CDE,alt-tab,すべてのデスクトップ +Keywords[km]=ផ្តោតអារម្មណ៍,ការដាក់,លើកឡើងស្វ័យប្រវត្តិ,លើកឡើង,ចុច លើកឡើង,ក្ដារចុច,CDE,ជំនួស-ថេប,ផ្ទៃតុទាំងអស់ +Keywords[lt]=focus,placement,auto raise,raise,click raise,keyboard,CDE,alt-tab,all desktop, fokusas,perkėlimas į pirmą planą, pirmas planas, klaviatūra, CDE,visi darbastaliai +Keywords[lv]=fokuss,novietojums,automātiska pacelšanās,pacelšanās,klikšķaraise,tastatūra,CDE,alt-tab,visas darbavirsmas +Keywords[mk]=focus,placement,auto raise,raise,click raise,keyboard,CDE,alt-tab,all desktop,фокус,позиција,авто подигање,подигање,клик подигање,сите десктопи +Keywords[mn]=Хараа,Идэвхижүүлэл,Зайчлал,Авто.Идэвхижүүлэлт, Дээшээ/доошоо,Товшилт,Гар,КДE +Keywords[mt]=focus,placement,auto raise,raise,click raise,keyboard,CDE,alt-tab,all desktop,tella',tastiera +Keywords[nb]=fokus,plassering,autohev,hev,klikk og hev,tastatur,CDE,bytt vindu,alle skrivebord +Keywords[nds]=aktiveren,Fokus,Platzeren,automaatsch fokusseren,aktiveren,klick fokusseren,Tastatuur,CDE,ALT-TAB,all Schriefdischen +Keywords[ne]=फोकस, स्थापना, स्वत: बृद्धि, बृद्धि, बृद्धि क्लिक गर्नुहोस्, कुञ्जीपाटी,CDE,अल्ट-ट्याब, सबै डेस्कटप +Keywords[nl]=focus,aandacht,plaatsing,voorgrond,achtergrond,klikken,toetsenbord,CDE,alt-tab,alle bureaubladen +Keywords[nn]=fokus,plassering,autohev,hev,klikk og hev,tastatur,CDE,byt vindauge,alle skrivebord +Keywords[nso]=tebeledisiso,peo,kgodiso ya go itirisa,kgodiso,tobetsa kgodiso,keyboard,CDE,alt-tab,desktop kamoka +Keywords[pl]=ognisko,umiejscawianie,automatyczne podnoszenie,podnoszenie, podniesienie przy kliknięciu,klawiatura,CDE,alt-tab,wszystkie biurka,wszystkie pulpity +Keywords[pt]=foco,colocação,auto-elevar,elevar,elevar com 'click',teclado,CDE,alt-tab,todos os ecrãs +Keywords[pt_BR]=foco,posição,auto elevar,elevar,teclado,CDE,alt-tab,todas as áreas de trabalho +Keywords[ro]=focus,plasare,ridicare automată,clic,tastatură,CDE,alt-tab,toate ecranele +Keywords[rw]=igaragazarikeye,ishyira mu mwanya,byizamura,kuzamura,Kanda kuzamura,Mwandikisho,CDE,Alt - tab,Ibiro byose +Keywords[se]=fohkus,auto lokten,lokten,coahkkal ja lokte,boallobeavdi,CDE,molssu lássii,buot čállinbeavddi +Keywords[sk]=fokus,umiestnenie,automatický presun,dopredu,dopredu na kliknutie,klávesnica,CDE,alt-tab,všetky plochy +Keywords[sl]=fokus,postavitev,dvigni,tipkovnica,CDE,alt-tab,vsa namizja +Keywords[sr]=focus,placement,auto raise,raise,click raise,keyboard,CDE,alt-tab,all desktop,фокус,смештање,аутоматско подизање,подизање,тастатура,alt-tab, сви радна површина +Keywords[sr@Latn]=focus,placement,auto raise,raise,click raise,keyboard,CDE,alt-tab,all desktop,fokus,smeštanje,automatsko podizanje,podizanje,tastatura,alt-tab, svi radna površina +Keywords[sv]=fokus,placering,autohöjning,höjning,höjning med klick,tangentbord,CDE,alt-tab,alla skrivbord +Keywords[ta]=ஒருமுகப்படுத்துதல்,இடம், தானாக மேலெழும்பு, மேலேழும்புதல், மேல் க்ளிக்செய்,விசைப்பலகை,CDE,alt-tab,எல்லா மேல்மேசை +Keywords[th]=โฟกัส,ตำแหน่ง,อยู่ด้านบนอัตโนมัติ,อยู่ด้านบน,คลิ้กเพื่ออยู่ด้านบน,แป้นพิมพ์,CDE,alt-tab,ทุกพื้นที่ทำงาน +Keywords[tr]=odaklama,yerleşim,masaüstü,yükselt,tıkla,klavye,CDE,yerleşim +Keywords[uk]=фокус,розташування,автопіднімання,підняти,клавіатура,CDE,alt-tab,вся стільниця +Keywords[uz]=avto-oldinga,oldinga,bosib oldinga,CDE,alt-tab,hamma ish stollari,fokuslash,tugmatag,joylashish +Keywords[uz@cyrillic]=авто-олдинга,олдинга,босиб олдинга,CDE,alt-tab,ҳамма иш столлари,фокуслаш,тугматаг,жойлашиш +Keywords[ven]=thetshelesa,u vhetshela,u vusa,vusa,putedzani u vusa,khiibodo,CDE,alt-tab,desktop dzothe +Keywords[vi]=chọn,di chuyển,tự nâng lên,nâng lên,nhấn nâng lên,bàn phím,CDE,alt-tab,tất cả màn hình nền +Keywords[wa]=focus,plaece,rimonte tot seu,rimonter,rimonte s' on clitche,taprece,CDE,ALT-TAB,tos les scribannes +Keywords[xh]=ucaco,ubuyiselo,phakamisa ngokuzenzekelayo,phakamisa,nqakraza phakamisa, ibhodi yezitshixho,CDE,alt-tab,zonke ii desktop +Keywords[zh_CN]=focus,placement,auto raise,raise,click raise,keyboard,CDE,alt-tab,all desktop,焦点,放置,自动升起,升起,单击升起,键盘,全部桌面 +Keywords[zh_TW]=focus,placement,auto raise,raise,click raise,keyboard,CDE,alt-tab,all desktop,焦點,佈置,自動抬升,抬升,單擊抬升,鍵盤,全部桌面 +Keywords[zu]=ukunaka,ukubeka,ukukhuphula okuzenzekelayo,ukukhuphula, ukukhuphula ngokucofa,ibhodi yokhiye,CDE,alt-tab,wonke ama-desktop diff --git a/twin/kcmtwin/twinoptions/twinmoving.desktop b/twin/kcmtwin/twinoptions/twinmoving.desktop new file mode 100644 index 000000000..9ba6aec20 --- /dev/null +++ b/twin/kcmtwin/twinoptions/twinmoving.desktop @@ -0,0 +1,229 @@ +[Desktop Entry] +Icon=kcmkwm +Type=Application +Exec=kcmshell twinmoving +DocPath=kcontrol/windowmanagement/index.html#action-moving + +X-KDE-ModuleType=Library +X-KDE-Library=twinoptions +X-KDE-FactoryName=twinmoving + +Name=Moving +Name[af]=Beweeg +Name[ar]=تحريك +Name[be]=Перамяшчэнне +Name[bg]=Преместване +Name[bn]=সরানো হচ্ছে +Name[br]=O tilec'hiañ +Name[bs]=Pomjeranje +Name[ca]=Moviment +Name[cs]=Přesouvání +Name[csb]=Przesëwanié +Name[cy]=Symud +Name[da]=Flytter +Name[de]=Verschieben +Name[el]=Μετακίνηση +Name[eo]=Movanta +Name[es]=Moviendo +Name[et]=Liigutamine +Name[eu]=Mugitzen +Name[fa]=حرکت +Name[fi]=Siirtäminen +Name[fo]=Flytir +Name[fr]=Déplacement +Name[fy]=Ferpleatsing +Name[ga]=Bogadh +Name[gl]=Movemento +Name[he]=הזזה +Name[hi]=खिसक रहा है +Name[hr]=Pomicanje +Name[hu]=Mozgatás +Name[id]=Pindah +Name[is]=Færa +Name[it]=Spostamento +Name[ja]=移動 +Name[ka]=გადაადგილება +Name[kk]=Жылжыту +Name[km]=ការផ្លាស់ទី +Name[ko]=이동 +Name[lo]=ລອກອິນ +Name[lt]=Perkėlimas +Name[lv]=Pārvietošana +Name[mk]=Движење +Name[mn]=Шилжүүлэх +Name[mt]=Tmexxija +Name[nb]=Flytting +Name[nds]=Verschuven +Name[ne]=सार्दा +Name[nl]=Verplaatsing +Name[nn]=Flytting +Name[nso]=Sutha +Name[pa]=ਏਧਰ-ਓਧਰ +Name[pl]=Przesuwanie +Name[pt]=Mover +Name[pt_BR]=Movendo +Name[ro]=Mutare +Name[ru]=Перемещение +Name[rw]=Kwimura +Name[se]=Lihkadeamen +Name[sk]=Presun +Name[sl]=Premikanje +Name[sr]=Померање +Name[sr@Latn]=Pomeranje +Name[sv]=Förflyttning +Name[ta]=நகர்கிறது +Name[te]=కదలిక +Name[tg]=Ҳаракат +Name[th]=การย้าย +Name[tr]=Taşıma +Name[tt]=Küçerü +Name[uz]=Koʻchirish +Name[uz@cyrillic]=Кўчириш +Name[ven]=U tshimbila +Name[vi]=Di chuyển +Name[wa]=Bodjî +Name[xh]=Iyahamba +Name[zh_CN]=移动 +Name[zh_TW]=移動 +Name[zu]=Iyanyakaza + +Comment=Configure the way that windows are moved +Comment[af]=Konfigureer die weg wat vensters word verskuif +Comment[ar]=تعريف الطريقة التي تتحرك فيها النوافذ +Comment[be]=Настаўленні перамяшчэння вокнаў +Comment[bg]=Настройване преместването на прозорците +Comment[bn]=উইণ্ডো কিভাবে সরানো হবে তা কনফিগার করুন +Comment[br]=Kefluniañ an daoare e vez fiñvalet ar prenester +Comment[bs]=Podesite način pomjeranja prozora +Comment[ca]=Aquí podeu configurar els valors per quan es moguin les finestres +Comment[cs]=Nastavení způsobu přesouvání oken +Comment[csb]=Kònfigùracëjô sztélu przesëwaniô òknów +Comment[cy]=Ffurfweddu'r ffordd y symudir ffenestri +Comment[da]=Indstil den måde vinduer flyttes på +Comment[de]=Festlegen, wie Fenster verschoben werden +Comment[el]=Ρυθμίστε τον τρόπο με τον οποίο μετακινούνται τα παράθυρα +Comment[eo]=Agordu la manieron, per kiu oni movas la fenestrojn +Comment[es]=Configuración del modo de movimiento de las ventanas +Comment[et]=Akende liigutamise viisi seadistamine +Comment[eu]=Konfiguratu leihoak mugitzeko era +Comment[fa]=پیکربندی روشی که پنجرهها حرکت میکنند +Comment[fi]=Ikkunoiden siirtäminen +Comment[fr]=Configuration de la manière dont les fenêtres sont déplacées +Comment[fy]=Hjir kinne jo de wize wêrop finsters har ferpleatse ynstelle +Comment[ga]=Cumraigh conas a aistrítear fuinneoga +Comment[gl]=Aqui pode configurar o xeito en que se moven as fiestras +Comment[he]=שינוי הדרך שבה חלונות מוזזים +Comment[hi]=कॉन्फ़िगर करें कि विंडो किस तरह खिसके +Comment[hr]=Konfiguriranje načina pomicanja prozora +Comment[hu]=Az ablakmozgatás beállításai +Comment[is]=Stilla hvernig gluggar eru hreyfðir +Comment[it]=Configura il modo in cui vengono spostate le finestre +Comment[ja]=ウィンドウの移動の仕方の設定 +Comment[ka]=ფანჯრების გადაადგილების კონფიგურაცია +Comment[kk]=Терезені жылжыту тәсілін баптау +Comment[km]=កំណត់រចនាសម្ព័ន្ធរបៀបដែលបង្អួចត្រូវបានផ្លាស់ទី +Comment[ko]=창이 움직이는 방법 설정하기 +Comment[lo]=ປັບແຕ່ງການຕັ້ງຄ່າລະບົບແຄຊທີ່ນີ่້ +Comment[lt]=Konfigūruoti langų perkėlimą +Comment[lv]=Šeit Jūs varat konfigurēt kā tiek pārvietoti logi +Comment[mk]=Конфигурирајте го начинот на кој се движат прозорците +Comment[mn]=Цонхыг яааж шилжүүлэхийг тогтоох +Comment[mt]=Ikkonfigura kif tmexxi l-windows +Comment[nb]=Velg hvordan vinduer skal flyttes +Comment[nds]=Instellen, woans de Finstern beweegt warrt +Comment[ne]=सञ्झ्यालहरू सार्ने तरिका कन्फिगर गर्नुहोस् +Comment[nl]=Hier kunt u de wijze waarop vensters worden verplaatst instellen +Comment[nn]=Vel korleis vindauga skal flyttast +Comment[nso]=Beakanya ka mokgwa wo window yeo e suthiswago kagona +Comment[pa]=ਝਰੋਖੇ ਦੇ ਹਿੱਲਣ ਦੇ ਢੰਗ ਦੀ ਸੰਰਚਨਾ +Comment[pl]=Konfiguracja stylu przesuwania okien +Comment[pt]=Configuração da forma como as janelas são movidas +Comment[pt_BR]=Configura o modo como as janelas são movidas +Comment[ro]=Configurează modul în care sînt mutate ferestrele +Comment[ru]=Настройка способа перемещения окон +Comment[rw]=Kuboneza uburyo amadirishya yimurwa +Comment[se]=Heivet mo láset lihkaduvvot +Comment[sk]=Nastavenie presunu okien +Comment[sl]=Nastavitve načinov premikanja okna +Comment[sr]=Подешавање начина на који се прозори померају +Comment[sr@Latn]=Podešavanje načina na koji se prozori pomeraju +Comment[sv]=Anpassa hur fönster flyttas +Comment[ta]=சாளரம் நகர்ரும் விதத்தை அமை +Comment[tg]=Танзими навъи ҳаракати тирезаҳо +Comment[th]=ปรับแต่งลักษณะวิธีการย้ายหน้าต่าง +Comment[tr]=Pencerelerin taşınması yöntemini yapılandır +Comment[tt]=Täräzä küçerü ısulın caylaw +Comment[uk]=Тут можна налаштувати поведінку при пересуванні вікон +Comment[uz]=Oynalarni koʻchirish yoʻlini moslash +Comment[uz@cyrillic]=Ойналарни кўчириш йўлини мослаш +Comment[ven]=Dzudzanyani ndila ine windoow ya tshimbidzhwa zwone +Comment[vi]=Cấu hình cách di chuyển cửa sổ +Comment[wa]=Apontyî l' manire di bodjî des purneas +Comment[xh]=Qwalasela iindlela ii windows ezshukunyiswa ngayo +Comment[zh_CN]=配置窗口移动的方式 +Comment[zh_TW]=設定視窗移動的方式 +Comment[zu]=Hlanganisela indlela ama-window anyakaziswa ngayo + +Keywords=moving,smart,cascade,maximize,maximise,snap zone,snap,border +Keywords[be]=Перамяшчэнне,Каскадам,Найбольшыць,Найменшыць,Мяжа,moving,smart,cascade,maximize,maximise,snap zone,snap,border +Keywords[bg]=преместване, прозорци, прозорец, промяна, размер, размера, moving, smart, cascade, maximize, maximise, snap zone, snap, border +Keywords[ca]=moviment,astut,cascada,maximitza,zona d'atracció,atracció,vora +Keywords[cs]=přesun,chytré,kaskáda,maximalizace,zóna,okraje +Keywords[csb]=przesëwanié,kaskadowò,masymilizacëjô,òbéńda chwëtaniô,chwëtanié,grańca +Keywords[cy]=symud,clyfar,rhaedru,maint llawn,cylchfa gosod,snap,ymyl +Keywords[da]=flytter,smart,stabl,maksimér,snapzone,snap,kant +Keywords[de]=Verschieben,Gestaffelt,Maximieren,Minimieren,Einrastzone,Ränder +Keywords[el]=μετακίνηση,έξυπνη,διαδοχικός,μεγιστοποίηση,μεγιστοποίηση,ζώνη αρπαγής,αρπαγή,περίγραμμα +Keywords[eo]=movanta,maksimigi,bordo +Keywords[es]=moviendo,inteligente,cascada,maximizar,zona de adhesión,adhesión,adherir,borde +Keywords[et]=liigutamine,tark,kaskaad,maksimeerimine,haaramise tsoon,haaramine,piire +Keywords[eu]=mugitzen,fina,kaskadan,maximizatu,itsasketa eremua, itsasketa,ertza +Keywords[fa]=حرکت، هوشمند، آبشاری، بیشینهسازی، بیشینهسازی، منطقۀ پرش، پرش، لبه +Keywords[fi]=liikkuva,älykäs,sarjoita,suurenna,kehys +Keywords[fr]=déplacement,cascade,maximiser,minimiser,coller,zone d'attraction,bordure +Keywords[fy]=verplaatsing,ferpleatse,intelligen,yntelligint,tûk,plaatsing,pleatsing,trapsgewijs,trepfoarm,maximaliseren,maksimalisearje,randen magnetisch,magnetisch veld,rand,râne,magnetische randen +Keywords[gl]=movemento,pequeno,fervenza,maximizar,maximizar,zona de suxección,suexección,beira +Keywords[he]=הזזה,חכם,מדורג,הגדלה,אזור הצמדה,הצמדה,גבול, moving,smart,cascade,maximize,maximise,snap zone,snap,border +Keywords[hi]=खिसकता,चतुर,कास्केड,अधिकतम,न्यूनतम,स्नैप ज़ोन,स्नेप,किनारा +Keywords[hr]=moving,smart,cascade,maximize,maximise,snap zone,snap,border,pomicanje,pametno,kaskadno,maksimiziranje,snap zona,snap,obrub +Keywords[hu]=mozgatás,intelligens,lépcsőzetes,maximalizálás,illeszkedési zóna,illeszkedés,szegély +Keywords[id]=pindah,smart,cascade,maksimum,minimum,snap zone,snap,border +Keywords[is]=færi,snjallt,stafla,hámarka,gripsvæði,grip,rammi,jaðar +Keywords[it]=spostamento,intelligente,cascata,massimizza,zona magnetica,bordi,bordi magnetici +Keywords[ja]=移動,スマート,カスケード,最大化,スナップゾーン,スナップ境界 +Keywords[km]=ការផ្លាស់ទី,ឆ្លាត,ល្បាក់,ពង្រីកអប្បបរមា,តំបន់ខ្ទាស់,ខ្ទាស់,ស៊ុម +Keywords[lt]=moving,smart,cascade,maximize,maximise,snap zone,snap,border, perkėlimas,išmoningas,kaskada,išdidinti,rėmelis,riba +Keywords[lv]=pārvietošana,gudra,kaskāde,maksimizē,maksimizēšana,pielipsanas zona,pielipt,mala +Keywords[mk]=moving,smart,cascade,maximize,maximise,snap zone,snap,border, движење,паметно,каскадно,рашири,спушти,граница +Keywords[mn]=Шилжүүлэх,Ухаалаг,Зайчилах,Томсгох,Жижигсгэх,Талбай,Хүрээ +Keywords[mt]=moving,smart,cascade,maximize,maximise,snap zone,snap,border,tmexxija,kaskada,massimizza,faqqa',bordura +Keywords[nb]=flytting,smart,overlapping,maksimer,kantlås,vindu +Keywords[nds]=bewegen,verschuven,plietsch,maximeren,minimeren,Andockrebeet,andocken,Rahmen +Keywords[ne]=सार्ने, छरितो, क्यासकेड, बढाउनु, बढाउनु, स्न्याप जोन, स्न्याप, किनारा +Keywords[nl]=verplaatsing,intelligent,plaatsing,trapsgewijs,maximaliseren,randen magnetisch,magnetisch veld,rand,magnetische randen +Keywords[nn]=flytting,smart,overlapping,maksimer,kantlås,vindauge +Keywords[nso]=sutha,botsana,phororo,oketsa,oketsa,lefelo la thwantsho ya menwana, thwantsho ya menwana,mollwane +Keywords[pa]=moving,smart,cascade,maximize,maximise,snap zone,snap,ਹਾਸ਼ੀਆ +Keywords[pl]=przesuwanie,sprytne,kaskadowo,maksymalizacja,obszar chwytania,chwytanie, granica +Keywords[pt]=mover,inteligente,cascata,maximizar,zona de atracção,atracção,contorno +Keywords[pt_BR]=movendo,pequeno,cascata,maximizar,zona rápida,zona de encaixe,borda +Keywords[ro]=mutare,isteț,cascadă,maximizare,margine +Keywords[rw]=kwimura,cyiza,urukurikirane,kugira kinini ,gukata agace,gukata, impera +Keywords[sk]=presun,inteligentný,kaskádovať,maximalizácia,minimalizácia,priťahovanie,zóna priťahovania,okraje +Keywords[sl]=premikanje,pametno,kaskadno,povečaj,raztegni,meja,mreža,pripni +Keywords[sr]=moving,smart,cascade,maximize,maximise,snap zone,snap,border,померање,паметно,каскадно,максимизуј,snap zone,snap,ивица +Keywords[sr@Latn]=moving,smart,cascade,maximize,maximise,snap zone,snap,border,pomeranje,pametno,kaskadno,maksimizuj,snap zone,snap,ivica +Keywords[sv]=förflyttning,smart,kaskad,maximera,bindningszon,bind,kant +Keywords[ta]=நகரும்,புத்திசாலி,மேலுக்குமேல், பெரிதாக்கு,பெரிதாக்கு,நிழற் படமெடுப்பு பகுதி,நிழற்படம்,விளிம்பு +Keywords[th]=การย้าย,ฉลาด,จัดเป็นขั้นๆ,ขยายเต็มจอ,ขยายเต็มหน้าจอ,snap zone,snap,border +Keywords[tr]=taşıma,taşınma,akıllı,kenar +Keywords[uk]=пересування,кмітливий,каскад,максимізувати,зона захоплення,захоплення,рамка +Keywords[uz]=snap zone,snap,border,koʻchirish,ixcham,oynalarni tartiblash,yoyish +Keywords[uz@cyrillic]=snap zone,snap,border,кўчириш,ихчам,ойналарни тартиблаш,ёйиш +Keywords[ven]=tshimbila,zwavhudi,cascade,engedza,engedza,fhethu ha snap,snap,mukano+- +Keywords[vi]=di chuyển,thông minh,tầng,phóng to,phóng to,vùng thả,thả,bờ +Keywords[wa]=bodjî,malén,a pertinne,, pus grand,nap zone,snap,båoird +Keywords[xh]=iyashukuma,iyabukeka,cascade,yenza nkulu,yenza nkulu,yandisa,snap zone,snap,umda +Keywords[zh_CN]=moving,smart,cascade,maximize,maximise,snap zone,snap,border,移动,智能,层叠,最大化,最小化,吸附区域,边框 +Keywords[zh_TW]=moving,smart,cascade,maximize,maximise,snap zone,snap,border,移動,聰明,最大化,邊框 +Keywords[zu]=iyanyakaza,okukhaliphile,landelanisa,khulisa,khulisa,indawo yokunamathisela,namathisela,umngcele diff --git a/twin/kcmtwin/twinoptions/twinoptions.desktop b/twin/kcmtwin/twinoptions/twinoptions.desktop new file mode 100644 index 000000000..e520dcc88 --- /dev/null +++ b/twin/kcmtwin/twinoptions/twinoptions.desktop @@ -0,0 +1,225 @@ +[Desktop Entry] +Icon=kcmkwm +Type=Application +Exec=kcmshell twinoptions +DocPath=kcontrol/windowmanagement/index.html + +X-KDE-ModuleType=Library +X-KDE-Library=twinoptions +X-KDE-FactoryName=twinoptions + +Name=Window Behavior +Name[af]=Venster Gedrag +Name[ar]=سلوك النوافذ +Name[az]=Pəncərə Davranışı +Name[be]=Паводзіны вокнаў +Name[bg]=Прозорци +Name[bn]=উইণ্ডো আচরণ +Name[br]=Emzalc'h ar prenester +Name[bs]=Ponašanje prozora +Name[ca]=Comportament de les finestres +Name[cs]=Chování oken +Name[csb]=Ùchòwanié òkna +Name[cy]=Ymddygiad Ffenestri +Name[da]=Vinduesopførsel +Name[de]=Fenstereigenschaften +Name[el]=Συμπεριφορά παραθύρων +Name[en_GB]=Window Behaviour +Name[eo]=Fenestrokonduto +Name[es]=Comportamiento de la ventana +Name[et]=Akende käitumine +Name[eu]=Leihoen portaera +Name[fa]=رفتار پنجره +Name[fi]=Ikkunoiden käyttäytyminen +Name[fr]=Comportement des fenêtres +Name[fy]=Finstergedrach +Name[ga]=Oibriú na bhFuinneoga +Name[gl]=Comportamento das Fiestras +Name[he]=פעולת חלונות +Name[hi]=विंडो बर्ताव +Name[hr]=Ponašanje prozora +Name[hu]=Ablakműveletek +Name[is]=Hegðun glugga +Name[it]=Comportamento delle finestre +Name[ja]=ウィンドウの挙動 +Name[ka]=ფანჯრის ქცევა +Name[kk]=Терезе қасиеттері +Name[km]=ឥរិយាបថបង្អួច +Name[ko]=창 동작 +Name[lo]=ພິດຕິກຳຂອງຫນ້າຕ່າງ +Name[lt]=Langų elgsena +Name[lv]=Loga izturēšanās +Name[mk]=Однесување на прозорци +Name[mn]=Цонхны байдал +Name[mt]=Imġieba tal-Window +Name[nb]=Vindusoppførsel +Name[nds]=Finsterbedregen +Name[ne]=सञ्झ्याल व्यवहार +Name[nl]=Venstergedrag +Name[nn]=Vindaugsåtferd +Name[nso]=Mekgwa ya Window +Name[oc]=Comportament de las finestras +Name[pa]=ਝਰੋਖਾ ਵਿਵਹਾਰ +Name[pl]=Okna +Name[pt]=Comportamento das Janelas +Name[pt_BR]=Comportamento da Janela +Name[ro]=Comportament fereastră +Name[ru]=Поведение окна +Name[rw]=Imyitwarire y'Idirishya +Name[se]=Láseláhtten +Name[sk]=Správanie okien +Name[sl]=Obnašanje oken +Name[sr]=Понашање прозора +Name[sr@Latn]=Ponašanje prozora +Name[ss]=Kutiphatsa kweliwindi +Name[sv]=Fönsterbeteende +Name[ta]=சாளர நடத்தை +Name[tg]=Рафтори тиреза +Name[th]=พฤติกรรมของหน้าต่าง +Name[tr]=Pencere Davranışı +Name[tt]=Täräzä Çağılışı +Name[uk]=Поведінка вікон +Name[uz]=Oynaning xususiyatlari +Name[uz@cyrillic]=Ойнанинг хусусиятлари +Name[ven]=Maitele a windo +Name[vi]=Ứng xử của Cửa sổ +Name[wa]=Dujhance des purneas +Name[xh]=Ukuziphatha kwe Window +Name[zh_CN]=窗口行为 +Name[zh_TW]=視窗行為 +Name[zu]=Ukuziphatha kwe-Window + +Comment=Configure the window behavior +Comment[af]=Stel die venster gedrag op +Comment[ar]=إعداد سلوك النافذة +Comment[be]=Настаўленні паводзінаў вокнаў +Comment[bg]=Настройване поведението на прозорците +Comment[bn]=উইণ্ডোটির আচরণ কনফিগার করুন +Comment[br]=Kefluniañ emzalc'h ar prenester +Comment[bs]=Podesite ponašanje prozora +Comment[ca]=Configura el comportament de finestra +Comment[cs]=Nastavení chování oken +Comment[csb]=Kònfigùracëjô ùchòwaniô òkna +Comment[cy]=Ffurfweddu ymddygiad y ffenestr +Comment[da]=Indstil vinduets opførsel +Comment[de]=Fensterverhalten festlegen +Comment[el]=Ρύθμιση της συμπεριφοράς των παραθύρων +Comment[en_GB]=Configure the window behaviour +Comment[eo]=Agordas la konduton de la fenestro +Comment[es]=Configuración del comportamiento de la ventana +Comment[et]=Akende käitumise seadistamine +Comment[eu]=Konfiguratu arakatzailearen portaera +Comment[fa]=پیکربندی رفتار پنجره +Comment[fi]=Ikkunoiden asetukset +Comment[fr]=Configuration du comportement des fenêtres +Comment[fy]=Stel it finstergedrach yn +Comment[ga]=Cumraigh oibriú na bhfuinneog +Comment[gl]=Configurar o comportamento das fiestras +Comment[he]=שינוי הגדרות פעולת הדפדפן +Comment[hi]=विंडो व्यवहार कॉन्फ़िगर करें +Comment[hr]=Konfiguriranje ponašanja preglednika +Comment[hu]=Az ablakok működési jellemzőinek beállítása +Comment[is]=Stilla hegðan glugga +Comment[it]=Configura il comportamento della finestra +Comment[ja]=ウィンドウの挙動を設定 +Comment[ka]=ბრაუზერის ქცევის კონფიგურაცია +Comment[kk]=Терезе қасиеттерін баптау +Comment[km]=កំណត់រចនាសម្ព័ន្ធឥរិយាបថបង្អួច +Comment[ko]=창 동작 설정 +Comment[lt]=Konfigūruoti lango elgseną +Comment[lv]=Konfigurē loga izturēšanos +Comment[mk]=Конфигурирајте го однесувањето на прозорците +Comment[mt]=Ikkonfigura l-imġieba tal-windows +Comment[nb]=Tilpass vinduets oppførsel +Comment[nds]=Dat Finsterbedregen instellen +Comment[ne]=सञ्झ्याल व्यवहार कन्फिगर गर्नुहोस् +Comment[nl]=Stel het venstergedrag in +Comment[nn]=Oppsett av nettlesaråtferda +Comment[pa]=ਝਰੋਖਾ ਵਿਵਹਾਰ ਸੰਰਚਨਾ +Comment[pl]=Konfiguracja zachowania okna +Comment[pt]=Configurar o comportamento das janelas +Comment[pt_BR]=Configura o comportamento das janelas +Comment[ro]=Configurează comportamentul ferestrei +Comment[ru]=Настройка поведения браузера +Comment[rw]=Kuboneza imyitwarire y'idirishya +Comment[se]=Heivet láseláhttema +Comment[sk]=Nastavenie správania okna +Comment[sl]=Nastavite obnašanje brskalnika +Comment[sr]=Подешавање понашања прозора +Comment[sr@Latn]=Podešavanje ponašanja prozora +Comment[sv]=Anpassa fönsterbeteende +Comment[ta]=º¡ÇÃò¾¢ý Àñ¨À ¯ûǨÁ +Comment[th]=ปรับแต่งพฤติกรมของหน้าต่าง +Comment[tr]=Pencere davranışlarını yapılandır +Comment[tt]=Täräzä çağılışın caylaw +Comment[uk]=Налаштування поведінки вікна +Comment[uz]=Oynaning xususiyatlarini moslash +Comment[uz@cyrillic]=Ойнанинг хусусиятларини мослаш +Comment[vi]=Cấu hình cách cửa sổ ứng xử +Comment[wa]=Apontyî l' dujhance des purneas +Comment[zh_CN]=配置窗口行为 +Comment[zh_TW]=設定視窗行為 + +Keywords=focus,placement,window behavior,animation,raise,auto raise,windows,frame,titlebar,doubleclick +Keywords[ar]=تركيز ركز,موضع مكان,سلوك النافذة,تحريك,رفع, رفع تلقائي,نوافذ,إطار,شريط العنوان,نقر ثنائي +Keywords[be]=Фокус,Размяшчэнне,Паводзіны акна,Анімацыя,Вокны,Акно,Фрэйм,Загаловак,Двайны націск мышы,focus,placement,window behavior,animation,raise,auto raise,windows,frame,titlebar,doubleclick +Keywords[bg]=фокус, поведение, прозорец, активиране, заглавие, focus, placement, window behaviour, animation, raise, auto raise, windows, frame, titlebar, doubleclick +Keywords[bs]=focus,placement,window behavior,animation,raise,auto raise,windows,frame,titlebar,doubleclick,fokus,smještaj,ponašanje prozora,animacija,podigni,automatski podigni,prozori,okvir,naslovna trak,dvoklik,dvostruki klik +Keywords[ca]=focus,emplaçament,comportament de la finestra,animació,eleva,eleva automàticament,finestres,marc,barra del títol,doble clic +Keywords[cs]=Zaměření,Umístění oken,Chování oken,Animace,Okna,Rámeček,Titulek,Dvojklik +Keywords[csb]=zrëszanié,aktiwòwanié,ùkłôdanié òknów,ùchòwanié òknów,animacëjô,aùtomatné aktiwòwanié,òkna,òkno,rama,tilowô lëstew,dëbeltné klëkniãce +Keywords[cy]=canolbwynt,lleoliad,ymddygiad ffenestr,bywluniad,codi,hunan-godi,ffenestri,ffrâm,bar-teitl,clic dwbl,dwbl-glic +Keywords[da]=fokus,placering,vinduesopførsel,animering,Hæv,autohæv,vinduer,ramme,titellinje,dobbeltklik +Keywords[de]=Aktivierung,Platzierung,Fensterverhalten,Animation,Nach vorn/hinten, Fenster,Rahmen,Umrandung,Titelleiste,Doppelklick +Keywords[el]=εστίαση,τοποθέτηση,συμπεριφορά παραθύρων,εφέ κίνησης,ανύψωση,αυτόματη ανύψωση,παράθυρα,πλαίσιο,μπάρα τίτλου,διπλό κλικ +Keywords[en_GB]=focus,placement,window behaviour,animation,raise,auto raise,windows,frame,titlebar,doubleclick +Keywords[eo]=fokuso,lokigo,fenestrokonduto,spektaklo,malfonigo,aŭtomalfonigo,fenestro,kadro,titollistelo,duklako +Keywords[es]=foco,ubicación,posición,ventana,comportamiento,animación,frente,pasar al frente,ventanas,marco,barra de título,doble pulsación +Keywords[et]=fookus,asetus,akende käitumine,animatsioon,tõstmine,automaatne tõstmine,aknad,raam,tiitliriba,topeltklikk,topeltklõps +Keywords[eu]=fokua,kokalekua,leihoaren portaera,animazioa,aurrera ekarri,auto aurrera ekarri,leihoak,markoa,titulu-barra,klik bikoitza +Keywords[fa]=کانون، جایدهی، رفتار پنجره، پویانمایی، بالا بردن، بالا بردن خودکار، پنجرهها، قاب، میله عنوان، دو بار فشار +Keywords[fi]=fokus,sijoittaminen,ikkunan toiminta,animaatio,nosto,automaattinosto,ikkunat,kehys,otsikkorivi,tuplanapsautus,kaksoisnapsautus +Keywords[fr]=focus,gestion du focus,fenêtre,placement des fenêtres,comportement des fenêtres,animation,fenêtres,barre de titre,double clic,souris,boutons de la souris,dessus,dessous,raise,auto raise +Keywords[fy]=focusbeleid,vensterplaatsing,finsterferpleatsing,venstergedrag,finstergedrach,focus,window,finster,plaatsing,pleatsing,plaatsingbeleid,pleatsingbelied,animatie,animaasje,voorgrond,foargrûn,vensters,finsters,frame,kader,dubbelklikken,dûbelklikke,fokusbeliid +Keywords[ga]=fócas,láithriú,oibriú na bhfuinneog,beochan,ardaigh,uathardaigh,fuinneoga,fráma,ceannteideal,déchliceáil +Keywords[gl]=foco,emprazamento,comportamento da fiestra,animación,subir,auto subir,fiestras,marco,barra de título,dobre presión +Keywords[he]=התמקדות,מיקום,פעולת חלונות,אנימציה,הנפשה,הבאה לחזית,הבאה אוטומטית לחזית,חלונות,גבול,מסגרת,שורת כותרת,לחיצה כפולה, focus,placement,window behavior,animation,raise,auto raise,windows,frame,titlebar,doubleclick +Keywords[hi]=फोकस,प्लेसमेंट,विंडो व्यवहार,एनिमेशन,ऊपर उठाएँ,स्वतः ऊपर उठाएँ,विंडोज़,फ्रेम,शीर्षक-पट्टी,डबल-क्लिक +Keywords[hr]=focus,placement,window behavior,animation,raise,auto raise,windows,frame,titlebar,doubleclick,fokus,smještaj,ponašanje prozora,animacija,pojava,podizanje,automatska pojava,prozori,okvir,naslovna traka,dvostruko klikanje +Keywords[hu]=fókusz,elhelyezés,ablakelhelyezés,animáció,felemelés,automatikus felemelés,ablakok,keret,címsor,dupla kattintás +Keywords[is]=virkni glugga,staðsetning,hegðun,högun glugga,hækka,hækka sjálfkrafa,gluggar,titilslá,titilrönd,tvísmella +Keywords[it]=focus,piazzamento,comportamento finestre,animazione,alza,alza automaticamente,finestre,cornice,barra del titolo,doppio clic +Keywords[ja]=フォーカス,配置,ウィンドウの挙動,アニメーション,前面へ,自動的に前面へ,ウィンドウ,フレーム,タイトルバー,ダブルクリック +Keywords[km]=ផ្ដោតអារម្មណ៍,ការដាក់,ឥរិយាបថបង្អួច,ចលនា,លើកឡើង,លើកឡើងស្វ័យប្រវត្តិ,បង្អួច,ស៊ុម,របារចំណងជើង,ចុចទ្វេដង +Keywords[lt]=focus,placement,window behaviour,animation,raise,auto raise,windows,frame,titlebar,doubleclick,lango išdėstymas,elgesys,langai,rėmelis,lango antraštė +Keywords[lv]=fokuss,novietojums,loga izturēšanās,animācija,celt,auto celt,logi,kadrs,virsraksta josla,dubultklikšķis +Keywords[mk]=focus,placement,window behavior,animation,raise,auto raise,windows,frame,titlebar,doubleclick,фокус,позиционирање,однесување на прозорците, анимација,подигање,авто подигање,прозорци,рамка,насловна лента,двоен клик +Keywords[mt]=focus,placement,window behaviour,animation,raise,auto raise,windows,frame,titlebar,doubleclick +Keywords[nb]=fokus,plassering,vindusoppførsel,animasjon,hev,autohev,vinduer,ramme,tittelliste,dobbeltklikk +Keywords[nds]=Fokus,Platzeren,Finsterbedregen,Animatschoon,fokusseren,aktiveren,automaatsch fokusseren,Finster,Rahmen,Titelbalken,Dubbelklick +Keywords[ne]=फोकस, स्थापना, सञ्झ्याल व्यवहार, एनिमेसन, बृद्धि, स्वत: बृद्धि, सञ्झ्याल, फ्रेम, शीर्षकपट्टी, डबल क्लिक +Keywords[nl]=focusbeleid,vensterplaatsing,venstergedrag,focus,window,plaatsing,plaatsingbeleid,animatie,voorgrond,vensters,frame,kader,dubbelklikken +Keywords[nn]=fokus,plassering,vindaugsplassering,vindaugsåtferd,animasjon,hev,automatisk heving,vindauge,ramme,tittellinje,dobbeltklikk +Keywords[pa]=focus,placement,window behavior,animation,raise,auto raise,windows,frame,titlebar,doubleclick,ਝਰੋਖਾ ਵਿਹਾਰ,ਸਜੀਵਤਾ,ਝਰੋਖੇ +Keywords[pl]=uaktywnianie,układanie okien,zachowanie okien,animacja,automatyczne uaktywnienie,okno,okna,ramka,pasek tytułowy,podwójne kliknięcie +Keywords[pt]=foco,posicionamento,comportamento das janelas,animação,elevar,auto-elevar,janelas,contorno,barra de título,duplo-carregar +Keywords[pt_BR]=foco,posicionamento,comportamento das janelas,animação,elevar,auto-elevar,janelas, quadro,barra de título,clique duplo +Keywords[ro]=focus,plasare,comportament fereastră,animație,ridicare,automat,ferestre,cadru,bară de titlu,dublu clic +Keywords[rw]=igaragazarikeye, ugushyira mu mwanya,imyitwarire y'idirishya,ibyinisha,byizamura,amadirishya,ikadiri,umwanyabikoresho,gukandakabiri +Keywords[se]=fohkus,sajádat,láseláhtten,animašuvdna,lokte,autolokte,láset,rámma,namahusholga,duppalcoahkkal +Keywords[sk]=fokus,umiestnenie,správanie okien,animácia,zdvihnutie,automatické zdvihnutie,titulok,dvojité kliknutie,rámec,okná +Keywords[sl]=fokus,postavitev,obnašanje okna,animacija,dvigni,okna,okvir,naslovna vrstica,dvojni klik +Keywords[sr]=focus,placement,window behaviour,animation,raise,ауто raise,windows,frame,titlebar,doubleclick,фокус,понашање прозора,анимација,прозори,оквир,насловна линија,двоклик +Keywords[sr@Latn]=focus,placement,window behaviour,animation,raise,auto raise,windows,frame,titlebar,doubleclick,fokus,ponašanje prozora,animacija,prozori,okvir,naslovna linija,dvoklik +Keywords[sv]=fokus,placering,fönsterbeteende,animering,höj, autohöj,fönster,kant,namnlist,dubbelklick +Keywords[ta]=பார்வை,இடம்,சாளரபண்பு,உயிர்சித்திரம்,மேலெழுப்பு, தானாக மேலெழுப்பு,சாளரங்கள்,சட்டம்,தலைப்புப்பட்டி,இரண்டு சொடுக்கு +Keywords[th]=โฟกัส,การวางตำแหน่ง,พฤติกรรมของหน้าต่าง,อนิเมชั่น,ยกขึ้นไว้ด้านบน,ยกขึ้นไว้ด้านบนโดยอัตโนมัติ,หน้าต่าง,กรอบ,แถบหัวเรื่อง,ดับเบิลคลิก +Keywords[tr]=odak,odak davranış biçimi,pencere yerleşimi,pencere davranışı,Yerleşim davranış biçimi,animasyon,kaldır,otomatik kaldır,çerçeve,çift tıkla +Keywords[uk]=фокус,розташовування,поведінка вікна,анімація,підняти,піднімати автоматично,вікна,рамка,заголовок,подвійне клацання +Keywords[uz]=fokuslash,joylashish,oynaning xususiyatlari,animatsiya,oldinga,avto-oldinga,oynalar,freym,sarlavha,ikki marta bosish +Keywords[uz@cyrillic]=фокуслаш,жойлашиш,ойнанинг хусусиятлари,анимация,олдинга,авто-олдинга,ойналар,фрейм,сарлавҳа,икки марта босиш +Keywords[vi]=chọn,dịch chuyển,ứng xử cửa sổ,hoạt hình,nâng lên,tự nâng lên,cửa sổ,khung,thanh tiêu đề,nhấn đúp +Keywords[wa]=focus,plaece,dujhance des purneas,animåcion,rimonter,rimonte tot seu,purneas,cåde,bår di tite,clitchî deus côps,clitchî deus feyes +Keywords[zh_CN]=focus,placement,window behavior,animation,raise,auto raise,windows,frame,titlebar,doubleclick,焦点,放置,窗口行为,动画,升起,自动升起,窗口,框架,标题栏,双击 +Keywords[zh_TW]=focus,placement,window behavior,animation,raise,auto raise,windows,frame,titlebar,doubleclick,焦點,放置,視窗行為,動畫,抬升,自動抬升,視窗,框架,標題列,雙擊 +Categories=Qt;KDE;X-KDE-settings-desktop; diff --git a/twin/kcmtwin/twinoptions/twintranslucency.desktop b/twin/kcmtwin/twinoptions/twintranslucency.desktop new file mode 100644 index 000000000..591cab231 --- /dev/null +++ b/twin/kcmtwin/twinoptions/twintranslucency.desktop @@ -0,0 +1,195 @@ +[Desktop Entry] +Icon=kcmkwm +Type=Application +Exec=kcmshell twintranslucency +DocPath=kcontrol/windowmanagement/index.html#action-translucency + +X-KDE-ModuleType=Library +X-KDE-Library=twinoptions +X-KDE-FactoryName=twintranslucency + +Name=Translucency +Name[af]=Deursigtigheid +Name[ar]=الشفافية +Name[be]=Празрыстасць +Name[bg]=Полупрозрачност +Name[bn]=সমস্বচ্ছতা +Name[br]=Treuzwel +Name[bs]=Prozirnost +Name[ca]=Translucidesa +Name[cs]=Průhlednost +Name[csb]=Przezérnota +Name[da]=Gennemsigtighed +Name[de]=Transparenz +Name[el]=Hμιδιαφάνεια +Name[eo]=Travidebleco +Name[es]=Translúcido +Name[et]=Läbipaistvus +Name[eu]=Gardentasuna +Name[fa]=نیمۀ شفافی +Name[fi]=Läpikuultavuus +Name[fr]=Transparence +Name[fy]=Trochsichtichheid +Name[ga]=Tréshoilseacht +Name[gl]=Translucidez +Name[he]=שקיפות +Name[hr]=Prozirnost +Name[hu]=Áttetszőség +Name[id]=Tembus Pandang +Name[is]=Gegnsæi +Name[it]=Trasparenza +Name[ja]=透過性 +Name[ka]=ნახევრადგამჭირვალეობა +Name[kk]=Мөлдірлігі +Name[km]=ភាពថ្លា +Name[ko]=반투명 +Name[lt]=Permatomumas +Name[mk]=Провидност +Name[nb]=Gjennomsiktighet +Name[nds]=Dörschienen +Name[ne]=स्वच्छता +Name[nl]=Transparantie +Name[nn]=Gjennomsiktig +Name[pa]=ਪਾਰਦਰਸ਼ੀ +Name[pl]=Przezroczystość +Name[pt]=Transparência +Name[pt_BR]=Translúcido +Name[ro]=Translucență +Name[ru]=Полупрозрачность +Name[rw]=Ukujyakwijima +Name[se]=Čađačuovgi +Name[sk]=Priesvitnosť +Name[sl]=Prosojnost +Name[sr]=Прозирност +Name[sr@Latn]=Prozirnost +Name[sv]=Genomskinlighet +Name[ta]=ஒளிகசிவு +Name[th]=ความโปร่งแสง +Name[tr]=Şeffaflık +Name[tt]=Ütäkürenü +Name[uk]=Прозорість +Name[uz]=Shaffoflik +Name[uz@cyrillic]=Шаффофлик +Name[vi]=Đục & Trong +Name[wa]=Translucidaedje +Name[zh_CN]=透明度 +Name[zh_TW]=透明度 + +Comment=Configure window translucency and shadow management +Comment[af]=Stel die venster deursigtigheid en skaduwee op +Comment[ar]=إعداد تدبيرات شفافية و تظليل النافذة +Comment[be]=Настаўленні празрыстасці вокнаў і кіраванне ценем +Comment[bg]=Настройване на полупрозрачността и сенките на прозорците +Comment[bn]=উইণ্ডোর সমস্বচ্ছতা এবং ছায়া কনফিগার করুন +Comment[bs]=Podesite prozirnost prozora i podesite sjenke +Comment[ca]=Configura la translucidesa de finestres i gestiona l'ombra +Comment[cs]=Nastavení průhlednosti a stínování oken +Comment[csb]=Kònfigùracëjô przezérnotë ë ceniów òknów +Comment[da]=Indstil vinduets gennemsigtighed og skyggehåndtering +Comment[de]=Einrichtung der Fenstertransparenz und Schatten +Comment[el]=Ρύθμιση ημιδιαφάνειας παραθύρου και διαχείρισης σκίασης +Comment[eo]=Agordu administradon de fenestro-travidebleco kaj ombreco. +Comment[es]=Configurar la opacidad de la ventana y gestión de sombra +Comment[et]=Akende läbipaistvuse ja varjude seadistamine +Comment[eu]=Konfiguratu leiho gardentasunak eta itzalen kudeaketa +Comment[fa]=پیکربندی مدیریت نیمۀ شفافی و سایۀ پنجره +Comment[fi]=Muokkaa ikkunoinnin läpikuultavuus ja varjostus +Comment[fr]=Configuration de la transparence et de l'ombre des fenêtres +Comment[fy]=Finstertrochsichtichheid- en -skaadbehear ynstelle +Comment[ga]=Cumraigh tréshoilseacht na fuinneoige agus bainisteoireacht scátha +Comment[gl]=Configurar a xestión de sombras e translucidez das fiestras +Comment[he]=תצורה של שקיפות החלונות וניהול ההצללות +Comment[hr]=Konfiguriranje prozirnosti prozora i upravljanje sjenčanjem +Comment[hu]=Az ablakkezelés áttetszőségi és árnyékolási beállításai +Comment[is]=Stilla gegnsæi glugga og sýsla með skugga +Comment[it]=Configura la trasparenza e le ombre delle finestre +Comment[ja]=ウィンドウの透過性と影の設定 +Comment[ka]=ფანჯრების გამჭირვალობის და ჩრდილების კონფიგურაცია +Comment[kk]=Терезенің мөлдірлігін және көлеңкесін баптау +Comment[km]=កំណត់រចនាសម្ព័ន្ធការគ្រប់គ្រងភាពថ្លា និងស្រមោលរបស់បង្អួច +Comment[lt]=Konfigūruoti langų permatomumą ir šešėlius +Comment[mk]=Конфигурирајте ги провидноста на прозорците и менаџментот на сенки +Comment[nb]=Tilpass behandling av vindusgjennomsiktighet og -skygge +Comment[nds]=Finsterdörschienen un -Schadden instellen +Comment[ne]=सञ्झ्याल स्वच्छता र छायाँ व्यवस्थापन कन्फिगर गर्नुहोस् +Comment[nl]=Venstertransparantie- en -schaduwbeheer instellen +Comment[nn]=Oppsett av gjennomsiktige vindauge og vindaugsskugge +Comment[pa]=ਝਰੋਖਾ ਪਾਰਦਰਸਤਾ ਅਤੇ ਛਾਂ ਪਰਬੰਧਨ ਸੰਰਚਨਾ +Comment[pl]=Konfiguracja przezroczystości i cieni okien +Comment[pt]=Configuração da transparência e sombras de janelas +Comment[pt_BR]=Configura o gerenciamento de sombra e transparência da janela +Comment[ro]=Configurează translucența și umbra ferestrelor +Comment[ru]=Настройка полупрозрачности и теней окна +Comment[rw]=Kuboneza ubuyobozi bw'ukujyakubonerana n'igicucu by'idirishya +Comment[se]=Heivet lášečađačuovgivuođa ja suoivvanasgieđaheami +Comment[sk]=Nastavenie priesvitnosti okien a správcu tieňovania +Comment[sl]=Nastavitve prosojnosti oken in upravljanje s sencami +Comment[sr]=Подешавање прозирности прозора и управљање сенкама +Comment[sr@Latn]=Podešavanje prozirnosti prozora i upravljanje senkama +Comment[sv]=Anpassa fönstergenomskinlighet och skugghantering +Comment[ta]=சாளர ஒளிகசிவு மற்றும் நிழல் மேலாண்மையை வடிவமை +Comment[th]=ปรับแต่งคุณสมบัติความโปร่งแสงและเงาของหน้าต่าง +Comment[tr]=Pencere şeffaflığını ve gölge yönetimini yapılandır +Comment[tt]=Täräzä ütäkürenüe belän külägäsen caylaw +Comment[uk]=Налаштування прозорості вікон та керування затіненням +Comment[uz]=Oynaning shaffofligini va soyasini moslash +Comment[uz@cyrillic]=Ойнанинг шаффофлигини ва соясини мослаш +Comment[vi]=Cấu hình độ đục và trong cùng với bóng râm của cửa sổ +Comment[wa]=Apontiaedje des fonccionålités translucides et d' ombe do manaedjaedje des purneas +Comment[zh_CN]=配置窗口透明度和阴影管理 +Comment[zh_TW]=設定視窗透明度與陰影管理功能 + +Keywords=translucency,transparence,shadows +Keywords[ar]=الشفافية,شفاف,أظلال +Keywords[be]=Празрыстасць,Цені,translucency,transparence,shadows +Keywords[bg]=полупрозрачност, прозрачност, сянка, сенки, translucency, transparence, shadows +Keywords[bs]=translucency,transparence,shadows,providnost,sjene,sjenke,sjenka +Keywords[ca]=translucidesa,transparència,ombres +Keywords[cs]=průhlednost,průsvitnost,stín +Keywords[csb]=przezérnota,półprzezérnota,przeswiécëna,ceniô,cenie +Keywords[da]=gennemsigtighed,transparens,skygge +Keywords[el]=ημιδιαφάνεια,διαφάνεια,σκιές +Keywords[eo]=Travidebleco, ombroj +Keywords[es]=translucido,transparente,sombras,opacidad +Keywords[et]=läbipaistvus,läbipaistev,vari +Keywords[eu]=gardena,gardentasunak,itzalak +Keywords[fa]=نیمۀ شفافی، شفافیت، سایهها +Keywords[fi]=läpikuultavuus, läpinäkyvyys, varjot +Keywords[fr]=translucidité,translucide,transparence,transparent,ombre +Keywords[fy]=translucency,trochsichtich,ransparantie,schaduwen,skaden +Keywords[ga]=tréshoilseacht,gléine,scáthanna +Keywords[gl]=translucéncia,transparéncia,sombras +Keywords[he]=translucency,transparence,shadows,הצללה,צל,צללים,שקוף,שקיפות +Keywords[hr]=translucency,transparence,shadows,prozirnost,sjene,providnost +Keywords[hu]=áttetszőség,áttetsző,árnyékok +Keywords[id]=tembus pandang,transparan, bayangan +Keywords[it]=trasparenza,ombre +Keywords[ja]=透過性,透明,影 +Keywords[km]=ភាពថ្លា,ថ្លា,ស្រមោល +Keywords[lt]=translucency,transparence,shadows,permatomumas,šešėliai +Keywords[mk]=translucency,transparence,shadows,провидност,проѕирност,сенки +Keywords[nb]=gjennomsiktighet,skygge +Keywords[nds]=Transparenz,Schadden,Dörschienen +Keywords[ne]=स्वच्छता,पारदर्शीता,छायाँ +Keywords[nl]=translucency,transparantie,schaduwen +Keywords[nn]=gjennomsiktig,skugge +Keywords[pa]=translucency,transparence,ਛਾਂ +Keywords[pl]=przezroczystość,półprzezroczystość,prześwitywanie,cień,cienie +Keywords[pt]=transparência,sombras +Keywords[pt_BR]=translúcido,transparência,sombras +Keywords[ro]=translucență,transparență,umbre +Keywords[rw]=ukujyakwijima,ukubonerana,ibicucu +Keywords[sl]=prosojnost,prozornost,sence +Keywords[sr]=translucency,transparence,shadows,провидност,сенке +Keywords[sr@Latn]=translucency,transparence,shadows,providnost,senke +Keywords[sv]=genomskinlighet,skuggor +Keywords[ta]=ஒளிகசிவு,ஊடகத்தன்மை,நிழல்கள் +Keywords[th]=ความโปร่งแสง,ความโปร่งใส,เงา +Keywords[tr]=şeffaflık,şeffaf,gölge,opak,opasite +Keywords[uk]=translucency,transparence,shadows,прозорість,напівпрозорість,тіні +Keywords[uz]=shaffof,soya +Keywords[uz@cyrillic]=шаффоф,соя +Keywords[vi]=mờ đục,trong suốt,bóng râm +Keywords[wa]=translucency,transparince,translucide,translucidaedje +Keywords[zh_CN]=透明度,阴影,translucency,transparence,shadows +Keywords[zh_TW]=translucency,transparence,shadows,透明,陰影 diff --git a/twin/kcmtwin/twinoptions/windows.cpp b/twin/kcmtwin/twinoptions/windows.cpp new file mode 100644 index 000000000..80185a427 --- /dev/null +++ b/twin/kcmtwin/twinoptions/windows.cpp @@ -0,0 +1,1712 @@ +/* + * windows.cpp + * + * Copyright (c) 1997 Patrick Dowler dowler@morgul.fsh.uvic.ca + * Copyright (c) 2001 Waldo Bastian bastian@kde.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * + */ + +#include <config.h> + +#include <tqdir.h> +#include <tqlayout.h> +#include <tqslider.h> +#include <tqwhatsthis.h> +#include <tqvbuttongroup.h> +#include <tqcheckbox.h> +#include <tqradiobutton.h> +#include <tqlabel.h> +#include <tqcombobox.h> +#include <kmessagebox.h> + +#include <kactivelabel.h> +#include <klocale.h> +#include <kcolorbutton.h> +#include <kconfig.h> +#include <knuminput.h> +#include <kapplication.h> +#include <kdialog.h> +#include <dcopclient.h> +#include <kglobal.h> +#include <kprocess.h> +#include <tqtabwidget.h> + +#include <X11/X.h> +#include <X11/Xlib.h> +#include <X11/Xutil.h> + +#include "windows.h" + + +// 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" + +//CT 15mar 98 - magics +#define KWM_BRDR_SNAP_ZONE "BorderSnapZone" +#define KWM_BRDR_SNAP_ZONE_DEFAULT 10 +#define KWM_WNDW_SNAP_ZONE "WindowSnapZone" +#define KWM_WNDW_SNAP_ZONE_DEFAULT 10 + +#define MAX_BRDR_SNAP 100 +#define MAX_WNDW_SNAP 100 +#define MAX_EDGE_RES 1000 + + +KFocusConfig::~KFocusConfig () +{ + if (standAlone) + delete config; +} + +// removed the LCD display over the slider - this is not good GUI design :) RNolden 051701 +KFocusConfig::KFocusConfig (bool _standAlone, KConfig *_config, TQWidget * parent, const char *) + : KCModule(parent, "kcmkwm"), config(_config), standAlone(_standAlone) +{ + TQString wtstr; + TQBoxLayout *lay = new TQVBoxLayout (this, 0, KDialog::spacingHint()); + + //iTLabel = new TQLabel(i18n(" Allowed overlap:\n" + // "(% of desktop space)"), + // plcBox); + //iTLabel->tqsetAlignment(AlignTop|AlignHCenter); + //pLay->addWidget(iTLabel,1,1); + + //interactiveTrigger = new TQSpinBox(0, 500, 1, plcBox); + //pLay->addWidget(interactiveTrigger,1,2); + + //pLay->addRowSpacing(2,KDialog::spacingHint()); + + //lay->addWidget(plcBox); + + // focus policy + fcsBox = new TQButtonGroup(i18n("Focus"),this); + fcsBox->setColumnLayout( 0, Qt::Horizontal ); + + TQBoxLayout *fLay = new TQVBoxLayout(fcsBox->tqlayout(), + KDialog::spacingHint()); + + TQBoxLayout *cLay = new TQHBoxLayout(fLay); + TQLabel *fLabel = new TQLabel(i18n("&Policy:"), fcsBox); + cLay->addWidget(fLabel, 0); + focusCombo = new TQComboBox(false, fcsBox); + focusCombo->insertItem(i18n("Click to Focus"), CLICK_TO_FOCUS); + 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); + fLabel->setBuddy(focusCombo); + + // FIXME, when more policies have been added to KWin + wtstr = i18n("The focus policy is used to determine the active window, i.e." + " the window you can work in. <ul>" + " <li><em>Click to focus:</em> A window becomes active when you click into it." + " This is the behavior you might know from other operating systems.</li>" + " <li><em>Focus follows mouse:</em> Moving the mouse pointer actively on to a" + " normal window activates it. New windows will receive the focus," + " without you having to point the mouse at them explicitly." + " Very practical if you are using the mouse a lot.</li>" + " <li><em>Focus under mouse:</em> The window that happens to be under the" + " mouse pointer is active. If the mouse points nowhere, the last window" + " that was under the mouse has focus." + " New windows will not automatically receive the focus.</li>" + " <li><em>Focus strictly under mouse:</em> Only the window under the mouse pointer is" + " active. If the mouse points nowhere, nothing has focus." + " </ul>" + "Note that 'Focus under mouse' and 'Focus strictly under mouse' prevent certain" + " features such as the Alt+Tab walk through windows dialog in the KDE mode" + " from working properly." + ); + TQWhatsThis::add( focusCombo, wtstr); + TQWhatsThis::add(fLabel, wtstr); + + connect(focusCombo, TQT_SIGNAL(activated(int)), this, TQT_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))); + + autoRaise = new KIntNumInput(500, fcsBox); + autoRaise->setLabel(i18n("Dela&y:"), Qt::AlignVCenter|Qt::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()) ); + + delayFocusOn = new TQCheckBox(i18n("Delay focus"), fcsBox); + fLay->addWidget(delayFocusOn); + connect(delayFocusOn,TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(delayFocusOnTog(bool))); + + delayFocus = new KIntNumInput(500, fcsBox); + delayFocus->setLabel(i18n("Dela&y:"), Qt::AlignVCenter|Qt::AlignLeft); + delayFocus->setRange(0, 3000, 100, true); + delayFocus->setSteps(100,100); + delayFocus->setSuffix(i18n(" msec")); + fLay->addWidget(delayFocus); + + clickRaiseOn = new TQCheckBox(i18n("C&lick raise active window"), fcsBox); + connect(clickRaiseOn,TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(clickRaiseOnTog(bool))); + fLay->addWidget(clickRaiseOn); + +// fLay->addColSpacing(0,QMAX(autoRaiseOn->tqsizeHint().width(), +// clickRaiseOn->tqsizeHint().width()) + 15); + + 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" + " come to the front."); + TQWhatsThis::add( autoRaise, wtstr ); + + TQWhatsThis::add( clickRaiseOn, i18n("When this option is enabled, the active window will be brought to the" + " front when you click somewhere into the window contents. To change" + " it for inactive windows, you need to change the settings" + " in the Actions tab.") ); + + TQWhatsThis::add( delayFocusOn, i18n("When this option is enabled, there will be a delay after which the" + " window the mouse pointer is over will become active (receive focus).") ); + TQWhatsThis::add( delayFocus, i18n("This is the delay after which the window the mouse pointer is over" + " will automatically receive focus.") ); + + separateScreenFocus = new TQCheckBox( i18n( "S&eparate screen focus" ), fcsBox ); + fLay->addWidget( separateScreenFocus ); + wtstr = i18n( "When this option is enabled, focus operations are limited only to the active Xinerama screen" ); + TQWhatsThis::add( separateScreenFocus, wtstr ); + + activeMouseScreen = new TQCheckBox( i18n( "Active &mouse screen" ), fcsBox ); + fLay->addWidget( activeMouseScreen ); + wtstr = i18n( "When this option is enabled, active Xinerama screen (where for example new windows appear)" + " is the screen with the mouse pointer. When disabled, the active Xinerama screen is the screen" + " 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())); + + if (!TQApplication::desktop()->isVirtualDesktop() || + TQApplication::desktop()->numScreens() == 1) // No Ximerama + { + separateScreenFocus->hide(); + activeMouseScreen->hide(); + } + + lay->addWidget(fcsBox); + + kbdBox = new TQButtonGroup(i18n("Navigation"), this); + kbdBox->setColumnLayout( 0, Qt::Horizontal ); + TQVBoxLayout *kLay = new TQVBoxLayout(kbdBox->tqlayout(), KDialog::spacingHint()); + + altTabPopup = new TQCheckBox( i18n("Show window list while switching windows"), kbdBox ); + kLay->addWidget( altTabPopup ); + + wtstr = i18n("Hold down the Alt key and press the Tab key repeatedly to walk" + " through the windows on the current desktop (the Alt+Tab" + " combination can be reconfigured).\n\n" + "If this checkbox is checked" + " a popup widget is shown, displaying the icons of all windows to" + " walk through and the title of the currently selected one.\n\n" + "Otherwise, the focus is passed to a new window each time Tab" + " 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())); + + traverseAll = new TQCheckBox( i18n( "&Traverse windows on all desktops" ), kbdBox ); + kLay->addWidget( traverseAll ); + + wtstr = i18n( "Leave this option disabled if you want to limit walking through" + " windows to the current desktop." ); + TQWhatsThis::add( traverseAll, wtstr ); + + rollOverDesktops = new TQCheckBox( i18n("Desktop navi&gation wraps around"), kbdBox ); + kLay->addWidget(rollOverDesktops); + + wtstr = i18n( "Enable this option if you want keyboard or active desktop border navigation beyond" + " the edge of a desktop to take you to the opposite edge of the new desktop." ); + TQWhatsThis::add( rollOverDesktops, wtstr ); + + showPopupinfo = new TQCheckBox( i18n("Popup desktop name on desktop &switch"), kbdBox ); + kLay->addWidget(showPopupinfo); + + wtstr = i18n( "Enable this option if you wish to see the current desktop" + " name popup whenever the current desktop is changed." ); + TQWhatsThis::add( showPopupinfo, wtstr ); + + lay->addWidget(kbdBox); + + 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())); + + load(); +} + + +int KFocusConfig::getFocus() +{ + return focusCombo->currentItem(); +} + +void KFocusConfig::setFocus(int foc) +{ + focusCombo->setCurrentItem(foc); + + // this will disable/hide the auto raise delay widget if focus==click + setAutoRaiseEnabled(); + updateAltTabMode(); +} + +void KFocusConfig::updateAltTabMode() +{ + // not KDE-style Alt+Tab with unreasonable focus policies + altTabPopup->setEnabled( focusCombo->currentItem() == 0 || focusCombo->currentItem() == 1 ); +} + +void KFocusConfig::setAutoRaiseInterval(int tb) +{ + autoRaise->setValue(tb); +} + +void KFocusConfig::setDelayFocusInterval(int tb) +{ + delayFocus->setValue(tb); +} + +int KFocusConfig::getAutoRaiseInterval() +{ + return autoRaise->value(); +} + +int KFocusConfig::getDelayFocusInterval() +{ + return delayFocus->value(); +} + +void KFocusConfig::setAutoRaise(bool on) +{ + autoRaiseOn->setChecked(on); +} + +void KFocusConfig::setDelayFocus(bool on) +{ + delayFocusOn->setChecked(on); +} + +void KFocusConfig::setClickRaise(bool on) +{ + clickRaiseOn->setChecked(on); +} + +void KFocusConfig::setAutoRaiseEnabled() +{ + // the auto raise related widgets are: autoRaise + if ( focusCombo->currentItem() != CLICK_TO_FOCUS ) + { + autoRaiseOn->setEnabled(true); + autoRaiseOnTog(autoRaiseOn->isChecked()); + } + else + { + autoRaiseOn->setEnabled(false); + autoRaiseOnTog(false); + } +} + +void KFocusConfig::setDelayFocusEnabled() +{ + // the delayed focus related widgets are: delayFocus + if ( focusCombo->currentItem() != CLICK_TO_FOCUS ) + { + delayFocusOn->setEnabled(true); + delayFocusOnTog(delayFocusOn->isChecked()); + } + else + { + delayFocusOn->setEnabled(false); + delayFocusOnTog(false); + } +} + +void KFocusConfig::autoRaiseOnTog(bool a) { + autoRaise->setEnabled(a); + clickRaiseOn->setEnabled( !a ); +} + +void KFocusConfig::delayFocusOnTog(bool a) { + delayFocus->setEnabled(a); +} + +void KFocusConfig::clickRaiseOnTog(bool ) { +} + +void KFocusConfig::setSeparateScreenFocus(bool s) { + separateScreenFocus->setChecked(s); +} + +void KFocusConfig::setActiveMouseScreen(bool a) { + activeMouseScreen->setChecked(a); +} + +void KFocusConfig::updateActiveMouseScreen() +{ + // on by default for non click to focus policies + KConfigGroup cfg( config, "Windows" ); + if( !cfg.hasKey( KWIN_ACTIVE_MOUSE_SCREEN )) + setActiveMouseScreen( focusCombo->currentItem() != 0 ); +} + +void KFocusConfig::setAltTabMode(bool a) { + altTabPopup->setChecked(a); +} + +void KFocusConfig::setTraverseAll(bool a) { + traverseAll->setChecked(a); +} + +void KFocusConfig::setRollOverDesktops(bool a) { + rollOverDesktops->setChecked(a); +} + +void KFocusConfig::setShowPopupinfo(bool a) { + showPopupinfo->setChecked(a); +} + +void KFocusConfig::load( void ) +{ + TQString key; + + config->setGroup( "Windows" ); + + key = config->readEntry(KWIN_FOCUS); + if( key == "ClickToFocus") + setFocus(CLICK_TO_FOCUS); + else if( key == "FocusFollowsMouse") + setFocus(FOCUS_FOLLOWS_MOUSE); + else if(key == "FocusUnderMouse") + setFocus(FOCUS_UNDER_MOUSE); + else if(key == "FocusStrictlyUnderMouse") + setFocus(FOCUS_STRICTLY_UNDER_MOUSE); + + int k = config->readNumEntry(KWIN_AUTORAISE_INTERVAL,750); + setAutoRaiseInterval(k); + + k = config->readNumEntry(KWIN_DELAYFOCUS_INTERVAL,750); + setDelayFocusInterval(k); + + key = config->readEntry(KWIN_AUTORAISE); + setAutoRaise(key == "on"); + key = config->readEntry(KWIN_DELAYFOCUS); + setDelayFocus(key == "on"); + key = config->readEntry(KWIN_CLICKRAISE); + 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 )); + + key = config->readEntry(KWIN_ALTTABMODE, "KDE"); + setAltTabMode(key == "KDE"); + + setRollOverDesktops( config->readBoolEntry(KWIN_ROLL_OVER_DESKTOPS, true )); + + config->setGroup( "PopupInfo" ); + setShowPopupinfo( config->readBoolEntry(KWIN_SHOW_POPUP, false )); + + config->setGroup( "TabBox" ); + setTraverseAll( config->readBoolEntry(KWIN_TRAVERSE_ALL, false )); + + config->setGroup("Desktops"); + emit KCModule::changed(false); +} + +void KFocusConfig::save( void ) +{ + int v; + + config->setGroup( "Windows" ); + + v = getFocus(); + if (v == CLICK_TO_FOCUS) + config->writeEntry(KWIN_FOCUS,"ClickToFocus"); + else if (v == FOCUS_UNDER_MOUSE) + config->writeEntry(KWIN_FOCUS,"FocusUnderMouse"); + else if (v == FOCUS_STRICTLY_UNDER_MOUSE) + config->writeEntry(KWIN_FOCUS,"FocusStrictlyUnderMouse"); + else + config->writeEntry(KWIN_FOCUS,"FocusFollowsMouse"); + + v = getAutoRaiseInterval(); + if (v <0) v = 0; + config->writeEntry(KWIN_AUTORAISE_INTERVAL,v); + + v = getDelayFocusInterval(); + if (v <0) v = 0; + config->writeEntry(KWIN_DELAYFOCUS_INTERVAL,v); + + if (autoRaiseOn->isChecked()) + config->writeEntry(KWIN_AUTORAISE, "on"); + else + config->writeEntry(KWIN_AUTORAISE, "off"); + + if (delayFocusOn->isChecked()) + config->writeEntry(KWIN_DELAYFOCUS, "on"); + else + config->writeEntry(KWIN_DELAYFOCUS, "off"); + + if (clickRaiseOn->isChecked()) + config->writeEntry(KWIN_CLICKRAISE, "on"); + else + config->writeEntry(KWIN_CLICKRAISE, "off"); + + config->writeEntry(KWIN_SEPARATE_SCREEN_FOCUS, separateScreenFocus->isChecked()); + config->writeEntry(KWIN_ACTIVE_MOUSE_SCREEN, activeMouseScreen->isChecked()); + + if (altTabPopup->isChecked()) + config->writeEntry(KWIN_ALTTABMODE, "KDE"); + else + config->writeEntry(KWIN_ALTTABMODE, "CDE"); + + config->writeEntry( KWIN_ROLL_OVER_DESKTOPS, rollOverDesktops->isChecked()); + + config->setGroup( "PopupInfo" ); + config->writeEntry( KWIN_SHOW_POPUP, showPopupinfo->isChecked()); + + config->setGroup( "TabBox" ); + config->writeEntry( KWIN_TRAVERSE_ALL , traverseAll->isChecked()); + + config->setGroup("Desktops"); + + if (standAlone) + { + config->sync(); + if ( !kapp->dcopClient()->isAttached() ) + kapp->dcopClient()->attach(); + kapp->dcopClient()->send("twin*", "", "reconfigure()", TQString("")); + } + emit KCModule::changed(false); +} + +void KFocusConfig::defaults() +{ + setAutoRaiseInterval(0); + setDelayFocusInterval(0); + setFocus(CLICK_TO_FOCUS); + setAutoRaise(false); + setDelayFocus(false); + setClickRaise(true); + setSeparateScreenFocus( false ); + // on by default for non click to focus policies + setActiveMouseScreen( focusCombo->currentItem() != 0 ); + setAltTabMode(true); + setTraverseAll( false ); + setRollOverDesktops(true); + setShowPopupinfo(false); + emit KCModule::changed(true); +} + +KAdvancedConfig::~KAdvancedConfig () +{ + if (standAlone) + delete config; +} + +KAdvancedConfig::KAdvancedConfig (bool _standAlone, KConfig *_config, TQWidget *parent, const char *) + : KCModule(parent, "kcmkwm"), config(_config), standAlone(_standAlone) +{ + TQString wtstr; + TQBoxLayout *lay = new TQVBoxLayout (this, 0, KDialog::spacingHint()); + + //iTLabel = new TQLabel(i18n(" Allowed overlap:\n" + // "(% of desktop space)"), + // plcBox); + //iTLabel->tqsetAlignment(AlignTop|AlignHCenter); + //pLay->addWidget(iTLabel,1,1); + + //interactiveTrigger = new TQSpinBox(0, 500, 1, plcBox); + //pLay->addWidget(interactiveTrigger,1,2); + + //pLay->addRowSpacing(2,KDialog::spacingHint()); + + //lay->addWidget(plcBox); + + shBox = new TQVButtonGroup(i18n("Shading"), this); + + animateShade = new TQCheckBox(i18n("Anima&te"), shBox); + TQWhatsThis::add(animateShade, i18n("Animate the action of reducing the window to its titlebar (shading)" + " as well as the expansion of a shaded window") ); + + shadeHoverOn = new TQCheckBox(i18n("&Enable hover"), shBox); + + connect(shadeHoverOn, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(shadeHoverChanged(bool))); + + shadeHover = new KIntNumInput(500, shBox); + shadeHover->setLabel(i18n("Dela&y:"), Qt::AlignVCenter|Qt::AlignLeft); + shadeHover->setRange(0, 3000, 100, true); + shadeHover->setSteps(100, 100); + shadeHover->setSuffix(i18n(" msec")); + + TQWhatsThis::add(shadeHoverOn, i18n("If Shade Hover is enabled, a shaded window will un-shade automatically " + "when the mouse pointer has been over the title bar for some time.")); + + wtstr = i18n("Sets the time in milliseconds before the window unshades " + "when the mouse pointer goes over the shaded window."); + TQWhatsThis::add(shadeHover, wtstr); + + 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); + + TQHBoxLayout* focusStealingLayout = new TQHBoxLayout( lay,KDialog::spacingHint()); + TQLabel* focusStealingLabel = new TQLabel( i18n( "Focus stealing prevention level:" ), this ); + focusStealing = new TQComboBox( this ); + focusStealing->insertItem( i18n( "Focus Stealing Prevention Level", "None" )); + focusStealing->insertItem( i18n( "Focus Stealing Prevention Level", "Low" )); + focusStealing->insertItem( i18n( "Focus Stealing Prevention Level", "Normal" )); + focusStealing->insertItem( i18n( "Focus Stealing Prevention Level", "High" )); + focusStealing->insertItem( i18n( "Focus Stealing Prevention Level", "Extreme" )); + focusStealingLabel->setBuddy( focusStealing ); + focusStealingLayout->addWidget( focusStealingLabel ); + focusStealingLayout->addWidget( focusStealing, AlignLeft ); + wtstr = i18n( "<p>This option specifies how much KWin 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.)" + "<ul>" + "<li><em>None:</em> Prevention is turned off " + "and new windows always become activated.</li>" + "<li><em>Low:</em> Prevention is enabled; when some window does not have support " + "for the underlying mechanism and KWin cannot reliably decide whether to " + "activate the window or not, it will be activated. This setting may have both " + "worse and better results than normal level, depending on the applications.</li>" + "<li><em>Normal:</em> Prevention is enabled.</li>" + "<li><em>High:</em> New windows get activated only if no window is currently active " + "or if they belong to the currently active application. This setting is probably " + "not really usable when not using mouse focus policy.</li>" + "<li><em>Extreme:</em> All windows must be explicitly activated by the user.</li>" + "</ul></p>" + "<p>Windows that are prevented from stealing focus are marked as demanding attention, " + "which by default means their taskbar entry will be highlighted. This can be changed " + "in the Notifications control module.</p>" ); + TQWhatsThis::add( focusStealing, wtstr ); + TQWhatsThis::add( focusStealingLabel, wtstr ); + connect(focusStealing, TQT_SIGNAL(activated(int)), TQT_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" + " 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())); + lay->addWidget( hideUtilityWindowsForInactive ); + + lay->addStretch(); + load(); + +} + +void KAdvancedConfig::setShadeHover(bool on) { + shadeHoverOn->setChecked(on); + shadeHover->setEnabled(on); +} + +void KAdvancedConfig::setShadeHoverInterval(int k) { + shadeHover->setValue(k); +} + +int KAdvancedConfig::getShadeHoverInterval() { + + return shadeHover->value(); +} + +void KAdvancedConfig::shadeHoverChanged(bool a) { + shadeHover->setEnabled(a); +} + +void KAdvancedConfig::setAnimateShade(bool a) { + animateShade->setChecked(a); +} + +void KAdvancedConfig::setFocusStealing(int l) { + l = KMAX( 0, KMIN( 4, l )); + focusStealing->setCurrentItem(l); +} + +void KAdvancedConfig::setHideUtilityWindowsForInactive(bool s) { + hideUtilityWindowsForInactive->setChecked( s ); +} + +void KAdvancedConfig::load( void ) +{ + config->setGroup( "Windows" ); + + setAnimateShade(config->readBoolEntry(KWIN_ANIMSHADE, true)); + 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)); + +// setFocusStealing( config->readNumEntry(KWIN_FOCUS_STEALING, 2 )); + // TODO default to low for now + setFocusStealing( config->readNumEntry(KWIN_FOCUS_STEALING, 1 )); + setHideUtilityWindowsForInactive( config->readBoolEntry( KWIN_HIDE_UTILITY, true )); + + emit KCModule::changed(false); +} + +void KAdvancedConfig::save( void ) +{ + int v; + + config->setGroup( "Windows" ); + config->writeEntry(KWIN_ANIMSHADE, animateShade->isChecked()); + if (shadeHoverOn->isChecked()) + config->writeEntry(KWIN_SHADEHOVER, "on"); + else + config->writeEntry(KWIN_SHADEHOVER, "off"); + + 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_FOCUS_STEALING, focusStealing->currentItem()); + config->writeEntry(KWIN_HIDE_UTILITY, hideUtilityWindowsForInactive->isChecked()); + + if (standAlone) + { + config->sync(); + if ( !kapp->dcopClient()->isAttached() ) + kapp->dcopClient()->attach(); + kapp->dcopClient()->send("twin*", "", "reconfigure()", TQString("")); + } + emit KCModule::changed(false); +} + +void KAdvancedConfig::defaults() +{ + setAnimateShade(true); + setShadeHover(false); + setShadeHoverInterval(250); + setElectricBorders(0); + setElectricBorderDelay(150); +// setFocusStealing(2); + // TODO default to low for now + setFocusStealing(1); + setHideUtilityWindowsForInactive( true ); + emit KCModule::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) + delete config; +} + +KMovingConfig::KMovingConfig (bool _standAlone, KConfig *_config, TQWidget *parent, const char *) + : KCModule(parent, "kcmkwm"), config(_config), standAlone(_standAlone) +{ + TQString wtstr; + TQBoxLayout *lay = new TQVBoxLayout (this, 0, KDialog::spacingHint()); + + windowsBox = new TQButtonGroup(i18n("Windows"), this); + windowsBox->setColumnLayout( 0, Qt::Horizontal ); + + TQBoxLayout *wLay = new TQVBoxLayout (windowsBox->tqlayout(), 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.") ); + + 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.") ); + + geometryTipOn = new TQCheckBox(i18n("Display window &geometry when moving or resizing"), windowsBox); + bLay->addWidget(geometryTipOn); + TQWhatsThis::add(geometryTipOn, i18n("Enable this option if you want a window's geometry to be displayed" + " while it is being moved or resized. The window position relative" + " to the top-left corner of the screen is displayed together with" + " its size.")); + + TQGridLayout *rLay = new TQGridLayout(2,3); + bLay->addLayout(TQT_TQLAYOUT(rLay)); + rLay->setColStretch(0,0); + rLay->setColStretch(1,1); + + minimizeAnimOn = new TQCheckBox(i18n("Animate minimi&ze and restore"), + windowsBox); + TQWhatsThis::add( minimizeAnimOn, i18n("Enable this option if you want an animation shown when" + " windows are minimized or restored." ) ); + rLay->addWidget(minimizeAnimOn,0,0); + + minimizeAnimSlider = new TQSlider(0,10,10,0,Qt::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))); + + minimizeAnimSlowLabel= new TQLabel(i18n("Slow"),windowsBox); + minimizeAnimSlowLabel->tqsetAlignment(Qt::AlignTop|Qt::AlignLeft); + rLay->addWidget(minimizeAnimSlowLabel,1,1); + + minimizeAnimFastLabel= new TQLabel(i18n("Fast"),windowsBox); + minimizeAnimFastLabel->tqsetAlignment(Qt::AlignTop|Qt::AlignRight); + rLay->addWidget(minimizeAnimFastLabel,1,2); + + wtstr = i18n("Here you can set the speed of the animation shown when windows are" + " minimized and restored. "); + TQWhatsThis::add( minimizeAnimSlider, wtstr ); + TQWhatsThis::add( minimizeAnimSlowLabel, wtstr ); + TQWhatsThis::add( minimizeAnimFastLabel, wtstr ); + + moveResizeMaximized = new TQCheckBox( i18n("Allow moving and resizing o&f maximized windows"), windowsBox); + bLay->addWidget(moveResizeMaximized); + TQWhatsThis::add(moveResizeMaximized, i18n("When enabled, this feature activates the border of maximized windows" + " and allows you to move or resize them," + " just like for normal windows")); + + TQBoxLayout *vLay = new TQHBoxLayout(bLay); + + TQLabel *plcLabel = new TQLabel(i18n("&Placement:"),windowsBox); + + placementCombo = new TQComboBox(false, windowsBox); + placementCombo->insertItem(i18n("Smart"), SMART_PLACEMENT); + placementCombo->insertItem(i18n("Maximizing"), MAXIMIZING_PLACEMENT); + placementCombo->insertItem(i18n("Cascade"), CASCADE_PLACEMENT); + placementCombo->insertItem(i18n("Random"), RANDOM_PLACEMENT); + placementCombo->insertItem(i18n("Centered"), CENTERED_PLACEMENT); + placementCombo->insertItem(i18n("Zero-Cornered"), ZEROCORNERED_PLACEMENT); + // CT: disabling is needed as long as functionality misses in twin + //placementCombo->insertItem(i18n("Interactive"), INTERACTIVE_PLACEMENT); + //placementCombo->insertItem(i18n("Manual"), MANUAL_PLACEMENT); + placementCombo->setCurrentItem(SMART_PLACEMENT); + + // FIXME, when more policies have been added to KWin + wtstr = i18n("The placement policy determines where a new window" + " will appear on the desktop." + " <ul>" + " <li><em>Smart</em> will try to achieve a minimum overlap of windows</li>" + " <li><em>Maximizing</em> will try to maximize every window to fill the whole screen." + " It might be useful to selectively affect placement of some windows using" + " the window-specific settings.</li>" + " <li><em>Cascade</em> will cascade the windows</li>" + " <li><em>Random</em> will use a random position</li>" + " <li><em>Centered</em> will place the window centered</li>" + " <li><em>Zero-Cornered</em> will place the window in the top-left corner</li>" + "</ul>") ; + + TQWhatsThis::add( plcLabel, wtstr); + TQWhatsThis::add( placementCombo, wtstr); + + plcLabel->setBuddy(placementCombo); + vLay->addWidget(plcLabel, 0); + vLay->addWidget(placementCombo, 1, Qt::AlignLeft); + + bLay->addSpacing(10); + + lay->addWidget(windowsBox); + + //iTLabel = new TQLabel(i18n(" Allowed overlap:\n" + // "(% of desktop space)"), + // plcBox); + //iTLabel->tqsetAlignment(AlignTop|AlignHCenter); + //pLay->addWidget(iTLabel,1,1); + + //interactiveTrigger = new TQSpinBox(0, 500, 1, plcBox); + //pLay->addWidget(interactiveTrigger,1,2); + + //pLay->addRowSpacing(2,KDialog::spacingHint()); + + //lay->addWidget(plcBox); + + + //CT 15mar98 - add EdgeResistance, BorderAttractor, WindowsAttractor config + MagicBox = new TQVButtonGroup(i18n("Snap Zones"), this); + MagicBox->setMargin(15); + + BrdrSnap = new KIntNumInput(10, MagicBox); + BrdrSnap->setSpecialValueText( i18n("none") ); + BrdrSnap->setRange( 0, MAX_BRDR_SNAP); + BrdrSnap->setLabel(i18n("&Border snap zone:")); + BrdrSnap->setSteps(1,10); + TQWhatsThis::add( BrdrSnap, i18n("Here you can set the snap zone for screen borders, i.e." + " the 'strength' of the magnetic field which will make windows snap to the border when" + " moved near it.") ); + + WndwSnap = new KIntNumInput(10, MagicBox); + WndwSnap->setSpecialValueText( i18n("none") ); + WndwSnap->setRange( 0, MAX_WNDW_SNAP); + WndwSnap->setLabel(i18n("&Window snap zone:")); + BrdrSnap->setSteps(1,10); + TQWhatsThis::add( WndwSnap, i18n("Here you can set the snap zone for windows, i.e." + " the 'strength' of the magnetic field which will make windows snap to each other when" + " they're moved near another window.") ); + + OverlapSnap=new TQCheckBox(i18n("Snap windows onl&y when overlapping"),MagicBox); + TQWhatsThis::add( OverlapSnap, i18n("Here you can set that windows will be only" + " snapped if you try to overlap them, i.e. they will not be snapped if the windows" + " comes only near another window or border.") ); + + lay->addWidget(MagicBox); + lay->addStretch(); + + 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())); + + // 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); +} + +bool KMovingConfig::getGeometryTip() +{ + return geometryTipOn->isChecked(); +} + +// placement policy --- CT 31jan98 --- +int KMovingConfig::getPlacement() +{ + return placementCombo->currentItem(); +} + +void KMovingConfig::setPlacement(int plac) +{ + placementCombo->setCurrentItem(plac); +} + +bool KMovingConfig::getMinimizeAnim() +{ + return minimizeAnimOn->isChecked(); +} + +int KMovingConfig::getMinimizeAnimSpeed() +{ + return minimizeAnimSlider->value(); +} + +void KMovingConfig::setMinimizeAnim(bool anim) +{ + minimizeAnimOn->setChecked( anim ); + minimizeAnimSlider->setEnabled( anim ); + minimizeAnimSlowLabel->setEnabled( anim ); + minimizeAnimFastLabel->setEnabled( anim ); +} + +void KMovingConfig::setMinimizeAnimSpeed(int speed) +{ + minimizeAnimSlider->setValue(speed); +} + +int KMovingConfig::getResizeOpaque() +{ + return (resizeOpaqueOn->isChecked())? RESIZE_OPAQUE : RESIZE_TRANSPARENT; +} + +void KMovingConfig::setResizeOpaque(int opaque) +{ + resizeOpaqueOn->setChecked(opaque == RESIZE_OPAQUE); +} + +void KMovingConfig::setMoveResizeMaximized(bool a) { + moveResizeMaximized->setChecked(a); +} + +void KMovingConfig::slotBrdrSnapChanged(int value) { + BrdrSnap->setSuffix(i18n(" pixel", " pixels", value)); +} + +void KMovingConfig::slotWndwSnapChanged(int value) { + WndwSnap->setSuffix(i18n(" pixel", " pixels", value)); +} + +void KMovingConfig::load( void ) +{ + TQString key; + + config->setGroup( "Windows" ); + + key = config->readEntry(KWIN_MOVE, "Opaque"); + if( key == "Transparent") + setMove(TRANSPARENT); + else if( key == "Opaque") + setMove(OPAQUE); + + //CT 17Jun1998 - variable animation speed from 0 (none!!) to 10 (max) + bool anim = config->readBoolEntry(KWIN_MINIMIZE_ANIM, true ); + int animSpeed = config->readNumEntry(KWIN_MINIMIZE_ANIM_SPEED, 5); + if( animSpeed < 1 ) animSpeed = 0; + if( animSpeed > 10 ) animSpeed = 10; + 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 ); + + // placement policy --- CT 19jan98 --- + key = config->readEntry(KWIN_PLACEMENT); + //CT 13mar98 interactive placement +// if( key.left(11) == "interactive") { +// setPlacement(INTERACTIVE_PLACEMENT); +// int comma_pos = key.find(','); +// if (comma_pos < 0) +// interactiveTrigger->setValue(0); +// else +// interactiveTrigger->setValue (key.right(key.length() +// - comma_pos).toUInt(0)); +// iTLabel->setEnabled(true); +// interactiveTrigger->show(); +// } +// else { +// interactiveTrigger->setValue(0); +// iTLabel->setEnabled(false); +// interactiveTrigger->hide(); + if( key == "Random") + setPlacement(RANDOM_PLACEMENT); + else if( key == "Cascade") + setPlacement(CASCADE_PLACEMENT); //CT 31jan98 + //CT 31mar98 manual placement + else if( key == "manual") + setPlacement(MANUAL_PLACEMENT); + else if( key == "Centered") + setPlacement(CENTERED_PLACEMENT); + else if( key == "ZeroCornered") + setPlacement(ZEROCORNERED_PLACEMENT); + else if( key == "Maximizing") + setPlacement(MAXIMIZING_PLACEMENT); + else + setPlacement(SMART_PLACEMENT); +// } + + setMoveResizeMaximized(config->readBoolEntry(KWIN_MOVE_RESIZE_MAXIMIZED, false)); + + int v; + + v = config->readNumEntry(KWM_BRDR_SNAP_ZONE, KWM_BRDR_SNAP_ZONE_DEFAULT); + if (v > MAX_BRDR_SNAP) setBorderSnapZone(MAX_BRDR_SNAP); + else if (v < 0) setBorderSnapZone (0); + else setBorderSnapZone(v); + + v = config->readNumEntry(KWM_WNDW_SNAP_ZONE, KWM_WNDW_SNAP_ZONE_DEFAULT); + if (v > MAX_WNDW_SNAP) setWindowSnapZone(MAX_WNDW_SNAP); + else if (v < 0) setWindowSnapZone (0); + else setWindowSnapZone(v); + + OverlapSnap->setChecked(config->readBoolEntry("SnapOnlyWhenOverlapping",false)); + emit KCModule::changed(false); +} + +void KMovingConfig::save( void ) +{ + int v; + + config->setGroup( "Windows" ); + + v = getMove(); + if (v == TRANSPARENT) + config->writeEntry(KWIN_MOVE,"Transparent"); + else + config->writeEntry(KWIN_MOVE,"Opaque"); + + config->writeEntry(KWIN_GEOMETRY, getGeometryTip()); + + // placement policy --- CT 31jan98 --- + v =getPlacement(); + if (v == RANDOM_PLACEMENT) + config->writeEntry(KWIN_PLACEMENT, "Random"); + else if (v == CASCADE_PLACEMENT) + config->writeEntry(KWIN_PLACEMENT, "Cascade"); + else if (v == CENTERED_PLACEMENT) + config->writeEntry(KWIN_PLACEMENT, "Centered"); + else if (v == ZEROCORNERED_PLACEMENT) + config->writeEntry(KWIN_PLACEMENT, "ZeroCornered"); + else if (v == MAXIMIZING_PLACEMENT) + config->writeEntry(KWIN_PLACEMENT, "Maximizing"); +//CT 13mar98 manual and interactive placement +// else if (v == MANUAL_PLACEMENT) +// config->writeEntry(KWIN_PLACEMENT, "Manual"); +// else if (v == INTERACTIVE_PLACEMENT) { +// TQString tmpstr = TQString("Interactive,%1").arg(interactiveTrigger->value()); +// config->writeEntry(KWIN_PLACEMENT, tmpstr); +// } + else + config->writeEntry(KWIN_PLACEMENT, "Smart"); + + 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(KWM_BRDR_SNAP_ZONE,getBorderSnapZone()); + config->writeEntry(KWM_WNDW_SNAP_ZONE,getWindowSnapZone()); + config->writeEntry("SnapOnlyWhenOverlapping",OverlapSnap->isChecked()); + + if (standAlone) + { + config->sync(); + if ( !kapp->dcopClient()->isAttached() ) + kapp->dcopClient()->attach(); + kapp->dcopClient()->send("twin*", "", "reconfigure()", TQString("")); + } + emit KCModule::changed(false); +} + +void KMovingConfig::defaults() +{ + setMove(OPAQUE); + setResizeOpaque(RESIZE_TRANSPARENT); + setGeometryTip(false); + setPlacement(SMART_PLACEMENT); + setMoveResizeMaximized(false); + + //copied from kcontrol/konq/twindesktop, aleXXX + setWindowSnapZone(KWM_WNDW_SNAP_ZONE_DEFAULT); + setBorderSnapZone(KWM_BRDR_SNAP_ZONE_DEFAULT); + OverlapSnap->setChecked(false); + + setMinimizeAnim( true ); + setMinimizeAnimSpeed( 5 ); + emit KCModule::changed(true); +} + +int KMovingConfig::getBorderSnapZone() { + return BrdrSnap->value(); +} + +void KMovingConfig::setBorderSnapZone(int pxls) { + BrdrSnap->setValue(pxls); +} + +int KMovingConfig::getWindowSnapZone() { + return WndwSnap->value(); +} + +void KMovingConfig::setWindowSnapZone(int pxls) { + WndwSnap->setValue(pxls); +} + +KTranslucencyConfig::~KTranslucencyConfig () +{ + if (standAlone) + delete config; + if (kompmgr) + kompmgr->detach(); +} + +KTranslucencyConfig::KTranslucencyConfig (bool _standAlone, KConfig *_config, TQWidget *parent, const char *) + : KCModule(parent, "kcmkwm"), config(_config), standAlone(_standAlone) +{ + kompmgr = 0L; + resetKompmgr_ = FALSE; + TQVBoxLayout *lay = new TQVBoxLayout (this); + kompmgrAvailable_ = kompmgrAvailable(); + if (!kompmgrAvailable_){ + KActiveLabel *label = new KActiveLabel(i18n("<qt><b>It seems that alpha channel support is not available.</b><br><br>" + "Please make sure you have " + "<a href=\"http://www.freedesktop.org/\">Xorg ≥ 6.8</a>," + " and installed the kompmgr that came with twin.<br>" + "Also, make sure you have the following entries in your XConfig (e.g. /etc/X11/xorg.conf):<br><br>" + "<i>Section \"Extensions\"<br>" + "Option \"Composite\" \"Enable\"<br>" + "EndSection</i><br><br>" + "And if your GPU provides hardware-accelerated Xrender support (mainly nVidia cards):<br><br>" + "<i>Option \"RenderAccel\" \"true\"</i><br>" + "In <i>Section \"Device\"</i></qt>"), this); + lay->addWidget(label); + } + else + { + TQTabWidget *tabW = new TQTabWidget(this); + 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); + + activeWindowTransparency = new TQCheckBox(i18n("Active windows:"),tGroup); + gLay->addWidget(activeWindowTransparency,0,0); + activeWindowOpacity = new KIntNumInput(100, tGroup); + activeWindowOpacity->setRange(0,100); + activeWindowOpacity->setSuffix("%"); + gLay->addWidget(activeWindowOpacity,0,1); + + inactiveWindowTransparency = new TQCheckBox(i18n("Inactive windows:"),tGroup); + gLay->addWidget(inactiveWindowTransparency,1,0); + inactiveWindowOpacity = new KIntNumInput(100, tGroup); + inactiveWindowOpacity->setRange(0,100); + inactiveWindowOpacity->setSuffix("%"); + gLay->addWidget(inactiveWindowOpacity,1,1); + + movingWindowTransparency = new TQCheckBox(i18n("Moving windows:"),tGroup); + gLay->addWidget(movingWindowTransparency,2,0); + movingWindowOpacity = new KIntNumInput(100, tGroup); + movingWindowOpacity->setRange(0,100); + movingWindowOpacity->setSuffix("%"); + gLay->addWidget(movingWindowOpacity,2,1); + + dockWindowTransparency = new TQCheckBox(i18n("Dock windows:"),tGroup); + gLay->addWidget(dockWindowTransparency,3,0); + dockWindowOpacity = new KIntNumInput(100, tGroup); + dockWindowOpacity->setRange(0,100); + dockWindowOpacity->setSuffix("%"); + gLay->addWidget(dockWindowOpacity,3,1); + + vLay->addSpacing(11); + + keepAboveAsActive = new TQCheckBox(i18n("Treat 'keep above' windows as active ones"),tGroup); + vLay->addWidget(keepAboveAsActive); + + disableARGB = new TQCheckBox(i18n("Disable ARGB windows (ignores window alpha maps, fixes gtk1 apps)"),tGroup); + vLay->addWidget(disableARGB); + + vLay->addStretch(); + tabW->addTab(tGroup, i18n("Opacity")); + + TQWidget *sGroup = new TQWidget(tabW); +// sGroup->setCheckable(TRUE); + TQVBoxLayout *vLay2 = new TQVBoxLayout (sGroup,11,6); + vLay2->addSpacing(11); // to get the proper gb top offset + useShadows = new TQCheckBox(i18n("Use shadows (standard effects should be disabled in the Styles module if this is checked)"),sGroup); + vLay2->addWidget(useShadows); + + vLay2->addSpacing(11); + + TQGridLayout *gLay2 = new TQGridLayout(vLay2,6,2); + gLay2->setColStretch(1,1); + + TQLabel *label2 = new TQLabel(i18n("Base shadow size:"),sGroup); + gLay2->addWidget(label2,0,0); + inactiveWindowShadowSize = new KIntNumInput(6,sGroup); + inactiveWindowShadowSize->setRange(0,32); +// inactiveWindowShadowSize->setSuffix("px"); + gLay2->addWidget(inactiveWindowShadowSize,0,1); + + TQLabel *label1 = new TQLabel(i18n("Active window shadow size multiplier:"),sGroup); + gLay2->addWidget(label1,1,0); + activeWindowShadowSize = new KIntNumInput(12,sGroup); + activeWindowShadowSize->setRange(0,32); +// activeWindowShadowSize->setSuffix("px"); + gLay2->addWidget(activeWindowShadowSize,1,1); + + TQLabel *label3 = new TQLabel(i18n("Dock shadow size multiplier:"),sGroup); + gLay2->addWidget(label3,2,0); + dockWindowShadowSize = new KIntNumInput(6,sGroup); + dockWindowShadowSize->setRange(0,32); +// dockWindowShadowSize->setSuffix("px"); + gLay2->addWidget(dockWindowShadowSize,2,1); + + TQLabel *label3a = new TQLabel(i18n("Menu shadow size multiplier:"),sGroup); + gLay2->addWidget(label3a,3,0); + menuWindowShadowSize = new KIntNumInput(6,sGroup); + menuWindowShadowSize->setRange(0,32); +// menuWindowShadowSize->setSuffix("px"); + gLay2->addWidget(menuWindowShadowSize,3,1); + + // Menu shadow settings don't work + label3a->hide(); + menuWindowShadowSize->hide(); + + TQLabel *label4 = new TQLabel(i18n("Vertical offset:"),sGroup); + gLay2->addWidget(label4,4,0); + shadowTopOffset = new KIntNumInput(80,sGroup); + shadowTopOffset->setSuffix("%"); + shadowTopOffset->setRange(-200,200); + gLay2->addWidget(shadowTopOffset,4,1); + + TQLabel *label5 = new TQLabel(i18n("Horizontal offset:"),sGroup); + gLay2->addWidget(label5,5,0); + shadowLeftOffset = new KIntNumInput(0,sGroup); + shadowLeftOffset->setSuffix("%"); + shadowLeftOffset->setRange(-200,200); + gLay2->addWidget(shadowLeftOffset,5,1); + + TQLabel *label6 = new TQLabel(i18n("Shadow color:"),sGroup); + gLay2->addWidget(label6,5,0); + shadowColor = new KColorButton(Qt::black,sGroup); + gLay2->addWidget(shadowColor,6,1); + gLay2->setColStretch(1,1); + vLay2->addSpacing(11); + removeShadowsOnMove = new TQCheckBox(i18n("Remove shadows on move"),sGroup); + vLay2->addWidget(removeShadowsOnMove); + removeShadowsOnResize = new TQCheckBox(i18n("Remove shadows on resize"),sGroup); + vLay2->addWidget(removeShadowsOnResize); + vLay2->addStretch(); + tabW->addTab(sGroup, i18n("Shadows")); + + TQWidget *eGroup = new TQWidget(this); + TQVBoxLayout *vLay3 = new TQVBoxLayout (eGroup,11,6); + + fadeInWindows = new TQCheckBox(i18n("Fade-in windows (including popups)"),eGroup); + fadeInMenuWindows = new TQCheckBox(i18n("Fade-in menus (requires menu fade effect to be disabled in the Styles module)"),eGroup); + fadeOnOpacityChange = new TQCheckBox(i18n("Fade between opacity changes"),eGroup); + fadeInSpeed = new KIntNumInput(100, eGroup); + fadeInSpeed->setRange(1,100); + fadeInSpeed->setLabel(i18n("Fade-in speed:")); + fadeOutSpeed = new KIntNumInput(100, eGroup); + fadeOutSpeed->setRange(1,100); + fadeOutSpeed->setLabel(i18n("Fade-out speed:")); + vLay3->addWidget(fadeInWindows); + vLay3->addWidget(fadeInMenuWindows); + vLay3->addWidget(fadeOnOpacityChange); + vLay3->addWidget(fadeInSpeed); + vLay3->addWidget(fadeOutSpeed); + vLay3->addStretch(); + + tabW->addTab(eGroup, i18n("Effects")); + + useTranslucency = new TQCheckBox(i18n("Enable the Trinity window composition manager"),this); + 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(useShadows, 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(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(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)), dockWindowShadowSize, TQT_SLOT(setEnabled(bool))); + connect(useShadows, TQT_SIGNAL(toggled(bool)), menuWindowShadowSize, TQT_SLOT(setEnabled(bool))); + connect(useShadows, TQT_SIGNAL(toggled(bool)), activeWindowShadowSize, TQT_SLOT(setEnabled(bool))); + connect(useShadows, TQT_SIGNAL(toggled(bool)), inactiveWindowShadowSize, TQT_SLOT(setEnabled(bool))); + connect(useShadows, TQT_SIGNAL(toggled(bool)), shadowTopOffset, TQT_SLOT(setEnabled(bool))); + connect(useShadows, TQT_SIGNAL(toggled(bool)), shadowLeftOffset, TQT_SLOT(setEnabled(bool))); + connect(useShadows, TQT_SIGNAL(toggled(bool)), shadowColor, TQT_SLOT(setEnabled(bool))); + + load(); + + tabW->setEnabled(useTranslucency->isChecked()); + + connect(useTranslucency, TQT_SIGNAL(toggled(bool)), this, TQT_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(useShadows, TQT_SIGNAL(toggled(bool)), TQT_SLOT(resetKompmgr())); + connect(inactiveWindowShadowSize, 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(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())); + + } +} + +void KTranslucencyConfig::resetKompmgr() +{ + resetKompmgr_ = TRUE; +} +void KTranslucencyConfig::load( void ) +{ + + if (!kompmgrAvailable_) + return; + config->setGroup( "Notification Messages" ); + useTranslucency->setChecked(config->readBoolEntry("UseTranslucency",false)); + + config->setGroup( "Translucency" ); + activeWindowTransparency->setChecked(config->readBoolEntry("TranslucentActiveWindows",false)); + inactiveWindowTransparency->setChecked(config->readBoolEntry("TranslucentInactiveWindows",false)); + movingWindowTransparency->setChecked(config->readBoolEntry("TranslucentMovingWindows",false)); + removeShadowsOnMove->setChecked(config->readBoolEntry("RemoveShadowsOnMove",false)); + removeShadowsOnResize->setChecked(config->readBoolEntry("RemoveShadowsOnResize",false)); + dockWindowTransparency->setChecked(config->readBoolEntry("TranslucentDocks",false)); + keepAboveAsActive->setChecked(config->readBoolEntry("TreatKeepAboveAsActive",true)); + onlyDecoTranslucent->setChecked(config->readBoolEntry("OnlyDecoTranslucent",false)); + + activeWindowOpacity->setValue(config->readNumEntry("ActiveWindowOpacity",100)); + inactiveWindowOpacity->setValue(config->readNumEntry("InactiveWindowOpacity",75)); + movingWindowOpacity->setValue(config->readNumEntry("MovingWindowOpacity",25)); + dockWindowOpacity->setValue(config->readNumEntry("DockOpacity",80)); + + int ass, iss, dss, mss; + dss = config->readNumEntry("DockShadowSize", 33); + mss = config->readNumEntry("MenuShadowSize", 33); + ass = config->readNumEntry("ActiveWindowShadowSize", 133); + iss = config->readNumEntry("InactiveWindowShadowSize", 67); + + activeWindowOpacity->setEnabled(activeWindowTransparency->isChecked()); + inactiveWindowOpacity->setEnabled(inactiveWindowTransparency->isChecked()); + movingWindowOpacity->setEnabled(movingWindowTransparency->isChecked()); + dockWindowOpacity->setEnabled(dockWindowTransparency->isChecked()); + + KConfig conf_(TQDir::homeDirPath() + "/.xcompmgrrc"); + conf_.setGroup("xcompmgr"); + + disableARGB->setChecked(conf_.readBoolEntry("DisableARGB",FALSE)); + + useShadows->setChecked(conf_.readEntry("Compmode","").compare("CompClientShadows") == 0); + shadowTopOffset->setValue(-1*(conf_.readNumEntry("ShadowOffsetY",-80))); + shadowLeftOffset->setValue(-1*(conf_.readNumEntry("ShadowOffsetX",0))); + + int ss = conf_.readNumEntry("ShadowRadius",6); + dockWindowShadowSize->setValue((int)(dss*ss/100.0)); + menuWindowShadowSize->setValue((int)(mss*ss/100.0)); + activeWindowShadowSize->setValue((int)(ass*ss/100.0)); + inactiveWindowShadowSize->setValue((int)(iss*ss/100.0)); + + TQString hex = conf_.readEntry("ShadowColor","#000000"); + uint r, g, b; + 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); + else + shadowColor->setColor(TQColor(r,g,b)); + + fadeInWindows->setChecked(conf_.readBoolEntry("FadeWindows",FALSE)); + fadeInMenuWindows->setChecked(conf_.readBoolEntry("FadeMenuWindows",FALSE)); + fadeOnOpacityChange->setChecked(conf_.readBoolEntry("FadeTrans",FALSE)); + fadeInSpeed->setValue((int)(conf_.readDoubleNumEntry("FadeInStep",0.070)*1000.0)); + fadeOutSpeed->setValue((int)(conf_.readDoubleNumEntry("FadeOutStep",0.070)*1000.0)); + + emit KCModule::changed(false); +} + +void KTranslucencyConfig::save( void ) +{ + if (!kompmgrAvailable_) + return; + config->setGroup( "Notification Messages" ); + config->writeEntry("UseTranslucency",useTranslucency->isChecked()); + + config->setGroup( "Translucency" ); + config->writeEntry("TranslucentActiveWindows",activeWindowTransparency->isChecked()); + config->writeEntry("TranslucentInactiveWindows",inactiveWindowTransparency->isChecked()); + config->writeEntry("TranslucentMovingWindows",movingWindowTransparency->isChecked()); + config->writeEntry("TranslucentDocks",dockWindowTransparency->isChecked()); + config->writeEntry("TreatKeepAboveAsActive",keepAboveAsActive->isChecked()); + config->writeEntry("ActiveWindowOpacity",activeWindowOpacity->value()); + config->writeEntry("InactiveWindowOpacity",inactiveWindowOpacity->value()); + config->writeEntry("MovingWindowOpacity",movingWindowOpacity->value()); + config->writeEntry("DockOpacity",dockWindowOpacity->value()); + // for simplification: + // xcompmgr supports a general shadow radius and additionally lets external apps set a multiplicator for each window + // (speed reasons, so the shadow matrix hasn't to be recreated for every window) + // we set inactive windows to 100%, the radius to the inactive window value and adjust the multiplicators for docks and active windows + // this way the user can set the three values without caring about the radius/multiplicator stuff + // additionally we find a value between big and small values to have a more smooth appereance + config->writeEntry("DockShadowSize",(int)(200.0 * dockWindowShadowSize->value() / (activeWindowShadowSize->value() + inactiveWindowShadowSize->value()))); + config->writeEntry("MenuShadowSize",(int)(200.0 * menuWindowShadowSize->value() / (activeWindowShadowSize->value() + inactiveWindowShadowSize->value()))); + config->writeEntry("ActiveWindowShadowSize",(int)(200.0 * activeWindowShadowSize->value() / (activeWindowShadowSize->value() + inactiveWindowShadowSize->value()))); + config->writeEntry("InactiveWindowShadowSize",(int)(200.0 * inactiveWindowShadowSize->value() / (activeWindowShadowSize->value() + inactiveWindowShadowSize->value()))); + + config->writeEntry("RemoveShadowsOnMove",removeShadowsOnMove->isChecked()); + config->writeEntry("RemoveShadowsOnResize",removeShadowsOnResize->isChecked()); + config->writeEntry("OnlyDecoTranslucent", onlyDecoTranslucent->isChecked()); + config->writeEntry("ResetKompmgr",resetKompmgr_); + + KConfig *conf_ = new KConfig(TQDir::homeDirPath() + "/.xcompmgrrc"); + conf_->setGroup("xcompmgr"); + + conf_->writeEntry("Compmode",useShadows->isChecked()?"CompClientShadows":""); + conf_->writeEntry("DisableARGB",disableARGB->isChecked()); + conf_->writeEntry("ShadowOffsetY",-1*shadowTopOffset->value()); + conf_->writeEntry("ShadowOffsetX",-1*shadowLeftOffset->value()); + + + int r, g, b; + shadowColor->color().rgb( &r, &g, &b ); + TQString hex; + hex.sprintf("0x%02X%02X%02X", r,g,b); + conf_->writeEntry("ShadowColor",hex); + conf_->writeEntry("ShadowRadius",(activeWindowShadowSize->value() + inactiveWindowShadowSize->value()) / 2); + conf_->writeEntry("FadeWindows",fadeInWindows->isChecked()); + conf_->writeEntry("FadeMenuWindows",fadeInMenuWindows->isChecked()); + conf_->writeEntry("FadeTrans",fadeOnOpacityChange->isChecked()); + conf_->writeEntry("FadeInStep",fadeInSpeed->value()/1000.0); + conf_->writeEntry("FadeOutStep",fadeOutSpeed->value()/1000.0); + + delete conf_; + + if (standAlone) + { + config->sync(); + if ( !kapp->dcopClient()->isAttached() ) + kapp->dcopClient()->attach(); + kapp->dcopClient()->send("twin*", "", "reconfigure()", TQString("")); + } + if (useTranslucency->isChecked()) + startKompmgr(); + emit KCModule::changed(false); +} + +void KTranslucencyConfig::defaults() +{ + if (!kompmgrAvailable_) + return; + useTranslucency->setChecked(false); + onlyDecoTranslucent->setChecked(false); + activeWindowTransparency->setChecked(false); + inactiveWindowTransparency->setChecked(false); + movingWindowTransparency->setChecked(false); + dockWindowTransparency->setChecked(false); + keepAboveAsActive->setChecked(true); + disableARGB->setChecked(false); + + activeWindowOpacity->setValue(100); + inactiveWindowOpacity->setValue(75); + movingWindowOpacity->setValue(25); + dockWindowOpacity->setValue(80); + + dockWindowShadowSize->setValue(6); + menuWindowShadowSize->setValue(6); + activeWindowShadowSize->setValue(12); + inactiveWindowShadowSize->setValue(6); + shadowTopOffset->setValue(80); + shadowLeftOffset->setValue(0); + + activeWindowOpacity->setEnabled(false); + inactiveWindowOpacity->setEnabled(false); + movingWindowOpacity->setEnabled(false); + dockWindowOpacity->setEnabled(false); + useShadows->setChecked(FALSE); + removeShadowsOnMove->setChecked(FALSE); + removeShadowsOnResize->setChecked(FALSE); + shadowColor->setColor(Qt::black); + fadeInWindows->setChecked(FALSE); + fadeInMenuWindows->setChecked(FALSE); + fadeOnOpacityChange->setChecked(FALSE); + fadeInSpeed->setValue(70); + fadeOutSpeed->setValue(70); + emit KCModule::changed(true); +} + + +bool KTranslucencyConfig::kompmgrAvailable() +{ + bool ret; + KProcess proc; + proc << "kompmgr" << "-v"; + ret = proc.start(KProcess::DontCare, KProcess::AllOutput); + proc.detach(); + return ret; +} + +void KTranslucencyConfig::startKompmgr() +{ + bool ret; + KProcess proc; + proc << "kompmgr"; + ret = proc.start(KProcess::DontCare); +} + +void KTranslucencyConfig::showWarning(bool alphaActivated) +{ +// if (alphaActivated) +// KMessageBox::information(this, i18n("<qt>Translucency support is new and may cause problems<br> including crashes (sometimes the translucency engine, seldom even X).</qt>"), i18n("Warning")); +} + +#include "windows.moc" diff --git a/twin/kcmtwin/twinoptions/windows.h b/twin/kcmtwin/twinoptions/windows.h new file mode 100644 index 000000000..e3b81d07a --- /dev/null +++ b/twin/kcmtwin/twinoptions/windows.h @@ -0,0 +1,297 @@ +/* + * windows.h + * + * Copyright (c) 1997 Patrick Dowler dowler@morgul.fsh.uvic.ca + * Copyright (c) 2001 Waldo Bastian bastian@kde.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef __KWINDOWCONFIG_H__ +#define __KWINDOWCONFIG_H__ + +#include <tqwidget.h> +#include <kcmodule.h> +#include <config.h> + +class TQRadioButton; +class TQCheckBox; +class TQPushButton; +class TQComboBox; +class TQGroupBox; +class TQLabel; +class TQSlider; +class TQButtonGroup; +class TQSpinBox; +class TQVButtonGroup; + +class KColorButton; +class KIntNumInput; + +#define TRANSPARENT 0 +#define OPAQUE 1 + +#define CLICK_TO_FOCUS 0 +#define FOCUS_FOLLOW_MOUSE 1 + +#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 +#define RANDOM_PLACEMENT 3 +#define CENTERED_PLACEMENT 4 +#define ZEROCORNERED_PLACEMENT 5 +#define INTERACTIVE_PLACEMENT 6 +#define MANUAL_PLACEMENT 7 + +#define CLICK_TO_FOCUS 0 +#define FOCUS_FOLLOWS_MOUSE 1 +#define FOCUS_UNDER_MOUSE 2 +#define FOCUS_STRICTLY_UNDER_MOUSE 3 + +class TQSpinBox; + +class KFocusConfig : public KCModule +{ + Q_OBJECT +public: + KFocusConfig( bool _standAlone, KConfig *_config, TQWidget *parent=0, const char* name=0 ); + ~KFocusConfig(); + + void load(); + void save(); + void defaults(); + +private slots: + void setDelayFocusEnabled(); + void setAutoRaiseEnabled(); + void autoRaiseOnTog(bool);//CT 23Oct1998 + void delayFocusOnTog(bool); + void clickRaiseOnTog(bool); + void updateAltTabMode(); + void updateActiveMouseScreen(); + void changed() { emit KCModule::changed(true); } + + +private: + + int getFocus( void ); + int getAutoRaiseInterval( void ); + int getDelayFocusInterval( void ); + + void setFocus(int); + void setAutoRaiseInterval(int); + void setAutoRaise(bool); + void setDelayFocusInterval(int); + void setDelayFocus(bool); + void setClickRaise(bool); + void setSeparateScreenFocus(bool); + void setActiveMouseScreen(bool); + void setAltTabMode(bool); + void setTraverseAll(bool); + void setRollOverDesktops(bool); + void setShowPopupinfo(bool); + + TQButtonGroup *fcsBox; + TQComboBox *focusCombo; + TQCheckBox *autoRaiseOn; + TQCheckBox *delayFocusOn; + TQCheckBox *clickRaiseOn; + KIntNumInput *autoRaise; + KIntNumInput *delayFocus; + TQCheckBox *separateScreenFocus; + TQCheckBox *activeMouseScreen; + + TQButtonGroup *kbdBox; + TQCheckBox *altTabPopup; + TQCheckBox *traverseAll; + TQCheckBox *rollOverDesktops; + TQCheckBox *showPopupinfo; + + KConfig *config; + bool standAlone; +}; + +class KMovingConfig : public KCModule +{ + Q_OBJECT +public: + KMovingConfig( bool _standAlone, KConfig *config, TQWidget *parent=0, const char* name=0 ); + ~KMovingConfig(); + + void load(); + void save(); + void defaults(); + +private slots: + void setMinimizeAnim( bool ); + void setMinimizeAnimSpeed( int ); + void changed() { emit KCModule::changed(true); } + void slotBrdrSnapChanged( int ); + void slotWndwSnapChanged( int ); + +private: + int getMove( void ); + bool getMinimizeAnim( void ); + int getMinimizeAnimSpeed( void ); + int getResizeOpaque ( void ); + bool getGeometryTip( void ); //KS + int getPlacement( void ); //CT + + void setMove(int); + void setResizeOpaque(int); + void setGeometryTip(bool); //KS + void setPlacement(int); //CT + void setMoveResizeMaximized(bool); + + TQButtonGroup *windowsBox; + TQCheckBox *opaque; + TQCheckBox *resizeOpaqueOn; + TQCheckBox *geometryTipOn; + TQCheckBox* minimizeAnimOn; + TQSlider *minimizeAnimSlider; + TQLabel *minimizeAnimSlowLabel, *minimizeAnimFastLabel; + TQCheckBox *moveResizeMaximized; + + TQComboBox *placementCombo; + + KConfig *config; + bool standAlone; + + int getBorderSnapZone(); + void setBorderSnapZone( int ); + int getWindowSnapZone(); + void setWindowSnapZone( int ); + + TQVButtonGroup *MagicBox; + KIntNumInput *BrdrSnap, *WndwSnap; + TQCheckBox *OverlapSnap; + +}; + +class KAdvancedConfig : public KCModule +{ + Q_OBJECT +public: + KAdvancedConfig( bool _standAlone, KConfig *config, TQWidget *parent=0, const char* name=0 ); + ~KAdvancedConfig(); + + void load(); + void save(); + void defaults(); + +private slots: + void shadeHoverChanged(bool); + + //copied from kcontrol/konq/twindesktop, aleXXX + void setEBorders(); + + void changed() { emit KCModule::changed(true); } + +private: + + int getShadeHoverInterval (void ); + void setAnimateShade(bool); + void setShadeHover(bool); + void setShadeHoverInterval(int); + + TQCheckBox *animateShade; + TQButtonGroup *shBox; + TQCheckBox *shadeHoverOn; + KIntNumInput *shadeHover; + + KConfig *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 setFocusStealing( int ); + void setHideUtilityWindowsForInactive( bool ); + + TQComboBox* focusStealing; + TQCheckBox* hideUtilityWindowsForInactive; +}; + +class KProcess; +class KTranslucencyConfig : public KCModule +{ + Q_OBJECT +public: + KTranslucencyConfig( bool _standAlone, KConfig *config, TQWidget *parent=0, const char* name=0 ); + ~KTranslucencyConfig(); + + void load(); + void save(); + void defaults(); + +private: + TQCheckBox *useTranslucency; + TQCheckBox *activeWindowTransparency; + TQCheckBox *inactiveWindowTransparency; + TQCheckBox *movingWindowTransparency; + TQCheckBox *dockWindowTransparency; + TQCheckBox *keepAboveAsActive; + TQCheckBox *disableARGB; + TQCheckBox *fadeInWindows; + TQCheckBox *fadeInMenuWindows; + TQCheckBox *fadeOnOpacityChange; + TQCheckBox *useShadows; + TQCheckBox *removeShadowsOnResize; + TQCheckBox *removeShadowsOnMove; + TQGroupBox *sGroup; + TQCheckBox *onlyDecoTranslucent; +// TQPushButton *xcompmgrButton; + KIntNumInput *activeWindowOpacity; + KIntNumInput *inactiveWindowOpacity; + KIntNumInput *movingWindowOpacity; + KIntNumInput *dockWindowOpacity; + KIntNumInput *dockWindowShadowSize; + KIntNumInput *menuWindowShadowSize; + KIntNumInput *activeWindowShadowSize; + KIntNumInput *inactiveWindowShadowSize; + KIntNumInput *shadowTopOffset; + KIntNumInput *shadowLeftOffset; + KIntNumInput *fadeInSpeed; + KIntNumInput *fadeOutSpeed; + KColorButton *shadowColor; + KConfig *config; + bool standAlone; + bool alphaActivated; + bool resetKompmgr_; + bool kompmgrAvailable(); + void startKompmgr(); + bool kompmgrAvailable_; + KProcess *kompmgr; + +private slots: + void resetKompmgr(); + void showWarning(bool alphaActivated); + +}; +#endif diff --git a/twin/kcmtwin/twinrules/CMakeLists.txt b/twin/kcmtwin/twinrules/CMakeLists.txt new file mode 100644 index 000000000..29aa24e4e --- /dev/null +++ b/twin/kcmtwin/twinrules/CMakeLists.txt @@ -0,0 +1,56 @@ +################################################# +# +# (C) 2010-2011 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +add_definitions( -DKCMRULES ) + +include_directories( + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_SOURCE_DIR}/twin/lib + ${TDE_INCLUDE_DIR} + ${TQT_INCLUDE_DIRS} +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + +##### other data ################################ + +install( FILES twinrules.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} ) + + +##### kcm_twinrules (module) #################### + +tde_add_kpart( kcm_twinrules AUTOMOC + SOURCES kcm.cpp + LINK twinrules-static + DESTINATION ${PLUGIN_INSTALL_DIR} ) + + +##### twin_rules_dialog (tdeinit) ############### + +tde_add_tdeinit_executable( twin_rules_dialog + SOURCES main.cpp + LINK ${TQT_LIBRARIES} twinrules-static ) + + +##### twinrules (static) ######################## + +set( target twinrules ) + +set( ${target}_SRCS + ruleswidget.cpp ruleslist.cpp twinsrc.cpp detectwidget.cpp + ruleswidgetbase.ui ruleslistbase.ui detectwidgetbase.ui + editshortcutbase.ui ) + +tde_add_library( ${target} STATIC_PIC AUTOMOC + SOURCES ${${target}_SRCS} + LINK tdeui-shared ) diff --git a/twin/kcmtwin/twinrules/Makefile.am b/twin/kcmtwin/twinrules/Makefile.am new file mode 100644 index 000000000..c9e7c7beb --- /dev/null +++ b/twin/kcmtwin/twinrules/Makefile.am @@ -0,0 +1,29 @@ +METASOURCES = AUTO +AM_CPPFLAGS = $(all_includes) -DKCMRULES +INCLUDES = -I$(top_srcdir)/twin/lib + +bin_PROGRAMS = +lib_LTLIBRARIES = +tdeinit_LTLIBRARIES = twin_rules_dialog.la +kde_module_LTLIBRARIES = kcm_twinrules.la +noinst_LTLIBRARIES = libtwinrules.la + +libtwinrules_la_SOURCES = ruleswidget.cpp ruleslist.cpp twinsrc.cpp detectwidget.cpp \ + ruleswidgetbase.ui ruleslistbase.ui detectwidgetbase.ui editshortcutbase.ui +libtwinrules_la_LDFLAGS = $(all_libraries) -no-undefined +libtwinrules_la_LIBADD = $(LIB_TDEUI) + +kcm_twinrules_la_SOURCES = kcm.cpp +kcm_twinrules_la_LDFLAGS = -module -avoid-version $(all_libraries) -no-undefined +kcm_twinrules_la_LIBADD = libtwinrules.la +kcm_twinrules_la_COMPILE_FIRST = ruleslistbase.h ruleswidgetbase.h editshortcutbase.h + +twin_rules_dialog_la_SOURCES = main.cpp +twin_rules_dialog_la_LDFLAGS = -module -avoid-version $(all_libraries) -no-undefined +twin_rules_dialog_la_LIBADD = libtwinrules.la +twin_rules_dialog_la_COMPILE_FIRST = ruleslistbase.h ruleswidgetbase.h editshortcutbase.h + +messages: rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/kcmtwinrules.pot + +xdg_apps_DATA = twinrules.desktop diff --git a/twin/kcmtwin/twinrules/detectwidget.cpp b/twin/kcmtwin/twinrules/detectwidget.cpp new file mode 100644 index 000000000..d82836868 --- /dev/null +++ b/twin/kcmtwin/twinrules/detectwidget.cpp @@ -0,0 +1,223 @@ +/* + * Copyright (c) 2004 Lubos Lunak <l.lunak@kde.org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "detectwidget.h" + +#include <kapplication.h> +#include <klocale.h> +#include <kdebug.h> +#include <twin.h> +#include <tqlabel.h> +#include <tqradiobutton.h> +#include <tqcheckbox.h> + +#include <X11/Xlib.h> +#include <X11/Xatom.h> +#include <X11/Xutil.h> +#include <fixx11h.h> + +namespace KWinInternal +{ + +DetectWidget::DetectWidget( TQWidget* parent, const char* name ) +: DetectWidgetBase( parent, name ) + { + } + +DetectDialog::DetectDialog( TQWidget* parent, const char* name ) +: KDialogBase( parent, name, true, "", Ok | Cancel ) +, grabber( NULL ) + { + widget = new DetectWidget( this ); + setMainWidget( widget ); + } + +void DetectDialog::detect( WId window ) + { + if( window == 0 ) + selectWindow(); + else + readWindow( window ); + } + +void DetectDialog::readWindow( WId w ) + { + if( w == 0 ) + { + emit detectionDone( false ); + return; + } + info = KWin::windowInfo( w, -1U, -1U ); // read everything + if( !info.valid()) + { + emit detectionDone( false ); + return; + } + wmclass_class = info.windowClassClass(); + wmclass_name = info.windowClassName(); + role = info.windowRole(); + type = info.windowType( NET::NormalMask | NET::DesktopMask | NET::DockMask + | NET::ToolbarMask | NET::MenuMask | NET::DialogMask | NET::OverrideMask | NET::TopMenuMask + | NET::UtilityMask | NET::SplashMask ); + title = info.name(); + extrarole = ""; // TODO + machine = info.clientMachine(); + executeDialog(); + } + +void DetectDialog::executeDialog() + { + static const char* const types[] = + { + I18N_NOOP( "Normal Window" ), + I18N_NOOP( "Desktop" ), + I18N_NOOP( "Dock (panel)" ), + I18N_NOOP( "Toolbar" ), + I18N_NOOP( "Torn-Off Menu" ), + I18N_NOOP( "Dialog Window" ), + I18N_NOOP( "Override Type" ), + I18N_NOOP( "Standalone Menubar" ), + I18N_NOOP( "Utility Window" ), + I18N_NOOP( "Splash Screen" ) + }; + widget->class_label->setText( wmclass_class + " (" + wmclass_name + ' ' + wmclass_class + ")" ); + widget->role_label->setText( role ); + widget->use_role->setEnabled( !role.isEmpty()); + if( widget->use_role->isEnabled()) + widget->use_role->setChecked( true ); + else + widget->use_whole_class->setChecked( true ); + if( type == NET::Unknown ) + widget->type_label->setText( i18n( "Unknown - will be treated as Normal Window" )); + else + widget->type_label->setText( i18n( types[ type ] )); + widget->title_label->setText( title ); + widget->extrarole_label->setText( extrarole ); + widget->machine_label->setText( machine ); + emit detectionDone( exec() == TQDialog::Accepted ); + } + +TQCString DetectDialog::selectedClass() const + { + if( widget->use_class->isChecked() || widget->use_role->isChecked()) + return wmclass_class; + return wmclass_name + ' ' + wmclass_class; + } + +bool DetectDialog::selectedWholeClass() const + { + return widget->use_whole_class->isChecked(); + } + +TQCString DetectDialog::selectedRole() const + { + if( widget->use_role->isChecked()) + return role; + return ""; + } + +TQString DetectDialog::selectedTitle() const + { + return title; + } + +Rules::StringMatch DetectDialog::titleMatch() const + { + return widget->match_title->isChecked() ? Rules::ExactMatch : Rules::UnimportantMatch; + } + +bool DetectDialog::selectedWholeApp() const + { + return widget->use_class->isChecked(); + } + +NET::WindowType DetectDialog::selectedType() const + { + return type; + } + +TQCString DetectDialog::selectedMachine() const + { + return machine; + } + +void DetectDialog::selectWindow() + { + // use a dialog, so that all user input is blocked + // use WX11BypassWM and moving away so that it's not actually visible + // grab only mouse, so that keyboard can be used e.g. for switching windows + grabber = new TQDialog( NULL, NULL, true, (WFlags)WX11BypassWM ); + grabber->move( -1000, -1000 ); + grabber->show(); + grabber->grabMouse( tqcrossCursor ); + grabber->installEventFilter( this ); + } + +bool DetectDialog::eventFilter( TQObject* o, TQEvent* e ) + { + if( TQT_BASE_OBJECT(o) != TQT_BASE_OBJECT(grabber) ) + return false; + if( e->type() != TQEvent::MouseButtonRelease ) + return false; + delete grabber; + grabber = NULL; + if( TQT_TQMOUSEEVENT( e )->button() != Qt::LeftButton ) + { + emit detectionDone( false ); + return true; + } + readWindow( findWindow()); + return true; + } + +WId DetectDialog::findWindow() + { + Window root; + Window child; + uint mask; + int rootX, rootY, x, y; + Window parent = qt_xrootwin(); + Atom wm_state = XInternAtom( qt_xdisplay(), "WM_STATE", False ); + for( int i = 0; + i < 10; + ++i ) + { + XQueryPointer( qt_xdisplay(), parent, &root, &child, + &rootX, &rootY, &x, &y, &mask ); + if( child == None ) + return 0; + Atom type; + int format; + unsigned long nitems, after; + unsigned char* prop; + if( XGetWindowProperty( qt_xdisplay(), child, wm_state, 0, 0, False, AnyPropertyType, + &type, &format, &nitems, &after, &prop ) == Success ) + { + if( prop != NULL ) + XFree( prop ); + if( type != None ) + return child; + } + parent = child; + } + return 0; + } + +} // namespace + +#include "detectwidget.moc" diff --git a/twin/kcmtwin/twinrules/detectwidget.h b/twin/kcmtwin/twinrules/detectwidget.h new file mode 100644 index 000000000..75e725f5f --- /dev/null +++ b/twin/kcmtwin/twinrules/detectwidget.h @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2004 Lubos Lunak <l.lunak@kde.org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + + +#ifndef __DETECTWIDGET_H__ +#define __DETECTWIDGET_H__ + +#include "detectwidgetbase.h" + +#include <kdialogbase.h> +#include <twin.h> + +#include "../../rules.h" + +namespace KWinInternal +{ + +class DetectWidget + : public DetectWidgetBase + { + Q_OBJECT + public: + DetectWidget( TQWidget* parent = NULL, const char* name = NULL ); + }; + +class DetectDialog + : public KDialogBase + { + Q_OBJECT + public: + DetectDialog( TQWidget* parent = NULL, const char* name = NULL ); + void detect( WId window ); + TQCString selectedClass() const; + bool selectedWholeClass() const; + TQCString selectedRole() const; + bool selectedWholeApp() const; + NET::WindowType selectedType() const; + TQString selectedTitle() const; + Rules::StringMatch titleMatch() const; + TQCString selectedMachine() const; + const KWin::WindowInfo& windowInfo() const; + signals: + void detectionDone( bool ); + protected: + virtual bool eventFilter( TQObject* o, TQEvent* e ); + private: + void selectWindow(); + void readWindow( WId window ); + void executeDialog(); + WId findWindow(); + TQCString wmclass_class; + TQCString wmclass_name; + TQCString role; + NET::WindowType type; + TQString title; + TQCString extrarole; + TQCString machine; + DetectWidget* widget; + TQDialog* grabber; + KWin::WindowInfo info; + }; + +inline +const KWin::WindowInfo& DetectDialog::windowInfo() const + { + return info; + } + +} // namespace + +#endif diff --git a/twin/kcmtwin/twinrules/detectwidgetbase.ui b/twin/kcmtwin/twinrules/detectwidgetbase.ui new file mode 100644 index 000000000..af4ca9670 --- /dev/null +++ b/twin/kcmtwin/twinrules/detectwidgetbase.ui @@ -0,0 +1,218 @@ +<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> +<class>KWinInternal::DetectWidgetBase</class> +<widget class="TQWidget"> + <property name="name"> + <cstring>Form3</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>523</width> + <height>325</height> + </rect> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <spacer row="9" column="0" rowspan="1" colspan="2"> + <property name="name"> + <cstring>spacer1</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="tqsizeHint"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + <widget class="TQLabel" row="6" column="0"> + <property name="name"> + <cstring>textLabel11</cstring> + </property> + <property name="text"> + <string>Extra role:</string> + </property> + </widget> + <widget class="TQLabel" row="2" column="0"> + <property name="name"> + <cstring>textLabel1</cstring> + </property> + <property name="text"> + <string>Class:</string> + </property> + </widget> + <widget class="TQLabel" row="3" column="0"> + <property name="name"> + <cstring>textLabel3</cstring> + </property> + <property name="text"> + <string>Role:</string> + </property> + </widget> + <widget class="TQLabel" row="4" column="1"> + <property name="name"> + <cstring>type_label</cstring> + </property> + <property name="text"> + <string></string> + </property> + </widget> + <widget class="TQLabel" row="5" column="0"> + <property name="name"> + <cstring>textLabel8</cstring> + </property> + <property name="text"> + <string>Title:</string> + </property> + </widget> + <widget class="TQLabel" row="2" column="1"> + <property name="name"> + <cstring>class_label</cstring> + </property> + <property name="text"> + <string></string> + </property> + </widget> + <widget class="TQLabel" row="3" column="1"> + <property name="name"> + <cstring>role_label</cstring> + </property> + <property name="text"> + <string></string> + </property> + </widget> + <widget class="TQLabel" row="5" column="1"> + <property name="name"> + <cstring>title_label</cstring> + </property> + <property name="text"> + <string></string> + </property> + </widget> + <widget class="TQLabel" row="7" column="1"> + <property name="name"> + <cstring>machine_label</cstring> + </property> + <property name="text"> + <string></string> + </property> + </widget> + <widget class="TQLabel" row="4" column="0"> + <property name="name"> + <cstring>textLabel4</cstring> + </property> + <property name="text"> + <string>Type:</string> + </property> + </widget> + <widget class="TQLabel" row="6" column="1"> + <property name="name"> + <cstring>extrarole_label</cstring> + </property> + <property name="text"> + <string></string> + </property> + </widget> + <widget class="TQLabel" row="7" column="0"> + <property name="name"> + <cstring>textLabel13</cstring> + </property> + <property name="text"> + <string>Machine:</string> + </property> + </widget> + <widget class="Line" row="1" column="0" rowspan="1" colspan="2"> + <property name="name"> + <cstring>line1</cstring> + </property> + <property name="frameShape"> + <enum>HLine</enum> + </property> + <property name="frameShadow"> + <enum>Sunken</enum> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + </widget> + <widget class="TQLabel" row="0" column="0" rowspan="1" colspan="2"> + <property name="name"> + <cstring>textLabel9</cstring> + </property> + <property name="text"> + <string>Information About Selected Window</string> + </property> + </widget> + <widget class="TQButtonGroup" row="8" column="0" rowspan="1" colspan="2"> + <property name="name"> + <cstring>buttonGroup1</cstring> + </property> + <property name="title"> + <string></string> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="TQRadioButton"> + <property name="name"> + <cstring>use_class</cstring> + </property> + <property name="text"> + <string>Use window &class (whole application)</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + <property name="whatsThis" stdset="0"> + <string>For selecting all windows belonging to a specific application, selecting only window class should usually work.</string> + </property> + </widget> + <widget class="TQRadioButton"> + <property name="name"> + <cstring>use_role</cstring> + </property> + <property name="text"> + <string>Use window class and window &role (specific window)</string> + </property> + <property name="whatsThis" stdset="0"> + <string>For selecting a specific window in an application, both window class and window role should be selected. Window class will determine the application, and window role the specific window in the application; many applications do not provide useful window roles though.</string> + </property> + </widget> + <widget class="TQRadioButton"> + <property name="name"> + <cstring>use_whole_class</cstring> + </property> + <property name="text"> + <string>Use &whole window class (specific window)</string> + </property> + <property name="whatsThis" stdset="0"> + <string>With some (non-KDE) applications whole window class can be sufficient for selecting a specific window in an application, as they set whole window class to contain both application and window role.</string> + </property> + </widget> + <widget class="TQCheckBox"> + <property name="name"> + <cstring>match_title</cstring> + </property> + <property name="text"> + <string>Match also window &title</string> + </property> + </widget> + </vbox> + </widget> + </grid> +</widget> +<layoutdefaults spacing="6" margin="11"/> +<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/> +</UI> diff --git a/twin/kcmtwin/twinrules/editshortcutbase.ui b/twin/kcmtwin/twinrules/editshortcutbase.ui new file mode 100644 index 000000000..af704c0a2 --- /dev/null +++ b/twin/kcmtwin/twinrules/editshortcutbase.ui @@ -0,0 +1,164 @@ +<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> +<class>EditShortcutBase</class> +<widget class="TQWidget"> + <property name="name"> + <cstring>EditShortcutBase</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>587</width> + <height>402</height> + </rect> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="TQLabel"> + <property name="name"> + <cstring>textLabel2</cstring> + </property> + <property name="text"> + <string>A single shortcut can be easily assigned or cleared using the two buttons. Only shortcuts with modifiers can be used.<p> +It is possible to have several possible shortcuts, and the first available shortcut will be used. The shortcuts are specified using space-separated shortcut sets. One set is specified as <i>base</i>+(<i>list</i>), where base are modifiers and list is a list of keys.<br> +For example "<b>Shift+Alt+(123) Shift+Ctrl+(ABC)</b>" will first try <b>Shift+Alt+1</b>, then others with <b>Shift+Ctrl+C</b> as the last one.</string> + </property> + <property name="textFormat"> + <enum>RichText</enum> + </property> + </widget> + <widget class="Line"> + <property name="name"> + <cstring>line1</cstring> + </property> + <property name="frameShape"> + <enum>HLine</enum> + </property> + <property name="frameShadow"> + <enum>Sunken</enum> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + </widget> + <widget class="KLineEdit"> + <property name="name"> + <cstring>shortcut</cstring> + </property> + </widget> + <widget class="TQLayoutWidget"> + <property name="name"> + <cstring>layout2</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <spacer> + <property name="name"> + <cstring>spacer1</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="tqsizeHint"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + <widget class="TQPushButton"> + <property name="name"> + <cstring>pushButton1</cstring> + </property> + <property name="text"> + <string>&Single Shortcut</string> + </property> + </widget> + <spacer> + <property name="name"> + <cstring>spacer2</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="tqsizeHint"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + <widget class="TQPushButton"> + <property name="name"> + <cstring>pushButton2</cstring> + </property> + <property name="text"> + <string>C&lear</string> + </property> + </widget> + <spacer> + <property name="name"> + <cstring>spacer3</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="tqsizeHint"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </hbox> + </widget> + <widget class="Line"> + <property name="name"> + <cstring>line2</cstring> + </property> + <property name="frameShape"> + <enum>HLine</enum> + </property> + <property name="frameShadow"> + <enum>Sunken</enum> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + </widget> + </vbox> +</widget> +<connections> + <connection> + <sender>pushButton1</sender> + <signal>clicked()</signal> + <receiver>EditShortcutBase</receiver> + <slot>editShortcut()</slot> + </connection> + <connection> + <sender>pushButton2</sender> + <signal>clicked()</signal> + <receiver>EditShortcutBase</receiver> + <slot>clearShortcut()</slot> + </connection> +</connections> +<Q_SLOTS> + <slot access="protected" specifier="pure virtual">editShortcut()</slot> + <slot access="protected" specifier="pure virtual">clearShortcut()</slot> +</Q_SLOTS> +<layoutdefaults spacing="6" margin="11"/> +<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/> +</UI> diff --git a/twin/kcmtwin/twinrules/kcm.cpp b/twin/kcmtwin/twinrules/kcm.cpp new file mode 100644 index 000000000..c7cdc7587 --- /dev/null +++ b/twin/kcmtwin/twinrules/kcm.cpp @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2004 Lubos Lunak <l.lunak@kde.org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "kcm.h" + +#include <kglobal.h> +#include <tqlayout.h> +#include <klocale.h> +#include <kapplication.h> +#include <dcopclient.h> +#include <kaboutdata.h> + +#include "ruleslist.h" + +extern "C" + KDE_EXPORT KCModule *create_twinrules( TQWidget *parent, const char *name ) + { + //CT there's need for decision: kwm or twin? + KGlobal::locale()->insertCatalogue( "kcmtwinrules" ); + return new KWinInternal::KCMRules( parent, name ); + } + +namespace KWinInternal +{ + +KCMRules::KCMRules( TQWidget *parent, const char *name ) +: KCModule( parent, name ) +, config( "twinrulesrc" ) + { + TQVBoxLayout *layout = new TQVBoxLayout( this ); + widget = new KCMRulesList( this ); + layout->addWidget( TQT_TQWIDGET(widget) ); + connect( widget, TQT_SIGNAL( changed( bool )), TQT_SLOT( moduleChanged( bool ))); + KAboutData *about = new KAboutData(I18N_NOOP( "kcmtwinrules" ), + I18N_NOOP( "Window-Specific Settings Configuration Module" ), + 0, 0, KAboutData::License_GPL, I18N_NOOP( "(c) 2004 KWin and KControl Authors" )); + about->addAuthor("Lubos Lunak",0,"l.lunak@kde.org"); + setAboutData(about); + } + +void KCMRules::load() + { + config.reparseConfiguration(); + widget->load(); + emit KCModule::changed( false ); + } + +void KCMRules::save() + { + widget->save(); + emit KCModule::changed( false ); + // Send signal to twin + config.sync(); + if( !kapp->dcopClient()->isAttached()) + kapp->dcopClient()->attach(); + kapp->dcopClient()->send("twin*", "", "reconfigure()", TQString("")); + } + +void KCMRules::defaults() + { + widget->defaults(); + } + +TQString KCMRules::quickHelp() const + { + return i18n("<h1>Window-specific Settings</h1> Here you can customize window settings specifically only" + " for some windows." + " <p>Please note that this configuration will not take effect if you do not use" + " KWin as your window manager. If you do use a different window manager, please refer to its documentation" + " for how to customize window behavior."); + } + +void KCMRules::moduleChanged( bool state ) + { + emit KCModule::changed( state ); + } + +} + +// i18n freeze :-/ +#if 0 +I18N_NOOP("Remember settings separately for every window") +I18N_NOOP("Show internal settings for remembering") +I18N_NOOP("Internal setting for remembering") +#endif + + +#include "kcm.moc" diff --git a/twin/kcmtwin/twinrules/kcm.h b/twin/kcmtwin/twinrules/kcm.h new file mode 100644 index 000000000..9fb307458 --- /dev/null +++ b/twin/kcmtwin/twinrules/kcm.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2004 Lubos Lunak <l.lunak@kde.org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + + +#ifndef __KCM_H__ +#define __KCM_H__ + +#include <kcmodule.h> +#include <kconfig.h> + +class KConfig; +class KAboutData; + +namespace KWinInternal +{ + +class KCMRulesList; + +class KCMRules + : public KCModule + { + Q_OBJECT + public: + KCMRules( TQWidget *parent, const char *name ); + virtual void load(); + virtual void save(); + virtual void defaults(); + virtual TQString quickHelp() const; + protected slots: + void moduleChanged( bool state ); + private: + KCMRulesList* widget; + KConfig config; + }; + +} // namespace + +#endif diff --git a/twin/kcmtwin/twinrules/main.cpp b/twin/kcmtwin/twinrules/main.cpp new file mode 100644 index 000000000..db3a9fc48 --- /dev/null +++ b/twin/kcmtwin/twinrules/main.cpp @@ -0,0 +1,294 @@ +/* + * Copyright (c) 2004 Lubos Lunak <l.lunak@kde.org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include <kcmdlineargs.h> +#include <kapplication.h> +#include <dcopclient.h> +#include <kconfig.h> +#include <klocale.h> +#include <twin.h> + +#include <X11/Xlib.h> +#include <fixx11h.h> + +#include "ruleswidget.h" +#include "../../rules.h" + +namespace KWinInternal +{ + +static void loadRules( TQValueList< Rules* >& rules ) + { + KConfig cfg( "twinrulesrc", true ); + cfg.setGroup( "General" ); + int count = cfg.readNumEntry( "count" ); + for( int i = 1; + i <= count; + ++i ) + { + cfg.setGroup( TQString::number( i )); + Rules* rule = new Rules( cfg ); + rules.append( rule ); + } + } + +static void saveRules( const TQValueList< Rules* >& rules ) + { + KConfig cfg( "twinrulesrc" ); + TQStringList groups = cfg.groupList(); + for( TQStringList::ConstIterator it = groups.begin(); + it != groups.end(); + ++it ) + cfg.deleteGroup( *it ); + cfg.setGroup( "General" ); + cfg.writeEntry( "count", rules.count()); + int i = 1; + for( TQValueList< Rules* >::ConstIterator it = rules.begin(); + it != rules.end(); + ++it ) + { + cfg.setGroup( TQString::number( i )); + (*it)->write( cfg ); + ++i; + } + } + +static Rules* findRule( const TQValueList< Rules* >& rules, Window wid, bool whole_app ) + { + KWin::WindowInfo info = KWin::windowInfo( wid, + NET::WMName | NET::WMWindowType, + NET::WM2WindowClass | NET::WM2WindowRole | NET::WM2ClientMachine ); + if( !info.valid()) // shouldn't really happen + return NULL; + TQCString wmclass_class = info.windowClassClass().lower(); + TQCString wmclass_name = info.windowClassName().lower(); + TQCString role = info.windowRole().lower(); + NET::WindowType type = info.windowType( NET::NormalMask | NET::DesktopMask | NET::DockMask + | NET::ToolbarMask | NET::MenuMask | NET::DialogMask | NET::OverrideMask | NET::TopMenuMask + | NET::UtilityMask | NET::SplashMask ); + TQString title = info.name(); +// TQCString extrarole = ""; // TODO + TQCString machine = info.clientMachine().lower(); + Rules* best_match = NULL; + int match_quality = 0; + for( TQValueList< Rules* >::ConstIterator it = rules.begin(); + it != rules.end(); + ++it ) + { + // try to find an exact match, i.e. not a generic rule + Rules* rule = *it; + int quality = 0; + bool generic = true; + if( rule->wmclassmatch != Rules::ExactMatch ) + continue; // too generic + if( !rule->matchWMClass( wmclass_class, wmclass_name )) + continue; + // from now on, it matches the app - now try to match for a specific window + if( rule->wmclasscomplete ) + { + quality += 1; + generic = false; // this can be considered specific enough (old X apps) + } + if( !whole_app ) + { + if( rule->windowrolematch != Rules::UnimportantMatch ) + { + quality += rule->windowrolematch == Rules::ExactMatch ? 5 : 1; + generic = false; + } + if( rule->titlematch != Rules::UnimportantMatch ) + { + quality += rule->titlematch == Rules::ExactMatch ? 3 : 1; + generic = false; + } + if( rule->types != NET::AllTypesMask ) + { + int bits = 0; + for( unsigned int bit = 1; + bit < 1U << 31; + bit <<= 1 ) + if( rule->types & bit ) + ++bits; + if( bits == 1 ) + quality += 2; + } + if( generic ) // ignore generic rules, use only the ones that are for this window + continue; + } + else + { + if( rule->types == NET::AllTypesMask ) + quality += 2; + } + if( !rule->matchType( type ) + || !rule->matchRole( role ) + || !rule->matchTitle( title ) + || !rule->matchClientMachine( machine )) + continue; + if( quality > match_quality ) + { + best_match = rule; + match_quality = quality; + } + } + if( best_match != NULL ) + return best_match; + Rules* ret = new Rules; + if( whole_app ) + { + ret->description = i18n( "Application settings for %1" ).tqarg( static_cast<const char *>(wmclass_class) ); + // TODO maybe exclude some types? If yes, then also exclude them above + // when searching. + ret->types = NET::AllTypesMask; + ret->titlematch = Rules::UnimportantMatch; + ret->clientmachine = machine; // set, but make unimportant + ret->clientmachinematch = Rules::UnimportantMatch; + ret->extrarolematch = Rules::UnimportantMatch; + ret->windowrolematch = Rules::UnimportantMatch; + if( wmclass_name == wmclass_class ) + { + ret->wmclasscomplete = false; + ret->wmclass = wmclass_class; + ret->wmclassmatch = Rules::ExactMatch; + } + else + { + // WM_CLASS components differ - perhaps the app got -name argument + ret->wmclasscomplete = true; + ret->wmclass = wmclass_name + ' ' + wmclass_class; + ret->wmclassmatch = Rules::ExactMatch; + } + return ret; + } + ret->description = i18n( "Window settings for %1" ).tqarg( static_cast<const char *>(wmclass_class) ); + if( type == NET::Unknown ) + ret->types = NET::NormalMask; + else + ret->types = 1 << type; // convert type to its mask + ret->title = title; // set, but make unimportant + ret->titlematch = Rules::UnimportantMatch; + ret->clientmachine = machine; // set, but make unimportant + ret->clientmachinematch = Rules::UnimportantMatch; +// ret->extrarole = extra; TODO + ret->extrarolematch = Rules::UnimportantMatch; + if( !role.isEmpty() + && role != "unknown" && role != "unnamed" ) // Qt sets this if not specified + { + ret->windowrole = role; + ret->windowrolematch = Rules::ExactMatch; + if( wmclass_name == wmclass_class ) + { + ret->wmclasscomplete = false; + ret->wmclass = wmclass_class; + ret->wmclassmatch = Rules::ExactMatch; + } + else + { + // WM_CLASS components differ - perhaps the app got -name argument + ret->wmclasscomplete = true; + ret->wmclass = wmclass_name + ' ' + wmclass_class; + ret->wmclassmatch = Rules::ExactMatch; + } + } + else // no role set + { + if( wmclass_name != wmclass_class ) + { + ret->wmclasscomplete = true; + ret->wmclass = wmclass_name + ' ' + wmclass_class; + ret->wmclassmatch = Rules::ExactMatch; + } + else + { + // This is a window that has no role set, and both components of WM_CLASS + // match (possibly only differing in case), which most likely means either + // the application doesn't give a damn about distinguishing its various + // windows, or it's an app that uses role for that, but this window + // lacks it for some reason. Use non-complete WM_CLASS matching, also + // include window title in the matching, and pray it causes many more positive + // matches than negative matches. + ret->titlematch = Rules::ExactMatch; + ret->wmclasscomplete = false; + ret->wmclass = wmclass_class; + ret->wmclassmatch = Rules::ExactMatch; + } + } + return ret; + } + +static int edit( Window wid, bool whole_app ) + { + TQValueList< Rules* > rules; + loadRules( rules ); + Rules* orig_rule = findRule( rules, wid, whole_app ); + RulesDialog dlg; + // dlg.edit() creates new Rules instance if edited + Rules* edited_rule = dlg.edit( orig_rule, wid, true ); + if( edited_rule == NULL || edited_rule->isEmpty()) + { + rules.remove( orig_rule ); + delete orig_rule; + if( orig_rule != edited_rule ) + delete edited_rule; + } + else if( edited_rule != orig_rule ) + { + TQValueList< Rules* >::Iterator pos = rules.find( orig_rule ); + if( pos != rules.end()) + *pos = edited_rule; + else + rules.prepend( edited_rule ); + delete orig_rule; + } + saveRules( rules ); + if( !kapp->dcopClient()->isAttached()) + kapp->dcopClient()->attach(); + kapp->dcopClient()->send("twin*", "", "reconfigure()", TQString("")); + return 0; + } + +} // namespace + +static const KCmdLineOptions options[] = + { + // no need for I18N_NOOP(), this is not supposed to be used directly + { "wid <wid>", "WId of the window for special window settings.", 0 }, + { "whole-app", "Whether the settings should affect all windows of the application.", 0 }, + KCmdLineLastOption + }; + +extern "C" +KDE_EXPORT int kdemain( int argc, char* argv[] ) + { + KLocale::setMainCatalogue( "kcmtwinrules" ); + KCmdLineArgs::init( argc, argv, "twin_rules_dialog", I18N_NOOP( "KWin" ), + I18N_NOOP( "KWin helper utility" ), "1.0" ); + KCmdLineArgs::addCmdLineOptions( options ); + KApplication app; + KCmdLineArgs* args = KCmdLineArgs::parsedArgs(); + bool id_ok = false; + Window id = args->getOption( "wid" ).toULong( &id_ok ); + bool whole_app = args->isSet( "whole-app" ); + args->clear(); + if( !id_ok || id == None ) + { + KCmdLineArgs::usage( i18n( "This helper utility is not supposed to be called directly." )); + return 1; + } + return KWinInternal::edit( id, whole_app ); + } diff --git a/twin/kcmtwin/twinrules/ruleslist.cpp b/twin/kcmtwin/twinrules/ruleslist.cpp new file mode 100644 index 000000000..29e02549d --- /dev/null +++ b/twin/kcmtwin/twinrules/ruleslist.cpp @@ -0,0 +1,200 @@ +/* + * Copyright (c) 2004 Lubos Lunak <l.lunak@kde.org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "ruleslist.h" + +#include <klistbox.h> +#include <kpushbutton.h> +#include <assert.h> +#include <kdebug.h> +#include <kconfig.h> + +#include "ruleswidget.h" + +namespace KWinInternal +{ + +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())); + load(); + } + +KCMRulesList::~KCMRulesList() + { + for( TQValueVector< Rules* >::Iterator it = rules.begin(); + it != rules.end(); + ++it ) + delete *it; + rules.clear(); + } + +void KCMRulesList::activeChanged( TQListBoxItem* item ) + { + if( item != NULL ) + rules_listbox->setSelected( item, true ); // make current==selected + modify_button->setEnabled( item != NULL ); + delete_button->setEnabled( item != NULL ); + moveup_button->setEnabled( item != NULL && item->prev() != NULL ); + movedown_button->setEnabled( item != NULL && item->next() != NULL ); + } + +void KCMRulesList::newClicked() + { + RulesDialog dlg; + Rules* rule = dlg.edit( NULL, 0, false ); + if( rule == NULL ) + return; + int pos = rules_listbox->currentItem() + 1; + rules_listbox->insertItem( rule->description, pos ); + rules_listbox->setSelected( pos, true ); + rules.insert( rules.begin() + pos, rule ); + emit changed( true ); + } + +void KCMRulesList::modifyClicked() + { + int pos = rules_listbox->currentItem(); + if ( pos == -1 ) + return; + RulesDialog dlg; + Rules* rule = dlg.edit( rules[ pos ], 0, false ); + if( rule == rules[ pos ] ) + return; + delete rules[ pos ]; + rules[ pos ] = rule; + rules_listbox->changeItem( rule->description, pos ); + emit changed( true ); + } + +void KCMRulesList::deleteClicked() + { + int pos = rules_listbox->currentItem(); + assert( pos != -1 ); + rules_listbox->removeItem( pos ); + rules.erase( rules.begin() + pos ); + emit changed( true ); + } + +void KCMRulesList::moveupClicked() + { + int pos = rules_listbox->currentItem(); + assert( pos != -1 ); + if( pos > 0 ) + { + TQString txt = rules_listbox->text( pos ); + rules_listbox->removeItem( pos ); + rules_listbox->insertItem( txt, pos - 1 ); + rules_listbox->setSelected( pos - 1, true ); + Rules* rule = rules[ pos ]; + rules[ pos ] = rules[ pos - 1 ]; + rules[ pos - 1 ] = rule; + } + emit changed( true ); + } + +void KCMRulesList::movedownClicked() + { + int pos = rules_listbox->currentItem(); + assert( pos != -1 ); + if( pos < int( rules_listbox->count()) - 1 ) + { + TQString txt = rules_listbox->text( pos ); + rules_listbox->removeItem( pos ); + rules_listbox->insertItem( txt, pos + 1 ); + rules_listbox->setSelected( pos + 1, true ); + Rules* rule = rules[ pos ]; + rules[ pos ] = rules[ pos + 1 ]; + rules[ pos + 1 ] = rule; + } + emit changed( true ); + } + +void KCMRulesList::load() + { + rules_listbox->clear(); + for( TQValueVector< Rules* >::Iterator it = rules.begin(); + it != rules.end(); + ++it ) + delete *it; + rules.clear(); + KConfig cfg( "twinrulesrc", true ); + cfg.setGroup( "General" ); + int count = cfg.readNumEntry( "count" ); + rules.reserve( count ); + for( int i = 1; + i <= count; + ++i ) + { + cfg.setGroup( TQString::number( i )); + Rules* rule = new Rules( cfg ); + rules.append( rule ); + rules_listbox->insertItem( rule->description ); + } + if( rules.count() > 0 ) + rules_listbox->setSelected( 0, true ); + else + activeChanged( NULL ); + } + +void KCMRulesList::save() + { + KConfig cfg( "twinrulesrc" ); + TQStringList groups = cfg.groupList(); + for( TQStringList::ConstIterator it = groups.begin(); + it != groups.end(); + ++it ) + cfg.deleteGroup( *it ); + cfg.setGroup( "General" ); + cfg.writeEntry( "count", rules.count()); + int i = 1; + for( TQValueVector< Rules* >::ConstIterator it = rules.begin(); + it != rules.end(); + ++it ) + { + cfg.setGroup( TQString::number( i )); + (*it)->write( cfg ); + ++i; + } + } + +void KCMRulesList::defaults() + { + load(); + } + +} // namespace + +#include "ruleslist.moc" diff --git a/twin/kcmtwin/twinrules/ruleslist.h b/twin/kcmtwin/twinrules/ruleslist.h new file mode 100644 index 000000000..f7e7fb541 --- /dev/null +++ b/twin/kcmtwin/twinrules/ruleslist.h @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2004 Lubos Lunak <l.lunak@kde.org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + + +#ifndef __RULESLIST_H__ +#define __RULESLIST_H__ + +#include "ruleslistbase.h" + +#include <tqvaluevector.h> + +#include "../../rules.h" + +class TQListBoxItem; + +namespace KWinInternal +{ + +class KCMRulesList + : public KCMRulesListBase + { + Q_OBJECT + public: + KCMRulesList( TQWidget* parent = NULL, const char* name = NULL ); + virtual ~KCMRulesList(); + void load(); + void save(); + void defaults(); + signals: + void changed( bool ); + private slots: + void newClicked(); + void modifyClicked(); + void deleteClicked(); + void moveupClicked(); + void movedownClicked(); + void activeChanged( TQListBoxItem* ); + private: + TQValueVector< Rules* > rules; + }; + +} // namespace + +#endif diff --git a/twin/kcmtwin/twinrules/ruleslistbase.ui b/twin/kcmtwin/twinrules/ruleslistbase.ui new file mode 100644 index 000000000..5fc5fd6ed --- /dev/null +++ b/twin/kcmtwin/twinrules/ruleslistbase.ui @@ -0,0 +1,91 @@ +<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> +<class>KWinInternal::KCMRulesListBase</class> +<widget class="TQWidget"> + <property name="name"> + <cstring>Form1</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>600</width> + <height>480</height> + </rect> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <widget class="KListBox" row="0" column="0" rowspan="6" colspan="1"> + <property name="name"> + <cstring>rules_listbox</cstring> + </property> + </widget> + <widget class="KPushButton" row="0" column="1"> + <property name="name"> + <cstring>new_button</cstring> + </property> + <property name="text"> + <string>&New...</string> + </property> + </widget> + <widget class="KPushButton" row="1" column="1"> + <property name="name"> + <cstring>modify_button</cstring> + </property> + <property name="text"> + <string>&Modify...</string> + </property> + </widget> + <widget class="KPushButton" row="2" column="1"> + <property name="name"> + <cstring>delete_button</cstring> + </property> + <property name="text"> + <string>Delete</string> + </property> + <property name="accel"> + <string></string> + </property> + </widget> + <widget class="KPushButton" row="3" column="1"> + <property name="name"> + <cstring>moveup_button</cstring> + </property> + <property name="text"> + <string>Move &Up</string> + </property> + </widget> + <widget class="KPushButton" row="4" column="1"> + <property name="name"> + <cstring>movedown_button</cstring> + </property> + <property name="text"> + <string>Move &Down</string> + </property> + </widget> + <spacer row="5" column="1"> + <property name="name"> + <cstring>spacer1</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="tqsizeHint"> + <size> + <width>20</width> + <height>294</height> + </size> + </property> + </spacer> + </grid> +</widget> +<layoutdefaults spacing="6" margin="11"/> +<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/> +</UI> diff --git a/twin/kcmtwin/twinrules/ruleswidget.cpp b/twin/kcmtwin/twinrules/ruleswidget.cpp new file mode 100644 index 000000000..cfe96458e --- /dev/null +++ b/twin/kcmtwin/twinrules/ruleswidget.cpp @@ -0,0 +1,803 @@ +/* + * Copyright (c) 2004 Lubos Lunak <l.lunak@kde.org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "ruleswidget.h" + +#include <klineedit.h> +#include <krestrictedline.h> +#include <kcombobox.h> +#include <tqcheckbox.h> +#include <kpushbutton.h> +#include <tqlabel.h> +#include <twinmodule.h> +#include <klocale.h> +#include <tqregexp.h> +#include <tqwhatsthis.h> +#include <assert.h> +#include <kmessagebox.h> +#include <tqtabwidget.h> +#include <tqtimer.h> + +#include "../../rules.h" + +#include "detectwidget.h" + +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())); \ + TQWhatsThis::add( enable_##var, enableDesc ); \ + TQWhatsThis::add( rule_##var, type##RuleDesc ); + +RulesWidget::RulesWidget( TQWidget* parent, const char* name ) +: RulesWidgetBase( parent, name ) +, detect_dlg( NULL ) + { + TQString enableDesc = + i18n( "Enable this checkbox to alter this window property for the specified window(s)." ); + TQString setRuleDesc = + i18n( "Specify how the window property should be affected:<ul>" + "<li><em>Do Not Affect:</em> The window property will not be affected and therefore" + " the default handling for it will be used. Specifying this will block more generic" + " window settings from taking effect.</li>" + "<li><em>Apply Initially:</em> The window property will be only set to the given value" + " after the window is created. No further changes will be affected.</li>" + "<li><em>Remember:</em> The value of the window property will be remembered and every time" + " time the window is created, the last remembered value will be applied.</li>" + "<li><em>Force:</em> The window property will be always forced to the given value.</li>" + "<li><em>Apply Now:</em> The window property will be set to the given value immediately" + " and will not be affected later (this action will be deleted afterwards).</li>" + "<li><em>Force temporarily:</em> The window property will be forced to the given value" + " until it is hidden (this action will be deleted after the window is hidden).</li>" + "</ul>" ); + TQString forceRuleDesc = + i18n( "Specify how the window property should be affected:<ul>" + "<li><em>Do Not Affect:</em> The window property will not be affected and therefore" + " the default handling for it will be used. Specifying this will block more generic" + " window settings from taking effect.</li>" + "<li><em>Force:</em> The window property will be always forced to the given value.</li>" + "<li><em>Force temporarily:</em> The window property will be forced to the given value" + " until it is hidden (this action will be deleted after the window is hidden).</li>" + "</ul>" ); + // window tabs have enable signals done in designer + // geometry tab + SETUP( position, set ); + SETUP( size, set ); + SETUP( desktop, set ); + SETUP( maximizehoriz, set ); + SETUP( maximizevert, set ); + SETUP( minimize, set ); + SETUP( shade, set ); + SETUP( fullscreen, set ); + SETUP( placement, force ); + // preferences tab + SETUP( above, set ); + SETUP( below, set ); + SETUP( noborder, set ); + SETUP( skiptaskbar, set ); + SETUP( skippager, set ); + SETUP( acceptfocus, force ); + SETUP( closeable, force ); + SETUP( opacityactive, force ); + SETUP( opacityinactive, force ); + SETUP( shortcut, force ); + // workarounds tab + SETUP( fsplevel, force ); + SETUP( moveresizemode, force ); + SETUP( type, force ); + SETUP( ignoreposition, force ); + SETUP( minsize, force ); + SETUP( maxsize, force ); + SETUP( strictgeometry, force ); + SETUP( disableglobalshortcuts, force ); + KWinModule module; + int i; + for( i = 1; + i <= module.numberOfDesktops(); + ++i ) + desktop->insertItem( TQString::number( i ).rightJustify( 2 ) + ":" + module.desktopName( i )); + desktop->insertItem( i18n( "All Desktops" )); + } + +#undef SETUP + +#define UPDATE_ENABLE_SLOT( var ) \ +void RulesWidget::updateEnable##var() \ + { \ + /* leave the label readable label_##var->setEnabled( enable_##var->isChecked() && rule_##var->currentItem() != 0 );*/ \ + var->setEnabled( enable_##var->isChecked() && rule_##var->currentItem() != 0 ); \ + } + +// geometry tab +UPDATE_ENABLE_SLOT( position ) +UPDATE_ENABLE_SLOT( size ) +UPDATE_ENABLE_SLOT( desktop ) +UPDATE_ENABLE_SLOT( maximizehoriz ) +UPDATE_ENABLE_SLOT( maximizevert ) +UPDATE_ENABLE_SLOT( minimize ) +UPDATE_ENABLE_SLOT( shade ) +UPDATE_ENABLE_SLOT( fullscreen ) +UPDATE_ENABLE_SLOT( placement ) +// preferences tab +UPDATE_ENABLE_SLOT( above ) +UPDATE_ENABLE_SLOT( below ) +UPDATE_ENABLE_SLOT( noborder ) +UPDATE_ENABLE_SLOT( skiptaskbar ) +UPDATE_ENABLE_SLOT( skippager ) +UPDATE_ENABLE_SLOT( acceptfocus ) +UPDATE_ENABLE_SLOT( closeable ) +UPDATE_ENABLE_SLOT( opacityactive ) +UPDATE_ENABLE_SLOT( opacityinactive ) +void RulesWidget::updateEnableshortcut() + { + shortcut->setEnabled( enable_shortcut->isChecked() && rule_shortcut->currentItem() != 0 ); + shortcut_edit->setEnabled( enable_shortcut->isChecked() && rule_shortcut->currentItem() != 0 ); + } +// workarounds tab +UPDATE_ENABLE_SLOT( fsplevel ) +UPDATE_ENABLE_SLOT( moveresizemode ) +UPDATE_ENABLE_SLOT( type ) +UPDATE_ENABLE_SLOT( ignoreposition ) +UPDATE_ENABLE_SLOT( minsize ) +UPDATE_ENABLE_SLOT( maxsize ) +UPDATE_ENABLE_SLOT( strictgeometry ) +UPDATE_ENABLE_SLOT( disableglobalshortcuts ) + +#undef UPDATE_ENABLE_SLOT + +static const int set_rule_to_combo[] = + { + 0, // Unused + 0, // Don't Affect + 3, // Force + 1, // Apply + 2, // Remember + 4, // ApplyNow + 5 // ForceTemporarily + }; + +static const Rules::SetRule combo_to_set_rule[] = + { + ( Rules::SetRule )Rules::DontAffect, + ( Rules::SetRule )Rules::Apply, + ( Rules::SetRule )Rules::Remember, + ( Rules::SetRule )Rules::Force, + ( Rules::SetRule )Rules::ApplyNow, + ( Rules::SetRule )Rules::ForceTemporarily + }; + +static const int force_rule_to_combo[] = + { + 0, // Unused + 0, // Don't Affect + 1, // Force + 0, // Apply + 0, // Remember + 0, // ApplyNow + 2 // ForceTemporarily + }; + +static const Rules::ForceRule combo_to_force_rule[] = + { + ( Rules::ForceRule )Rules::DontAffect, + ( Rules::ForceRule )Rules::Force, + ( Rules::ForceRule )Rules::ForceTemporarily + }; + +static TQString positionToStr( const TQPoint& p ) + { + if( p == invalidPoint ) + return TQString::null; + return TQString::number( p.x()) + "," + TQString::number( p.y()); + } + +static TQPoint strToPosition( const TQString& str ) + { // two numbers, with + or -, separated by any of , x X : + TQRegExp reg( "\\s*([+-]?[0-9]*)\\s*[,xX:]\\s*([+-]?[0-9]*)\\s*" ); + if( !reg.exactMatch( str )) + return invalidPoint; + return TQPoint( reg.cap( 1 ).toInt(), reg.cap( 2 ).toInt()); + } + +static TQString sizeToStr( const TQSize& s ) + { + if( !s.isValid()) + return TQString::null; + return TQString::number( s.width()) + "," + TQString::number( s.height()); + } + +static TQSize strToSize( const TQString& str ) + { // two numbers, with + or -, separated by any of , x X : + TQRegExp reg( "\\s*([+-]?[0-9]*)\\s*[,xX:]\\s*([+-]?[0-9]*)\\s*" ); + if( !reg.exactMatch( str )) + return TQSize(); + return TQSize( reg.cap( 1 ).toInt(), reg.cap( 2 ).toInt()); + } + +//used for opacity settings +static TQString intToStr( const int& s ) + { + if( s < 1 || s > 100 ) + return TQString::null; + return TQString::number(s); + } + +static int strToInt( const TQString& str ) + { + int tmp = str.toInt(); + if( tmp < 1 || tmp > 100 ) + return 100; + return tmp; + } + +int RulesWidget::desktopToCombo( int d ) const + { + if( d >= 1 && d < desktop->count()) + return d - 1; + return desktop->count() - 1; // on all desktops + } + +int RulesWidget::comboToDesktop( int val ) const + { + if( val == desktop->count() - 1 ) + return NET::OnAllDesktops; + return val + 1; + } + +static int placementToCombo( Placement::Policy placement ) + { + static const int conv[] = + { + 1, // NoPlacement + 0, // Default + 0, // Unknown + 6, // Random + 2, // Smart + 4, // Cascade + 5, // Centered + 7, // ZeroCornered + 8, // UnderMouse + 9, // OnMainWindow + 3 // Maximizing + }; + return conv[ placement ]; + } + +static Placement::Policy comboToPlacement( int val ) + { + static const Placement::Policy conv[] = + { + Placement::Default, + Placement::NoPlacement, + Placement::Smart, + Placement::Maximizing, + Placement::Cascade, + Placement::Centered, + Placement::Random, + Placement::ZeroCornered, + Placement::UnderMouse, + Placement::OnMainWindow + // no Placement::Unknown + }; + return conv[ val ]; + } + +static int moveresizeToCombo( Options::MoveResizeMode mode ) + { + return mode == Options::Opaque ? 0 : 1; + } + +static Options::MoveResizeMode comboToMoveResize( int val ) + { + return val == 0 ? Options::Opaque : Options::Transparent; + } + +static int typeToCombo( NET::WindowType type ) + { + if( type < NET::Normal || type > NET::Splash ) + return 0; // Normal + static const int conv[] = + { + 0, // Normal + 7, // Desktop + 3, // Dock + 4, // Toolbar + 5, // Menu + 1, // Dialog + 8, // Override + 9, // TopMenu + 2, // Utility + 6 // Splash + }; + return conv[ type ]; + } + +static NET::WindowType comboToType( int val ) + { + static const NET::WindowType conv[] = + { + NET::Normal, + NET::Dialog, + NET::Utility, + NET::Dock, + NET::Toolbar, + NET::Menu, + NET::Splash, + NET::Desktop, + NET::Override, + NET::TopMenu + }; + return conv[ val ]; + } + +#define GENERIC_RULE( var, func, Type, type, uimethod, uimethod0 ) \ + if( rules->var##rule == Rules::Unused##Type##Rule ) \ + { \ + enable_##var->setChecked( false ); \ + rule_##var->setCurrentItem( 0 ); \ + var->uimethod0; \ + updateEnable##var(); \ + } \ + else \ + { \ + enable_##var->setChecked( true ); \ + rule_##var->setCurrentItem( type##_rule_to_combo[ rules->var##rule ] ); \ + var->uimethod( func( rules->var )); \ + updateEnable##var(); \ + } + +#define CHECKBOX_SET_RULE( var, func ) GENERIC_RULE( var, func, Set, set, setChecked, setChecked( false )) +#define LINEEDIT_SET_RULE( var, func ) GENERIC_RULE( var, func, Set, set, setText, setText( "" )) +#define COMBOBOX_SET_RULE( var, func ) GENERIC_RULE( var, func, Set, set, setCurrentItem, setCurrentItem( 0 )) +#define CHECKBOX_FORCE_RULE( var, func ) GENERIC_RULE( var, func, Force, force, setChecked, setChecked( false )) +#define LINEEDIT_FORCE_RULE( var, func ) GENERIC_RULE( var, func, Force, force, setText, setText( "" )) +#define COMBOBOX_FORCE_RULE( var, func ) GENERIC_RULE( var, func, Force, force, setCurrentItem, setCurrentItem( 0 )) + +void RulesWidget::setRules( Rules* rules ) + { + Rules tmp; + if( rules == NULL ) + rules = &tmp; // empty + description->setText( rules->description ); + wmclass->setText( rules->wmclass ); + whole_wmclass->setChecked( rules->wmclasscomplete ); + wmclass_match->setCurrentItem( rules->wmclassmatch ); + wmclassMatchChanged(); + role->setText( rules->windowrole ); + role_match->setCurrentItem( rules->windowrolematch ); + roleMatchChanged(); + types->setSelected( 0, rules->types & NET::NormalMask ); + types->setSelected( 1, rules->types & NET::DialogMask ); + types->setSelected( 2, rules->types & NET::UtilityMask ); + types->setSelected( 3, rules->types & NET::DockMask ); + types->setSelected( 4, rules->types & NET::ToolbarMask ); + types->setSelected( 5, rules->types & NET::MenuMask ); + types->setSelected( 6, rules->types & NET::SplashMask ); + types->setSelected( 7, rules->types & NET::DesktopMask ); + types->setSelected( 8, rules->types & NET::OverrideMask ); + types->setSelected( 9, rules->types & NET::TopMenuMask ); + title->setText( rules->title ); + title_match->setCurrentItem( rules->titlematch ); + titleMatchChanged(); + extra->setText( rules->extrarole ); + extra_match->setCurrentItem( rules->extrarolematch ); + extraMatchChanged(); + machine->setText( rules->clientmachine ); + machine_match->setCurrentItem( rules->clientmachinematch ); + machineMatchChanged(); + LINEEDIT_SET_RULE( position, positionToStr ); + LINEEDIT_SET_RULE( size, sizeToStr ); + COMBOBOX_SET_RULE( desktop, desktopToCombo ); + CHECKBOX_SET_RULE( maximizehoriz, ); + CHECKBOX_SET_RULE( maximizevert, ); + CHECKBOX_SET_RULE( minimize, ); + CHECKBOX_SET_RULE( shade, ); + CHECKBOX_SET_RULE( fullscreen, ); + COMBOBOX_FORCE_RULE( placement, placementToCombo ); + CHECKBOX_SET_RULE( above, ); + CHECKBOX_SET_RULE( below, ); + CHECKBOX_SET_RULE( noborder, ); + CHECKBOX_SET_RULE( skiptaskbar, ); + CHECKBOX_SET_RULE( skippager, ); + CHECKBOX_FORCE_RULE( acceptfocus, ); + CHECKBOX_FORCE_RULE( closeable, ); + LINEEDIT_FORCE_RULE( opacityactive, intToStr ); + LINEEDIT_FORCE_RULE( opacityinactive, intToStr ); + LINEEDIT_SET_RULE( shortcut, ); + COMBOBOX_FORCE_RULE( fsplevel, ); + COMBOBOX_FORCE_RULE( moveresizemode, moveresizeToCombo ); + COMBOBOX_FORCE_RULE( type, typeToCombo ); + CHECKBOX_FORCE_RULE( ignoreposition, ); + LINEEDIT_FORCE_RULE( minsize, sizeToStr ); + LINEEDIT_FORCE_RULE( maxsize, sizeToStr ); + CHECKBOX_FORCE_RULE( strictgeometry, ); + CHECKBOX_FORCE_RULE( disableglobalshortcuts, ); + } + +#undef GENERIC_RULE +#undef CHECKBOX_SET_RULE +#undef LINEEDIT_SET_RULE +#undef COMBOBOX_SET_RULE +#undef CHECKBOX_FORCE_RULE +#undef LINEEDIT_FORCE_RULE +#undef COMBOBOX_FORCE_RULE + +#define GENERIC_RULE( var, func, Type, type, uimethod ) \ + if( enable_##var->isChecked()) \ + { \ + rules->var##rule = combo_to_##type##_rule[ rule_##var->currentItem() ]; \ + rules->var = func( var->uimethod()); \ + } \ + else \ + rules->var##rule = Rules::Unused##Type##Rule; + +#define CHECKBOX_SET_RULE( var, func ) GENERIC_RULE( var, func, Set, set, isChecked ) +#define LINEEDIT_SET_RULE( var, func ) GENERIC_RULE( var, func, Set, set, text ) +#define COMBOBOX_SET_RULE( var, func ) GENERIC_RULE( var, func, Set, set, currentItem ) +#define CHECKBOX_FORCE_RULE( var, func ) GENERIC_RULE( var, func, Force, force, isChecked ) +#define LINEEDIT_FORCE_RULE( var, func ) GENERIC_RULE( var, func, Force, force, text ) +#define COMBOBOX_FORCE_RULE( var, func ) GENERIC_RULE( var, func, Force, force, currentItem ) + +Rules* RulesWidget::rules() const + { + Rules* rules = new Rules(); + rules->description = description->text(); + rules->wmclass = wmclass->text().utf8(); + rules->wmclasscomplete = whole_wmclass->isChecked(); + rules->wmclassmatch = static_cast< Rules::StringMatch >( wmclass_match->currentItem()); + rules->windowrole = role->text().utf8(); + rules->windowrolematch = static_cast< Rules::StringMatch >( role_match->currentItem()); + rules->types = 0; + bool all_types = true; + for( unsigned int i = 0; + i < types->count(); + ++i ) + if( !types->isSelected( i )) + all_types = false; + if( all_types ) // if all types are selected, use AllTypesMask (for future expansion) + rules->types = NET::AllTypesMask; + else + { + rules->types |= types->isSelected( 0 ) ? NET::NormalMask : 0; + rules->types |= types->isSelected( 1 ) ? NET::DialogMask : 0; + rules->types |= types->isSelected( 2 ) ? NET::UtilityMask : 0; + rules->types |= types->isSelected( 3 ) ? NET::DockMask : 0; + rules->types |= types->isSelected( 4 ) ? NET::ToolbarMask : 0; + rules->types |= types->isSelected( 5 ) ? NET::MenuMask : 0; + rules->types |= types->isSelected( 6 ) ? NET::SplashMask : 0; + rules->types |= types->isSelected( 7 ) ? NET::DesktopMask : 0; + rules->types |= types->isSelected( 8 ) ? NET::OverrideMask : 0; + rules->types |= types->isSelected( 9 ) ? NET::TopMenuMask : 0; + } + rules->title = title->text(); + rules->titlematch = static_cast< Rules::StringMatch >( title_match->currentItem()); + rules->extrarole = extra->text().utf8(); + rules->extrarolematch = static_cast< Rules::StringMatch >( extra_match->currentItem()); + rules->clientmachine = machine->text().utf8(); + rules->clientmachinematch = static_cast< Rules::StringMatch >( machine_match->currentItem()); + LINEEDIT_SET_RULE( position, strToPosition ); + LINEEDIT_SET_RULE( size, strToSize ); + COMBOBOX_SET_RULE( desktop, comboToDesktop ); + CHECKBOX_SET_RULE( maximizehoriz, ); + CHECKBOX_SET_RULE( maximizevert, ); + CHECKBOX_SET_RULE( minimize, ); + CHECKBOX_SET_RULE( shade, ); + CHECKBOX_SET_RULE( fullscreen, ); + COMBOBOX_FORCE_RULE( placement, comboToPlacement ); + CHECKBOX_SET_RULE( above, ); + CHECKBOX_SET_RULE( below, ); + CHECKBOX_SET_RULE( noborder, ); + CHECKBOX_SET_RULE( skiptaskbar, ); + CHECKBOX_SET_RULE( skippager, ); + CHECKBOX_FORCE_RULE( acceptfocus, ); + CHECKBOX_FORCE_RULE( closeable, ); + LINEEDIT_FORCE_RULE( opacityactive, strToInt ); + LINEEDIT_FORCE_RULE( opacityinactive, strToInt ); + LINEEDIT_SET_RULE( shortcut, ); + COMBOBOX_FORCE_RULE( fsplevel, ); + COMBOBOX_FORCE_RULE( moveresizemode, comboToMoveResize ); + COMBOBOX_FORCE_RULE( type, comboToType ); + CHECKBOX_FORCE_RULE( ignoreposition, ); + LINEEDIT_FORCE_RULE( minsize, strToSize ); + LINEEDIT_FORCE_RULE( maxsize, strToSize ); + CHECKBOX_FORCE_RULE( strictgeometry, ); + CHECKBOX_FORCE_RULE( disableglobalshortcuts, ); + return rules; + } + +#undef GENERIC_RULE +#undef CHECKBOX_SET_RULE +#undef LINEEDIT_SET_RULE +#undef COMBOBOX_SET_RULE +#undef CHECKBOX_FORCE_RULE +#undef LINEEDIT_FORCE_RULE +#undef COMBOBOX_FORCE_RULE + +#define STRING_MATCH_COMBO( type ) \ +void RulesWidget::type##MatchChanged() \ + { \ + edit_reg_##type->setEnabled( type##_match->currentItem() == Rules::RegExpMatch ); \ + type->setEnabled( type##_match->currentItem() != Rules::UnimportantMatch ); \ + } + +STRING_MATCH_COMBO( wmclass ) +STRING_MATCH_COMBO( role ) +STRING_MATCH_COMBO( title ) +STRING_MATCH_COMBO( extra ) +STRING_MATCH_COMBO( machine ) + +#undef STRING_MATCH_COMBO + +void RulesWidget::detectClicked() + { + assert( detect_dlg == NULL ); + detect_dlg = new DetectDialog; + connect( detect_dlg, TQT_SIGNAL( detectionDone( bool )), this, TQT_SLOT( detected( bool ))); + detect_dlg->detect( 0 ); + } + +void RulesWidget::detected( bool ok ) + { + if( ok ) + { + wmclass->setText( detect_dlg->selectedClass()); + wmclass_match->setCurrentItem( Rules::ExactMatch ); + wmclassMatchChanged(); // grrr + whole_wmclass->setChecked( detect_dlg->selectedWholeClass()); + role->setText( detect_dlg->selectedRole()); + role_match->setCurrentItem( detect_dlg->selectedRole().isEmpty() + ? Rules::UnimportantMatch : Rules::ExactMatch ); + roleMatchChanged(); + if( detect_dlg->selectedWholeApp()) + { + for( unsigned int i = 0; + i < types->count(); + ++i ) + types->setSelected( i, true ); + } + else + { + NET::WindowType type = detect_dlg->selectedType(); + for( unsigned int i = 0; + i < types->count(); + ++i ) + types->setSelected( i, false ); + types->setSelected( typeToCombo( type ), true ); + } + title->setText( detect_dlg->selectedTitle()); + title_match->setCurrentItem( detect_dlg->titleMatch()); + titleMatchChanged(); + machine->setText( detect_dlg->selectedMachine()); + machine_match->setCurrentItem( Rules::UnimportantMatch ); + machineMatchChanged(); + // prefill values from to window to settings which already set + const KWin::WindowInfo& info = detect_dlg->windowInfo(); + prefillUnusedValues( info ); + } + delete detect_dlg; + detect_dlg = NULL; + detect_dlg_ok = ok; + } + +#define GENERIC_PREFILL( var, func, info, uimethod ) \ + if( !enable_##var->isChecked()) \ + { \ + var->uimethod( func( info )); \ + } + +#define CHECKBOX_PREFILL( var, func, info ) GENERIC_PREFILL( var, func, info, setChecked ) +#define LINEEDIT_PREFILL( var, func, info ) GENERIC_PREFILL( var, func, info, setText ) +#define COMBOBOX_PREFILL( var, func, info ) GENERIC_PREFILL( var, func, info, setCurrentItem ) + +void RulesWidget::prefillUnusedValues( const KWin::WindowInfo& info ) + { + LINEEDIT_PREFILL( position, positionToStr, info.frameGeometry().topLeft() ); + LINEEDIT_PREFILL( size, sizeToStr, info.frameGeometry().size() ); + COMBOBOX_PREFILL( desktop, desktopToCombo, info.desktop() ); + CHECKBOX_PREFILL( maximizehoriz,, info.state() & NET::MaxHoriz ); + CHECKBOX_PREFILL( maximizevert,, info.state() & NET::MaxVert ); + CHECKBOX_PREFILL( minimize,, info.isMinimized() ); + CHECKBOX_PREFILL( shade,, info.state() & NET::Shaded ); + CHECKBOX_PREFILL( fullscreen,, info.state() & NET::FullScreen ); + //COMBOBOX_PREFILL( placement, placementToCombo ); + CHECKBOX_PREFILL( above,, info.state() & NET::KeepAbove ); + CHECKBOX_PREFILL( below,, info.state() & NET::KeepBelow ); + // noborder is only internal KWin information, so let's guess + CHECKBOX_PREFILL( noborder,, info.frameGeometry() == info.geometry() ); + CHECKBOX_PREFILL( skiptaskbar,, info.state() & NET::SkipTaskbar ); + CHECKBOX_PREFILL( skippager,, info.state() & NET::SkipPager ); + //CHECKBOX_PREFILL( acceptfocus, ); + //CHECKBOX_PREFILL( closeable, ); + LINEEDIT_PREFILL( opacityactive, intToStr, 100 /*get the actual opacity somehow*/); + LINEEDIT_PREFILL( opacityinactive, intToStr, 100 /*get the actual opacity somehow*/); + //LINEEDIT_PREFILL( shortcut, ); + //COMBOBOX_PREFILL( fsplevel, ); + //COMBOBOX_PREFILL( moveresizemode, moveresizeToCombo ); + COMBOBOX_PREFILL( type, typeToCombo, info.windowType( SUPPORTED_WINDOW_TYPES_MASK ) ); + //CHECKBOX_PREFILL( ignoreposition, ); + LINEEDIT_PREFILL( minsize, sizeToStr, info.frameGeometry().size() ); + LINEEDIT_PREFILL( maxsize, sizeToStr, info.frameGeometry().size() ); + //CHECKBOX_PREFILL( strictgeometry, ); + //CHECKBOX_PREFILL( disableglobalshortcuts, ); + } + +#undef GENERIC_PREFILL +#undef CHECKBOX_PREFILL +#undef LINEEDIT_PREFILL +#undef COMBOBOX_PREFILL + +bool RulesWidget::finalCheck() + { + if( description->text().isEmpty()) + { + if( !wmclass->text().isEmpty()) + description->setText( i18n( "Settings for %1" ).arg( wmclass->text())); + else + description->setText( i18n( "Unnamed entry" )); + } + bool all_types = true; + for( unsigned int i = 0; + i < types->count(); + ++i ) + if( !types->isSelected( i )) + all_types = false; + if( wmclass_match->currentItem() == Rules::UnimportantMatch && all_types ) + { + if( KMessageBox::warningContinueCancel( tqtopLevelWidget(), + i18n( "You have specified the window class as unimportant.\n" + "This means the settings will possibly apply to windows from all applications. " + "If you really want to create a generic setting, it is recommended you at least " + "limit the window types to avoid special window types." )) != KMessageBox::Continue ) + return false; + } + return true; + } + +void RulesWidget::prepareWindowSpecific( WId window ) + { + tabs->setCurrentPage( 2 ); // geometry tab, skip tabs for window identification + KWin::WindowInfo info( window, -1U, -1U ); // read everything + prefillUnusedValues( info ); + } + +void RulesWidget::shortcutEditClicked() + { + EditShortcutDialog dlg( tqtopLevelWidget()); + dlg.setShortcut( shortcut->text()); + if( dlg.exec() == TQDialog::Accepted ) + shortcut->setText( dlg.shortcut()); + } + +RulesDialog::RulesDialog( TQWidget* parent, const char* name ) +: KDialogBase( parent, name, true, i18n( "Edit Window-Specific Settings" ), Ok | Cancel ) + { + widget = new RulesWidget( this ); + setMainWidget( widget ); + } + +// window is set only for Alt+F3/Window-specific settings, because the dialog +// is then related to one specific window +Rules* RulesDialog::edit( Rules* r, WId window, bool show_hints ) + { + rules = r; + widget->setRules( rules ); + if( window != 0 ) + widget->prepareWindowSpecific( window ); + if( show_hints ) + TQTimer::singleShot( 0, this, TQT_SLOT( displayHints())); + exec(); + return rules; + } + +void RulesDialog::displayHints() + { + TQString str = "<qt><p>"; + str += i18n( "This configuration dialog allows altering settings only for the selected window" + " or application. Find the setting you want to affect, enable the setting using the checkbox," + " select in what way the setting should be affected and to which value." ); +#if 0 // maybe later + str += "</p><p>" + i18n( "Consult the documentation for more details." ); +#endif + str += "</p></qt>"; + KMessageBox::information( this, str, TQString::null, "displayhints" ); + } + +void RulesDialog::accept() + { + if( !widget->finalCheck()) + return; + rules = widget->rules(); + KDialogBase::accept(); + } + +EditShortcut::EditShortcut( TQWidget* parent, const char* name ) +: EditShortcutBase( parent, name ) + { + } + +void EditShortcut::editShortcut() + { + ShortcutDialog dlg( KShortcut( shortcut->text()), tqtopLevelWidget()); + if( dlg.exec() == TQDialog::Accepted ) + shortcut->setText( dlg.shortcut().toString()); + } + +void EditShortcut::clearShortcut() + { + shortcut->setText( "" ); + } + +EditShortcutDialog::EditShortcutDialog( TQWidget* parent, const char* name ) +: KDialogBase( parent, name, true, i18n( "Edit Shortcut" ), Ok | Cancel ) + { + widget = new EditShortcut( this ); + setMainWidget( widget ); + } + +void EditShortcutDialog::setShortcut( const TQString& cut ) + { + widget->shortcut->setText( cut ); + } + +TQString EditShortcutDialog::shortcut() const + { + return widget->shortcut->text(); + } + +ShortcutDialog::ShortcutDialog( const KShortcut& cut, TQWidget* parent, const char* name ) + : KShortcutDialog( cut, false /*TODO???*/, parent, name ) + { + } + +void ShortcutDialog::accept() + { + for( int i = 0; + ; + ++i ) + { + KKeySequence seq = shortcut().seq( i ); + if( seq.isNull()) + break; + if( seq.key( 0 ) == Key_Escape ) + { + reject(); + return; + } + if( seq.key( 0 ) == Key_Space ) + { // clear + setShortcut( KShortcut()); + KShortcutDialog::accept(); + return; + } + if( seq.key( 0 ).modFlags() == 0 ) + { // no shortcuts without modifiers + KShortcut cut = shortcut(); + cut.setSeq( i, KKeySequence()); + setShortcut( cut ); + return; + } + } + KShortcutDialog::accept(); + } + +} // namespace + +#include "ruleswidget.moc" diff --git a/twin/kcmtwin/twinrules/ruleswidget.h b/twin/kcmtwin/twinrules/ruleswidget.h new file mode 100644 index 000000000..2a9b0d036 --- /dev/null +++ b/twin/kcmtwin/twinrules/ruleswidget.h @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2004 Lubos Lunak <l.lunak@kde.org> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + + +#ifndef __RULESWIDGET_H__ +#define __RULESWIDGET_H__ + +#include <kdialogbase.h> +#include <twin.h> +#include <kshortcutdialog.h> + +#include "ruleswidgetbase.h" +#include "editshortcutbase.h" + +namespace KWinInternal +{ + +class Rules; +class DetectDialog; + +class RulesWidget + : public RulesWidgetBase + { + Q_OBJECT + public: + RulesWidget( TQWidget* parent = NULL, const char* name = NULL ); + void setRules( Rules* r ); + Rules* rules() const; + bool finalCheck(); + void prepareWindowSpecific( WId window ); + signals: + void changed( bool state ); + protected slots: + virtual void detectClicked(); + virtual void wmclassMatchChanged(); + virtual void roleMatchChanged(); + virtual void titleMatchChanged(); + virtual void extraMatchChanged(); + virtual void machineMatchChanged(); + virtual void shortcutEditClicked(); + private slots: + // geometry tab + void updateEnableposition(); + void updateEnablesize(); + void updateEnabledesktop(); + void updateEnablemaximizehoriz(); + void updateEnablemaximizevert(); + void updateEnableminimize(); + void updateEnableshade(); + void updateEnablefullscreen(); + void updateEnableplacement(); + // preferences tab + void updateEnableabove(); + void updateEnablebelow(); + void updateEnablenoborder(); + void updateEnableskiptaskbar(); + void updateEnableskippager(); + void updateEnableacceptfocus(); + void updateEnablecloseable(); + void updateEnableopacityactive(); + void updateEnableopacityinactive(); + // workarounds tab + void updateEnablefsplevel(); + void updateEnablemoveresizemode(); + void updateEnabletype(); + void updateEnableignoreposition(); + void updateEnableminsize(); + void updateEnablemaxsize(); + void updateEnablestrictgeometry(); + void updateEnableshortcut(); + void updateEnabledisableglobalshortcuts(); + // internal + void detected( bool ); + private: + int desktopToCombo( int d ) const; + int comboToDesktop( int val ) const; + void prefillUnusedValues( const KWin::WindowInfo& info ); + DetectDialog* detect_dlg; + bool detect_dlg_ok; + }; + +class RulesDialog + : public KDialogBase + { + Q_OBJECT + public: + RulesDialog( TQWidget* parent = NULL, const char* name = NULL ); + Rules* edit( Rules* r, WId window, bool show_hints ); + protected: + virtual void accept(); + private slots: + void displayHints(); + private: + RulesWidget* widget; + Rules* rules; + }; + +class EditShortcut + : public EditShortcutBase + { + Q_OBJECT + public: + EditShortcut( TQWidget* parent = NULL, const char* name = NULL ); + protected: + void editShortcut(); + void clearShortcut(); + }; + +class EditShortcutDialog + : public KDialogBase + { + Q_OBJECT + public: + EditShortcutDialog( TQWidget* parent = NULL, const char* name = NULL ); + void setShortcut( const TQString& cut ); + TQString shortcut() const; + private: + EditShortcut* widget; + }; + +// slightly duped from utils.cpp +class ShortcutDialog + : public KShortcutDialog + { + Q_OBJECT + public: + ShortcutDialog( const KShortcut& cut, TQWidget* parent = NULL, const char* name = NULL ); + virtual void accept(); + }; + +} // namespace + +#endif diff --git a/twin/kcmtwin/twinrules/ruleswidgetbase.ui b/twin/kcmtwin/twinrules/ruleswidgetbase.ui new file mode 100644 index 000000000..5a5640ca2 --- /dev/null +++ b/twin/kcmtwin/twinrules/ruleswidgetbase.ui @@ -0,0 +1,2597 @@ +<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> +<class>KWinInternal::RulesWidgetBase</class> +<widget class="TQWidget"> + <property name="name"> + <cstring>Form2</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>630</width> + <height>503</height> + </rect> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <widget class="TQTabWidget"> + <property name="name"> + <cstring>tabs</cstring> + </property> + <widget class="TQWidget"> + <property name="name"> + <cstring>tab</cstring> + </property> + <attribute name="title"> + <string>&Window</string> + </attribute> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="TQLabel" row="0" column="0" rowspan="1" colspan="5"> + <property name="name"> + <cstring>textLabel1</cstring> + </property> + <property name="text"> + <string>De&scription:</string> + </property> + <property name="buddy" stdset="0"> + <cstring>description</cstring> + </property> + </widget> + <widget class="KLineEdit" row="1" column="0" rowspan="1" colspan="5"> + <property name="name"> + <cstring>description</cstring> + </property> + </widget> + <widget class="TQLabel" row="2" column="0" rowspan="1" colspan="5"> + <property name="name"> + <cstring>textLabel2</cstring> + </property> + <property name="text"> + <string>Window &class (application type):</string> + </property> + <property name="buddy" stdset="0"> + <cstring>wmclass</cstring> + </property> + </widget> + <widget class="TQLabel" row="5" column="0" rowspan="1" colspan="5"> + <property name="name"> + <cstring>textLabel3</cstring> + </property> + <property name="text"> + <string>Window &role:</string> + </property> + <property name="buddy" stdset="0"> + <cstring>role</cstring> + </property> + </widget> + <widget class="KLineEdit" row="6" column="0" rowspan="1" colspan="5"> + <property name="name"> + <cstring>role</cstring> + </property> + </widget> + <spacer row="9" column="1"> + <property name="name"> + <cstring>spacer29</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="tqsizeHint"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + <widget class="KComboBox" row="7" column="0"> + <item> + <property name="text"> + <string>Unimportant</string> + </property> + </item> + <item> + <property name="text"> + <string>Exact Match</string> + </property> + </item> + <item> + <property name="text"> + <string>Substring Match</string> + </property> + </item> + <item> + <property name="text"> + <string>Regular Expression</string> + </property> + </item> + <property name="name"> + <cstring>role_match</cstring> + </property> + </widget> + <spacer row="7" column="1"> + <property name="name"> + <cstring>spacer1</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="tqsizeHint"> + <size> + <width>212</width> + <height>20</height> + </size> + </property> + </spacer> + <widget class="KPushButton" row="7" column="2"> + <property name="name"> + <cstring>edit_reg_role</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="text"> + <string>Edit</string> + </property> + </widget> + <spacer row="7" column="3" rowspan="1" colspan="2"> + <property name="name"> + <cstring>spacer4</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="tqsizeHint"> + <size> + <width>211</width> + <height>20</height> + </size> + </property> + </spacer> + <widget class="KComboBox" row="4" column="0"> + <item> + <property name="text"> + <string>Unimportant</string> + </property> + </item> + <item> + <property name="text"> + <string>Exact Match</string> + </property> + </item> + <item> + <property name="text"> + <string>Substring Match</string> + </property> + </item> + <item> + <property name="text"> + <string>Regular Expression</string> + </property> + </item> + <property name="name"> + <cstring>wmclass_match</cstring> + </property> + </widget> + <spacer row="4" column="1"> + <property name="name"> + <cstring>spacer2</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="tqsizeHint"> + <size> + <width>212</width> + <height>20</height> + </size> + </property> + </spacer> + <widget class="KPushButton" row="4" column="2"> + <property name="name"> + <cstring>edit_reg_wmclass</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + <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"> + <cstring>spacer5</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="tqsizeHint"> + <size> + <width>211</width> + <height>20</height> + </size> + </property> + </spacer> + <widget class="KLineEdit" row="3" column="0" rowspan="1" colspan="4"> + <property name="name"> + <cstring>wmclass</cstring> + </property> + </widget> + <widget class="TQCheckBox" row="3" column="4"> + <property name="name"> + <cstring>whole_wmclass</cstring> + </property> + <property name="text"> + <string>Match w&hole window class</string> + </property> + </widget> + <widget class="TQGroupBox" row="8" column="0" rowspan="1" colspan="5"> + <property name="name"> + <cstring>groupBox1</cstring> + </property> + <property name="title"> + <string>Detect Window Properties</string> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <spacer> + <property name="name"> + <cstring>spacer27</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="tqsizeHint"> + <size> + <width>270</width> + <height>20</height> + </size> + </property> + </spacer> + <widget class="KPushButton"> + <property name="name"> + <cstring>detect1</cstring> + </property> + <property name="text"> + <string>&Detect</string> + </property> + </widget> + <spacer> + <property name="name"> + <cstring>spacer28</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="tqsizeHint"> + <size> + <width>269</width> + <height>20</height> + </size> + </property> + </spacer> + </hbox> + </widget> + </grid> + </widget> + <widget class="TQWidget"> + <property name="name"> + <cstring>tab</cstring> + </property> + <attribute name="title"> + <string>Window &Extra</string> + </attribute> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="TQLabel" row="0" column="0" rowspan="1" colspan="4"> + <property name="name"> + <cstring>textLabel4</cstring> + </property> + <property name="text"> + <string>Window &types:</string> + </property> + <property name="buddy" stdset="0"> + <cstring>types</cstring> + </property> + </widget> + <widget class="KListBox" row="1" column="0" rowspan="1" colspan="4"> + <item> + <property name="text"> + <string>Normal Window</string> + </property> + </item> + <item> + <property name="text"> + <string>Dialog Window</string> + </property> + </item> + <item> + <property name="text"> + <string>Utility Window</string> + </property> + </item> + <item> + <property name="text"> + <string>Dock (panel)</string> + </property> + </item> + <item> + <property name="text"> + <string>Toolbar</string> + </property> + </item> + <item> + <property name="text"> + <string>Torn-Off Menu</string> + </property> + </item> + <item> + <property name="text"> + <string>Splash Screen</string> + </property> + </item> + <item> + <property name="text"> + <string>Desktop</string> + </property> + </item> + <item> + <property name="text"> + <string>Override Type</string> + </property> + </item> + <item> + <property name="text"> + <string>Standalone Menubar</string> + </property> + </item> + <property name="name"> + <cstring>types</cstring> + </property> + <property name="selectionMode"> + <enum>Multi</enum> + </property> + </widget> + <widget class="TQLabel" row="2" column="0" rowspan="1" colspan="4"> + <property name="name"> + <cstring>textLabel5</cstring> + </property> + <property name="text"> + <string>Window t&itle:</string> + </property> + <property name="buddy" stdset="0"> + <cstring>title</cstring> + </property> + </widget> + <widget class="KLineEdit" row="3" column="0" rowspan="1" colspan="4"> + <property name="name"> + <cstring>title</cstring> + </property> + </widget> + <widget class="TQLabel" row="5" column="0" rowspan="1" colspan="4"> + <property name="name"> + <cstring>textLabel6</cstring> + </property> + <property name="text"> + <string>Extra role:</string> + </property> + <property name="buddy" stdset="0"> + <cstring>extra</cstring> + </property> + </widget> + <widget class="KLineEdit" row="6" column="0" rowspan="1" colspan="4"> + <property name="name"> + <cstring>extra</cstring> + </property> + </widget> + <widget class="TQLabel" row="8" column="0" rowspan="1" colspan="4"> + <property name="name"> + <cstring>textLabel7</cstring> + </property> + <property name="text"> + <string>&Machine (hostname):</string> + </property> + <property name="buddy" stdset="0"> + <cstring>machine</cstring> + </property> + </widget> + <widget class="KLineEdit" row="9" column="0" rowspan="1" colspan="4"> + <property name="name"> + <cstring>machine</cstring> + </property> + </widget> + <widget class="KComboBox" row="4" column="0"> + <item> + <property name="text"> + <string>Unimportant</string> + </property> + </item> + <item> + <property name="text"> + <string>Exact Match</string> + </property> + </item> + <item> + <property name="text"> + <string>Substring Match</string> + </property> + </item> + <item> + <property name="text"> + <string>Regular Expression</string> + </property> + </item> + <property name="name"> + <cstring>title_match</cstring> + </property> + </widget> + <spacer row="4" column="1"> + <property name="name"> + <cstring>spacer2_2</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="tqsizeHint"> + <size> + <width>199</width> + <height>20</height> + </size> + </property> + </spacer> + <widget class="KPushButton" row="4" column="2"> + <property name="name"> + <cstring>edit_reg_title</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="text"> + <string>Edit</string> + </property> + <property name="accel"> + <string></string> + </property> + </widget> + <spacer row="4" column="3"> + <property name="name"> + <cstring>spacer5_2</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="tqsizeHint"> + <size> + <width>199</width> + <height>20</height> + </size> + </property> + </spacer> + <widget class="KComboBox" row="7" column="0"> + <item> + <property name="text"> + <string>Unimportant</string> + </property> + </item> + <item> + <property name="text"> + <string>Exact Match</string> + </property> + </item> + <item> + <property name="text"> + <string>Substring Match</string> + </property> + </item> + <item> + <property name="text"> + <string>Regular Expression</string> + </property> + </item> + <property name="name"> + <cstring>extra_match</cstring> + </property> + </widget> + <spacer row="7" column="1"> + <property name="name"> + <cstring>spacer2_2_2</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="tqsizeHint"> + <size> + <width>199</width> + <height>20</height> + </size> + </property> + </spacer> + <widget class="KPushButton" row="7" column="2"> + <property name="name"> + <cstring>edit_reg_extra</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="text"> + <string>Edit</string> + </property> + <property name="accel"> + <string></string> + </property> + </widget> + <spacer row="7" column="3"> + <property name="name"> + <cstring>spacer5_2_2</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="tqsizeHint"> + <size> + <width>199</width> + <height>20</height> + </size> + </property> + </spacer> + <widget class="KComboBox" row="10" column="0"> + <item> + <property name="text"> + <string>Unimportant</string> + </property> + </item> + <item> + <property name="text"> + <string>Exact Match</string> + </property> + </item> + <item> + <property name="text"> + <string>Substring Match</string> + </property> + </item> + <item> + <property name="text"> + <string>Regular Expression</string> + </property> + </item> + <property name="name"> + <cstring>machine_match</cstring> + </property> + </widget> + <spacer row="10" column="1"> + <property name="name"> + <cstring>spacer2_2_3</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="tqsizeHint"> + <size> + <width>199</width> + <height>20</height> + </size> + </property> + </spacer> + <widget class="KPushButton" row="10" column="2"> + <property name="name"> + <cstring>edit_reg_machine</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="text"> + <string>Edit</string> + </property> + <property name="accel"> + <string></string> + </property> + </widget> + <spacer row="10" column="3"> + <property name="name"> + <cstring>spacer5_2_3</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="tqsizeHint"> + <size> + <width>199</width> + <height>20</height> + </size> + </property> + </spacer> + </grid> + </widget> + <widget class="TQWidget"> + <property name="name"> + <cstring>TabPage</cstring> + </property> + <attribute name="title"> + <string>&Geometry</string> + </attribute> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="KComboBox" row="1" column="1"> + <item> + <property name="text"> + <string>Do Not Affect</string> + </property> + </item> + <item> + <property name="text"> + <string>Apply Initially</string> + </property> + </item> + <item> + <property name="text"> + <string>Remember</string> + </property> + </item> + <item> + <property name="text"> + <string>Force</string> + </property> + </item> + <item> + <property name="text"> + <string>Apply Now</string> + </property> + </item> + <item> + <property name="text"> + <string>Force Temporarily</string> + </property> + </item> + <property name="name"> + <cstring>rule_size</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + </widget> + <widget class="KRestrictedLine" row="1" column="2"> + <property name="name"> + <cstring>size</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="validChars"> + <string>0123456789-+,xX:</string> + </property> + </widget> + <widget class="TQCheckBox" row="1" column="0"> + <property name="name"> + <cstring>enable_size</cstring> + </property> + <property name="text"> + <string>&Size</string> + </property> + </widget> + <widget class="TQCheckBox" row="0" column="0"> + <property name="name"> + <cstring>enable_position</cstring> + </property> + <property name="text"> + <string>&Position</string> + </property> + </widget> + <widget class="KRestrictedLine" row="0" column="2"> + <property name="name"> + <cstring>position</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="validChars"> + <string>0123456789-+,xX:</string> + </property> + </widget> + <widget class="KComboBox" row="0" column="1"> + <item> + <property name="text"> + <string>Do Not Affect</string> + </property> + </item> + <item> + <property name="text"> + <string>Apply Initially</string> + </property> + </item> + <item> + <property name="text"> + <string>Remember</string> + </property> + </item> + <item> + <property name="text"> + <string>Force</string> + </property> + </item> + <item> + <property name="text"> + <string>Apply Now</string> + </property> + </item> + <item> + <property name="text"> + <string>Force Temporarily</string> + </property> + </item> + <property name="name"> + <cstring>rule_position</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + </widget> + <widget class="TQCheckBox" row="3" column="2"> + <property name="name"> + <cstring>maximizevert</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="text"> + <string></string> + </property> + </widget> + <widget class="KComboBox" row="2" column="1"> + <item> + <property name="text"> + <string>Do Not Affect</string> + </property> + </item> + <item> + <property name="text"> + <string>Apply Initially</string> + </property> + </item> + <item> + <property name="text"> + <string>Remember</string> + </property> + </item> + <item> + <property name="text"> + <string>Force</string> + </property> + </item> + <item> + <property name="text"> + <string>Apply Now</string> + </property> + </item> + <item> + <property name="text"> + <string>Force Temporarily</string> + </property> + </item> + <property name="name"> + <cstring>rule_maximizehoriz</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + </widget> + <widget class="TQCheckBox" row="4" column="2"> + <property name="name"> + <cstring>fullscreen</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="text"> + <string></string> + </property> + </widget> + <widget class="TQCheckBox" row="2" column="0"> + <property name="name"> + <cstring>enable_maximizehoriz</cstring> + </property> + <property name="text"> + <string>Maximized &horizontally</string> + </property> + </widget> + <widget class="TQCheckBox" row="2" column="2"> + <property name="name"> + <cstring>maximizehoriz</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="text"> + <string></string> + </property> + </widget> + <widget class="KComboBox" row="4" column="1"> + <item> + <property name="text"> + <string>Do Not Affect</string> + </property> + </item> + <item> + <property name="text"> + <string>Apply Initially</string> + </property> + </item> + <item> + <property name="text"> + <string>Remember</string> + </property> + </item> + <item> + <property name="text"> + <string>Force</string> + </property> + </item> + <item> + <property name="text"> + <string>Apply Now</string> + </property> + </item> + <item> + <property name="text"> + <string>Force Temporarily</string> + </property> + </item> + <property name="name"> + <cstring>rule_fullscreen</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + </widget> + <widget class="TQCheckBox" row="4" column="0"> + <property name="name"> + <cstring>enable_fullscreen</cstring> + </property> + <property name="text"> + <string>&Fullscreen</string> + </property> + </widget> + <widget class="KComboBox" row="3" column="1"> + <item> + <property name="text"> + <string>Do Not Affect</string> + </property> + </item> + <item> + <property name="text"> + <string>Apply Initially</string> + </property> + </item> + <item> + <property name="text"> + <string>Remember</string> + </property> + </item> + <item> + <property name="text"> + <string>Force</string> + </property> + </item> + <item> + <property name="text"> + <string>Apply Now</string> + </property> + </item> + <item> + <property name="text"> + <string>Force Temporarily</string> + </property> + </item> + <property name="name"> + <cstring>rule_maximizevert</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + </widget> + <widget class="TQCheckBox" row="3" column="0"> + <property name="name"> + <cstring>enable_maximizevert</cstring> + </property> + <property name="text"> + <string>Maximized &vertically</string> + </property> + </widget> + <widget class="KComboBox" row="5" column="1"> + <item> + <property name="text"> + <string>Do Not Affect</string> + </property> + </item> + <item> + <property name="text"> + <string>Apply Initially</string> + </property> + </item> + <item> + <property name="text"> + <string>Remember</string> + </property> + </item> + <item> + <property name="text"> + <string>Force</string> + </property> + </item> + <item> + <property name="text"> + <string>Apply Now</string> + </property> + </item> + <item> + <property name="text"> + <string>Force Temporarily</string> + </property> + </item> + <property name="name"> + <cstring>rule_desktop</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + </widget> + <widget class="KComboBox" row="5" column="2"> + <property name="name"> + <cstring>desktop</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + </widget> + <widget class="TQCheckBox" row="5" column="0"> + <property name="name"> + <cstring>enable_desktop</cstring> + </property> + <property name="text"> + <string>&Desktop</string> + </property> + </widget> + <widget class="TQCheckBox" row="7" column="0"> + <property name="name"> + <cstring>enable_shade</cstring> + </property> + <property name="text"> + <string>Sh&aded</string> + </property> + </widget> + <widget class="TQCheckBox" row="7" column="2"> + <property name="name"> + <cstring>shade</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="text"> + <string></string> + </property> + </widget> + <widget class="KComboBox" row="6" column="1"> + <item> + <property name="text"> + <string>Do Not Affect</string> + </property> + </item> + <item> + <property name="text"> + <string>Apply Initially</string> + </property> + </item> + <item> + <property name="text"> + <string>Remember</string> + </property> + </item> + <item> + <property name="text"> + <string>Force</string> + </property> + </item> + <item> + <property name="text"> + <string>Apply Now</string> + </property> + </item> + <item> + <property name="text"> + <string>Force Temporarily</string> + </property> + </item> + <property name="name"> + <cstring>rule_minimize</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + </widget> + <widget class="TQCheckBox" row="6" column="2"> + <property name="name"> + <cstring>minimize</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="text"> + <string></string> + </property> + </widget> + <widget class="TQCheckBox" row="6" column="0"> + <property name="name"> + <cstring>enable_minimize</cstring> + </property> + <property name="text"> + <string>M&inimized</string> + </property> + </widget> + <widget class="KComboBox" row="8" column="1"> + <item> + <property name="text"> + <string>Do Not Affect</string> + </property> + </item> + <item> + <property name="text"> + <string>Force</string> + </property> + </item> + <item> + <property name="text"> + <string>Force Temporarily</string> + </property> + </item> + <property name="name"> + <cstring>rule_placement</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + </widget> + <widget class="KComboBox" row="8" column="2"> + <item> + <property name="text"> + <string>Default</string> + </property> + </item> + <item> + <property name="text"> + <string>No Placement</string> + </property> + </item> + <item> + <property name="text"> + <string>Smart</string> + </property> + </item> + <item> + <property name="text"> + <string>Maximizing</string> + </property> + </item> + <item> + <property name="text"> + <string>Cascade</string> + </property> + </item> + <item> + <property name="text"> + <string>Centered</string> + </property> + </item> + <item> + <property name="text"> + <string>Random</string> + </property> + </item> + <item> + <property name="text"> + <string>Top-Left Corner</string> + </property> + </item> + <item> + <property name="text"> + <string>Under Mouse</string> + </property> + </item> + <item> + <property name="text"> + <string>On Main Window</string> + </property> + </item> + <property name="name"> + <cstring>placement</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + </widget> + <widget class="TQCheckBox" row="8" column="0"> + <property name="name"> + <cstring>enable_placement</cstring> + </property> + <property name="text"> + <string>P&lacement</string> + </property> + </widget> + <spacer row="9" column="1"> + <property name="name"> + <cstring>spacer31</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="tqsizeHint"> + <size> + <width>20</width> + <height>16</height> + </size> + </property> + </spacer> + <widget class="KComboBox" row="7" column="1"> + <item> + <property name="text"> + <string>Do Not Affect</string> + </property> + </item> + <item> + <property name="text"> + <string>Apply Initially</string> + </property> + </item> + <item> + <property name="text"> + <string>Remember</string> + </property> + </item> + <item> + <property name="text"> + <string>Force</string> + </property> + </item> + <item> + <property name="text"> + <string>Apply Now</string> + </property> + </item> + <item> + <property name="text"> + <string>Force Temporarily</string> + </property> + </item> + <property name="name"> + <cstring>rule_shade</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + </widget> + </grid> + </widget> + <widget class="TQWidget"> + <property name="name"> + <cstring>TabPage</cstring> + </property> + <attribute name="title"> + <string>&Preferences</string> + </attribute> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="TQCheckBox" row="0" column="0"> + <property name="name"> + <cstring>enable_above</cstring> + </property> + <property name="text"> + <string>Keep &above</string> + </property> + </widget> + <widget class="TQCheckBox" row="1" column="0"> + <property name="name"> + <cstring>enable_below</cstring> + </property> + <property name="text"> + <string>Keep &below</string> + </property> + </widget> + <widget class="TQCheckBox" row="4" column="0"> + <property name="name"> + <cstring>enable_skippager</cstring> + </property> + <property name="text"> + <string>Skip pa&ger</string> + </property> + </widget> + <widget class="TQCheckBox" row="3" column="0"> + <property name="name"> + <cstring>enable_skiptaskbar</cstring> + </property> + <property name="text"> + <string>Skip &taskbar</string> + </property> + </widget> + <widget class="TQCheckBox" row="2" column="0"> + <property name="name"> + <cstring>enable_noborder</cstring> + </property> + <property name="text"> + <string>&No border</string> + </property> + </widget> + <widget class="TQCheckBox" row="5" column="0"> + <property name="name"> + <cstring>enable_acceptfocus</cstring> + </property> + <property name="text"> + <string>Accept &focus</string> + </property> + </widget> + <widget class="TQCheckBox" row="6" column="0"> + <property name="name"> + <cstring>enable_closeable</cstring> + </property> + <property name="text"> + <string>&Closeable</string> + </property> + </widget> + <widget class="TQCheckBox" row="7" column="0"> + <property name="name"> + <cstring>enable_opacityactive</cstring> + </property> + <property name="text"> + <string>A&ctive opacity in %</string> + </property> + </widget> + <widget class="KComboBox" row="7" column="1"> + <item> + <property name="text"> + <string>Do Not Affect</string> + </property> + </item> + <item> + <property name="text"> + <string>Force</string> + </property> + </item> + <item> + <property name="text"> + <string>Force Temporarily</string> + </property> + </item> + <property name="name"> + <cstring>rule_opacityactive</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + </widget> + <widget class="KRestrictedLine" row="7" column="2" rowspan="1" colspan="2"> + <property name="name"> + <cstring>opacityactive</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="validChars"> + <string>0123456789</string> + </property> + </widget> + <spacer row="7" column="4" rowspan="1" colspan="2"> + <property name="name"> + <cstring>spacer24</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="tqsizeHint"> + <size> + <width>171</width> + <height>20</height> + </size> + </property> + </spacer> + <spacer row="6" column="3" rowspan="1" colspan="3"> + <property name="name"> + <cstring>spacer36_7</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="tqsizeHint"> + <size> + <width>290</width> + <height>20</height> + </size> + </property> + </spacer> + <spacer row="5" column="3" rowspan="1" colspan="3"> + <property name="name"> + <cstring>spacer36_6</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="tqsizeHint"> + <size> + <width>290</width> + <height>20</height> + </size> + </property> + </spacer> + <spacer row="4" column="3" rowspan="1" colspan="3"> + <property name="name"> + <cstring>spacer36_5</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="tqsizeHint"> + <size> + <width>290</width> + <height>20</height> + </size> + </property> + </spacer> + <spacer row="3" column="3" rowspan="1" colspan="3"> + <property name="name"> + <cstring>spacer36_4</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="tqsizeHint"> + <size> + <width>290</width> + <height>20</height> + </size> + </property> + </spacer> + <spacer row="2" column="3" rowspan="1" colspan="3"> + <property name="name"> + <cstring>spacer36_3</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="tqsizeHint"> + <size> + <width>290</width> + <height>20</height> + </size> + </property> + </spacer> + <spacer row="1" column="3" rowspan="1" colspan="3"> + <property name="name"> + <cstring>spacer36_2</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="tqsizeHint"> + <size> + <width>290</width> + <height>20</height> + </size> + </property> + </spacer> + <spacer row="0" column="3" rowspan="1" colspan="3"> + <property name="name"> + <cstring>spacer36</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="tqsizeHint"> + <size> + <width>290</width> + <height>20</height> + </size> + </property> + </spacer> + <widget class="TQCheckBox" row="0" column="2"> + <property name="name"> + <cstring>above</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="text"> + <string></string> + </property> + </widget> + <widget class="TQCheckBox" row="1" column="2"> + <property name="name"> + <cstring>below</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="text"> + <string></string> + </property> + </widget> + <widget class="TQCheckBox" row="2" column="2"> + <property name="name"> + <cstring>noborder</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="text"> + <string></string> + </property> + </widget> + <widget class="TQCheckBox" row="3" column="2"> + <property name="name"> + <cstring>skiptaskbar</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="text"> + <string></string> + </property> + </widget> + <widget class="TQCheckBox" row="4" column="2"> + <property name="name"> + <cstring>skippager</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="text"> + <string></string> + </property> + </widget> + <widget class="TQCheckBox" row="5" column="2"> + <property name="name"> + <cstring>acceptfocus</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="text"> + <string></string> + </property> + </widget> + <widget class="TQCheckBox" row="6" column="2"> + <property name="name"> + <cstring>closeable</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="text"> + <string></string> + </property> + </widget> + <widget class="KComboBox" row="6" column="1"> + <item> + <property name="text"> + <string>Do Not Affect</string> + </property> + </item> + <item> + <property name="text"> + <string>Force</string> + </property> + </item> + <item> + <property name="text"> + <string>Force Temporarily</string> + </property> + </item> + <property name="name"> + <cstring>rule_closeable</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + </widget> + <widget class="KComboBox" row="5" column="1"> + <item> + <property name="text"> + <string>Do Not Affect</string> + </property> + </item> + <item> + <property name="text"> + <string>Force</string> + </property> + </item> + <item> + <property name="text"> + <string>Force Temporarily</string> + </property> + </item> + <property name="name"> + <cstring>rule_acceptfocus</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + </widget> + <widget class="KComboBox" row="4" column="1"> + <item> + <property name="text"> + <string>Do Not Affect</string> + </property> + </item> + <item> + <property name="text"> + <string>Apply Initially</string> + </property> + </item> + <item> + <property name="text"> + <string>Remember</string> + </property> + </item> + <item> + <property name="text"> + <string>Force</string> + </property> + </item> + <item> + <property name="text"> + <string>Apply Now</string> + </property> + </item> + <item> + <property name="text"> + <string>Force Temporarily</string> + </property> + </item> + <property name="name"> + <cstring>rule_skippager</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + </widget> + <widget class="KComboBox" row="3" column="1"> + <item> + <property name="text"> + <string>Do Not Affect</string> + </property> + </item> + <item> + <property name="text"> + <string>Apply Initially</string> + </property> + </item> + <item> + <property name="text"> + <string>Remember</string> + </property> + </item> + <item> + <property name="text"> + <string>Force</string> + </property> + </item> + <item> + <property name="text"> + <string>Apply Now</string> + </property> + </item> + <item> + <property name="text"> + <string>Force Temporarily</string> + </property> + </item> + <property name="name"> + <cstring>rule_skiptaskbar</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + </widget> + <widget class="KComboBox" row="2" column="1"> + <item> + <property name="text"> + <string>Do Not Affect</string> + </property> + </item> + <item> + <property name="text"> + <string>Apply Initially</string> + </property> + </item> + <item> + <property name="text"> + <string>Remember</string> + </property> + </item> + <item> + <property name="text"> + <string>Force</string> + </property> + </item> + <item> + <property name="text"> + <string>Apply Now</string> + </property> + </item> + <item> + <property name="text"> + <string>Force Temporarily</string> + </property> + </item> + <property name="name"> + <cstring>rule_noborder</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + </widget> + <widget class="KComboBox" row="1" column="1"> + <item> + <property name="text"> + <string>Do Not Affect</string> + </property> + </item> + <item> + <property name="text"> + <string>Apply Initially</string> + </property> + </item> + <item> + <property name="text"> + <string>Remember</string> + </property> + </item> + <item> + <property name="text"> + <string>Force</string> + </property> + </item> + <item> + <property name="text"> + <string>Apply Now</string> + </property> + </item> + <item> + <property name="text"> + <string>Force Temporarily</string> + </property> + </item> + <property name="name"> + <cstring>rule_below</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + </widget> + <widget class="KComboBox" row="0" column="1"> + <item> + <property name="text"> + <string>Do Not Affect</string> + </property> + </item> + <item> + <property name="text"> + <string>Apply Initially</string> + </property> + </item> + <item> + <property name="text"> + <string>Remember</string> + </property> + </item> + <item> + <property name="text"> + <string>Force</string> + </property> + </item> + <item> + <property name="text"> + <string>Apply Now</string> + </property> + </item> + <item> + <property name="text"> + <string>Force Temporarily</string> + </property> + </item> + <property name="name"> + <cstring>rule_above</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + </widget> + <spacer row="10" column="1"> + <property name="name"> + <cstring>spacer33</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="tqsizeHint"> + <size> + <width>20</width> + <height>80</height> + </size> + </property> + </spacer> + <widget class="KComboBox" row="8" column="1"> + <item> + <property name="text"> + <string>Do Not Affect</string> + </property> + </item> + <item> + <property name="text"> + <string>Force</string> + </property> + </item> + <item> + <property name="text"> + <string>Force Temporarily</string> + </property> + </item> + <property name="name"> + <cstring>rule_opacityinactive</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + </widget> + <widget class="KRestrictedLine" row="8" column="2" rowspan="1" colspan="2"> + <property name="name"> + <cstring>opacityinactive</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="validChars"> + <string>0123456789</string> + </property> + </widget> + <spacer row="8" column="4" rowspan="1" colspan="2"> + <property name="name"> + <cstring>spacer25</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="tqsizeHint"> + <size> + <width>181</width> + <height>20</height> + </size> + </property> + </spacer> + <widget class="TQCheckBox" row="8" column="0"> + <property name="name"> + <cstring>enable_opacityinactive</cstring> + </property> + <property name="text"> + <string>I&nactive opacity in %</string> + </property> + </widget> + <widget class="TQCheckBox" row="9" column="0"> + <property name="name"> + <cstring>enable_shortcut</cstring> + </property> + <property name="text"> + <string>Shortcut</string> + </property> + <property name="accel"> + <string></string> + </property> + </widget> + <widget class="KComboBox" row="9" column="1"> + <item> + <property name="text"> + <string>Do Not Affect</string> + </property> + </item> + <item> + <property name="text"> + <string>Apply Initially</string> + </property> + </item> + <item> + <property name="text"> + <string>Remember</string> + </property> + </item> + <item> + <property name="text"> + <string>Force</string> + </property> + </item> + <item> + <property name="text"> + <string>Apply Now</string> + </property> + </item> + <item> + <property name="text"> + <string>Force Temporarily</string> + </property> + </item> + <property name="name"> + <cstring>rule_shortcut</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + </widget> + <widget class="TQPushButton" row="9" column="5"> + <property name="name"> + <cstring>shortcut_edit</cstring> + </property> + <property name="text"> + <string>Edit...</string> + </property> + </widget> + <widget class="KRestrictedLine" row="9" column="2" rowspan="1" colspan="3"> + <property name="name"> + <cstring>shortcut</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + </widget> + </grid> + </widget> + <widget class="TQWidget"> + <property name="name"> + <cstring>TabPage</cstring> + </property> + <attribute name="title"> + <string>W&orkarounds</string> + </attribute> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="TQCheckBox" row="0" column="0"> + <property name="name"> + <cstring>enable_fsplevel</cstring> + </property> + <property name="text"> + <string>&Focus stealing prevention</string> + </property> + </widget> + <widget class="KComboBox" row="2" column="1"> + <item> + <property name="text"> + <string>Do Not Affect</string> + </property> + </item> + <item> + <property name="text"> + <string>Force</string> + </property> + </item> + <item> + <property name="text"> + <string>Force Temporarily</string> + </property> + </item> + <property name="name"> + <cstring>rule_type</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + </widget> + <widget class="KComboBox" row="2" column="3"> + <item> + <property name="text"> + <string>Normal Window</string> + </property> + </item> + <item> + <property name="text"> + <string>Dialog Window</string> + </property> + </item> + <item> + <property name="text"> + <string>Utility Window</string> + </property> + </item> + <item> + <property name="text"> + <string>Dock (panel)</string> + </property> + </item> + <item> + <property name="text"> + <string>Toolbar</string> + </property> + </item> + <item> + <property name="text"> + <string>Torn-Off Menu</string> + </property> + </item> + <item> + <property name="text"> + <string>Splash Screen</string> + </property> + </item> + <item> + <property name="text"> + <string>Desktop</string> + </property> + </item> + <item> + <property name="text"> + <string>Override Type</string> + </property> + </item> + <item> + <property name="text"> + <string>Standalone Menubar</string> + </property> + </item> + <property name="name"> + <cstring>type</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + </widget> + <widget class="KComboBox" row="1" column="3"> + <item> + <property name="text"> + <string>Opaque</string> + </property> + </item> + <item> + <property name="text"> + <string>Transparent</string> + </property> + </item> + <property name="name"> + <cstring>moveresizemode</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + </widget> + <widget class="TQCheckBox" row="2" column="0"> + <property name="name"> + <cstring>enable_type</cstring> + </property> + <property name="text"> + <string>Window &type</string> + </property> + </widget> + <widget class="TQCheckBox" row="1" column="0"> + <property name="name"> + <cstring>enable_moveresizemode</cstring> + </property> + <property name="text"> + <string>&Moving/resizing</string> + </property> + </widget> + <widget class="KComboBox" row="0" column="1"> + <item> + <property name="text"> + <string>Do Not Affect</string> + </property> + </item> + <item> + <property name="text"> + <string>Force</string> + </property> + </item> + <item> + <property name="text"> + <string>Force Temporarily</string> + </property> + </item> + <property name="name"> + <cstring>rule_fsplevel</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + </widget> + <widget class="KComboBox" row="1" column="1"> + <item> + <property name="text"> + <string>Do Not Affect</string> + </property> + </item> + <item> + <property name="text"> + <string>Force</string> + </property> + </item> + <item> + <property name="text"> + <string>Force Temporarily</string> + </property> + </item> + <property name="name"> + <cstring>rule_moveresizemode</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + </widget> + <widget class="KComboBox" row="0" column="3"> + <item> + <property name="text"> + <string>None</string> + </property> + </item> + <item> + <property name="text"> + <string>Low</string> + </property> + </item> + <item> + <property name="text"> + <string>Normal</string> + </property> + </item> + <item> + <property name="text"> + <string>High</string> + </property> + </item> + <item> + <property name="text"> + <string>Extreme</string> + </property> + </item> + <property name="name"> + <cstring>fsplevel</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + </widget> + <widget class="KRestrictedLine" row="5" column="3"> + <property name="name"> + <cstring>maxsize</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="validChars"> + <string>0123456789-+,xX:</string> + </property> + </widget> + <widget class="TQCheckBox" row="4" column="0"> + <property name="name"> + <cstring>enable_minsize</cstring> + </property> + <property name="text"> + <string>M&inimum size</string> + </property> + </widget> + <widget class="KComboBox" row="4" column="1"> + <item> + <property name="text"> + <string>Do Not Affect</string> + </property> + </item> + <item> + <property name="text"> + <string>Force</string> + </property> + </item> + <item> + <property name="text"> + <string>Force Temporarily</string> + </property> + </item> + <property name="name"> + <cstring>rule_minsize</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + </widget> + <widget class="TQCheckBox" row="5" column="0"> + <property name="name"> + <cstring>enable_maxsize</cstring> + </property> + <property name="text"> + <string>M&aximum size</string> + </property> + </widget> + <widget class="KRestrictedLine" row="4" column="3"> + <property name="name"> + <cstring>minsize</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="validChars"> + <string>0123456789-+,xX:</string> + </property> + </widget> + <widget class="KComboBox" row="5" column="1"> + <item> + <property name="text"> + <string>Do Not Affect</string> + </property> + </item> + <item> + <property name="text"> + <string>Force</string> + </property> + </item> + <item> + <property name="text"> + <string>Force Temporarily</string> + </property> + </item> + <property name="name"> + <cstring>rule_maxsize</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + </widget> + <widget class="TQCheckBox" row="3" column="0"> + <property name="name"> + <cstring>enable_ignoreposition</cstring> + </property> + <property name="text"> + <string>Ignore requested &geometry</string> + </property> + </widget> + <widget class="KComboBox" row="3" column="1"> + <item> + <property name="text"> + <string>Do Not Affect</string> + </property> + </item> + <item> + <property name="text"> + <string>Force</string> + </property> + </item> + <item> + <property name="text"> + <string>Force Temporarily</string> + </property> + </item> + <property name="name"> + <cstring>rule_ignoreposition</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + </widget> + <widget class="TQCheckBox" row="3" column="3"> + <property name="name"> + <cstring>ignoreposition</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="text"> + <string></string> + </property> + </widget> + <spacer row="8" column="2"> + <property name="name"> + <cstring>spacer35</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="tqsizeHint"> + <size> + <width>20</width> + <height>160</height> + </size> + </property> + </spacer> + <widget class="TQCheckBox" row="6" column="0"> + <property name="name"> + <cstring>enable_strictgeometry</cstring> + </property> + <property name="text"> + <string>Strictly obey geometry</string> + </property> + <property name="accel"> + <string></string> + </property> + </widget> + <widget class="KComboBox" row="6" column="1"> + <item> + <property name="text"> + <string>Do Not Affect</string> + </property> + </item> + <item> + <property name="text"> + <string>Force</string> + </property> + </item> + <item> + <property name="text"> + <string>Force Temporarily</string> + </property> + </item> + <property name="name"> + <cstring>rule_strictgeometry</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + </widget> + <widget class="TQCheckBox" row="6" column="3"> + <property name="name"> + <cstring>strictgeometry</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="text"> + <string></string> + </property> + </widget> + <widget class="TQCheckBox" row="7" column="3"> + <property name="name"> + <cstring>disableglobalshortcuts</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="text"> + <string></string> + </property> + </widget> + <widget class="TQCheckBox" row="7" column="0"> + <property name="name"> + <cstring>enable_disableglobalshortcuts</cstring> + </property> + <property name="text"> + <string>Block global shortcuts</string> + </property> + <property name="accel"> + <string></string> + </property> + </widget> + <widget class="KComboBox" row="7" column="1"> + <item> + <property name="text"> + <string>Do Not Affect</string> + </property> + </item> + <item> + <property name="text"> + <string>Force</string> + </property> + </item> + <item> + <property name="text"> + <string>Force Temporarily</string> + </property> + </item> + <property name="name"> + <cstring>rule_disableglobalshortcuts</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + </widget> + </grid> + </widget> + </widget> + </vbox> +</widget> +<customwidgets> +</customwidgets> +<connections> + <connection> + <sender>detect1</sender> + <signal>clicked()</signal> + <receiver>Form2</receiver> + <slot>detectClicked()</slot> + </connection> + <connection> + <sender>wmclass_match</sender> + <signal>activated(int)</signal> + <receiver>Form2</receiver> + <slot>wmclassMatchChanged()</slot> + </connection> + <connection> + <sender>role_match</sender> + <signal>activated(int)</signal> + <receiver>Form2</receiver> + <slot>roleMatchChanged()</slot> + </connection> + <connection> + <sender>title_match</sender> + <signal>activated(int)</signal> + <receiver>Form2</receiver> + <slot>titleMatchChanged()</slot> + </connection> + <connection> + <sender>extra_match</sender> + <signal>activated(int)</signal> + <receiver>Form2</receiver> + <slot>extraMatchChanged()</slot> + </connection> + <connection> + <sender>machine_match</sender> + <signal>activated(int)</signal> + <receiver>Form2</receiver> + <slot>machineMatchChanged()</slot> + </connection> + <connection> + <sender>shortcut_edit</sender> + <signal>clicked()</signal> + <receiver>Form2</receiver> + <slot>shortcutEditClicked()</slot> + </connection> +</connections> +<tabstops> + <tabstop>tabs</tabstop> + <tabstop>description</tabstop> + <tabstop>wmclass</tabstop> + <tabstop>whole_wmclass</tabstop> + <tabstop>wmclass_match</tabstop> + <tabstop>edit_reg_wmclass</tabstop> + <tabstop>role</tabstop> + <tabstop>role_match</tabstop> + <tabstop>edit_reg_role</tabstop> + <tabstop>detect1</tabstop> + <tabstop>types</tabstop> + <tabstop>title</tabstop> + <tabstop>title_match</tabstop> + <tabstop>edit_reg_title</tabstop> + <tabstop>extra</tabstop> + <tabstop>extra_match</tabstop> + <tabstop>edit_reg_extra</tabstop> + <tabstop>machine</tabstop> + <tabstop>machine_match</tabstop> + <tabstop>edit_reg_machine</tabstop> + <tabstop>enable_position</tabstop> + <tabstop>rule_position</tabstop> + <tabstop>position</tabstop> + <tabstop>enable_size</tabstop> + <tabstop>rule_size</tabstop> + <tabstop>size</tabstop> + <tabstop>enable_maximizehoriz</tabstop> + <tabstop>rule_maximizehoriz</tabstop> + <tabstop>maximizehoriz</tabstop> + <tabstop>enable_maximizevert</tabstop> + <tabstop>rule_maximizevert</tabstop> + <tabstop>maximizevert</tabstop> + <tabstop>enable_fullscreen</tabstop> + <tabstop>rule_fullscreen</tabstop> + <tabstop>fullscreen</tabstop> + <tabstop>enable_desktop</tabstop> + <tabstop>rule_desktop</tabstop> + <tabstop>desktop</tabstop> + <tabstop>enable_minimize</tabstop> + <tabstop>rule_minimize</tabstop> + <tabstop>minimize</tabstop> + <tabstop>enable_shade</tabstop> + <tabstop>rule_shade</tabstop> + <tabstop>shade</tabstop> + <tabstop>enable_placement</tabstop> + <tabstop>rule_placement</tabstop> + <tabstop>placement</tabstop> + <tabstop>enable_above</tabstop> + <tabstop>rule_above</tabstop> + <tabstop>above</tabstop> + <tabstop>enable_below</tabstop> + <tabstop>rule_below</tabstop> + <tabstop>below</tabstop> + <tabstop>enable_noborder</tabstop> + <tabstop>rule_noborder</tabstop> + <tabstop>noborder</tabstop> + <tabstop>enable_skiptaskbar</tabstop> + <tabstop>rule_skiptaskbar</tabstop> + <tabstop>skiptaskbar</tabstop> + <tabstop>enable_skippager</tabstop> + <tabstop>rule_skippager</tabstop> + <tabstop>skippager</tabstop> + <tabstop>enable_acceptfocus</tabstop> + <tabstop>rule_acceptfocus</tabstop> + <tabstop>acceptfocus</tabstop> + <tabstop>enable_closeable</tabstop> + <tabstop>rule_closeable</tabstop> + <tabstop>closeable</tabstop> + <tabstop>enable_opacityactive</tabstop> + <tabstop>rule_opacityactive</tabstop> + <tabstop>opacityactive</tabstop> + <tabstop>enable_opacityinactive</tabstop> + <tabstop>rule_opacityinactive</tabstop> + <tabstop>opacityinactive</tabstop> + <tabstop>enable_shortcut</tabstop> + <tabstop>rule_shortcut</tabstop> + <tabstop>shortcut</tabstop> + <tabstop>shortcut_edit</tabstop> + <tabstop>enable_fsplevel</tabstop> + <tabstop>rule_fsplevel</tabstop> + <tabstop>fsplevel</tabstop> + <tabstop>enable_moveresizemode</tabstop> + <tabstop>rule_moveresizemode</tabstop> + <tabstop>moveresizemode</tabstop> + <tabstop>enable_type</tabstop> + <tabstop>rule_type</tabstop> + <tabstop>type</tabstop> + <tabstop>enable_ignoreposition</tabstop> + <tabstop>rule_ignoreposition</tabstop> + <tabstop>ignoreposition</tabstop> + <tabstop>enable_minsize</tabstop> + <tabstop>rule_minsize</tabstop> + <tabstop>minsize</tabstop> + <tabstop>enable_maxsize</tabstop> + <tabstop>rule_maxsize</tabstop> + <tabstop>maxsize</tabstop> + <tabstop>enable_strictgeometry</tabstop> + <tabstop>rule_strictgeometry</tabstop> + <tabstop>strictgeometry</tabstop> + <tabstop>enable_disableglobalshortcuts</tabstop> + <tabstop>rule_disableglobalshortcuts</tabstop> + <tabstop>disableglobalshortcuts</tabstop> +</tabstops> +<Q_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> + <slot access="protected" specifier="pure virtual">titleMatchChanged()</slot> + <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> +<layoutdefaults spacing="6" margin="11"/> +<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/> +<includehints> + <includehint>kcombobox.h</includehint> + <includehint>kpushbutton.h</includehint> + <includehint>kcombobox.h</includehint> + <includehint>kpushbutton.h</includehint> + <includehint>kpushbutton.h</includehint> + <includehint>klistbox.h</includehint> + <includehint>kcombobox.h</includehint> + <includehint>kpushbutton.h</includehint> + <includehint>kcombobox.h</includehint> + <includehint>kpushbutton.h</includehint> + <includehint>kcombobox.h</includehint> + <includehint>kpushbutton.h</includehint> + <includehint>kcombobox.h</includehint> + <includehint>krestrictedline.h</includehint> + <includehint>krestrictedline.h</includehint> + <includehint>kcombobox.h</includehint> + <includehint>kcombobox.h</includehint> + <includehint>kcombobox.h</includehint> + <includehint>kcombobox.h</includehint> + <includehint>kcombobox.h</includehint> + <includehint>kcombobox.h</includehint> + <includehint>kcombobox.h</includehint> + <includehint>kcombobox.h</includehint> + <includehint>kcombobox.h</includehint> + <includehint>kcombobox.h</includehint> + <includehint>kcombobox.h</includehint> + <includehint>krestrictedline.h</includehint> + <includehint>kcombobox.h</includehint> + <includehint>kcombobox.h</includehint> + <includehint>kcombobox.h</includehint> + <includehint>kcombobox.h</includehint> + <includehint>kcombobox.h</includehint> + <includehint>kcombobox.h</includehint> + <includehint>kcombobox.h</includehint> + <includehint>kcombobox.h</includehint> + <includehint>krestrictedline.h</includehint> + <includehint>kcombobox.h</includehint> + <includehint>krestrictedline.h</includehint> + <includehint>kcombobox.h</includehint> + <includehint>kcombobox.h</includehint> + <includehint>kcombobox.h</includehint> + <includehint>kcombobox.h</includehint> + <includehint>kcombobox.h</includehint> + <includehint>kcombobox.h</includehint> + <includehint>krestrictedline.h</includehint> + <includehint>kcombobox.h</includehint> + <includehint>krestrictedline.h</includehint> + <includehint>kcombobox.h</includehint> + <includehint>kcombobox.h</includehint> + <includehint>kcombobox.h</includehint> + <includehint>kcombobox.h</includehint> +</includehints> +</UI> diff --git a/twin/kcmtwin/twinrules/twinrules.desktop b/twin/kcmtwin/twinrules/twinrules.desktop new file mode 100644 index 000000000..9d82ea38a --- /dev/null +++ b/twin/kcmtwin/twinrules/twinrules.desktop @@ -0,0 +1,209 @@ +[Desktop Entry] +Icon=kcmkwm +Type=Application +Exec=kcmshell twinrules +DocPath=kcontrol/windowmanagement/index.html + +X-KDE-ModuleType=Library +X-KDE-Library=twinrules +X-KDE-FactoryName=twinrules + +Name=Window-Specific Settings +Name[af]=Venser spesifike Instellings +Name[ar]=تعيينات خاصة بالنوافذ +Name[be]=Настаўленні для асобных вокнаў +Name[bg]=Специфични прозорци +Name[bn]=উইণ্ডো-প্রতি সেটিংস +Name[bs]=Postavke specifične za ovaj prozor +Name[ca]=Arranjament específic de finestra +Name[cs]=Specifická nastavení oken +Name[csb]=Nastôw specyficzny dlô òkna +Name[cy]=Gosodiadau sy'n Benodol i'r Ffenestr +Name[da]=Vinduesspecifik opsætning +Name[de]=Fensterspezifische Einstellungen +Name[el]=Ρυθμίσεις σχετικές με παράθυρα +Name[eo]=Apartafenestraj Agordoj +Name[es]=Preferencias específicas de la ventana +Name[et]=Akende seadistused +Name[eu]=Leihoen ezarpen espezifikoak +Name[fa]=تنظیمات مشخص پنجره +Name[fi]=Ikkunakohtaiset asetukset +Name[fr]=Paramètres spécifiques à la fenêtre +Name[fy]=Finsterspesifike ynstellings +Name[gl]=Opcións específicas da fiestra +Name[he]=הגדרות חלונות ספציפיות +Name[hi]=विशिष्ट-विंडो विन्यास +Name[hr]=Postavke za prozor +Name[hu]=Egyedi ablakbeállítások +Name[is]=Stillingar einstakra glugga +Name[it]=Impostazioni specifiche della finestra +Name[ja]=ウィンドウ固有の設定 +Name[ka]=ფანჯრის განსაკუთრებული პარამეტრები +Name[kk]=Терезенің ерекше параметрлері +Name[km]=ការកំណត់សម្រាប់បង្អួច +Name[ko]=창 지정 +Name[lt]=Nuo lango priklausantys nustatymai +Name[lv]=Specifiski logu parametri +Name[mk]=Поставувања по прозорец +Name[nb]=Innstillinger for vinduer +Name[nds]=Instellen för enkelte Finstern +Name[ne]=सञ्झ्याल निर्दिष्ट सेटिङ +Name[nl]=Vensterspecifieke instellingen +Name[nn]=Instillingar for vindauge +Name[pa]=ਝਰੋਖਾ-ਖਾਸ ਸਥਾਪਨ +Name[pl]=Ustawienia danego okna +Name[pt]=Opções Específicas da Janela +Name[pt_BR]=Configurações Específicas da Janela +Name[ro]=Setări specifice fereastră +Name[ru]=Особые параметры окна +Name[rw]=Amagenamiterere y'Idirishya-Ryihariye +Name[se]=Láseheivehusat +Name[sk]=Špecifické nastavenia okna +Name[sl]=Nastavitve glede na okno +Name[sr]=Посебне поставке за прозоре +Name[sr@Latn]=Posebne postavke za prozore +Name[sv]=Fönsterspecifika inställningar +Name[ta]=சாளர-குறிப்பிடும் அமைப்புகள் +Name[th]=ตั้งค่าเกี่ยวกับหน้าต่างโดยเฉพาะ +Name[tr]=Pencereye Özel Seçenekler +Name[tt]=Täräzägä-Bäyle Caylawlar +Name[uk]=Параметри для окремих вікон +Name[uz]=Oynaga oid moslamalar +Name[uz@cyrillic]=Ойнага оид мосламалар +Name[vi]=Thiết lập Danh riêng cho Cửa sổ +Name[wa]=Apontiaedjes specifikes a-z on purnea +Name[zh_CN]=特定窗口的设置 +Name[zh_TW]=特定視窗設定 + +Comment=Configure settings specifically for a window +Comment[af]=Stel spesifieke venster instellings op +Comment[ar]=إعداد التعيينات الخاصة بنافذة +Comment[be]=Настаўленні для кожнага вакна асабіста +Comment[bg]=Настройване на специфични особености за отделните прозорци +Comment[bn]=শুধুমাত্র এই বিশেষ উইণ্ডো-টির সেটিংস কনফিগার করুন +Comment[bs]=Podesite postavke specifične za ovaj prozor +Comment[ca]=Configura l'arranjament específicament per a una finestra +Comment[cs]=Nastavení specifická pro okno +Comment[csb]=Kònfigùracëjô nastôwów specyficznëch dlô wëbrónegò òkna +Comment[cy]=Ffurfweddu gosodiadau yn benodol ar gyfer ffenestr +Comment[da]=Indstil opsætning specifikt for et vindue +Comment[de]=Einstellungen für einzelne Fenster vornehmen +Comment[el]=Ρυθμίσεις σχετικές ειδικά με Ένα Παράθυρο +Comment[eo]=Agordi nur por tiu fenestro +Comment[es]=Configurar parámetros específicos de una ventana +Comment[et]=Spetsiaalselt akendega seotud seadistused +Comment[eu]=Konfiguratu leiho jakin baten ezarpenak +Comment[fa]=پیکربندی تنظیمات برای پنجره به طور ویژه +Comment[fi]=Muokkaa ikkunakohtaisia asetuksia +Comment[fr]=Configuration de paramètres spécifiques à une fenêtre +Comment[fy]=Hjir kinne jo ynstellings kieze spesifyk foar ien finster +Comment[ga]=Cumraigh na socruithe le haghaidh fuinneoige ar leith +Comment[gl]=Configuración das opcións específicas para unha fiestra +Comment[he]=קבע הגדרות לחלון מסוים +Comment[hi]=किसी खास विंडो के लिए विन्यास कॉन्फ़िगर करें +Comment[hr]=Konfiguriranje određenih postavki za prozor +Comment[hu]=Egy adott ablak beállításai +Comment[is]=Stillingar sem varða tiltekinn glugga +Comment[it]=Configura le impostazioni specifiche di una finestra +Comment[ja]=特定のウィンドウに固有の設定を行います +Comment[ka]=ფანჯრის განსაკუთრებული პარამეტრების კონფიგურაცია +Comment[kk]=Терезенің ерекше параметрлерін баптау +Comment[km]=កំណត់រចនាសម្ព័ន្ធការកំណត់ពិសេសសម្រាប់បង្អួចមួយ +Comment[ko]=창마다의 개별 설정 +Comment[lt]=Čia galite konfigūruoti konkretaus lango nustatymus +Comment[lv]=Konfigurē parametrus priekš speciāla loga +Comment[mk]=Конфигурирајте ги поставувањата за поодделни прозорци +Comment[mt]=Ikkonfigura setings li jistgħu itejbu l-veloċità ta' KDE +Comment[nb]=Innstillinger som er knyttet til et spesielt vindu +Comment[nds]=Instellen för enkelte Finstern +Comment[ne]=सञ्झ्यालका लागि निर्दिष्ट तरिकाले सेटिङ कन्फिगर गर्नुहोस् +Comment[nl]=Hier kunt u instellingen kiezen specifiek voor één venster +Comment[nn]=Innstillingar som er knytte til eitt særskilt vindauge +Comment[pa]=ਇੱਕ ਝਰੋਖੇ ਲਈ ਖਾਸ ਸਥਾਪਨ ਸੰਰਚਨਾ +Comment[pl]=Konfiguracja ustawień wybranego okna +Comment[pt]=Configura as opções especificamente para uma janela +Comment[pt_BR]=Configurações específicas para uma janela +Comment[ro]=Configurează setări specifice anumitor ferestre +Comment[ru]=Настройка особых параметров окна +Comment[rw]=Kuboneza Amagenamiterere mu buryo bwihariye bw'idirishya +Comment[se]=Heivehusat erenoamáš láse várás +Comment[sk]=Nastavenie pre jednotlivé okná +Comment[sl]=Nastavite možnosti glede na posamezno okno +Comment[sr]=Подешавање поставки посебно за прозор +Comment[sr@Latn]=Podešavanje postavki posebno za prozor +Comment[sv]=Anpassa inställningar specifikt för ett fönster +Comment[ta]=KDE செயல்திறனை அதிகப்படுத்தும் அமைப்புகளை அமை +Comment[th]=ปรับแต่งค่าต่างๆ ที่เกี่ยวกับหน้าต่างโดยเฉพาะ +Comment[tr]=Bir pencere için özel olan seçenekleri yapılandır +Comment[tt]=Täräzä öçen ayırım caylawlar +Comment[uk]=Налаштування параметрів для окремого типу вікон +Comment[uz]=Oynaga oid boʻlgan moslamalarni moslash +Comment[uz@cyrillic]=Ойнага оид бўлган мосламаларни мослаш +Comment[vi]=Thiết lập cài đặt dành riêng cho cửa sổ +Comment[wa]=Apontiaedjes specifikes po-z on purnea +Comment[zh_CN]=配置一个窗口的设置 +Comment[zh_TW]=設定特定視窗設定值 + +Keywords=size,position,state,window behavior,windows,specific,workarounds,remember,rules +Keywords[ar]=القياس,الموضع,الحالة,سلوك النافذة,نوافذ,خاص,تدكر,قواعد,معاملات +Keywords[be]=Памер,Пазіцыя,Стан,Паводзіны акна,Вокны,Акно,Спецыфічныя,Запомніць,Правілы,size,position,state,window behavior,windows,specific,workarounds,remember,rules +Keywords[bg]=размер, позиция, състояние, прозорец, поведение,правила, запомняне,size,position,state,window behavior,windows,specific,workarounds,remember,rules +Keywords[bs]=size,position,state,window behavior,windows,specific,workarounds,remember,rules,veličina,položaj,ponašanje prozora,prozori,specifično,pravila +Keywords[ca]=mida,posició,estat,comportament de finestra,finestres,específic,reparacions,recorda,regles +Keywords[cs]=velikost,pozice,umístění,stav,chování oken,pravidla +Keywords[csb]=miara,pòłożenié,stón,ùchòwanié òknół,òkna,spamiãtanié nastôwów,zapamiãtanié nastôwów,regle +Keywords[cy]=maint,lleoliad,cyflwr,ffenestr,ymddygiad,ffenestri,penodol,ffyrdd osgoi,cofio,rheolau +Keywords[da]=størrelse,position,tilstand,vinduesopførsel,vinduer,specifik, omgåelse,husk,regler +Keywords[de]=Größe,Position,Status,Fensterverhalten,Fenster,Regeln +Keywords[el]=μέγεθος,θέση,κατάσταση,συμπεριφορά παραθύρου,παράθυρα,ειδικές,λύσεις,αποθήκευση,κανόνων +Keywords[en_GB]=size,position,state,window behaviour,windows,specific,workarounds,remember,rules +Keywords[eo]=grandeco,pozicio,stato,fenestra konduto,fenestroj,reguloj +Keywords[es]=tamaño,posición,estado,comportamiento de la ventana,ventanas,específico,soluciones,recordar,reglas +Keywords[et]=suurus,asend,olek,akna käitumine,aknad,spetsiaalne,kohandamine,reeglid +Keywords[eu]=neurria,kokapena,egoera,leihoaren portaera,leihoak,espezifikoa,konponbideak,gogoratu,arauak +Keywords[fa]=اندازه، موقعیت، وضعیت، رفتار پنجره، پنجرهها، مشخص، workarounds، یادآوری، قواعد +Keywords[fi]=koko,sijainti,tila,ikkunan käyttäytyminen,ikkunat,ikkunakohtainen,säännöt +Keywords[fr]=taille,position,état,comportement de fenêtre,fenêtres,spécifique,astuces,souvenir,règles +Keywords[fy]=grootte,grutte,positie,posysje,venstergedrag,finstergedrach,vensters,finsters,specifiek,spesifyk,alternatieven,alternativen,onthouden,ûnthâlde,regels +Keywords[ga]=méid,ionad,staid,oibriú na bhfuinneog,fuinneoga,sainiúil,réitigh seiftithe,meabhraigh,rialacha +Keywords[gl]=tamaño,posición,estado,comportamento da fiestra,fiestras,específico,lembrar,reglas +Keywords[he]=גודל, מיקום, מצב, חלון, התנהגות, חלונות, אישית, זכור, חוקים, size,position,state,window behavior,windows,specific,workarounds,remember,rules +Keywords[hi]=आकार,स्थान,स्थिति,विंडो व्यवहार,विंडोज़,विशिष्ट,कार्य-विकल्प,याददाश्त,नियम +Keywords[hr]=size,position,state,window behavior,windows,specific,workarounds,remember,rules,veličina,položaj,smještaj,stanje,ponašanje prozora,prozori,rješenja,zapamti,upamti,pravila +Keywords[hu]=méret,pozíció,állapot,ablakműködés,ablakok,specifikus,megjegyzés,szabályok +Keywords[id]=ukuran,posisi,status,perilaku jendela,jendela, spesifik,solusi,remember,aturan +Keywords[it]=dimensione,posizione,stato,comportamento finestra,finestre,specifico,ricorda,regole +Keywords[ja]=サイズ,位置,状態,ウィンドウの挙動,windows,特定,ワークアラウンド,記憶,ルール +Keywords[km]=ទំហំ,ទីតាំង,សភាព,ឥរិយាបថបង្អួច បង្អួចs ជាក់លាក់c ចងចាំr ច្បាប់s +Keywords[lt]=size,position,state,window behavior,windows,specific,workarounds,remember,rules,dydis,pozicija,būsena,lango eelgesys,langai,atsiminti,taisyklės +Keywords[lv]=izmērs,novietojums,statuss,loga izturēšanās,logi,specifisks,apjājiens,atcerēties,noteikumi +Keywords[mk]=size,position,state,window behavior,windows,specific,workarounds,remember,rules,големина,позиција,состојба,однесување на прозорец,специфично,заобиколни +Keywords[mt]=size,position,state,window behavior,windows,specific,workarounds,remember,rules,daqs +Keywords[nb]=størrelse,posisjon,status,vindusoppførsel,vinduer,spesifikk,jukseløsninger,husk,regler +Keywords[nds]=Grött,Positschoon,Status,Finsterbedregen,Finstern,enkel,enkelte,Regeln,behollen,workaround +Keywords[ne]=साइज, स्थिति, अवस्था, सञ्झ्याल व्यवहार, सञ्झ्यालहरू, निर्दिष्ट, कार्यक्षेत्र, याद गर्नुहोस्, नियम +Keywords[nl]=grootte,positie,venstergedrag,vensters,specifiek,alternatieven,onthouden,regels +Keywords[nn]=storleik,plassering,tilstand,vindaugsåtferd,vindauge,spesifikk,jukseløysingar,hugs,reglar +Keywords[pa]=ਅਕਾਰ,ਸਥਿਤੀ,ਝਰੋਖਾ ਵਿਵਹਾਰ,ਝਰੋਖੇ,ਖਾਸ,ਯਾਦ ਰੱਖੋ,ਨਿਯਮ +Keywords[pl]=rozmiar,położenie,stan,zachowanie okien,okna,zapamiętywanie ustawień,reguły +Keywords[pt]=tamanho,posição,estado,comportamento da janela,janelas,específico,recordar,regras +Keywords[pt_BR]=tamanho,posição, estado, comportamento da janela, janelas, específica, elementos, lembrar, regras +Keywords[ro]=mărime,poziție,stare,comportament fereastră,ferestre,specific,reguli +Keywords[rw]=Ingano,Ibirindiro,leta, imyitwarire y'idirishya,amadirishya,byihariye, amakorahafi,kwibuka,amategeko +Keywords[se]=sturrodat,sajádat,dilli,láseláhtten,láset,erenoamáš,fillenčovdosat,muitte,njuolggadusat +Keywords[sk]=veľkosť,pozícia,stav,správanie okna,okná,špecifické,jedno okno,opravy,pravidlá +Keywords[sl]=velikost,položaj,stanje,obnašanje okna,okna,posebno,obvoz,zapomni,pravila +Keywords[sr]=величина,позиција,стање,понашање прозора,прозори,запамти,правила +Keywords[sr@Latn]=veličina,pozicija,stanje,ponašanje prozora,prozori,zapamti,pravila +Keywords[sv]=storlek,position,tillstånd,fönsterbeteende,fönster,specifik,komma runt,komma ihåg,regler +Keywords[ta]=அளவு,நிலை,மாநிலம்,சாளர நடத்தை,சாளரங்கள்,குறிப்பிட்ட,பணிவட்டாரங்கள்,விதிகள் +Keywords[th]=ขนาด,ตำแหน่ง,สถานะ,พฤติกรรมหน้าต่าง,หน้าต่าง,โดยเฉพาะ,หารอบๆ,จำ,กฎ +Keywords[tr]=boyut,yer,pozisyon,durum,pencere davranışı,pencereler,özel,çalışma alanı,hatırla,kurallar +Keywords[uk]=розмір,позиція,стан,поведінка вікна,вікна,окремі,підігнати,запам'ятати,правила +Keywords[uz]=oʻlcham,joy,holat,oynaning xususiyatlari,oynalar,maxsus,eslab qolish,qoidalar +Keywords[uz@cyrillic]=ўлчам,жой,ҳолат,ойнанинг хусусиятлари,ойналар,махсус,эслаб қолиш,қоидалар +Keywords[vi]=kích cỡ,vị trí,trạng thái,ứng xử cửa sổ,cửa sổ,dành riêng,cách chữa chạy,nhớ,quy tắc +Keywords[wa]=grandeu,plaece,estat,estance,dujhance des purneas,purneas,specifike,workarounds,remember,rîles,sovni,sovnance +Keywords[zh_CN]=size,position,state,window behavior,windows,specific,workarounds,remember,rules,大小,位置,状态,窗口行为,窗口,特定,工作区,记住,规则 +Keywords[zh_TW]=size,position,state,window behavior,windows,specific,workarounds,remember,rules,大小,位置,狀態,視窗行為,視窗,指定,記憶,規則 +Categories=Qt;KDE;X-KDE-settings-desktop; diff --git a/twin/kcmtwin/twinrules/twinsrc.cpp b/twin/kcmtwin/twinrules/twinsrc.cpp new file mode 100644 index 000000000..fb901efb6 --- /dev/null +++ b/twin/kcmtwin/twinrules/twinsrc.cpp @@ -0,0 +1,8 @@ +// Include some code from twin core in order to avoid +// double implementation. + +#include "ruleslist.h" +#include "../../rules.cpp" +#include "../../placement.cpp" +#include "../../options.cpp" +#include "../../utils.cpp" |