diff --git a/effects/CMakeLists.txt b/effects/CMakeLists.txt index f7a82ddb5d..28618d2356 100644 --- a/effects/CMakeLists.txt +++ b/effects/CMakeLists.txt @@ -106,9 +106,6 @@ if( KWIN_HAVE_OPENGL_COMPOSITING ) include( trackmouse/CMakeLists.txt ) include( wobblywindows/CMakeLists.txt ) endif( KWIN_HAVE_OPENGL_COMPOSITING ) -if( KWIN_HAVE_OPENGL_COMPOSITING AND NOT KWIN_HAVE_OPENGLES_COMPOSITING ) - include( snow/CMakeLists.txt ) -endif( KWIN_HAVE_OPENGL_COMPOSITING AND NOT KWIN_HAVE_OPENGLES_COMPOSITING ) ############################################################################### diff --git a/effects/configs_builtins.cpp b/effects/configs_builtins.cpp index a0b56bf680..b5d4a6d2e4 100644 --- a/effects/configs_builtins.cpp +++ b/effects/configs_builtins.cpp @@ -51,9 +51,6 @@ along with this program. If not, see . #include "mousemark/mousemark_config.h" #include "trackmouse/trackmouse_config.h" #include "wobblywindows/wobblywindows_config.h" -#ifndef KWIN_HAVE_OPENGLES -#include "snow/snow_config.h" -#endif #endif #include @@ -92,9 +89,6 @@ KWIN_EFFECT_CONFIG_MULTIPLE( builtins, KWIN_EFFECT_CONFIG_SINGLE( mousemark, MouseMarkEffectConfig ) KWIN_EFFECT_CONFIG_SINGLE( trackmouse, TrackMouseEffectConfig ) KWIN_EFFECT_CONFIG_SINGLE( wobblywindows, WobblyWindowsEffectConfig ) -#ifndef KWIN_HAVE_OPENGLES - KWIN_EFFECT_CONFIG_SINGLE( snow, SnowEffectConfig ) -#endif #endif ) diff --git a/effects/snow/CMakeLists.txt b/effects/snow/CMakeLists.txt deleted file mode 100644 index f2884ee9bd..0000000000 --- a/effects/snow/CMakeLists.txt +++ /dev/null @@ -1,33 +0,0 @@ -####################################### -# Effect - -# Source files -set( kwin4_effect_builtins_sources ${kwin4_effect_builtins_sources} - snow/snow.cpp - ) - -# .desktop files -install( FILES - snow/snow.desktop - DESTINATION ${SERVICES_INSTALL_DIR}/kwin ) - -# Data files -install( FILES - snow/data/snow.frag - snow/data/snow.vert - snow/data/snowflake.png - DESTINATION ${DATA_INSTALL_DIR}/kwin ) - -####################################### -# Config - -# Source files -set( kwin4_effect_builtins_config_sources ${kwin4_effect_builtins_config_sources} - snow/snow_config.cpp - snow/snow_config.ui - ) - -# .desktop files -install( FILES - snow/snow_config.desktop - DESTINATION ${SERVICES_INSTALL_DIR}/kwin ) diff --git a/effects/snow/data/snow.frag b/effects/snow/data/snow.frag deleted file mode 100644 index 812da9907b..0000000000 --- a/effects/snow/data/snow.frag +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************** - KWin - the KDE window manager - This file is part of the KDE project. - - Copyright (C) 2008 Martin Gräßlin - -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, see . -*********************************************************************/ -uniform sampler2D snowTexture; -uniform int left; -uniform int right; -uniform int top; -uniform int bottom; - -void main() -{ - gl_FragColor = texture2D( snowTexture, gl_TexCoord[0].st ); - // manual clipping - if( gl_FragCoord.x < float( left ) || gl_FragCoord.x > float( right ) - || gl_FragCoord.y < float( top ) || gl_FragCoord.y > float( bottom ) ) - discard; -} diff --git a/effects/snow/data/snow.vert b/effects/snow/data/snow.vert deleted file mode 100644 index 06b8462c49..0000000000 --- a/effects/snow/data/snow.vert +++ /dev/null @@ -1,47 +0,0 @@ -/******************************************************************** - KWin - the KDE window manager - This file is part of the KDE project. - - Copyright (C) 2008 Martin Gräßlin - -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, see . -*********************************************************************/ -uniform float angle; -uniform int x; -uniform int width; -uniform int height; -varying float discarding; -uniform int hSpeed; -uniform int vSpeed; -uniform int frames; - -void main() -{ - gl_TexCoord[0] = gl_MultiTexCoord0; - float radian = radians( angle*float(frames) ); - mat2 rotation = mat2( cos(radian), sin(radian), -sin(radian), cos(radian) ); - float xCoord; - float yCoord; - if( gl_MultiTexCoord0.s == 0.0 ) - xCoord = -float(width)*0.5; - else - xCoord = float(width)*0.5; - if( gl_MultiTexCoord0.t == 0.0 ) - yCoord = -float(height)*0.5; - else - yCoord = float(height)*0.5; - vec2 vertex = vec2( xCoord, yCoord ); - vertex = (vertex)*rotation + vec2( float(x), float(-height) ) + vec2(hSpeed, vSpeed)*float(frames); - gl_Position = gl_ModelViewProjectionMatrix * vec4(vertex, gl_Vertex.zw); -} diff --git a/effects/snow/data/snowflake.png b/effects/snow/data/snowflake.png deleted file mode 100644 index 2f9d2c90b3..0000000000 Binary files a/effects/snow/data/snowflake.png and /dev/null differ diff --git a/effects/snow/snow.cpp b/effects/snow/snow.cpp deleted file mode 100644 index bcb1cecb71..0000000000 --- a/effects/snow/snow.cpp +++ /dev/null @@ -1,450 +0,0 @@ -/******************************************************************** - KWin - the KDE window manager - This file is part of the KDE project. - - Copyright (C) 2007 Martin Gräßlin - Copyright (C) 2008 Torgny Johansson - -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, see . -*********************************************************************/ - -#include "snow.h" - -#include - -#include -#include -#include -#include -#include -#include - -#include - -#include - -#ifdef KWIN_HAVE_OPENGL_COMPOSITING -#include -#endif - -namespace KWin -{ - -KWIN_EFFECT( snow, SnowEffect ) -KWIN_EFFECT_SUPPORTED( snow, SnowEffect::supported() ) - -SnowEffect::SnowEffect() - : texture( NULL ) - , active( false) - , snowBehindWindows( false ) - , mShader( 0 ) - , mInited( false ) - , mUseShader( true ) - , hasSnown( false ) - { - srandom( std::time( NULL ) ); - nextFlakeMillis = 0; - KActionCollection* actionCollection = new KActionCollection( this ); - KAction* a = static_cast< KAction* >( actionCollection->addAction( "Snow" )); - a->setText( i18n("Snow" )); - a->setGlobalShortcut( KShortcut( Qt::CTRL + Qt::META + Qt::Key_F12 )); - connect( a, SIGNAL( triggered( bool )), this, SLOT( toggle())); - reconfigure( ReconfigureAll ); - } - -SnowEffect::~SnowEffect() - { - delete texture; - if( active ) - delete mShader; - } - -bool SnowEffect::supported() - { - return effects->compositingType() == OpenGLCompositing; - } - -void SnowEffect::reconfigure( ReconfigureFlags ) - { - KConfigGroup conf = effects->effectConfig("Snow"); - mNumberFlakes = conf.readEntry("Number", 200); - mMinFlakeSize = conf.readEntry("MinFlakes", 10); - mMaxFlakeSize = conf.readEntry("MaxFlakes", 50); - mMaxVSpeed = conf.readEntry("MaxVSpeed", 2); - mMaxHSpeed = conf.readEntry("MaxHSpeed", 1); - snowBehindWindows = conf.readEntry("BehindWindows", true); - } - -void SnowEffect::prePaintScreen( ScreenPrePaintData& data, int time ) - { - if ( active ) - { - // if number of active snowflakes is smaller than maximum number - // create a random new snowflake - nextFlakeMillis -= time; - if ( ( nextFlakeMillis <= 0 ) && flakes.count() < mNumberFlakes) - { - int size = 0; - while ( size < mMinFlakeSize ) - size = random() % mMaxFlakeSize; - SnowFlake flake = SnowFlake( random() % (displayWidth() - size), -size, size, size, mMaxVSpeed, mMaxHSpeed ); - flakes.append( flake ); - - // calculation of next time of snowflake - // depends on the time the flow needs to get to the bottom (screen size) - // and the fps - long next = ((500/(time+5))*(Effect::displayHeight()/flake.getVSpeed()))/mNumberFlakes; - nextFlakeMillis = next; - } - data.mask |= PAINT_SCREEN_TRANSFORMED; - hasSnown = false; - } - effects->prePaintScreen( data, time ); - } - -void SnowEffect::paintScreen( int mask, QRegion region, ScreenPaintData& data ) - { - if( active && snowBehindWindows ) - repaintRegion = QRegion( 0, 0, displayWidth(), displayHeight() ); - effects->paintScreen( mask, region, data ); // paint normal screen - if( active && !snowBehindWindows ) - snowing( region ); - } - -void SnowEffect::snowing( QRegion& region ) - { - if(! texture ) loadTexture(); - if( texture ) - { - glActiveTexture(GL_TEXTURE0); - texture->bind(); - if( mUseShader && !mInited ) - mUseShader = loadShader(); - glPushAttrib( GL_CURRENT_BIT | GL_ENABLE_BIT ); - glEnable( GL_BLEND ); - glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); - - if( mUseShader ) - { - mShader->bind(); - QRect rect = region.boundingRect(); - mShader->setUniform( "left", rect.x() ); - mShader->setUniform( "right", rect.x() + rect.width() ); - mShader->setUniform( "top", rect.y() ); - mShader->setUniform( "bottom", rect.y() + rect.height() ); - } - - for (int i=0; isetUniform( "angle", flake.getRotationSpeed() ); - mShader->setUniform( "x", flake.getX() ); - mShader->setUniform( "hSpeed", flake.getHSpeed() ); - mShader->setUniform( "vSpeed", flake.getVSpeed() ); - mShader->setUniform( "frames", flake.getFrames() ); - mShader->setUniform( "width", flake.getWidth() ); - mShader->setUniform( "height", flake.getHeight() ); - glCallList( list ); - } - else - { - if( !hasSnown ) - { - // only update during first paint in one frame - flake.updateSpeedAndRotation(); - } - // no shader - // save the matrix - glPushMatrix(); - - // translate to the center of the flake - glTranslatef(flake.getWidth()/2 + flake.getX(), flake.getHeight()/2 + flake.getY(), 0); - - // rotate around the Z-axis - glRotatef(flake.getRotationAngle(), 0.0, 0.0, 1.0); - - // translate back to the starting point - glTranslatef(-flake.getWidth()/2 - flake.getX(), -flake.getHeight()/2 - flake.getY(), 0); - - // paint the snowflake - texture->render( region, flake.getRect()); - - // restore the matrix - glPopMatrix(); - } - } - if( mUseShader ) - { - mShader->unbind(); - } - - glDisable( GL_BLEND ); - texture->unbind(); - glPopAttrib(); - hasSnown = true; - } - } - -void SnowEffect::postPaintScreen() - { - if( active ) - { - if( snowBehindWindows ) - effects->addRepaint( repaintRegion ); - else - effects->addRepaintFull(); - } - effects->postPaintScreen(); - } - -void SnowEffect::paintWindow( EffectWindow* w, int mask, QRegion region, WindowPaintData& data ) - { - if( active && snowBehindWindows && !w->isDesktop() && !w->isDock() && !w->hasAlpha() && data.opacity == 1.0 ) - { - repaintRegion -= QRegion( w->geometry() ); - } - effects->paintWindow( w, mask, region, data ); - if( active && w->isDesktop() && snowBehindWindows ) - { - QRect rect = effects->clientArea( FullScreenArea, w->screen(), effects->currentDesktop()); - QRegion snowRegion( rect.x() + data.xTranslate, rect.y() + data.yTranslate, - (double)rect.width()*data.xScale, (double)rect.height()*data.yScale); - if( mUseShader ) - { - // have to adjust the y values to fit OpenGL - // in OpenGL y==0 is at bottom, in Qt at top - int y = 0; - if( effects->numScreens() > 1 ) - { - QRect fullArea = effects->clientArea( FullArea, 0, 1 ); - if( fullArea.height() != rect.height() ) - { - if( rect.y() == 0 ) - y = fullArea.height() - rect.height(); - else - y = fullArea.height() - rect.y() - rect.height(); - } - } - snowRegion = QRegion( rect.x() + data.xTranslate, - y + rect.height() - data.yTranslate - (double)rect.height()*data.yScale, - (double)rect.width()*data.xScale, (double)rect.height()*data.yScale); - } - glPushMatrix(); - glTranslatef( rect.x() + data.xTranslate, rect.y() + data.yTranslate, 0.0 ); - glScalef( data.xScale, data.yScale, 1.0 ); - snowing( snowRegion ); - glPopMatrix(); - } - } - -void SnowEffect::toggle() - { -#ifdef KWIN_HAVE_OPENGL_COMPOSITING - active = !active; - if( active ) - { - list = glGenLists(1); - } - else - { - glDeleteLists( list, 1 ); - flakes.clear(); - if( mUseShader ) - { - delete mShader; - mShader = NULL; - mInited = false; - mUseShader = true; - } - } - effects->addRepaintFull(); -#endif - } - -bool SnowEffect::loadShader() - { - mInited = true; - if( !(GLShader::fragmentShaderSupported() && - (effects->compositingType() == OpenGLCompositing)) ) - { - kDebug(1212) << "Shaders not supported - waisting CPU cycles" << endl; - return false; - } - QString fragmentshader = KGlobal::dirs()->findResource("data", "kwin/snow.frag"); - QString vertexshader = KGlobal::dirs()->findResource("data", "kwin/snow.vert"); - if(fragmentshader.isEmpty() || vertexshader.isEmpty()) - { - kDebug(1212) << "Couldn't locate shader files" << endl; - return false; - } - - mShader = new GLShader(vertexshader, fragmentshader); - if(!mShader->isValid()) - { - kDebug(1212) << "The shader failed to load!" << endl; - return false; - } - else - { - mShader->bind(); - mShader->setUniform( "snowTexture", 0 ); - mShader->unbind(); - } - kDebug(1212) << "using shader"; - - glNewList( list, GL_COMPILE ); - glBegin( GL_QUADS ); - glTexCoord2f( 0.0f, 0.0f ); - glVertex2i( 0, 0 ); - glTexCoord2f( 1.0f, 0.0f ); - glVertex2i( 0, 0 ); - glTexCoord2f( 1.0f, 1.0f ); - glVertex2i( 0, 0 ); - glTexCoord2f( 0.0f, 1.0f ); - glVertex2i( 0, 0 ); - glEnd(); - glEndList(); - return true; - } - -void SnowEffect::loadTexture() - { - QString file = KGlobal::dirs()->findResource( "appdata", "snowflake.png" ); - if( file.isEmpty()) - return; - texture = new GLTexture( file ); - } - - -// the snowflake class -SnowFlake::SnowFlake(int x, int y, int width, int height, int maxVSpeed, int maxHSpeed) - { - int minVSpeed = maxVSpeed - 8; // 8 gives a nice difference in speed - if(minVSpeed < 1) minVSpeed = 1; - vSpeed = random()%maxVSpeed + minVSpeed; - - hSpeed = random()%(maxHSpeed+1); - if(random()%2 < 1) hSpeed = -hSpeed; // to create negative hSpeeds at random - - rotationAngle = 0; - rotationSpeed = random()%4 - 2; - if(rotationSpeed == 0) rotationSpeed = 0.5; - rect = QRect(x, y, width, height); - frameCounter = 0; - maxFrames = (displayHeight() + 2*height) / vSpeed; - if( hSpeed > 0 ) - maxFrames = qMin( maxFrames, (displayWidth() + width - x)/hSpeed ); - else if( hSpeed < 0 ) - maxFrames = qMin( maxFrames, (x + width)/(-hSpeed) ); - } - -SnowFlake::~SnowFlake() - { - } - -int SnowFlake::getHSpeed() - { - return hSpeed; - } - -QRect SnowFlake::getRect() - { - return rect; - } - -void SnowFlake::updateSpeedAndRotation() - { - rotationAngle = rotationAngle+rotationSpeed; - rect.translate(hSpeed, vSpeed); - } - -float SnowFlake::getRotationAngle() - { - return rotationAngle; - } - -float SnowFlake::getRotationSpeed() - { - return rotationSpeed; - } - -int SnowFlake::getVSpeed() - { - return vSpeed; - } - -int SnowFlake::getHeight() - { - return rect.height(); - } - -int SnowFlake::getWidth() - { - return rect.width(); - } - -int SnowFlake::getX() - { - return rect.x(); - } - -int SnowFlake::getY() - { - return rect.y(); - } - -void SnowFlake::setHeight(int height) - { - rect.setHeight(height); - } - -void SnowFlake::setWidth(int width) - { - rect.setWidth(width); - } - -void SnowFlake::setX(int x) - { - rect.setX(x); - } - -void SnowFlake::setY(int y) - { - rect.setY(y); - } - -int SnowFlake::addFrame() - { - return ( maxFrames - (++frameCounter) ); - } - -int SnowFlake::getFrames() - { - return frameCounter; - } - -} // namespace diff --git a/effects/snow/snow.desktop b/effects/snow/snow.desktop deleted file mode 100644 index 3e8474e49f..0000000000 --- a/effects/snow/snow.desktop +++ /dev/null @@ -1,171 +0,0 @@ -[Desktop Entry] -# Name of the effect -Name=Snow -Name[af]=Sneeu -Name[ar]=الثلج -Name[ast]=Ñeve -Name[be@latin]=Śnieh -Name[bg]=Сняг -Name[bn]=বরফ -Name[bn_IN]=Snow (তুষার) -Name[ca]=Neu -Name[ca@valencia]=Neu -Name[cs]=Sníh -Name[csb]=Sniég -Name[da]=Sne -Name[de]=Schnee -Name[el]=Χιόνι -Name[en_GB]=Snow -Name[eo]=Neĝo -Name[es]=Nieve -Name[et]=Lumi -Name[eu]=Elurra -Name[fi]=Lumisade -Name[fr]=Neige -Name[fy]=Snie -Name[ga]=Sneachta -Name[gl]=Neve -Name[gu]=બરફ -Name[he]=שלג -Name[hi]=बर्फीला -Name[hne]=बरफ -Name[hr]=Snijeg -Name[hu]=Hóesés -Name[ia]=Nive -Name[id]=Salju -Name[is]=Snjór -Name[it]=Neve -Name[ja]=雪 -Name[kk]=Қар -Name[km]=ធ្លាក់​ព្រឹល -Name[kn]=ಮಂಜು -Name[ko]=눈 -Name[ku]=Berf -Name[lt]=Sniegas -Name[lv]=Sniegs -Name[mai]=बर्फबारी -Name[mk]=Снег -Name[ml]=മഞ്ഞു വീഴ്ച -Name[mr]=हिमवृष्टी -Name[nb]=Snø -Name[nds]=Snee -Name[nl]=Sneeuw -Name[nn]=Snø -Name[oc]=Nèu -Name[pa]=ਬਰਫ਼ -Name[pl]=Śnieg -Name[pt]=Neve -Name[pt_BR]=Neve -Name[ro]=Zăpadă -Name[ru]=Снег -Name[si]=හිම -Name[sk]=Sneh -Name[sl]=Sneg -Name[sr]=Снег -Name[sr@ijekavian]=Снијег -Name[sr@ijekavianlatin]=Snijeg -Name[sr@latin]=Sneg -Name[sv]=Snö -Name[ta]=பணி -Name[te]=మంచు -Name[tg]=Барф -Name[th]=หิมะโปรยปราย -Name[tr]=Kar -Name[uk]=Сніг -Name[uz]=Qor -Name[uz@cyrillic]=Қор -Name[wa]=Nive -Name[x-test]=xxSnowxx -Name[zh_CN]=雪飘 -Name[zh_TW]=下雪 -Comment=Simulate snow falling over the desktop -Comment[ar]=يحاكي سقوط الثلج على سطح المكتب -Comment[ast]=Simula una nevada nel escritoriu -Comment[be@latin]=Uklučaje śniehapad na rabočym stale. -Comment[bg]=Сняг върху работния плот -Comment[bn_IN]=ডেস্কটপে তুষারপাত প্রদর্শন করা হবে -Comment[ca]=Simula que cau neu sobre l'escriptori -Comment[ca@valencia]=Simula que cau neu sobre l'escriptori -Comment[cs]=Simuluje sněžení na ploše -Comment[csb]=Symùlëjë padający sniég na pùlce -Comment[da]=Simulér snefald over skrivebordet -Comment[de]=Lässt Schnee auf Ihre Arbeitsfläche fallen. -Comment[el]=Εξομοίωση χιονιού στην επιφάνεια εργασίας -Comment[en_GB]=Simulate snow falling over the desktop -Comment[eo]=Neĝu sur la labortablo -Comment[es]=Simula una nevada en el escritorio -Comment[et]=Lumesadu töölaual -Comment[eu]=Egin mahaigainean elurra ari balu bezala -Comment[fi]=Näyttää lumisadetta työpöydällä -Comment[fr]=Simule de la neige qui tombe sur votre bureau -Comment[fy]=Lit it snije op it buroblêd -Comment[ga]=Insamhail sneachta ag titim ar an deasc -Comment[gl]=Simula unha nevarada no escritorio -Comment[gu]=ડેસ્કટોપ પર બરફ પડતો બતાવે છે -Comment[he]=מדמה נפילת שלג על שולחן העבודה -Comment[hi]=डेस्कटॉप के ऊपर बर्फबारी सिमुलेट करें -Comment[hne]=डेस्कटाप के ऊपर बरफबारी सिमुलेट करथे -Comment[hr]=Simulira padanje snijega po radnoj površini -Comment[hu]=Hull a hó az asztalon -Comment[ia]=Il simula nive cadente su le scriptorio -Comment[id]=Simulasikan turunnya salju di atas desktop -Comment[is]=Líkja eftir snjókomu á skjáborð -Comment[it]=Simula una nevicata sul desktop -Comment[ja]=デスクトップに雪を降らせます -Comment[kk]=Үстелде қар жабуын көрсету -Comment[km]=អនុញ្ញាត​ឲ្យ​វា​ធ្លាក់​ព្រឹល​នៅលើ​ផ្ទៃតុ -Comment[kn]=ಗಣಕತೆರೆಯಲ್ಲಿ ಮಂಜು ಬೀಳುತ್ತಿರುವಂತೆ ತೋರುವ ಹಾಗೆ ಮಾಡು -Comment[ko]=데스크톱에 눈이 오도록 합니다 -Comment[lt]=Imituoja snigimą jūsų darbastalyje -Comment[lv]=Imitē sniegu uz darbvirsmas -Comment[mk]=Симулира паѓање снег на работната површина -Comment[ml]=പണിയിടത്തില്‍ മഞ്ഞുപെയ്യുന്ന പോലെ തോന്നട്ടെ -Comment[nb]=Vis snø som faller på skrivebordet -Comment[nds]=Op'n Schriefdisch dat Fallen vun Snee simuleren -Comment[nl]=Laat het op uw bureaublad sneeuwen -Comment[nn]=La det snø på skrivebordet -Comment[pa]=ਡੈਸਕਟਾਪ ਉੱਤੇ ਬਰਫ਼ ਪੈਣ ਦਿਓ -Comment[pl]=Śnieg na pulpicie -Comment[pt]=Simular a queda de neve no ecrã -Comment[pt_BR]=Simula a queda de neve na área de trabalho -Comment[ro]=Simulează zăpada căzînd pe birou -Comment[ru]=Показывать падающий снег -Comment[si]=වැඩතලය මත හිම වැටීමක් අනුකරණය කරන්න -Comment[sk]=Simuluje sneh padajúci na plochu -Comment[sl]=Simulira sneženje na zaslonu -Comment[sr]=Симулира падање снега на површи -Comment[sr@ijekavian]=Симулира падање снијега на површи -Comment[sr@ijekavianlatin]=Simulira padanje snijega na površi -Comment[sr@latin]=Simulira padanje snega na površi -Comment[sv]=Simulera snö som faller över skrivbordet -Comment[ta]=திரைமேசை மீது பணி விழுவது போல் பாசாங்கு செய் -Comment[th]=จำลองการตกหิมะมาสู่พื้นที่ทำงานของคุณ -Comment[tr]=Masaüstüne kar yağdır -Comment[uk]=Імітація завірюх на стільниці -Comment[x-test]=xxSimulate snow falling over the desktopxx -Comment[zh_CN]=在桌面上模拟雪飘效果 -Comment[zh_TW]=模擬在桌面上下雪 -Icon=preferences-system-windows-effect-snow - -# This is KWin effect -Type=Service -X-KDE-ServiceTypes=KWin/Effect -# Author and email of the author -X-KDE-PluginInfo-Author=Martin Gräßlin -X-KDE-PluginInfo-Email=ubuntu@martin-graesslin.com -# Internal name of the effect -X-KDE-PluginInfo-Name=kwin4_effect_snow -# Category of the effect, for config dialog -X-KDE-PluginInfo-Category=Candy -# Version and license -X-KDE-PluginInfo-Version=0.1.2 -X-KDE-PluginInfo-License=GPL -# If the effect depends on any other effect(s) to be active, then internal -# names of those effects can be given here -X-KDE-PluginInfo-Depends= -# Whether this effect should be enabled by default -X-KDE-PluginInfo-EnabledByDefault=false -# The plugin (library) which contains the effect. One library may contain more effects. -X-KDE-Library=kwin4_effect_builtins -# The order in which this effect is loaded. Lower numbers are loaded first. -X-KDE-Ordering=90 diff --git a/effects/snow/snow.h b/effects/snow/snow.h deleted file mode 100644 index e8a96cedfb..0000000000 --- a/effects/snow/snow.h +++ /dev/null @@ -1,107 +0,0 @@ -/******************************************************************** - KWin - the KDE window manager - This file is part of the KDE project. - - Copyright (C) 2007 Martin Gräßlin - Copyright (C) 2008 Torgny Johansson - -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, see . -*********************************************************************/ - - -#ifndef KWIN_SNOW_H -#define KWIN_SNOW_H - -#include -#include -#include - -#include - -namespace KWin -{ - -class SnowFlake - { - public: - SnowFlake(int x, int y, int width, int height, int maxVSpeed, int maxHSpeed); - virtual ~SnowFlake(); - int getHSpeed(); - int getVSpeed(); - float getRotationAngle(); - float getRotationSpeed(); - void updateSpeedAndRotation(); - int addFrame(); - int getHeight(); - int getWidth(); - int getX(); - int getY(); - int getFrames(); - QRect getRect(); - void setHeight(int height); - void setWidth(int width); - void setX(int x); - void setY(int y); - - private: - QRect rect; - int vSpeed; - int hSpeed; - int frameCounter; - int maxFrames; - float rotationAngle; - float rotationSpeed; - }; - -class SnowEffect - : public QObject, public Effect - { - Q_OBJECT - public: - SnowEffect(); - virtual ~SnowEffect(); - virtual void reconfigure( ReconfigureFlags ); - virtual void prePaintScreen( ScreenPrePaintData& data, int time ); - virtual void paintScreen( int mask, QRegion region, ScreenPaintData& data ); - virtual void postPaintScreen(); - virtual void paintWindow( EffectWindow* w, int mask, QRegion region, WindowPaintData& data ); - - static bool supported(); - private slots: - void toggle(); - private: - void loadTexture(); - void snowing( QRegion& region ); - bool loadShader(); - GLTexture* texture; - QList flakes; - long nextFlakeMillis; - int mNumberFlakes; - int mMinFlakeSize; - int mMaxFlakeSize; - int mMaxVSpeed; - int mMaxHSpeed; - bool active; - GLuint list; - bool snowBehindWindows; - GLShader* mShader; - bool mInited; - bool mUseShader; - QRegion repaintRegion; - bool hasSnown; - }; - -} // namespace - -#endif diff --git a/effects/snow/snow_config.cpp b/effects/snow/snow_config.cpp deleted file mode 100644 index a6135a0ca4..0000000000 --- a/effects/snow/snow_config.cpp +++ /dev/null @@ -1,138 +0,0 @@ -/******************************************************************** - KWin - the KDE window manager - This file is part of the KDE project. - - Copyright (C) 2007 Martin Gräßlin . -*********************************************************************/ - -#include "snow_config.h" -#include - -#include -#include -#include -#include -#include - -#include - -namespace KWin -{ - -KWIN_EFFECT_CONFIG_FACTORY - -SnowEffectConfigForm::SnowEffectConfigForm(QWidget* parent) : QWidget(parent) - { - setupUi(this); - } - -SnowEffectConfig::SnowEffectConfig(QWidget* parent, const QVariantList& args) : - KCModule(EffectFactory::componentData(), parent, args) - { - m_ui = new SnowEffectConfigForm(this); - - QVBoxLayout* layout = new QVBoxLayout(this); - - layout->addWidget(m_ui); - - connect(m_ui->editor, SIGNAL(keyChange()), this, SLOT(changed())); - connect(m_ui->numberFlakes, SIGNAL(valueChanged(int)), this, SLOT(changed())); - connect(m_ui->minSizeFlake, SIGNAL(valueChanged(int)), this, SLOT(changed())); - connect(m_ui->maxSizeFlake, SIGNAL(valueChanged(int)), this, SLOT(changed())); - connect(m_ui->maxVSpeed, SIGNAL(valueChanged(int)), this, SLOT(changed())); - connect(m_ui->maxHSpeed, SIGNAL(valueChanged(int)), this, SLOT(changed())); - connect(m_ui->snowBehindWindows, SIGNAL(stateChanged(int)), this, SLOT(changed())); - - // Shortcut config. The shortcut belongs to the component "kwin"! - m_actionCollection = new KActionCollection( this, KComponentData("kwin") ); - - m_actionCollection->setConfigGroup("Snow"); - m_actionCollection->setConfigGlobal(true); - - KAction* a = (KAction*)m_actionCollection->addAction( "Snow" ); - a->setText( i18n("Toggle Snow on Desktop" )); - a->setProperty("isConfigurationAction", true); - a->setGlobalShortcut( KShortcut( Qt::CTRL + Qt::META + Qt::Key_F12 )); - - m_ui->editor->addCollection(m_actionCollection); - } - -SnowEffectConfig::~SnowEffectConfig() - { - // Undo (only) unsaved changes to global key shortcuts - m_ui->editor->undoChanges(); - } - -void SnowEffectConfig::load() - { - KCModule::load(); - - KConfigGroup conf = EffectsHandler::effectConfig("Snow"); - - int number = conf.readEntry("Number", 200); - int minFlake = conf.readEntry("MinFlakes", 10); - int maxFlake = conf.readEntry("MaxFlakes", 50); - int maxVSpeed = conf.readEntry("MaxVSpeed", 2); - int maxHSpeed = conf.readEntry("MaxHSpeed", 1); - m_ui->snowBehindWindows->setChecked( conf.readEntry("BehindWindows", true)); - m_ui->numberFlakes->setValue( number ); - m_ui->minSizeFlake->setValue( minFlake ); - m_ui->minSizeFlake->setSuffix( ki18np(" pixel", " pixels") ); - m_ui->maxSizeFlake->setValue( maxFlake ); - m_ui->maxSizeFlake->setSuffix( ki18np(" pixel", " pixels") ); - m_ui->maxVSpeed->setValue( maxVSpeed ); - m_ui->maxVSpeed->setSuffix( ki18np(" pixel/frame", " pixels/frame") ); - m_ui->maxHSpeed->setValue( maxHSpeed ); - m_ui->maxHSpeed->setSuffix( ki18np(" pixel/frame", " pixels/frame") ); - - - emit changed(false); - } - -void SnowEffectConfig::save() - { - KConfigGroup conf = EffectsHandler::effectConfig("Snow"); - conf.writeEntry("Number", m_ui->numberFlakes->value()); - conf.writeEntry("MinFlakes", m_ui->minSizeFlake->value()); - conf.writeEntry("MaxFlakes", m_ui->maxSizeFlake->value()); - conf.writeEntry("MaxVSpeed", m_ui->maxVSpeed->value()); - conf.writeEntry("MaxHSpeed", m_ui->maxHSpeed->value()); - conf.writeEntry("BehindWindows", m_ui->snowBehindWindows->isChecked()); - - m_ui->editor->save(); // undo() will restore to this state from now on - - conf.sync(); - - emit changed(false); - EffectsHandler::sendReloadMessage( "snow" ); - } - -void SnowEffectConfig::defaults() - { - m_ui->numberFlakes->setValue( 200 ); - m_ui->minSizeFlake->setValue( 10 ); - m_ui->maxSizeFlake->setValue( 50 ); - m_ui->maxVSpeed->setValue( 2 ); - m_ui->maxHSpeed->setValue( 1 ); - m_ui->snowBehindWindows->setChecked( true ); - m_ui->editor->allDefault(); - emit changed(true); - } - - -} // namespace - -#include "snow_config.moc" diff --git a/effects/snow/snow_config.desktop b/effects/snow/snow_config.desktop deleted file mode 100644 index 3e7cb6400b..0000000000 --- a/effects/snow/snow_config.desktop +++ /dev/null @@ -1,86 +0,0 @@ -[Desktop Entry] -Type=Service -X-KDE-ServiceTypes=KCModule - -X-KDE-Library=kcm_kwin4_effect_builtins -X-KDE-ParentComponents=kwin4_effect_snow -X-KDE-PluginKeyword=snow - -Name=Snow -Name[af]=Sneeu -Name[ar]=الثلج -Name[ast]=Ñeve -Name[be@latin]=Śnieh -Name[bg]=Сняг -Name[bn]=বরফ -Name[bn_IN]=Snow (তুষার) -Name[ca]=Neu -Name[ca@valencia]=Neu -Name[cs]=Sníh -Name[csb]=Sniég -Name[da]=Sne -Name[de]=Schnee -Name[el]=Χιόνι -Name[en_GB]=Snow -Name[eo]=Neĝo -Name[es]=Nieve -Name[et]=Lumi -Name[eu]=Elurra -Name[fi]=Lumisade -Name[fr]=Neige -Name[fy]=Snie -Name[ga]=Sneachta -Name[gl]=Neve -Name[gu]=બરફ -Name[he]=שלג -Name[hi]=बर्फीला -Name[hne]=बरफ -Name[hr]=Snijeg -Name[hu]=Hóesés -Name[ia]=Nive -Name[id]=Salju -Name[is]=Snjór -Name[it]=Neve -Name[ja]=雪 -Name[kk]=Қар -Name[km]=ធ្លាក់​ព្រឹល -Name[kn]=ಮಂಜು -Name[ko]=눈 -Name[ku]=Berf -Name[lt]=Sniegas -Name[lv]=Sniegs -Name[mai]=बर्फबारी -Name[mk]=Снег -Name[ml]=മഞ്ഞു വീഴ്ച -Name[mr]=हिमवृष्टी -Name[nb]=Snø -Name[nds]=Snee -Name[nl]=Sneeuw -Name[nn]=Snø -Name[oc]=Nèu -Name[pa]=ਬਰਫ਼ -Name[pl]=Śnieg -Name[pt]=Neve -Name[pt_BR]=Neve -Name[ro]=Zăpadă -Name[ru]=Снег -Name[si]=හිම -Name[sk]=Sneh -Name[sl]=Sneg -Name[sr]=Снег -Name[sr@ijekavian]=Снијег -Name[sr@ijekavianlatin]=Snijeg -Name[sr@latin]=Sneg -Name[sv]=Snö -Name[ta]=பணி -Name[te]=మంచు -Name[tg]=Барф -Name[th]=หิมะโปรยปราย -Name[tr]=Kar -Name[uk]=Сніг -Name[uz]=Qor -Name[uz@cyrillic]=Қор -Name[wa]=Nive -Name[x-test]=xxSnowxx -Name[zh_CN]=雪飘 -Name[zh_TW]=下雪 diff --git a/effects/snow/snow_config.h b/effects/snow/snow_config.h deleted file mode 100644 index 3b2abb7481..0000000000 --- a/effects/snow/snow_config.h +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************** - KWin - the KDE window manager - This file is part of the KDE project. - - Copyright (C) 2007 Martin Gräßlin . -*********************************************************************/ - -#ifndef KWIN_SNOW_CONFIG_H -#define KWIN_SNOW_CONFIG_H - -#include - -#include "ui_snow_config.h" - -class KActionCollection; - -namespace KWin -{ - -class SnowEffectConfigForm : public QWidget, public Ui::SnowEffectConfigForm - { - Q_OBJECT - public: - explicit SnowEffectConfigForm(QWidget* parent); - }; - -class SnowEffectConfig : public KCModule - { - Q_OBJECT - public: - explicit SnowEffectConfig(QWidget* parent = 0, const QVariantList& args = QVariantList()); - ~SnowEffectConfig(); - - public slots: - virtual void save(); - virtual void load(); - virtual void defaults(); - - private: - SnowEffectConfigForm* m_ui; - KActionCollection* m_actionCollection; - }; - -} // namespace - -#endif diff --git a/effects/snow/snow_config.ui b/effects/snow/snow_config.ui deleted file mode 100644 index 9e32e8ea14..0000000000 --- a/effects/snow/snow_config.ui +++ /dev/null @@ -1,200 +0,0 @@ - - KWin::SnowEffectConfigForm - - - - 0 - 0 - 400 - 300 - - - - - - - Appearance - - - - - - &Number of snowflakes: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - numberFlakes - - - - - - - - 0 - 0 - - - - 1000 - - - 200 - - - - - - - M&inimum size of snowflake: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - minSizeFlake - - - - - - - - 0 - 0 - - - - 30 - - - 10 - - - - - - - M&aximum size of snowflake: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - maxSizeFlake - - - - - - - - 0 - 0 - - - - 1000 - - - 200 - - - - - - - Maximum &vertical speed: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - maxVSpeed - - - - - - - - 0 - 0 - - - - 1 - - - 30 - - - 2 - - - - - - - Maximum &horizontal speed: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - maxHSpeed - - - - - - - - 0 - 0 - - - - 0 - - - 30 - - - 1 - - - - - - - Snow &behind windows - - - - - - - - - - - - - - KIntSpinBox - QSpinBox -
knuminput.h
-
- - KWin::GlobalShortcutsEditor - QWidget -
kwineffects.h
- 1 -
-
- - -