diff options
Diffstat (limited to 'kwin/clients/test')
-rw-r--r-- | kwin/clients/test/Makefile.am | 15 | ||||
-rw-r--r-- | kwin/clients/test/test.cpp | 343 | ||||
-rw-r--r-- | kwin/clients/test/test.desktop | 67 | ||||
-rw-r--r-- | kwin/clients/test/test.h | 49 |
4 files changed, 0 insertions, 474 deletions
diff --git a/kwin/clients/test/Makefile.am b/kwin/clients/test/Makefile.am deleted file mode 100644 index 07ac72c02..000000000 --- a/kwin/clients/test/Makefile.am +++ /dev/null @@ -1,15 +0,0 @@ -INCLUDES = -I$(srcdir)/../../lib $(all_includes) - -kde_module_LTLIBRARIES = twin3_test.la - -twin3_test_la_SOURCES = test.cpp -twin3_test_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module -twin3_test_la_LIBADD = $(LIB_TDEUI) ../../lib/libtdecorations.la -#twin_keramik_la_LDFLAGS = $(all_libraries) -avoid-version -module $(KDE_RPATH) $(KDE_MT_LDFLAGS) - -METASOURCES = AUTO - -twin_test_lnkdir = $(kde_datadir)/twin -twin_test_lnk_DATA = test.desktop - -EXTRA_DIST = $(twin_test_lnk_DATA) diff --git a/kwin/clients/test/test.cpp b/kwin/clients/test/test.cpp deleted file mode 100644 index 02fd5b1d3..000000000 --- a/kwin/clients/test/test.cpp +++ /dev/null @@ -1,343 +0,0 @@ -#include "test.h" - -#include <tqtooltip.h> -#include <kglobal.h> -#include <kdebug.h> - -namespace KWinTest -{ - -Decoration::Decoration( KDecorationBridge* bridge, KDecorationFactory* factory ) - : KDecoration( bridge, factory ), - button( NULL ) - { - } - -void Decoration::init() - { - createMainWidget(); - widget()->setEraseColor( red ); - widget()->installEventFilter( this ); - if( isCloseable()) - { - button = new TQPushButton( widget()); - button->show(); - button->setCursor( tqarrowCursor ); - button->move( 0, 0 ); - connect( button, TQT_SIGNAL( clicked()), TQT_SLOT( closeWindow())); - TQToolTip::add( button, "Zelva Mana" ); - } - } - -Decoration::MousePosition Decoration::mousePosition( const TQPoint& p ) const - { - const int range = 16; - const int border = 4; - - MousePosition m = Nowhere; - - int width = widget()->width(); - int height = widget()->height(); - if ( ( p.x() > border && p.x() < width - border ) - && ( p.y() > border && p.y() < height - border ) ) - return Center; - - if ( p.y() <= range && p.x() <= range) - m = TopLeft2; - else if ( p.y() >= height-range && p.x() >= width-range) - m = BottomRight2; - else if ( p.y() >= height-range && p.x() <= range) - m = BottomLeft2; - else if ( p.y() <= range && p.x() >= width-range) - m = TopRight2; - else if ( p.y() <= border ) - m = Top; - else if ( p.y() >= height-border ) - m = Bottom; - else if ( p.x() <= border ) - m = Left; - else if ( p.x() >= width-border ) - m = Right; - else - m = Center; - return m; - } - -void Decoration::borders( int& left, int& right, int& top, int& bottom ) const - { - if( options()->preferredBorderSize( factory()) == BorderTiny ) - { - left = right = bottom = 1; - top = 5; - } - else - { - left = right = options()->preferredBorderSize( factory()) * 5; - top = options()->preferredBorderSize( factory()) * 10; - bottom = options()->preferredBorderSize( factory()) * 2; - } - if( isShade()) - bottom = 0; - if( ( maximizeMode() & MaximizeHorizontal ) && !options()->moveResizeMaximizedWindows()) - left = right = 0; - if( ( maximizeMode() & MaximizeVertical ) && !options()->moveResizeMaximizedWindows()) - bottom = 0; - } - -void Decoration::reset( unsigned long ) - { - } - -void Decoration::resize( const TQSize& s ) - { - widget()->resize( s ); - } - -TQSize Decoration::tqminimumSize() const - { - return TQSize( 100, 50 ); - } - -bool Decoration::eventFilter( TQObject* o, TQEvent* e ) - { - if( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(widget())) - { - switch( e->type()) - { - case TQEvent::MouseButtonPress: - { // FRAME - processMousePressEvent( TQT_TQMOUSEEVENT( e )); - return true; - } - case TQEvent::Show: - break; - case TQEvent::Hide: - break; - default: - break; - } - } - return false; - } - -} -#include <tqapplication.h> -#include <tqpainter.h> -#include <X11/Xlib.h> -#include <math.h> -#include <unistd.h> -namespace KWinTest -{ - -// taken from riscos -bool Decoration::animateMinimize(bool iconify) -{ - int style = 1; - switch (style) { - - case 1: - { - // Double twisting double back, with pike ;) - - if (!iconify) // No animation for restore. - return true; - - // Go away quick. - helperShowHide( false ); - tqApp->syncX(); - - TQRect r = iconGeometry(); - - if (!r.isValid()) - return true; - - // Algorithm taken from Window Maker (http://www.windowmaker.org) - - int sx = geometry().x(); - int sy = geometry().y(); - int sw = width(); - int sh = height(); - int dx = r.x(); - int dy = r.y(); - int dw = r.width(); - int dh = r.height(); - - double steps = 12; - - double xstep = double((dx-sx)/steps); - double ystep = double((dy-sy)/steps); - double wstep = double((dw-sw)/steps); - double hstep = double((dh-sh)/steps); - - double cx = sx; - double cy = sy; - double cw = sw; - double ch = sh; - - double finalAngle = 3.14159265358979323846; - - double delta = finalAngle / steps; - - TQPainter p( workspaceWidget()); - p.setRasterOp(TQt::NotROP); - - for (double angle = 0; ; angle += delta) { - - if (angle > finalAngle) - angle = finalAngle; - - double dx = (cw / 10) - ((cw / 5) * sin(angle)); - double dch = (ch / 2) * cos(angle); - double midy = cy + (ch / 2); - - TQPoint p1(int(cx + dx), int(midy - dch)); - TQPoint p2(int(cx + cw - dx), p1.y()); - TQPoint p3(int(cx + dw + dx), int(midy + dch)); - TQPoint p4(int(cx - dx), p3.y()); - - grabXServer(); - - p.drawLine(p1, p2); - p.drawLine(p2, p3); - p.drawLine(p3, p4); - p.drawLine(p4, p1); - - p.flush(); - - usleep(500); - - p.drawLine(p1, p2); - p.drawLine(p2, p3); - p.drawLine(p3, p4); - p.drawLine(p4, p1); - - ungrabXServer(); - -// FRAME tqApp->processEvents(); // FRAME ??? - - cx += xstep; - cy += ystep; - cw += wstep; - ch += hstep; - - if (angle >= finalAngle) - break; - } - } - break; - - case 2: - { - // KVirc style ? Maybe. For qwertz. - - if (!iconify) // No animation for restore. - return true; - - // Go away quick. - helperShowHide( false ); - - tqApp->syncX(); - - int stepCount = 12; - - TQRect r(geometry()); - - int dx = r.width() / (stepCount * 2); - int dy = r.height() / (stepCount * 2); - - TQPainter p( workspaceWidget()); - p.setRasterOp(TQt::NotROP); - - for (int step = 0; step < stepCount; step++) { - - r.moveBy(dx, dy); - r.setWidth(r.width() - 2 * dx); - r.setHeight(r.height() - 2 * dy); - - grabXServer(); - - p.drawRect(r); - p.flush(); - usleep(200); - p.drawRect(r); - - ungrabXServer(); - -// FRAME tqApp->processEvents(); - } - } - break; - - - default: - { - TQRect icongeom = iconGeometry(); - - if (!icongeom.isValid()) - return true; - - TQRect wingeom = geometry(); - - TQPainter p( workspaceWidget()); - - p.setRasterOp(TQt::NotROP); - -#if 0 - if (iconify) - p.setClipRegion( - TQRegion( workspaceWidget()->rect()) - wingeom - ); -#endif - - grabXServer(); - - p.drawLine(wingeom.bottomRight(), icongeom.bottomRight()); - p.drawLine(wingeom.bottomLeft(), icongeom.bottomLeft()); - p.drawLine(wingeom.topLeft(), icongeom.topLeft()); - p.drawLine(wingeom.topRight(), icongeom.topRight()); - - p.flush(); - - tqApp->syncX(); - - usleep(30000); - - p.drawLine(wingeom.bottomRight(), icongeom.bottomRight()); - p.drawLine(wingeom.bottomLeft(), icongeom.bottomLeft()); - p.drawLine(wingeom.topLeft(), icongeom.topLeft()); - p.drawLine(wingeom.topRight(), icongeom.topRight()); - - ungrabXServer(); - } - break; - } - return true; -} - -KDecoration* Factory::createDecoration( KDecorationBridge* bridge ) - { - NET::WindowType type = windowType( SUPPORTED_WINDOW_TYPES_MASK, bridge ); - if( type == NET::Dialog ) - ; - return new Decoration( bridge, this ); - } - -bool Factory::reset( unsigned long changed ) - { - resetDecorations( changed ); - return false; - } - -} // namespace - -extern "C" -{ - -KDE_EXPORT KDecorationFactory *create_factory() - { - return new KWinTest::Factory(); - } - -} - -#include "test.moc" diff --git a/kwin/clients/test/test.desktop b/kwin/clients/test/test.desktop deleted file mode 100644 index c6cd1e8fa..000000000 --- a/kwin/clients/test/test.desktop +++ /dev/null @@ -1,67 +0,0 @@ -[Desktop Entry] -Name=KWin test -Name[af]=KWin toets -Name[ar]=اختبار KWin -Name[az]=KWin sınağı -Name[be]=Тэст KWin -Name[bn]=Kwin পরীক্ষা -Name[ca]=Test de KWin -Name[csb]=Test KWin -Name[cy]=arbrawf KWin -Name[da]=KWin-test -Name[de]=KWin-Test -Name[el]=KWin τεστ -Name[eo]=Testo de KDE-fenestroadministrilo -Name[es]=Prueba de KWin -Name[eu]=KWin froga -Name[fa]=آزمون KWin -Name[fi]=KWin-testi -Name[fr]=Test de KWin -Name[ga]=Tástáil KWim -Name[gl]=Proba de KWin -Name[he]=ניסיון KWin -Name[hi]=के-विन जांच -Name[hr]=KWina proba -Name[hu]=KWin-teszt -Name[is]=KWin prófun -Name[it]=Prova KWin -Name[ja]=KWin テスト -Name[ka]=KWin შემოწმება -Name[kk]=KWin сынауы -Name[km]=សាកល្បង KWin -Name[ko]=KWin 테스트 -Name[lt]=KWin patikrinimas -Name[lv]=KWin tests -Name[mk]=Тест за KWin -Name[mn]=KWin шалгалт -Name[ms]=Ujian KWin -Name[nds]=KWin-Test -Name[ne]=के विन परीक्षण -Name[nn]=KWin-test -Name[pa]=KWin ਜਾਂਚ -Name[pl]=Test KWin -Name[pt]=Teste do KWin -Name[pt_BR]=Teste do KWin -Name[ro]=Test KWin -Name[ru]=Проверка KWin -Name[rw]= Isuzuma rya KWin -Name[se]=KWin-geahččaleapmi -Name[sk]=Test KWin -Name[sl]=Preizkus KWin -Name[sr]=Проба KWin-а -Name[sr@Latn]=Proba KWin-a -Name[sv]=Kwin-test -Name[ta]=KWin சோதனை -Name[te]=కెవిన్ పరిక్ష -Name[tg]=Тафтиши KWin -Name[th]=ทดสอบ KWin -Name[tr]=KWin Testi -Name[tt]=KWin sınaw -Name[uk]=Тест KWin -Name[uz]=KWin sinash -Name[uz@cyrillic]=KWin синаш -Name[vi]=Thử KWin -Name[wa]=Saye KPurnea -Name[zh_CN]=KWin 测试 -Name[zh_TW]=KWin 測試 -X-KDE-Library=twin3_test diff --git a/kwin/clients/test/test.h b/kwin/clients/test/test.h deleted file mode 100644 index e1d3d51a6..000000000 --- a/kwin/clients/test/test.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef KWIN_TEST -#define KWIN_TEST - -#include <kdecoration.h> -#include <kdecorationfactory.h> -#include <tqpushbutton.h> - -namespace KWinTest -{ - -const int SUPPORTED_WINDOW_TYPES_MASK = NET::NormalMask | NET::DesktopMask | NET::DockMask - | NET::ToolbarMask | NET::MenuMask | NET::DialogMask /*| NET::OverrideMask*/ | NET::TopMenuMask - | NET::UtilityMask | NET::SplashMask; - -class Decoration - : public KDecoration - { - Q_OBJECT - public: - Decoration( KDecorationBridge* bridge, KDecorationFactory* factory ); - virtual void init(); - virtual MousePosition mousePosition( const TQPoint& p ) const; - virtual void borders( int& left, int& right, int& top, int& bottom ) const; - virtual void resize( const TQSize& s ); - virtual TQSize tqminimumSize() const; - virtual void activeChange() {}; - virtual void captionChange() {}; - virtual void maximizeChange() {}; - virtual void desktopChange() {}; - virtual void shadeChange() {}; - virtual void iconChange() {}; - virtual bool eventFilter( TQObject* o, TQEvent* e ); - virtual void reset( unsigned long changed ); - virtual bool animateMinimize( bool minimize ); - private: - TQPushButton* button; - }; - -class Factory - : public KDecorationFactory - { - public: - virtual KDecoration* createDecoration( KDecorationBridge* ); - virtual bool reset( unsigned long changed ); - }; - -} // namespace - -#endif |