kscreensaver from kdeartwork

This commit is contained in:
Ivailo Monev 2014-12-10 18:09:09 +00:00
parent 5305cad6d2
commit 073e380d1c
382 changed files with 120176 additions and 0 deletions

View file

@ -0,0 +1,81 @@
#Macro to find xscreensaver directory
# Copyright (c) 2006, Laurent Montel, <montel@kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
if (NOT XSCREENSAVER_FOUND)
set(xscreensaver_alldirs)
set(xscreensaver_checkdirs ${KDE4_INCLUDE_DIR}
/usr/
/usr/local/
/opt/local/
/usr/X11R6/
/opt/kde/
/opt/kde3/
/usr/kde/
/usr/local/kde/
/usr/local/xscreensaver/
/usr/openwin/lib/xscreensaver/
/etc/ )
foreach(suffix lib${LIB_SUFFIX}/xscreensaver lib${LIB_SUFFIX}/misc/xscreensaver lib/xscreensaver lib64/xscreensaver libexec/xscreensaver
bin/xscreensaver-hacks hacks)
foreach(xscreensaver_path ${xscreensaver_checkdirs} )
set(xscreensaver_alldirs ${xscreensaver_alldirs} ${xscreensaver_path}/${suffix})
endforeach(xscreensaver_path ${xscreensaver_checkdirs} )
endforeach(suffix lib${LIB_SUFFIX}/xscreensaver lib/xscreensaver lib64/xscreensaver libexec/xscreensaver bin/xscreensaver-hacks hacks)
FIND_PATH(XSCREENSAVER_DIR deco ${xscreensaver_alldirs})
set(XSCREENSAVER_CONFIG_DIR)
FIND_PATH(XSCREENSAVER_CONFIG_DECO config/deco.xml
${KDE4_INCLUDE_DIR}
/usr/
/usr/local/
/opt/local/
/usr/X11R6/
/opt/kde/
/opt/kde3/
/usr/kde/
/usr/share/xscreensaver/
/usr/local/kde/
/usr/local/xscreensaver/
/usr/openwin/lib/xscreensaver/
/etc/
)
#MESSAGE(STATUS "XSCREENSAVER_CONFIG_DIR :<${XSCREENSAVER_CONFIG_DIR}>")
if(XSCREENSAVER_CONFIG_DECO)
set(XSCREENSAVER_CONFIG_DIR "${XSCREENSAVER_CONFIG_DECO}/config/")
#MESSAGE(STATUS "XSCREENSAVER_CONFIG_DIR <${XSCREENSAVER_CONFIG_DIR}>")
endif(XSCREENSAVER_CONFIG_DECO)
# Try and locate XScreenSaver config when path doesn't include config
if(NOT XSCREENSAVER_CONFIG_DIR)
FIND_PATH(XSCREENSAVER_CONFIG_DIR deco.xml
/etc/xscreensaver
)
endif(NOT XSCREENSAVER_CONFIG_DIR)
endif(NOT XSCREENSAVER_FOUND)
#MESSAGE(STATUS "XSCREENSAVER_CONFIG_DIR :<${XSCREENSAVER_CONFIG_DIR}>")
#MESSAGE(STATUS "XSCREENSAVER_DIR :<${XSCREENSAVER_DIR}>")
# Need to fix hack
if(XSCREENSAVER_DIR AND XSCREENSAVER_CONFIG_DIR)
set(XSCREENSAVER_FOUND TRUE)
endif(XSCREENSAVER_DIR AND XSCREENSAVER_CONFIG_DIR)
if (XSCREENSAVER_FOUND)
if (NOT Xscreensaver_FIND_QUIETLY)
message(STATUS "Found SCREENSAVER_CONFIG_DIR <${XSCREENSAVER_CONFIG_DIR}>")
endif (NOT Xscreensaver_FIND_QUIETLY)
else (XSCREENSAVER_FOUND)
if (Xscreensaver_FIND_REQUIRED)
message(FATAL_ERROR "XScreenSaver not found")
endif (Xscreensaver_FIND_REQUIRED)
endif (XSCREENSAVER_FOUND)
MARK_AS_ADVANCED(XSCREENSAVER_DIR XSCREENSAVER_CONFIG_DIR)

View file

@ -2,3 +2,21 @@
add_subdirectory( libkscreensaver )
add_subdirectory( kblank_screensaver )
add_subdirectory( krandom_screensaver )
macro_optional_find_package(Xscreensaver)
macro_log_feature(XSCREENSAVER_FOUND "Xscreensaver"
"A modular screen saver and locker for the X Window System"
"http://www.jwz.org/xscreensaver"
FALSE
""
"Provides screen savers for the desktop.")
macro_optional_find_package(OpenGL)
macro_log_feature(OPENGL_FOUND "OpenGL" "API for developing portable, interactive 2D and 3D graphics applications" "http://mesa3d.sourceforge.net" FALSE "" "Provides 3D screensavers.")
add_subdirectory( kdesavers )
add_subdirectory( kpartsaver )
if(XSCREENSAVER_FOUND)
add_subdirectory(kxsconfig)
add_subdirectory(xsavers)
endif(XSCREENSAVER_FOUND)

4
kscreensaver/Messages.sh Executable file
View file

@ -0,0 +1,4 @@
#! /bin/sh
$EXTRACTRC kdesavers/*.ui >> rc.cpp
$XGETTEXT kdesavers/*.cpp xsavers/*.cpp rc.cpp -o $podir/klock.pot
rm -f rc.cpp

View file

@ -0,0 +1,207 @@
macro_optional_find_package(Eigen3)
macro_log_feature(EIGEN3_FOUND "Eigen3" "A C++ template library for linear algebra" "kdesupport" FALSE "" "Needed to build the krotation and kpendulum screensavers" )
add_definitions(-DEIGEN2_SUPPORT)
macro_optional_find_package(Kexiv2)
macro_log_feature(KEXIV2_FOUND "Kexiv2" "A C++ library for exiv manipulation" "kdegraphics" FALSE "" "Needed to rotate photos with exif data" )
option(KSCREENSAVER_SOUND_SUPPORT "Build with sound support" OFF)
include_directories(${KDE4WORKSPACE_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR})
add_subdirectory( data )
macro_optional_add_subdirectory( asciiquarium )
if (WIN32)
SET(LIBMATH "")
else (WIN32)
SET(LIBMATH "m")
endif (WIN32)
########### next target ###############
set(kbanner.kss_SRCS banner.cpp )
kde4_add_executable(kbanner.kss ${kbanner.kss_SRCS})
target_link_libraries(kbanner.kss ${KDE4_KDEUI_LIBS} ${KDE4WORKSPACE_KSCREENSAVER_LIBRARY})
install(TARGETS kbanner.kss ${INSTALL_TARGETS_DEFAULT_ARGS} )
########### next target ###############
set(kpolygon.kss_SRCS polygon.cpp )
kde4_add_executable(kpolygon.kss ${kpolygon.kss_SRCS})
target_link_libraries(kpolygon.kss ${KDE4_KDEUI_LIBS} ${KDE4WORKSPACE_KSCREENSAVER_LIBRARY})
install(TARGETS kpolygon.kss ${INSTALL_TARGETS_DEFAULT_ARGS} )
########### next target ###############
set(kslideshow.kss_SRCS slideshow.cpp )
kde4_add_ui_files(kslideshow.kss_SRCS slideshowcfg.ui )
kde4_add_executable(kslideshow.kss ${kslideshow.kss_SRCS})
macro_bool_to_01(KEXIV2_FOUND HAVE_KEXIV2)
if(HAVE_KEXIV2)
include_directories( ${KEXIV2_INCLUDES} )
set_source_files_properties(slideshow.cpp PROPERTIES COMPILE_FLAGS -DHAVE_KEXIV2)
target_link_libraries(kslideshow.kss ${KDE4_KIO_LIBS} ${LIBMATH} ${KDE4WORKSPACE_KSCREENSAVER_LIBRARY} ${KEXIV2_LIBRARIES})
else(HAVE_KEXIV2)
target_link_libraries(kslideshow.kss ${KDE4_KIO_LIBS} ${LIBMATH} ${KDE4WORKSPACE_KSCREENSAVER_LIBRARY})
endif(HAVE_KEXIV2)
install(TARGETS kslideshow.kss ${INSTALL_TARGETS_DEFAULT_ARGS} )
########### next target ###############
set(klines.kss_SRCS lines.cpp )
kde4_add_executable(klines.kss ${klines.kss_SRCS})
target_link_libraries(klines.kss ${KDE4_KDEUI_LIBS} ${KDE4WORKSPACE_KSCREENSAVER_LIBRARY})
install(TARGETS klines.kss ${INSTALL_TARGETS_DEFAULT_ARGS} )
########### next target ###############
set(klorenz.kss_SRCS lorenz.cpp )
kde4_add_executable(klorenz.kss ${klorenz.kss_SRCS})
target_link_libraries(klorenz.kss ${KDE4_KDEUI_LIBS} ${LIBMATH} ${KDE4WORKSPACE_KSCREENSAVER_LIBRARY})
install(TARGETS klorenz.kss ${INSTALL_TARGETS_DEFAULT_ARGS} )
########### next target ###############
set(kblob.kss_SRCS blob.cpp )
kde4_add_executable(kblob.kss ${kblob.kss_SRCS})
target_link_libraries(kblob.kss ${KDE4_KDEUI_LIBS} ${LIBMATH} ${KDE4WORKSPACE_KSCREENSAVER_LIBRARY})
install(TARGETS kblob.kss ${INSTALL_TARGETS_DEFAULT_ARGS} )
########### next target ###############
set(kvm.kss_SRCS kvm.cpp vm.c vm_random.c )
kde4_add_executable(kvm.kss ${kvm.kss_SRCS})
target_link_libraries(kvm.kss ${KDE4_KDEUI_LIBS} ${KDE4WORKSPACE_KSCREENSAVER_LIBRARY})
install(TARGETS kvm.kss ${INSTALL_TARGETS_DEFAULT_ARGS} )
########### next target ###############
set(kclock.kss_SRCS kclock.cpp )
kde4_add_executable(kclock.kss ${kclock.kss_SRCS})
target_link_libraries(kclock.kss ${KDE4_KDEUI_LIBS} ${LIBMATH} ${KDE4WORKSPACE_KSCREENSAVER_LIBRARY})
install(TARGETS kclock.kss ${INSTALL_TARGETS_DEFAULT_ARGS} )
install(FILES KClock.desktop DESTINATION ${SERVICES_INSTALL_DIR}/ScreenSavers)
########### next target ###############
#set($(X11_KSAVERS)_SRCS dummy.cpp )
if(Q_WS_X11)
set(kscience.kss_SRCS science.cpp )
kde4_add_executable(kscience.kss ${kscience.kss_SRCS})
target_link_libraries(kscience.kss ${KDE4_KDEUI_LIBS} ${KDE4WORKSPACE_KSCREENSAVER_LIBRARY} ${X11_LIBRARIES})
install(TARGETS kscience.kss ${INSTALL_TARGETS_DEFAULT_ARGS} )
install(FILES KScience.desktop DESTINATION ${SERVICES_INSTALL_DIR}/ScreenSavers)
endif(Q_WS_X11)
########### next target ###############
message(STATUS "readd opengl+sound support screensaver")
if(OPENGL_FOUND AND OPENGL_GLU_FOUND AND KSCREENSAVER_SOUND_SUPPORT)
#set(kfiresaver.kss_SRCS firesaverparticle.cpp firesaverwriter.cpp firesaver.cpp )
#kde4_add_ui3_files(kfiresaver.kss_SRCS aversetup.ui)
##kde4_add_executable(kfiresaver.kss ${kfiresaver.kss_SRCS})
#target_link_libraries(kfiresaver.kss ${KDE4_KDEUI_LIBS} )
#install(TARGETS kfiresaver.kss ${INSTALL_TARGETS_DEFAULT_ARGS} )
#install( FILES KFiresaver.desktop DESTINATION ${SERVICES_INSTALL_DIR}/ScreenSavers )
endif(OPENGL_FOUND AND OPENGL_GLU_FOUND AND KSCREENSAVER_SOUND_SUPPORT)
########### next target ###############
if(OPENGL_FOUND AND OPENGL_GLU_FOUND AND QT_QTOPENGL_LIBRARY)
## krotation, kpendulum need Eigen2
if (EIGEN3_FOUND)
include_directories(${EIGEN3_INCLUDE_DIR})
set(krotation.kss_SRCS rotation.cpp sspreviewarea.cpp)
kde4_add_ui_files(krotation.kss_SRCS rotationcfg.ui)
kde4_add_executable(krotation.kss ${krotation.kss_SRCS})
target_link_libraries(krotation.kss ${KDE4_KDEUI_LIBS} ${QT_QTOPENGL_LIBRARY} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${KDE4WORKSPACE_KSCREENSAVER_LIBRARY})
install(TARGETS krotation.kss ${INSTALL_TARGETS_DEFAULT_ARGS})
set(kpendulum.kss_SRCS pendulum.cpp sspreviewarea.cpp)
kde4_add_ui_files(kpendulum.kss_SRCS pendulumcfg.ui)
kde4_add_executable(kpendulum.kss ${kpendulum.kss_SRCS})
target_link_libraries(kpendulum.kss ${KDE4_KDEUI_LIBS} ${QT_QTOPENGL_LIBRARY} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${KDE4WORKSPACE_KSCREENSAVER_LIBRARY})
install(TARGETS kpendulum.kss ${INSTALL_TARGETS_DEFAULT_ARGS})
endif (EIGEN3_FOUND)
set(ksolarwinds.kss_SRCS SolarWinds.cpp )
kde4_add_executable(ksolarwinds.kss ${ksolarwinds.kss_SRCS})
target_link_libraries( ksolarwinds.kss ${KDE4_KDEUI_LIBS} ${QT_QTOPENGL_LIBRARY} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${KDE4WORKSPACE_KSCREENSAVER_LIBRARY})
install(TARGETS ksolarwinds.kss ${INSTALL_TARGETS_DEFAULT_ARGS} )
set(kflux.kss_SRCS Flux.cpp )
kde4_add_executable(kflux.kss ${kflux.kss_SRCS})
target_link_libraries( kflux.kss ${KDE4_KDEUI_LIBS} ${QT_QTOPENGL_LIBRARY} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${KDE4WORKSPACE_KSCREENSAVER_LIBRARY})
install(TARGETS kflux.kss ${INSTALL_TARGETS_DEFAULT_ARGS} )
set(keuphoria.kss_SRCS Euphoria.cpp )
kde4_add_executable(keuphoria.kss ${keuphoria.kss_SRCS})
target_link_libraries( keuphoria.kss ${KDE4_KDEUI_LIBS} ${QT_QTOPENGL_LIBRARY} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${KDE4WORKSPACE_KSCREENSAVER_LIBRARY})
install(TARGETS keuphoria.kss ${INSTALL_TARGETS_DEFAULT_ARGS} )
set(kfountain.kss_SRCS fountain.cpp )
kde4_add_ui_files(kfountain.kss_SRCS fountaincfg.ui)
kde4_add_executable(kfountain.kss ${kfountain.kss_SRCS})
target_link_libraries( kfountain.kss ${KDE4_KDEUI_LIBS} ${QT_QTOPENGL_LIBRARY} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${KDE4WORKSPACE_KSCREENSAVER_LIBRARY})
install(TARGETS kfountain.kss ${INSTALL_TARGETS_DEFAULT_ARGS} )
set(kwave.kss_SRCS wave.cpp )
kde4_add_ui_files(kwave.kss_SRCS wavecfg.ui)
kde4_add_executable(kwave.kss ${kwave.kss_SRCS})
target_link_libraries( kwave.kss ${KDE4_KDEUI_LIBS} ${QT_QTOPENGL_LIBRARY} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${KDE4WORKSPACE_KSCREENSAVER_LIBRARY})
install(TARGETS kwave.kss ${INSTALL_TARGETS_DEFAULT_ARGS} )
set(kgravity.kss_SRCS gravity.cpp )
kde4_add_ui_files(kgravity.kss_SRCS gravitycfg.ui)
kde4_add_executable(kgravity.kss ${kgravity.kss_SRCS})
target_link_libraries( kgravity.kss ${KDE4_KDEUI_LIBS} ${QT_QTOPENGL_LIBRARY} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${KDE4WORKSPACE_KSCREENSAVER_LIBRARY})
install(TARGETS kgravity.kss ${INSTALL_TARGETS_DEFAULT_ARGS} )
install( FILES KGravity.desktop KWave.desktop KFountain.desktop KFlux.desktop KEuphoria.desktop KSolarWinds.desktop KRotation.desktop KPendulum.desktop DESTINATION ${SERVICES_INSTALL_DIR}/ScreenSavers )
endif(OPENGL_FOUND AND OPENGL_GLU_FOUND AND QT_QTOPENGL_LIBRARY)
########### install files ###############
install( FILES kscience.png particle.png image.png DESTINATION ${DATA_INSTALL_DIR}/kscreensaver )
install( FILES KBanner.desktop KPolygon.desktop KSlideshow.desktop KLines-saver.desktop KLorenz.desktop KBlob.desktop KVm.desktop DESTINATION ${SERVICES_INSTALL_DIR}/ScreenSavers )

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,167 @@
/*
* Terence Welsh Screensaver - Euphoria
* http://www.reallyslick.com/
*
* Ported to KDE by Karl Robillard
* Copyright (C) 2002 Terence M. Welsh
*
* 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 <http://www.gnu.org/licenses/>.
*/
#ifndef EUPHORIASS_H
#define EUPHORIASS_H
#include <qgl.h>
#include <kdialog.h>
class wisp;
class QTimer;
class EuphoriaWidget : public QGLWidget
{
Q_OBJECT
public:
enum eDefault
{
Regular,
Grid,
Cubism,
BadMath,
MTheory,
UHFTEM, // ultra high frequency tunneling electron microscope
Nowhere,
Echo,
Kaleidoscope,
DefaultModes
};
EuphoriaWidget( QWidget* parent=0 );
~EuphoriaWidget();
void updateParameters();
void setDefaults( int which );
protected:
void paintGL();
void resizeGL( int w, int h );
void initializeGL();
#ifdef UNIT_TEST
void keyPressEvent( QKeyEvent* );
#endif
private slots:
void nextFrame();
private:
GLuint texName;
wisp* _wisps;
wisp* _backwisps;
unsigned char* feedbackmap;
float aspectRatio;
int viewport[4];
double elapsedTime;
// feedback texture object
unsigned int feedbacktex;
int feedbacktexsize;
// feedback variables
float fr[4];
float fv[4];
float f[4];
// feedback limiters
float lr[3];
float lv[3];
float l[3];
int dWisps;
int dBackground;
int dDensity;
int dVisibility;
float dSpeed;
int dFeedback;
int dFeedbackspeed;
int dFeedbacksize;
int dWireframe;
int dTexture;
int dPriority;
// Using QTimer rather than timerEvent() to avoid getting locked out of
// the QEvent loop on lower-end systems. Ian Geiser <geiseri@kde.org>
// says this is the way to go.
QTimer* _timer;
int _frameTime;
friend class wisp;
};
#ifndef UNIT_TEST
#include <qdialog.h>
#include <kscreensaver.h>
class KEuphoriaScreenSaver : public KScreenSaver
{
Q_OBJECT
public:
KEuphoriaScreenSaver( WId id );
virtual ~KEuphoriaScreenSaver();
int mode() const { return _mode; }
public slots:
void setMode( int );
private:
void readSettings();
EuphoriaWidget* _effect;
int _mode;
};
class QComboBox;
class KEuphoriaSetup : public KDialog
{
Q_OBJECT
public:
KEuphoriaSetup( QWidget* parent = 0 );
~KEuphoriaSetup();
private slots:
void slotHelp();
void slotOk();
private:
QComboBox* modeW;
KEuphoriaScreenSaver* _saver;
};
#endif
#endif //__EUPHORIASS_H__

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,992 @@
/*
* Terence Welsh Screensaver - Flux
* http://www.reallyslick.com/
*
* Ported to KDE by Karl Robillard
* Copyright (C) 2002 Terence M. Welsh
*
* 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 <http://www.gnu.org/licenses/>.
*/
/*
TODO
[ ] Regular and others are messed up after Sparkler.
Insane seems to reset them.
*/
#include "Flux.h"
#include <qtimer.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#ifdef Q_WS_MACX
#include <OpenGL/glu.h>
#else
#include <GL/glu.h>
#endif
#define NUMCONSTS 8
#define PIx2 6.28318530718f
#define DEG2RAD 0.0174532925f
void hsl2rgb(float h, float s, float l, float &r, float &g, float &b)
{
// hue influence
if(h < 0.166667){ // full red, some green
r = 1.0;
g = h * 6.0f;
b = 0.0;
}
else {
if(h < 0.5){ // full green
g = 1.0;
if(h < 0.333333){ // some red
r = 1.0f - ((h - 0.166667f) * 6.0f);
b = 0.0;
}
else{ // some blue
b = (h - 0.333333f) * 6.0f;
r = 0.0;
}
}
else{
if(h < 0.833333){ // full blue
b = 1.0;
if(h < 0.666667){ // some green
g = 1.0f - ((h - 0.5f) * 6.0f);
r = 0.0;
}
else{ // some red
r = (h - 0.666667f) * 6.0f;
g = 0.0;
}
}
else{ // full red, some blue
r = 1.0;
b = 1.0f - ((h - 0.833333f) * 6.0f);
g = 0.0;
}
}
}
// saturation influence
r = 1.0f - (s * (1.0f - r));
g = 1.0f - (s * (1.0f - g));
b = 1.0f - (s * (1.0f - b));
// luminosity influence
r *= l;
g *= l;
b *= l;
}
// Useful random number macros
// Don't forget to initialize with srand()
inline int myRandi(int x){
return((rand() * x) / RAND_MAX);
}
inline float myRandf(float x){
return(float(rand() * x) / float(RAND_MAX));
}
//----------------------------------------------------------------------------
// Flux context to allow many instances.
static FluxWidget* _fc = 0;
static int whichparticle;
// This class is poorly named. It's actually a whole trail of particles.
class particle
{
public:
particle();
~particle();
float update(float *c);
private:
float** vertices;
short trails;
short counter;
float offset[3];
};
particle::particle()
{
// Offsets are somewhat like default positions for the head of each
// particle trail. Offsets spread out the particle trails and keep
// them from all overlapping.
offset[0] = cos(PIx2 * float(whichparticle) / float(_fc->dParticles));
offset[1] = float(whichparticle) / float(_fc->dParticles) - 0.5f;
offset[2] = sin(PIx2 * float(whichparticle) / float(_fc->dParticles));
whichparticle++;
// Initialize memory and set initial positions out of view of the camera
trails = _fc->dTrail;
vertices = new float*[ trails ];
int i;
for(i=0; i<trails; i++)
{
vertices[i] = new float[5]; // 0,1,2 = position, 3 = hue, 4 = saturation
vertices[i][0] = 0.0f;
vertices[i][1] = 3.0f;
vertices[i][2] = 0.0f;
vertices[i][3] = 0.0f;
vertices[i][4] = 0.0f;
}
counter = 0;
}
particle::~particle()
{
for(int i=0; i<trails; i++)
delete[] vertices[i];
delete[] vertices;
}
float particle::update(float *c)
{
int i, p, growth;
float rgb[3];
float cx, cy, cz; // Containment variables
float luminosity;
static float expander = 1.0f + 0.0005f * float(_fc->dExpansion);
static float blower = 0.001f * float(_fc->dWind);
//static float otherxyz[3];
float depth = 0;
// Record old position
int oldc = counter;
float oldpos[3];
oldpos[0] = vertices[oldc][0];
oldpos[1] = vertices[oldc][1];
oldpos[2] = vertices[oldc][2];
counter ++;
if(counter >= _fc->dTrail)
counter = 0;
// Here's the iterative math for calculating new vertex positions
// first calculate limiting terms which keep vertices from constantly
// flying off to infinity
cx = vertices[oldc][0] * (1.0f - 1.0f / (vertices[oldc][0] * vertices[oldc][0] + 1.0f));
cy = vertices[oldc][1] * (1.0f - 1.0f / (vertices[oldc][1] * vertices[oldc][1] + 1.0f));
cz = vertices[oldc][2] * (1.0f - 1.0f / (vertices[oldc][2] * vertices[oldc][2] + 1.0f));
// then calculate new positions
vertices[counter][0] = vertices[oldc][0] + c[6] * offset[0] - cx
+ c[2] * vertices[oldc][1]
+ c[5] * vertices[oldc][2];
vertices[counter][1] = vertices[oldc][1] + c[6] * offset[1] - cy
+ c[1] * vertices[oldc][2]
+ c[4] * vertices[oldc][0];
vertices[counter][2] = vertices[oldc][2] + c[6] * offset[2] - cz
+ c[0] * vertices[oldc][0]
+ c[3] * vertices[oldc][1];
// Pick a hue
vertices[counter][3] = cx * cx + cy * cy + cz * cz;
if(vertices[counter][3] > 1.0f)
vertices[counter][3] = 1.0f;
vertices[counter][3] += c[7];
// Limit the hue (0 - 1)
if(vertices[counter][3] > 1.0f)
vertices[counter][3] -= 1.0f;
if(vertices[counter][3] < 0.0f)
vertices[counter][3] += 1.0f;
// Pick a saturation
vertices[counter][4] = c[0] + vertices[counter][3];
// Limit the saturation (0 - 1)
if(vertices[counter][4] < 0.0f)
vertices[counter][4] = -vertices[counter][4];
vertices[counter][4] -= float(int(vertices[counter][4]));
vertices[counter][4] = 1.0f - (vertices[counter][4] * vertices[counter][4]);
// Bring particles back if they escape
if(!counter){
if((vertices[0][0] > 1000000000.0f) || (vertices[0][0] < -1000000000.0f)
|| (vertices[0][1] > 1000000000.0f) || (vertices[0][1] < -1000000000.0f)
|| (vertices[2][2] > 1000000000.0f) || (vertices[0][2] < -1000000000.0f)){
vertices[0][0] = myRandf(2.0f) - 1.0f;
vertices[0][1] = myRandf(2.0f) - 1.0f;
vertices[0][2] = myRandf(2.0f) - 1.0f;
}
}
// Draw every vertex in particle trail
p = counter;
growth = 0;
luminosity = _fc->lumdiff;
for(i=0; i<_fc->dTrail; i++){
p ++;
if(p >= _fc->dTrail)
p = 0;
growth++;
// assign color to particle
hsl2rgb(vertices[p][3], vertices[p][4], luminosity, rgb[0], rgb[1], rgb[2]);
glColor3fv(rgb);
glPushMatrix();
if(_fc->dGeometry == 1) // Spheres
glTranslatef(vertices[p][0], vertices[p][1], vertices[p][2]);
else{ // Points or lights
depth = _fc->cosCameraAngle * vertices[p][2] - _fc->sinCameraAngle * vertices[p][0];
glTranslatef(_fc->cosCameraAngle * vertices[p][0] + _fc->sinCameraAngle
* vertices[p][2], vertices[p][1], depth);
}
if(_fc->dGeometry){ // Spheres or lights
switch(_fc->dTrail - growth){
case 0:
glScalef(0.259f, 0.259f, 0.259f);
break;
case 1:
glScalef(0.5f, 0.5f, 0.5f);
break;
case 2:
glScalef(0.707f, 0.707f, 0.707f);
break;
case 3:
glScalef(0.866f, 0.866f, 0.866f);
break;
case 4:
glScalef(0.966f, 0.966f, 0.966f);
}
}
switch(_fc->dGeometry){
case 0: // Points
switch(_fc->dTrail - growth){
case 0:
glPointSize(float(_fc->dSize * (depth + 200.0f) * 0.001036f));
break;
case 1:
glPointSize(float(_fc->dSize * (depth + 200.0f) * 0.002f));
break;
case 2:
glPointSize(float(_fc->dSize * (depth + 200.0f) * 0.002828f));
break;
case 3:
glPointSize(float(_fc->dSize * (depth + 200.0f) * 0.003464f));
break;
case 4:
glPointSize(float(_fc->dSize * (depth + 200.0f) * 0.003864f));
break;
default:
glPointSize(float(_fc->dSize * (depth + 200.0f) * 0.004f));
}
glBegin(GL_POINTS);
glVertex3f(0.0f,0.0f,0.0f);
glEnd();
break;
case 1: // Spheres
case 2: // Lights
glCallList(1);
}
glPopMatrix();
vertices[p][0] *= expander;
vertices[p][1] *= expander;
vertices[p][2] *= expander;
vertices[p][2] += blower;
luminosity += _fc->lumdiff;
}
// Find distance between new position and old position and return it
oldpos[0] -= vertices[counter][0];
oldpos[1] -= vertices[counter][1];
oldpos[2] -= vertices[counter][2];
return(float(sqrt(oldpos[0] * oldpos[0] + oldpos[1] * oldpos[1] + oldpos[2] * oldpos[2])));
}
// This class is a set of particle trails and constants that enter
// into their equations of motion.
class flux
{
public:
flux();
~flux();
void update();
particle *particles;
int randomize;
float c[NUMCONSTS]; // constants
float cv[NUMCONSTS]; // constants' change velocities
int currentSmartConstant;
float oldDistance;
};
flux::flux()
{
whichparticle = 0;
particles = new particle[_fc->dParticles];
randomize = 1;
float instability = _fc->dInstability;
int i;
for(i=0; i<NUMCONSTS; i++)
{
c[i] = myRandf(2.0f) - 1.0f;
cv[i] = myRandf(0.000005f * instability * instability)
+ 0.000001f * instability * instability;
}
currentSmartConstant = 0;
oldDistance = 0.0f;
}
flux::~flux()
{
delete[] particles;
}
void flux::update()
{
int i;
// randomize constants
if(_fc->dRandomize){
randomize --;
if(randomize <= 0){
for(i=0; i<NUMCONSTS; i++)
c[i] = myRandf(2.0f) - 1.0f;
int temp = 101 - _fc->dRandomize;
temp = temp * temp;
randomize = temp + myRandi(temp);
}
}
// update constants
for(i=0; i<NUMCONSTS; i++){
c[i] += cv[i];
if(c[i] >= 1.0f){
c[i] = 1.0f;
cv[i] = -cv[i];
}
if(c[i] <= -1.0f){
c[i] = -1.0f;
cv[i] = -cv[i];
}
}
// update all particles in this flux field
float dist;
for(i=0; i<_fc->dParticles; i++)
dist = particles[i].update(c);
// use dist from last particle to activate smart constants
_fc->dSmart = 0;
if(_fc->dSmart){
const float upper = 0.4f;
const float lower = 0.2f;
int beSmart = 0;
if(dist > upper && dist > oldDistance)
beSmart = 1;
if(dist < lower && dist < oldDistance)
beSmart = 1;
if(beSmart){
cv[currentSmartConstant] = -cv[currentSmartConstant];
currentSmartConstant ++;
if(currentSmartConstant >= _fc->dSmart)
currentSmartConstant = 0;
}
oldDistance = dist;
}
}
//----------------------------------------------------------------------------
FluxWidget::FluxWidget( QWidget* parent )
: QGLWidget(parent), _fluxes(0)
{
setDefaults( Regular );
_frameTime = 1000 / 60;
_timer = new QTimer( this );
connect( _timer, SIGNAL(timeout()), this, SLOT(nextFrame()) );
}
FluxWidget::~FluxWidget()
{
// Free memory
delete[] _fluxes;
}
void FluxWidget::paintGL()
{
// clear the screen
glLoadIdentity();
if(dBlur) // partially
{
int viewport[4];
glGetIntegerv(GL_VIEWPORT, viewport);
float viewRatio = float(viewport[2]) / float(viewport[3]);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
glDisable(GL_DEPTH_TEST);
glColor4f(0.0f, 0.0f, 0.0f, 0.5f - (float(sqrt(sqrt(double(dBlur)))) * 0.15495f));
glBegin(GL_TRIANGLE_STRIP);
glVertex3f(-3.0f * viewRatio, -3.0f, 0.0f);
glVertex3f(3.0f * viewRatio, -3.0f, 0.0f);
glVertex3f(-3.0f * viewRatio, 3.0f, 0.0f);
glVertex3f(3.0f * viewRatio, 3.0f, 0.0f);
glEnd();
}
else // completely
{
glClear(GL_COLOR_BUFFER_BIT);
}
cameraAngle += 0.01f * float(dRotation);
if(cameraAngle >= 360.0f)
cameraAngle -= 360.0f;
if(dGeometry == 1) // Only rotate for spheres
glRotatef(cameraAngle, 0.0f, 1.0f, 0.0f);
else
{
cosCameraAngle = cos(cameraAngle * DEG2RAD);
sinCameraAngle = sin(cameraAngle * DEG2RAD);
}
// set up blend modes for rendering particles
switch(dGeometry)
{
case 0: // Blending for points
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
glEnable(GL_BLEND);
glEnable(GL_POINT_SMOOTH);
glHint(GL_POINT_SMOOTH_HINT, GL_NICEST);
break;
case 1: // No blending for spheres, but we need z-buffering
glDisable(GL_BLEND);
glEnable(GL_DEPTH_TEST);
glClear(GL_DEPTH_BUFFER_BIT);
break;
case 2: // Blending for lights
glBlendFunc(GL_ONE, GL_ONE);
glEnable(GL_BLEND);
}
// Update particles
if( _fluxes )
{
_fc = this;
int i;
for(i=0; i<dFluxes; i++)
_fluxes[i].update();
}
glFlush();
}
void FluxWidget::resizeGL( int w, int h )
{
glViewport(0, 0, w, h );
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(100.0, (float) w / (float) h, 0.01, 200);
glTranslatef(0.0, 0.0, -2.5);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
// Window initialization
void FluxWidget::initializeGL()
{
//resizeGL( width(), height() );
updateParameters();
_timer->setSingleShot(true);
_timer->start( _frameTime );
}
#ifdef UNIT_TEST
void FluxWidget::keyPressEvent( QKeyEvent* e )
{
if( e->key() == Qt::Key_0 ) { setDefaults( 0 ); updateParameters(); }
if( e->key() == Qt::Key_1 ) { setDefaults( 1 ); updateParameters(); }
if( e->key() == Qt::Key_2 ) { setDefaults( 2 ); updateParameters(); }
if( e->key() == Qt::Key_3 ) { setDefaults( 3 ); updateParameters(); }
if( e->key() == Qt::Key_4 ) { setDefaults( 4 ); updateParameters(); }
if( e->key() == Qt::Key_5 ) { setDefaults( 5 ); updateParameters(); }
}
#endif
void FluxWidget::nextFrame()
{
updateGL();
_timer->setSingleShot(true);
_timer->start( _frameTime );
}
/**
May be called at any time - makes no OpenGL calls.
*/
void FluxWidget::setDefaults( int which )
{
switch(which)
{
case Hypnotic:
dFluxes = 2;
dParticles = 10;
dTrail = 40;
dGeometry = 2;
dSize = 15;
dRandomize = 80;
dExpansion = 20;
dRotation = 0;
dWind = 40;
dInstability = 10;
dBlur = 30;
break;
case Insane:
dFluxes = 4;
dParticles = 30;
dTrail = 8;
dGeometry = 2;
dSize = 25;
dRandomize = 0;
dExpansion = 80;
dRotation = 60;
dWind = 40;
dInstability = 100;
dBlur = 10;
break;
case Sparklers:
dFluxes = 3;
dParticles = 20;
dTrail = 6;
dGeometry = 1;
dSize = 20;
dComplexity = 3;
dRandomize = 85;
dExpansion = 60;
dRotation = 30;
dWind = 20;
dInstability = 30;
dBlur = 0;
break;
case Paradigm:
dFluxes = 1;
dParticles = 40;
dTrail = 40;
dGeometry = 2;
dSize = 5;
dRandomize = 90;
dExpansion = 30;
dRotation = 20;
dWind = 10;
dInstability = 5;
dBlur = 10;
break;
case Galactic:
dFluxes = 1;
dParticles = 2;
dTrail = 1500;
dGeometry = 2;
dSize = 10;
dRandomize = 0;
dExpansion = 5;
dRotation = 25;
dWind = 0;
dInstability = 5;
dBlur = 0;
break;
case Regular:
default:
dFluxes = 1;
dParticles = 20;
dTrail = 40;
dGeometry = 2;
dSize = 15;
dRandomize = 0;
dExpansion = 40;
dRotation = 30;
dWind = 20;
dInstability = 20;
dBlur = 0;
break;
}
}
/**
Called after dGeometry, dTrail, or dFluxes is changed
(such as with setDefaults).
*/
void FluxWidget::updateParameters()
{
int i, j;
float x, y, temp;
srand((unsigned)time(NULL));
rand(); rand(); rand(); rand(); rand();
cameraAngle = 0.0f;
glFrontFace(GL_CCW);
glEnable(GL_CULL_FACE);
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
if(dGeometry == 0)
{
glDisable(GL_LIGHTING);
glDisable(GL_COLOR_MATERIAL);
glDisable(GL_TEXTURE_2D);
glEnable(GL_POINT_SMOOTH);
//glHint(GL_POINT_SMOOTH_HINT, GL_NICEST);
}
else if(dGeometry == 1) // Spheres and their lighting
{
glNewList(1, GL_COMPILE);
GLUquadricObj* qobj = gluNewQuadric();
gluSphere(qobj, 0.005f * dSize, dComplexity + 2, dComplexity + 1);
gluDeleteQuadric(qobj);
glEndList();
glDisable(GL_TEXTURE_2D);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
float ambient[4] = {0.0f, 0.0f, 0.0f, 0.0f};
float diffuse[4] = {1.0f, 1.0f, 1.0f, 0.0f};
float specular[4] = {1.0f, 1.0f, 1.0f, 0.0f};
float position[4] = {500.0f, 500.0f, 500.0f, 0.0f};
glLightfv(GL_LIGHT0, GL_AMBIENT, ambient);
glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse);
glLightfv(GL_LIGHT0, GL_SPECULAR, specular);
glLightfv(GL_LIGHT0, GL_POSITION, position);
glEnable(GL_COLOR_MATERIAL);
glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE);
}
else if(dGeometry == 2) // Init lights
{
for(i=0; i<LIGHTSIZE; i++)
{
for(j=0; j<LIGHTSIZE; j++)
{
x = float(i - LIGHTSIZE / 2) / float(LIGHTSIZE / 2);
y = float(j - LIGHTSIZE / 2) / float(LIGHTSIZE / 2);
temp = 1.0f - float(sqrt((x * x) + (y * y)));
if(temp > 1.0f)
temp = 1.0f;
if(temp < 0.0f)
temp = 0.0f;
lightTexture[i][j] = (unsigned char) (255.0f * temp * temp);
}
}
glDisable(GL_LIGHTING);
glDisable(GL_COLOR_MATERIAL);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, 1);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexImage2D(GL_TEXTURE_2D, 0, 1, LIGHTSIZE, LIGHTSIZE, 0,
GL_LUMINANCE, GL_UNSIGNED_BYTE, lightTexture);
temp = float(dSize) * 0.005f;
glNewList(1, GL_COMPILE);
glBindTexture(GL_TEXTURE_2D, 1);
glBegin(GL_TRIANGLES);
glTexCoord2f(0.0f, 0.0f);
glVertex3f(-temp, -temp, 0.0f);
glTexCoord2f(1.0f, 0.0f);
glVertex3f(temp, -temp, 0.0f);
glTexCoord2f(1.0f, 1.0f);
glVertex3f(temp, temp, 0.0f);
glTexCoord2f(0.0f, 0.0f);
glVertex3f(-temp, -temp, 0.0f);
glTexCoord2f(1.0f, 1.0f);
glVertex3f(temp, temp, 0.0f);
glTexCoord2f(0.0f, 1.0f);
glVertex3f(-temp, temp, 0.0f);
glEnd();
glEndList();
}
// Initialize luminosity difference
lumdiff = 1.0f / float(dTrail);
_fc = this;
delete[] _fluxes;
_fluxes = new flux[dFluxes];
}
//----------------------------------------------------------------------------
#ifndef UNIT_TEST
#include <klocale.h>
#include <kglobal.h>
#include <kconfig.h>
// libkscreensaver interface
class KFluxSaverInterface : public KScreenSaverInterface
{
public:
virtual KAboutData* aboutData() {
return new KAboutData( "kflux.kss", "klock", ki18n( "Flux" ), "1.0", ki18n( "Flux" ) );
}
virtual KScreenSaver* create( WId id )
{
return new KFluxScreenSaver( id );
}
virtual QDialog* setup()
{
return new KFluxSetup;
}
};
int main( int argc, char *argv[] )
{
KFluxSaverInterface kss;
return kScreenSaverMain( argc, argv, kss );
}
//----------------------------------------------------------------------------
KFluxScreenSaver::KFluxScreenSaver( WId id ) : KScreenSaver( id )
{
_flux = new FluxWidget;
readSettings();
embed( _flux );
_flux->show();
show();
}
KFluxScreenSaver::~KFluxScreenSaver()
{
}
static int filterRandom( int n )
{
if( (n < 0) || (n >= FluxWidget::DefaultModes) )
{
srand((unsigned)time(NULL));
n = rand() % FluxWidget::DefaultModes;
}
return n;
}
void KFluxScreenSaver::readSettings()
{
KConfigGroup config(KGlobal::config(), "Settings");
_mode = config.readEntry( "Mode", (int)FluxWidget::Regular );
_flux->setDefaults( filterRandom(_mode) );
}
/**
Any invalid mode will select one at random.
*/
void KFluxScreenSaver::setMode( int id )
{
_mode = id;
_flux->setDefaults( filterRandom(id) );
_flux->updateParameters();
}
//----------------------------------------------------------------------------
#include <qlayout.h>
#include <qpushbutton.h>
#include <qlabel.h>
#include <qcombobox.h>
#include <kmessagebox.h>
static const char* defaultText[] =
{
I18N_NOOP( "Regular" ),
I18N_NOOP( "Hypnotic" ),
I18N_NOOP( "Insane" ),
I18N_NOOP( "Sparklers" ),
I18N_NOOP( "Paradigm" ),
I18N_NOOP( "Galactic" ),
I18N_NOOP( "(Random)" ),
0
};
KFluxSetup::KFluxSetup( QWidget* parent )
: KDialog( parent)
{
setButtonText( Help, i18n( "A&bout" ) );
setButtons(Ok|Cancel|Help);
setDefaultButton(Ok);
setModal(true);
showButtonSeparator(true);
QWidget *main = new QWidget(this);
setMainWidget(main);
QHBoxLayout* top = new QHBoxLayout( main );
top->setSpacing( spacingHint() );
QVBoxLayout* leftCol = new QVBoxLayout;
top->addLayout( leftCol );
setButtonText( Help, i18n( "A&bout" ) );
// Parameters
QLabel* label = new QLabel( i18n("Mode:"), main );
leftCol->addWidget( label );
modeW = new QComboBox( main );
int i = 0;
while (defaultText[i])
modeW->addItem( i18n(defaultText[i++]) );
leftCol->addWidget( modeW );
leftCol->addStretch();
// Preview
QWidget* preview;
preview = new QWidget( main );
preview->setFixedSize( 220, 165 );
{
QPalette palette;
palette.setColor( preview->backgroundRole(), Qt::black );
preview->setPalette( palette );
preview->setAutoFillBackground(true);
}
preview->show(); // otherwise saver does not get correct size
_saver = new KFluxScreenSaver( preview->winId() );
top->addWidget(preview);
// Now that we have _saver...
modeW->setCurrentIndex( _saver->mode() ); // set before we connect
connect( modeW, SIGNAL(activated(int)), _saver, SLOT(setMode(int)) );
connect( this, SIGNAL(okClicked()), SLOT(slotOk()));
connect(this, SIGNAL(helpClicked()),SLOT(slotHelp()));
}
KFluxSetup::~KFluxSetup()
{
delete _saver;
}
void KFluxSetup::slotHelp()
{
KMessageBox::about(this,
i18n("<h3>Flux 1.0</h3>\n<p>Copyright (c) 2002 Terence M. Welsh<br>\n<a href=\"http://www.reallyslick.com/\">http://www.reallyslick.com/</a></p>\n\n<p>Ported to KDE by Karl Robillard</p>"),
QString(), KMessageBox::AllowLink);
}
/**
Ok pressed - save settings and exit
*/
void KFluxSetup::slotOk()
{
KConfigGroup config(KGlobal::config(), "Settings");
QString val;
val.setNum( modeW->currentIndex() );
config.writeEntry("Mode", val );
config.sync();
accept();
}
#endif
//----------------------------------------------------------------------------
#ifdef UNIT_TEST
// moc Flux.h -o Flux.moc
// g++ -g -DUNIT_TEST Flux.cpp -I/usr/lib/qt3/include -lqt -L/usr/lib/qt3/lib -lGLU -lGL
#include <qapplication.h>
int main( int argc, char** argv )
{
QApplication app( argc, argv );
FluxWidget w;
w.setDefaults( FluxWidget::Sparklers );
app.setMainWidget( &w );
w.show();
return app.exec();
}
#endif
#include "Flux.moc"
//EOF

View file

@ -0,0 +1,157 @@
/*
* Terence Welsh Screensaver - Flux
* http://www.reallyslick.com/
*
* Ported to KDE by Karl Robillard
* Copyright (C) 2002 Terence M. Welsh
*
* 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 <http://www.gnu.org/licenses/>.
*/
#ifndef FLUXSS_H
#define FLUXSS_H
#include <qgl.h>
#define LIGHTSIZE 64
class flux;
class particle;
class QTimer;
class FluxWidget : public QGLWidget
{
Q_OBJECT
public:
enum eDefault
{
Regular,
Hypnotic,
Insane,
Sparklers,
Paradigm,
Galactic,
DefaultModes
};
FluxWidget( QWidget* parent=0 );
~FluxWidget();
void setDefaults( int which );
void updateParameters();
protected:
void paintGL();
void resizeGL( int w, int h );
void initializeGL();
#ifdef UNIT_TEST
void keyPressEvent( QKeyEvent* );
#endif
private slots:
void nextFrame();
private:
float lumdiff;
float cameraAngle;
float cosCameraAngle, sinCameraAngle;
unsigned char lightTexture[LIGHTSIZE][LIGHTSIZE];
int dFluxes;
int dParticles;
int dTrail;
int dGeometry;
float dSize;
int dComplexity;
int dRandomize;
int dExpansion;
int dRotation;
int dWind;
float dInstability;
int dBlur;
int dSmart;
int dPriority;
flux* _fluxes;
// Using QTimer rather than timerEvent() to avoid getting locked out of
// the QEvent loop on lower-end systems. Ian Geiser <geiseri@kde.org>
// says this is the way to go.
QTimer* _timer;
int _frameTime;
friend class flux;
friend class particle;
};
#ifndef UNIT_TEST
#include <kdialog.h>
#include <kscreensaver.h>
class KFluxScreenSaver : public KScreenSaver
{
Q_OBJECT
public:
KFluxScreenSaver( WId id );
virtual ~KFluxScreenSaver();
int mode() const { return _mode; }
public slots:
void setMode( int );
private:
void readSettings();
FluxWidget* _flux;
int _mode;
};
class QComboBox;
class KFluxSetup : public KDialog
{
Q_OBJECT
public:
KFluxSetup( QWidget* parent = 0 );
~KFluxSetup();
private slots:
void slotHelp();
void slotOk();
private:
QComboBox* modeW;
KFluxScreenSaver* _saver;
};
#endif
#endif //__FLUXSS_H__

View file

@ -0,0 +1,295 @@
[Desktop Entry]
Exec=kbanner.kss
Icon=preferences-desktop-screensaver
Type=Service
X-KDE-ServiceTypes=ScreenSaver
Actions=Setup;InWindow;Root;
X-KDE-Category=Banners & Pictures
Name=Banner
Name[af]=Bannier
Name[ast]=Pancarta
Name[bg]=Банер
Name[br]=Lugan
Name[bs]=Zastava
Name[ca]=Rètol
Name[ca@valencia]=Rètol
Name[cs]=Běžící text
Name[cy]=Baner
Name[da]=Banner
Name[de]=Lauftext
Name[el]=Τίτλος
Name[en_GB]=Banner
Name[eo]=Standardo
Name[es]=Pancarta
Name[et]=Tekstiriba
Name[eu]=Titularra
Name[fa]=بنر
Name[fi]=Viesti
Name[fr]=Bannière
Name[fy]=Ljochtkrante
Name[ga]=Meirge
Name[gl]=Cartel
Name[he]=כתובית
Name[hne]=
Name[hr]=Natpis
Name[hu]=Banner
Name[is]=Borði
Name[it]=Testo scorrevole
Name[ja]=
Name[kk]=Баннер
Name[ko]=
Name[lt]=Plakatas
Name[lv]=Karogs
Name[mk]=Транспарент
Name[ml]=
Name[ms]=Kain Rentang
Name[nb]=Banner
Name[nds]=Looptext
Name[ne]=
Name[nl]=Lichtkrant
Name[nn]=Fane
Name[pa]=
Name[pl]=Banner
Name[pt]=Cartaz
Name[pt_BR]=Banner
Name[ro]=Baner
Name[ru]=Бегущая строка
Name[sk]=Banner
Name[sl]=Napis
Name[sq]=Banner
Name[sr]=Барјак
Name[sr@ijekavian]=Барјак
Name[sr@ijekavianlatin]=Barjak
Name[sr@latin]=Barjak
Name[sv]=Rubrik
Name[ta]=
Name[tg]=Давида истодаи рах
Name[th]=
Name[tr]=Afiş
Name[ug]=لەۋھە
Name[uk]=Транспарант
Name[vi]=Biu ng
Name[xh]=Isiqwentshu selaphu
Name[x-test]=xxBannerxx
Name[zh_CN]=
Name[zh_TW]=
[Desktop Action Setup]
Exec=kbanner.kss -setup
Name=Setup...
Name[af]=Opstelling...
Name[ast]=Configuración...
Name[bg]=Настройки...
Name[br]=Kefluniadur ...
Name[bs]=Podesi...
Name[ca]=Arranjament...
Name[ca@valencia]=Arranjament...
Name[cs]=Nastavení...
Name[cy]=Gosod ...
Name[da]=Opsætning...
Name[de]=Einrichtung ...
Name[el]=Ρύθμιση...
Name[en_GB]=Setup...
Name[eo]=Agordo...
Name[es]=Configuración...
Name[et]=Seadistamine...
Name[eu]=Konfiguratu...
Name[fa]=برپایی...
Name[fi]=Asetukset
Name[fr]=Configuration...
Name[fy]=Opset...
Name[ga]=Socrú...
Name[gl]=Configuración...
Name[he]=הגדרות...
Name[hne]=...
Name[hr]=Postavke 
Name[hu]=Beállítás...
Name[is]=Stillingar...
Name[it]=Impostazioni...
Name[ja]=...
Name[kk]=Баптау...
Name[ko]=...
Name[lt]=Sąranka ...
Name[lv]=Iestatījumi...
Name[mai]=...
Name[mk]=Поставување...
Name[ml]=...
Name[mr]= ...
Name[ms]=Setkan...
Name[nb]=Innstillinger 
Name[nds]=Instellen...
Name[ne]=...
Name[nl]=Instellingen...
Name[nn]=Oppsett 
Name[pa]=...
Name[pl]=Ustawienia...
Name[pt]=Configurar...
Name[pt_BR]=Configurar...
Name[ro]=Configurare...
Name[ru]=Настройка...
Name[sk]=Nastavenie...
Name[sl]=Nastavi ...
Name[sq]=Instalimi...
Name[sr]=Подеси...
Name[sr@ijekavian]=Подеси...
Name[sr@ijekavianlatin]=Podesi...
Name[sr@latin]=Podesi...
Name[sv]=Inställningar...
Name[ta]=...
Name[tg]=Барпосозӣ...
Name[th]=...
Name[tr]=Kurulum...
Name[ug]=ئورنات
Name[uk]=Встановити...
Name[uz]=Oʻrnatish
Name[uz@cyrillic]=Ўрнатиш
Name[vi]=Thiết lp...
Name[xh]=Iyacwangciswa...
Name[x-test]=xxSetup...xx
Name[zh_CN]=...
Name[zh_TW]=...
Icon=preferences-desktop-screensaver
[Desktop Action InWindow]
Exec=kbanner.kss -window-id %w
Name=Display in Specified Window
Name[ast]=Amosar na ventana especificada
Name[bg]=Показване в избран прозорец
Name[br]=Diskwel er prenestr spisaet
Name[bs]=Prikaži u određenom prozoru
Name[ca]=Mostra a la finestra especificada
Name[ca@valencia]=Mostra a la finestra especificada
Name[cs]=Zobrazit v určeném okně
Name[cy]=Dangos mewn Ffenestr Benodol
Name[da]=Visning i angivet vindue
Name[de]=In bestimmten Fenster anzeigen
Name[el]=Προβολή στο καθορισμένο παράθυρο
Name[en_GB]=Display in Specified Window
Name[eo]=Montri en indikita fenestro
Name[es]=Mostrar en la ventana especificada
Name[et]=Määratud aknas näitamine
Name[eu]=Bistaratu zehaztutako lehioan
Name[fa]=نمایش در پنجره مشخصشده
Name[fi]=Näytä määrätyssä ikkunassa
Name[fr]=Affichage dans la fenêtre spécifiée
Name[fy]=Werjefte yn in definiearre finster
Name[ga]=Taispeáin san Fhuinneog Sonraithe
Name[gl]=Mostrar na xanela indicada
Name[he]=הצג בחלון המצוין
Name[hne]=िि ि
Name[hr]=Prikaži u određenom prozoru
Name[hu]=Megjelenítés a megadott ablakban
Name[is]=Birta í völdum glugga
Name[it]=Mostra nella finestra specificata
Name[ja]=
Name[kk]=Келтірілген терезеде көрсетілсін
Name[ko]=
Name[lt]=Rodyti nurodytame lange
Name[lv]=Rādīt norādītajā logā
Name[mai]=िि ि ि
Name[mk]=Прикажи во наведениот прозорец
Name[ml]= ിി ി ിി
Name[mr]=ि
Name[ms]=Papar dalam Tetingkap Yang Dinyatakan
Name[nb]=Vis i angitt vindu
Name[nds]=In utsöcht Finster wiesen
Name[ne]=िि
Name[nl]=Weergeven In een opgegeven venster
Name[nn]=Vis i oppgjeve vindauge
Name[pa]= ਿ
Name[pl]=Wyświetl w zadanym oknie
Name[pt]=Mostrar na Janela Indicada
Name[pt_BR]=Exibir na janela indicada
Name[ro]=Afișează în fereastra specificată
Name[ru]=Показывать в указанном окне
Name[sk]=Zobraziť v zadanom okne
Name[sl]=Pokaži v določenem oknu
Name[sq]=Shfaq në Dritaren e Specifikuar
Name[sr]=Прикажи у задатом прозору
Name[sr@ijekavian]=Прикажи у задатом прозору
Name[sr@ijekavianlatin]=Prikaži u zadatom prozoru
Name[sr@latin]=Prikaži u zadatom prozoru
Name[sv]=Visa i angivet fönster
Name[ta]=ி ி
Name[tg]=Дар тирезаи нишондода намоиш намоед
Name[th]=
Name[tr]=Belirtilen Pencerede Göster
Name[ug]=بەلگىلەنگەن كۆزنەكتە كۆرسەت
Name[uk]=Відобразити у вказаному вікні
Name[vi]=Hin th trong Ca s Đã đnh
Name[x-test]=xxDisplay in Specified Windowxx
Name[zh_CN]=
Name[zh_TW]=
NoDisplay=true
[Desktop Action Root]
Exec=kbanner.kss -root
Name=Display in Root Window
Name[ast]=Amosar na ventana raíz
Name[bg]=Показване в главния прозорец
Name[br]=Diskwel er prenestr gwrizienn
Name[bs]=Prikaži u korijenom prozoru
Name[ca]=Mostra a la finestra arrel
Name[ca@valencia]=Mostra a la finestra arrel
Name[cs]=Zobrazit na pozadí plochy
Name[cy]=Dangos mewn Ffenestr Wraidd
Name[da]=Visning i root-vindue
Name[de]=In Hintergrundfenster anzeigen
Name[el]=Προβολή στο βασικό παράθυρο
Name[en_GB]=Display in Root Window
Name[eo]=Montri en radika fenestro
Name[es]=Mostrar en la ventana raíz
Name[et]=Juuraknas näitamine
Name[eu]=Bistaratu erro lehioan
Name[fa]=نمایش در پنجره ریشه
Name[fi]=Näytä juuri-ikkunassa
Name[fr]=Affichage dans la fenêtre racine
Name[fy]=Werjefte yn haadfinster
Name[ga]=Taispeáin sa Phríomhfhuinneog
Name[gl]=Mostrar na xanela raíz
Name[he]=הצג בחלון השורש
Name[hne]= ि
Name[hr]=Prikaži u ishodišnom prozoru
Name[hu]=Megjelenítés a gyökérablakban
Name[is]=Birta í rótarglugganum
Name[it]=Mostra sullo sfondo
Name[ja]=
Name[kk]=Түбір терезесінде көрсетілсін
Name[ko]=
Name[lt]=Rodyti root lange
Name[lv]=Rādīt saknes logā
Name[mai]= ि ि
Name[mk]=Прикажи во коренскиот прозорец
Name[ml]= ി ിി
Name[mr]=
Name[ms]=Papar dalam Tetingkap Root
Name[nb]=Vis i root-vindu
Name[nds]=In Hööftfinster wiesen
Name[ne]=
Name[nl]=Weergeven in hoofdvenster
Name[nn]=Vis i rotvindauget
Name[pa]=Root ਿ
Name[pl]=Wyświetl w oknie głównym
Name[pt]=Mostrar na Janela de Fundo
Name[pt_BR]=Exibir na janela raiz
Name[ro]=Afișează în fereastra rădăcină
Name[ru]=Показывать в корневом окне
Name[sk]=Zobraziť v koreňovom okne
Name[sl]=Pokaži v določenem oknu
Name[sq]=Shfaq në Dritaren Bazë
Name[sr]=Прикажи у кореном прозору
Name[sr@ijekavian]=Прикажи у корјеном прозору
Name[sr@ijekavianlatin]=Prikaži u korjenom prozoru
Name[sr@latin]=Prikaži u korenom prozoru
Name[sv]=Visa i rotfönstret
Name[ta]= ி
Name[tg]=Дар тирезаи решагӣ намоиш намоед
Name[th]=
Name[tr]=Kök Pencerede Göster
Name[ug]=غول كۆزنەكتە كۆرسەت
Name[uk]=Відобразити в кореневому вікні
Name[vi]=Hin th trong Ca s Gc
Name[x-test]=xxDisplay in Root Windowxx
Name[zh_CN]=
Name[zh_TW]=
NoDisplay=true

View file

@ -0,0 +1,291 @@
[Desktop Entry]
Exec=kblob.kss
Icon=preferences-desktop-screensaver
Type=Service
X-KDE-ServiceTypes=ScreenSaver
Actions=Setup;InWindow;Root;
X-KDE-Category=Visit to Flatland
Name=Blob
Name[af]=Blob
Name[ast]=Blob
Name[bg]=Петно
Name[br]=Pokard
Name[bs]=Grudva
Name[ca]=Bombolla
Name[ca@valencia]=Bombolla
Name[cs]=Kaňka
Name[cy]=Smotyn
Name[da]=Dråbe
Name[de]=Blob 
Name[el]=Blob
Name[en_GB]=Blob
Name[eo]=Gutoj
Name[es]=Blob
Name[et]=Piisk
Name[eu]=Tanta
Name[fi]=Kuplat
Name[fr]=Blob
Name[fy]=Blob
Name[ga]=Blob
Name[gl]=Blob
Name[he]=כתמים
Name[hne]=
Name[hu]=Blob
Name[is]=Blob
Name[it]=Blob
Name[ja]=
Name[kk]=Геометриялық өрнектер
Name[ko]=
Name[lt]=Rutuliukas
Name[lv]=Lāse
Name[mk]=Дамка
Name[ml]=
Name[ms]=Blob
Name[nb]=Fargeflekk
Name[nds]=Blob
Name[ne]=
Name[nl]=Blob
Name[nn]=Klattar
Name[pa]=Blob
Name[pl]=Bąbel
Name[pt]=Blob
Name[pt_BR]=Gotas
Name[ro]=Bule
Name[ru]=Геометрические построения
Name[sk]=Blob
Name[sl]=Kepica
Name[sq]=Blob
Name[sr]=БЛОБ
Name[sr@ijekavian]=БЛОБ
Name[sr@ijekavianlatin]=BLOB
Name[sr@latin]=BLOB
Name[sv]=Färgfläck
Name[ta]=ி
Name[tg]=Асос гузории геометрӣ
Name[tr]=Damlacık
Name[uk]=Геометричні візерунки
Name[vi]=Git nưc
Name[xh]=Ichaphaza elincinane
Name[x-test]=xxBlobxx
Name[zh_CN]=
Name[zh_TW]=
[Desktop Action Setup]
Exec=kblob.kss -setup
Name=Setup...
Name[af]=Opstelling...
Name[ast]=Configuración...
Name[bg]=Настройки...
Name[br]=Kefluniadur ...
Name[bs]=Podesi...
Name[ca]=Arranjament...
Name[ca@valencia]=Arranjament...
Name[cs]=Nastavení...
Name[cy]=Gosod ...
Name[da]=Opsætning...
Name[de]=Einrichtung ...
Name[el]=Ρύθμιση...
Name[en_GB]=Setup...
Name[eo]=Agordo...
Name[es]=Configuración...
Name[et]=Seadistamine...
Name[eu]=Konfiguratu...
Name[fa]=برپایی...
Name[fi]=Asetukset
Name[fr]=Configuration...
Name[fy]=Opset...
Name[ga]=Socrú...
Name[gl]=Configuración...
Name[he]=הגדרות...
Name[hne]=...
Name[hr]=Postavke 
Name[hu]=Beállítás...
Name[is]=Stillingar...
Name[it]=Impostazioni...
Name[ja]=...
Name[kk]=Баптау...
Name[ko]=...
Name[lt]=Sąranka ...
Name[lv]=Iestatījumi...
Name[mai]=...
Name[mk]=Поставување...
Name[ml]=...
Name[mr]= ...
Name[ms]=Setkan...
Name[nb]=Innstillinger 
Name[nds]=Instellen...
Name[ne]=...
Name[nl]=Instellingen...
Name[nn]=Oppsett 
Name[pa]=...
Name[pl]=Ustawienia...
Name[pt]=Configurar...
Name[pt_BR]=Configurar...
Name[ro]=Configurare...
Name[ru]=Настройка...
Name[sk]=Nastavenie...
Name[sl]=Nastavi ...
Name[sq]=Instalimi...
Name[sr]=Подеси...
Name[sr@ijekavian]=Подеси...
Name[sr@ijekavianlatin]=Podesi...
Name[sr@latin]=Podesi...
Name[sv]=Inställningar...
Name[ta]=...
Name[tg]=Барпосозӣ...
Name[th]=...
Name[tr]=Kurulum...
Name[ug]=ئورنات
Name[uk]=Встановити...
Name[uz]=Oʻrnatish
Name[uz@cyrillic]=Ўрнатиш
Name[vi]=Thiết lp...
Name[xh]=Iyacwangciswa...
Name[x-test]=xxSetup...xx
Name[zh_CN]=...
Name[zh_TW]=...
Icon=preferences-desktop-screensaver
[Desktop Action InWindow]
Exec=kblob.kss -window-id %w
Name=Display in Specified Window
Name[ast]=Amosar na ventana especificada
Name[bg]=Показване в избран прозорец
Name[br]=Diskwel er prenestr spisaet
Name[bs]=Prikaži u određenom prozoru
Name[ca]=Mostra a la finestra especificada
Name[ca@valencia]=Mostra a la finestra especificada
Name[cs]=Zobrazit v určeném okně
Name[cy]=Dangos mewn Ffenestr Benodol
Name[da]=Visning i angivet vindue
Name[de]=In bestimmten Fenster anzeigen
Name[el]=Προβολή στο καθορισμένο παράθυρο
Name[en_GB]=Display in Specified Window
Name[eo]=Montri en indikita fenestro
Name[es]=Mostrar en la ventana especificada
Name[et]=Määratud aknas näitamine
Name[eu]=Bistaratu zehaztutako lehioan
Name[fa]=نمایش در پنجره مشخصشده
Name[fi]=Näytä määrätyssä ikkunassa
Name[fr]=Affichage dans la fenêtre spécifiée
Name[fy]=Werjefte yn in definiearre finster
Name[ga]=Taispeáin san Fhuinneog Sonraithe
Name[gl]=Mostrar na xanela indicada
Name[he]=הצג בחלון המצוין
Name[hne]=िि ि
Name[hr]=Prikaži u određenom prozoru
Name[hu]=Megjelenítés a megadott ablakban
Name[is]=Birta í völdum glugga
Name[it]=Mostra nella finestra specificata
Name[ja]=
Name[kk]=Келтірілген терезеде көрсетілсін
Name[ko]=
Name[lt]=Rodyti nurodytame lange
Name[lv]=Rādīt norādītajā logā
Name[mai]=िि ि ि
Name[mk]=Прикажи во наведениот прозорец
Name[ml]= ിി ി ിി
Name[mr]=ि
Name[ms]=Papar dalam Tetingkap Yang Dinyatakan
Name[nb]=Vis i angitt vindu
Name[nds]=In utsöcht Finster wiesen
Name[ne]=िि
Name[nl]=Weergeven In een opgegeven venster
Name[nn]=Vis i oppgjeve vindauge
Name[pa]= ਿ
Name[pl]=Wyświetl w zadanym oknie
Name[pt]=Mostrar na Janela Indicada
Name[pt_BR]=Exibir na janela indicada
Name[ro]=Afișează în fereastra specificată
Name[ru]=Показывать в указанном окне
Name[sk]=Zobraziť v zadanom okne
Name[sl]=Pokaži v določenem oknu
Name[sq]=Shfaq në Dritaren e Specifikuar
Name[sr]=Прикажи у задатом прозору
Name[sr@ijekavian]=Прикажи у задатом прозору
Name[sr@ijekavianlatin]=Prikaži u zadatom prozoru
Name[sr@latin]=Prikaži u zadatom prozoru
Name[sv]=Visa i angivet fönster
Name[ta]=ி ி
Name[tg]=Дар тирезаи нишондода намоиш намоед
Name[th]=
Name[tr]=Belirtilen Pencerede Göster
Name[ug]=بەلگىلەنگەن كۆزنەكتە كۆرسەت
Name[uk]=Відобразити у вказаному вікні
Name[vi]=Hin th trong Ca s Đã đnh
Name[x-test]=xxDisplay in Specified Windowxx
Name[zh_CN]=
Name[zh_TW]=
NoDisplay=true
[Desktop Action Root]
Exec=kblob.kss -root
Name=Display in Root Window
Name[ast]=Amosar na ventana raíz
Name[bg]=Показване в главния прозорец
Name[br]=Diskwel er prenestr gwrizienn
Name[bs]=Prikaži u korijenom prozoru
Name[ca]=Mostra a la finestra arrel
Name[ca@valencia]=Mostra a la finestra arrel
Name[cs]=Zobrazit na pozadí plochy
Name[cy]=Dangos mewn Ffenestr Wraidd
Name[da]=Visning i root-vindue
Name[de]=In Hintergrundfenster anzeigen
Name[el]=Προβολή στο βασικό παράθυρο
Name[en_GB]=Display in Root Window
Name[eo]=Montri en radika fenestro
Name[es]=Mostrar en la ventana raíz
Name[et]=Juuraknas näitamine
Name[eu]=Bistaratu erro lehioan
Name[fa]=نمایش در پنجره ریشه
Name[fi]=Näytä juuri-ikkunassa
Name[fr]=Affichage dans la fenêtre racine
Name[fy]=Werjefte yn haadfinster
Name[ga]=Taispeáin sa Phríomhfhuinneog
Name[gl]=Mostrar na xanela raíz
Name[he]=הצג בחלון השורש
Name[hne]= ि
Name[hr]=Prikaži u ishodišnom prozoru
Name[hu]=Megjelenítés a gyökérablakban
Name[is]=Birta í rótarglugganum
Name[it]=Mostra sullo sfondo
Name[ja]=
Name[kk]=Түбір терезесінде көрсетілсін
Name[ko]=
Name[lt]=Rodyti root lange
Name[lv]=Rādīt saknes logā
Name[mai]= ि ि
Name[mk]=Прикажи во коренскиот прозорец
Name[ml]= ി ിി
Name[mr]=
Name[ms]=Papar dalam Tetingkap Root
Name[nb]=Vis i root-vindu
Name[nds]=In Hööftfinster wiesen
Name[ne]=
Name[nl]=Weergeven in hoofdvenster
Name[nn]=Vis i rotvindauget
Name[pa]=Root ਿ
Name[pl]=Wyświetl w oknie głównym
Name[pt]=Mostrar na Janela de Fundo
Name[pt_BR]=Exibir na janela raiz
Name[ro]=Afișează în fereastra rădăcină
Name[ru]=Показывать в корневом окне
Name[sk]=Zobraziť v koreňovom okne
Name[sl]=Pokaži v določenem oknu
Name[sq]=Shfaq në Dritaren Bazë
Name[sr]=Прикажи у кореном прозору
Name[sr@ijekavian]=Прикажи у корјеном прозору
Name[sr@ijekavianlatin]=Prikaži u korjenom prozoru
Name[sr@latin]=Prikaži u korenom prozoru
Name[sv]=Visa i rotfönstret
Name[ta]= ி
Name[tg]=Дар тирезаи решагӣ намоиш намоед
Name[th]=
Name[tr]=Kök Pencerede Göster
Name[ug]=غول كۆزنەكتە كۆرسەت
Name[uk]=Відобразити в кореневому вікні
Name[vi]=Hin th trong Ca s Gc
Name[x-test]=xxDisplay in Root Windowxx
Name[zh_CN]=
Name[zh_TW]=
NoDisplay=true

View file

@ -0,0 +1,299 @@
[Desktop Entry]
Exec=kclock.kss
Icon=preferences-desktop-screensaver
Type=Service
X-KDE-ServiceTypes=ScreenSaver
Actions=Setup;InWindow;Root;
X-KDE-Category=Miscellaneous
Name=Clock
Name[ast]=Reló
Name[bg]=Часовник
Name[br]=Eurier
Name[bs]=Sat
Name[ca]=Rellotge
Name[ca@valencia]=Rellotge
Name[cs]=Hodiny
Name[cy]=Cloc
Name[da]=Ur
Name[de]=Uhr
Name[el]=Clock
Name[en_GB]=Clock
Name[eo]=Horloĝo
Name[es]=Reloj
Name[et]=Kell
Name[eu]=Erlojua
Name[fa]=ساعت
Name[fi]=Kello
Name[fr]=Horloge
Name[fy]=Klok
Name[ga]=Clog
Name[gl]=Reloxo
Name[he]=שעון
Name[hne]=
Name[hu]=Clock
Name[is]=Klukka
Name[it]=Orologio
Name[ja]=
Name[kk]=Сағат
Name[ko]=
Name[ku]=Saet
Name[lt]=Laikrodis
Name[lv]=Pulkstenis
Name[mai]=
Name[mk]=Часовник
Name[ml]=ി
Name[mr]=
Name[ms]=Jam
Name[nb]=Klokke
Name[nds]=Klock
Name[ne]=
Name[nl]=Klok
Name[nn]=Klokke
Name[oc]=Relòtge
Name[pa]=
Name[pl]=Zegar
Name[pt]=Relógio
Name[pt_BR]=Relógio
Name[ro]=Ceas
Name[ru]=Часы
Name[sk]=Hodiny
Name[sl]=Ura
Name[sq]=Ora
Name[sr]=Сат
Name[sr@ijekavian]=Сат
Name[sr@ijekavianlatin]=Sat
Name[sr@latin]=Sat
Name[sv]=Klocka
Name[ta]=ி
Name[tg]=Соат
Name[th]=
Name[tr]=Saat
Name[ug]=سائەت
Name[uk]=Годинник
Name[uz]=Soat
Name[uz@cyrillic]=Соат
Name[vi]=Đng h
Name[xh]=Ikloko
Name[x-test]=xxClockxx
Name[zh_CN]=
Name[zh_TW]=
[Desktop Action Setup]
Exec=kclock.kss -setup
Name=Setup...
Name[af]=Opstelling...
Name[ast]=Configuración...
Name[bg]=Настройки...
Name[br]=Kefluniadur ...
Name[bs]=Podesi...
Name[ca]=Arranjament...
Name[ca@valencia]=Arranjament...
Name[cs]=Nastavení...
Name[cy]=Gosod ...
Name[da]=Opsætning...
Name[de]=Einrichtung ...
Name[el]=Ρύθμιση...
Name[en_GB]=Setup...
Name[eo]=Agordo...
Name[es]=Configuración...
Name[et]=Seadistamine...
Name[eu]=Konfiguratu...
Name[fa]=برپایی...
Name[fi]=Asetukset
Name[fr]=Configuration...
Name[fy]=Opset...
Name[ga]=Socrú...
Name[gl]=Configuración...
Name[he]=הגדרות...
Name[hne]=...
Name[hr]=Postavke 
Name[hu]=Beállítás...
Name[is]=Stillingar...
Name[it]=Impostazioni...
Name[ja]=...
Name[kk]=Баптау...
Name[ko]=...
Name[lt]=Sąranka ...
Name[lv]=Iestatījumi...
Name[mai]=...
Name[mk]=Поставување...
Name[ml]=...
Name[mr]= ...
Name[ms]=Setkan...
Name[nb]=Innstillinger 
Name[nds]=Instellen...
Name[ne]=...
Name[nl]=Instellingen...
Name[nn]=Oppsett 
Name[pa]=...
Name[pl]=Ustawienia...
Name[pt]=Configurar...
Name[pt_BR]=Configurar...
Name[ro]=Configurare...
Name[ru]=Настройка...
Name[sk]=Nastavenie...
Name[sl]=Nastavi ...
Name[sq]=Instalimi...
Name[sr]=Подеси...
Name[sr@ijekavian]=Подеси...
Name[sr@ijekavianlatin]=Podesi...
Name[sr@latin]=Podesi...
Name[sv]=Inställningar...
Name[ta]=...
Name[tg]=Барпосозӣ...
Name[th]=...
Name[tr]=Kurulum...
Name[ug]=ئورنات
Name[uk]=Встановити...
Name[uz]=Oʻrnatish
Name[uz@cyrillic]=Ўрнатиш
Name[vi]=Thiết lp...
Name[xh]=Iyacwangciswa...
Name[x-test]=xxSetup...xx
Name[zh_CN]=...
Name[zh_TW]=...
Icon=preferences-desktop-screensaver
[Desktop Action InWindow]
Exec=kclock.kss -window-id %w
Name=Display in Specified Window
Name[ast]=Amosar na ventana especificada
Name[bg]=Показване в избран прозорец
Name[br]=Diskwel er prenestr spisaet
Name[bs]=Prikaži u određenom prozoru
Name[ca]=Mostra a la finestra especificada
Name[ca@valencia]=Mostra a la finestra especificada
Name[cs]=Zobrazit v určeném okně
Name[cy]=Dangos mewn Ffenestr Benodol
Name[da]=Visning i angivet vindue
Name[de]=In bestimmten Fenster anzeigen
Name[el]=Προβολή στο καθορισμένο παράθυρο
Name[en_GB]=Display in Specified Window
Name[eo]=Montri en indikita fenestro
Name[es]=Mostrar en la ventana especificada
Name[et]=Määratud aknas näitamine
Name[eu]=Bistaratu zehaztutako lehioan
Name[fa]=نمایش در پنجره مشخصشده
Name[fi]=Näytä määrätyssä ikkunassa
Name[fr]=Affichage dans la fenêtre spécifiée
Name[fy]=Werjefte yn in definiearre finster
Name[ga]=Taispeáin san Fhuinneog Sonraithe
Name[gl]=Mostrar na xanela indicada
Name[he]=הצג בחלון המצוין
Name[hne]=िि ि
Name[hr]=Prikaži u određenom prozoru
Name[hu]=Megjelenítés a megadott ablakban
Name[is]=Birta í völdum glugga
Name[it]=Mostra nella finestra specificata
Name[ja]=
Name[kk]=Келтірілген терезеде көрсетілсін
Name[ko]=
Name[lt]=Rodyti nurodytame lange
Name[lv]=Rādīt norādītajā logā
Name[mai]=िि ि ि
Name[mk]=Прикажи во наведениот прозорец
Name[ml]= ിി ി ിി
Name[mr]=ि
Name[ms]=Papar dalam Tetingkap Yang Dinyatakan
Name[nb]=Vis i angitt vindu
Name[nds]=In utsöcht Finster wiesen
Name[ne]=िि
Name[nl]=Weergeven In een opgegeven venster
Name[nn]=Vis i oppgjeve vindauge
Name[pa]= ਿ
Name[pl]=Wyświetl w zadanym oknie
Name[pt]=Mostrar na Janela Indicada
Name[pt_BR]=Exibir na janela indicada
Name[ro]=Afișează în fereastra specificată
Name[ru]=Показывать в указанном окне
Name[sk]=Zobraziť v zadanom okne
Name[sl]=Pokaži v določenem oknu
Name[sq]=Shfaq në Dritaren e Specifikuar
Name[sr]=Прикажи у задатом прозору
Name[sr@ijekavian]=Прикажи у задатом прозору
Name[sr@ijekavianlatin]=Prikaži u zadatom prozoru
Name[sr@latin]=Prikaži u zadatom prozoru
Name[sv]=Visa i angivet fönster
Name[ta]=ி ி
Name[tg]=Дар тирезаи нишондода намоиш намоед
Name[th]=
Name[tr]=Belirtilen Pencerede Göster
Name[ug]=بەلگىلەنگەن كۆزنەكتە كۆرسەت
Name[uk]=Відобразити у вказаному вікні
Name[vi]=Hin th trong Ca s Đã đnh
Name[x-test]=xxDisplay in Specified Windowxx
Name[zh_CN]=
Name[zh_TW]=
NoDisplay=true
[Desktop Action Root]
Exec=kclock.kss -root
Name=Display in Root Window
Name[ast]=Amosar na ventana raíz
Name[bg]=Показване в главния прозорец
Name[br]=Diskwel er prenestr gwrizienn
Name[bs]=Prikaži u korijenom prozoru
Name[ca]=Mostra a la finestra arrel
Name[ca@valencia]=Mostra a la finestra arrel
Name[cs]=Zobrazit na pozadí plochy
Name[cy]=Dangos mewn Ffenestr Wraidd
Name[da]=Visning i root-vindue
Name[de]=In Hintergrundfenster anzeigen
Name[el]=Προβολή στο βασικό παράθυρο
Name[en_GB]=Display in Root Window
Name[eo]=Montri en radika fenestro
Name[es]=Mostrar en la ventana raíz
Name[et]=Juuraknas näitamine
Name[eu]=Bistaratu erro lehioan
Name[fa]=نمایش در پنجره ریشه
Name[fi]=Näytä juuri-ikkunassa
Name[fr]=Affichage dans la fenêtre racine
Name[fy]=Werjefte yn haadfinster
Name[ga]=Taispeáin sa Phríomhfhuinneog
Name[gl]=Mostrar na xanela raíz
Name[he]=הצג בחלון השורש
Name[hne]= ि
Name[hr]=Prikaži u ishodišnom prozoru
Name[hu]=Megjelenítés a gyökérablakban
Name[is]=Birta í rótarglugganum
Name[it]=Mostra sullo sfondo
Name[ja]=
Name[kk]=Түбір терезесінде көрсетілсін
Name[ko]=
Name[lt]=Rodyti root lange
Name[lv]=Rādīt saknes logā
Name[mai]= ि ि
Name[mk]=Прикажи во коренскиот прозорец
Name[ml]= ി ിി
Name[mr]=
Name[ms]=Papar dalam Tetingkap Root
Name[nb]=Vis i root-vindu
Name[nds]=In Hööftfinster wiesen
Name[ne]=
Name[nl]=Weergeven in hoofdvenster
Name[nn]=Vis i rotvindauget
Name[pa]=Root ਿ
Name[pl]=Wyświetl w oknie głównym
Name[pt]=Mostrar na Janela de Fundo
Name[pt_BR]=Exibir na janela raiz
Name[ro]=Afișează în fereastra rădăcină
Name[ru]=Показывать в корневом окне
Name[sk]=Zobraziť v koreňovom okne
Name[sl]=Pokaži v določenem oknu
Name[sq]=Shfaq në Dritaren Bazë
Name[sr]=Прикажи у кореном прозору
Name[sr@ijekavian]=Прикажи у корјеном прозору
Name[sr@ijekavianlatin]=Prikaži u korjenom prozoru
Name[sr@latin]=Prikaži u korenom prozoru
Name[sv]=Visa i rotfönstret
Name[ta]= ி
Name[tg]=Дар тирезаи решагӣ намоиш намоед
Name[th]=
Name[tr]=Kök Pencerede Göster
Name[ug]=غول كۆزنەكتە كۆرسەت
Name[uk]=Відобразити в кореневому вікні
Name[vi]=Hin th trong Ca s Gc
Name[x-test]=xxDisplay in Root Windowxx
Name[zh_CN]=
Name[zh_TW]=
NoDisplay=true

View file

@ -0,0 +1,294 @@
[Desktop Entry]
Exec=keuphoria.kss
Icon=preferences-desktop-screensaver
Type=Service
X-KDE-ServiceTypes=ScreenSaver
Actions=Setup;InWindow;Root;
X-KDE-Category=OpenGL Screen Savers
X-KDE-Type=OpenGL
Name=Euphoria (GL)
Name[ast]=Euforia (GL)
Name[bg]=Еуфория
Name[br]=Euphoria (GL)
Name[bs]=Euforija (GL)
Name[ca]=Eufòria (GL)
Name[ca@valencia]=Eufòria (GL)
Name[cs]=Euphoria (GL)
Name[cy]=Iwfforia (GL)
Name[da]=Eufori (GL)
Name[de]=Euphorie
Name[el]=Euphoria (GL)
Name[en_GB]=Euphoria (GL)
Name[eo]=Eŭforio (GL)
Name[es]=Euforia (GL)
Name[et]=Eufooria (GL)
Name[eu]=Euforia (GL)
Name[fa]=شادی (GL)
Name[fi]=Euphoria (GL)
Name[fr]=Euphorie (GL)
Name[fy]=Euphoria (GL)
Name[ga]=Euphoria (GL)
Name[gl]=Euphoria (GL)
Name[he]=אופוריה (GL)
Name[hne]= ()
Name[hu]=Euphoria (OpenGL)
Name[is]=Euphoria (GL)
Name[it]=Euforia (GL)
Name[ja]= (GL)
Name[kk]=Масайрау (GL)
Name[ko]=(GL)
Name[lt]=Euphoria (GL)
Name[lv]=Eiforija (GL)
Name[mk]=Еуфорија (GL)
Name[ml]=ി (ി)
Name[ms]=Euphoria (GL)
Name[nb]=Eufori (GL)
Name[nds]=Euphorie (GL)
Name[ne]=ि (GL)
Name[nl]=Euphoria (GL)
Name[nn]=Rom (GL)
Name[pl]=Euforia (GL)
Name[pt]=Euforia (GL)
Name[pt_BR]=Euforia (GL)
Name[ro]=Euforia (GL)
Name[ru]=Эйфория (GL)
Name[sk]=Euphoria (GL)
Name[sl]=Evforija (GL)
Name[sq]=Euphoria (GL)
Name[sr]=Еуфорија
Name[sr@ijekavian]=Еуфорија
Name[sr@ijekavianlatin]=Euforija
Name[sr@latin]=Euforija
Name[sv]=Eufori (GL)
Name[ta]=ிி(GL)
Name[tg]=Кайфчоқӣ (GL)
Name[th]= (GL)
Name[tr]=Euphoria (GL)
Name[uk]=Ейфорія (GL)
Name[uz]=Eyforiya (GL)
Name[uz@cyrillic]=Эйфория (GL)
Name[vi]=Trng thái phn phơ (GL)
Name[xh]=Euphoria (GL)
Name[x-test]=xxEuphoria (GL)xx
Name[zh_CN]=(GL)
Name[zh_TW]=Euphoria (GL)
[Desktop Action Setup]
Exec=keuphoria.kss -setup
Name=Setup...
Name[af]=Opstelling...
Name[ast]=Configuración...
Name[bg]=Настройки...
Name[br]=Kefluniadur ...
Name[bs]=Podesi...
Name[ca]=Arranjament...
Name[ca@valencia]=Arranjament...
Name[cs]=Nastavení...
Name[cy]=Gosod ...
Name[da]=Opsætning...
Name[de]=Einrichtung ...
Name[el]=Ρύθμιση...
Name[en_GB]=Setup...
Name[eo]=Agordo...
Name[es]=Configuración...
Name[et]=Seadistamine...
Name[eu]=Konfiguratu...
Name[fa]=برپایی...
Name[fi]=Asetukset
Name[fr]=Configuration...
Name[fy]=Opset...
Name[ga]=Socrú...
Name[gl]=Configuración...
Name[he]=הגדרות...
Name[hne]=...
Name[hr]=Postavke 
Name[hu]=Beállítás...
Name[is]=Stillingar...
Name[it]=Impostazioni...
Name[ja]=...
Name[kk]=Баптау...
Name[ko]=...
Name[lt]=Sąranka ...
Name[lv]=Iestatījumi...
Name[mai]=...
Name[mk]=Поставување...
Name[ml]=...
Name[mr]= ...
Name[ms]=Setkan...
Name[nb]=Innstillinger 
Name[nds]=Instellen...
Name[ne]=...
Name[nl]=Instellingen...
Name[nn]=Oppsett 
Name[pa]=...
Name[pl]=Ustawienia...
Name[pt]=Configurar...
Name[pt_BR]=Configurar...
Name[ro]=Configurare...
Name[ru]=Настройка...
Name[sk]=Nastavenie...
Name[sl]=Nastavi ...
Name[sq]=Instalimi...
Name[sr]=Подеси...
Name[sr@ijekavian]=Подеси...
Name[sr@ijekavianlatin]=Podesi...
Name[sr@latin]=Podesi...
Name[sv]=Inställningar...
Name[ta]=...
Name[tg]=Барпосозӣ...
Name[th]=...
Name[tr]=Kurulum...
Name[ug]=ئورنات
Name[uk]=Встановити...
Name[uz]=Oʻrnatish
Name[uz@cyrillic]=Ўрнатиш
Name[vi]=Thiết lp...
Name[xh]=Iyacwangciswa...
Name[x-test]=xxSetup...xx
Name[zh_CN]=...
Name[zh_TW]=...
Icon=preferences-desktop-screensaver
[Desktop Action InWindow]
Exec=keuphoria.kss -window-id %w
Name=Display in Specified Window
Name[ast]=Amosar na ventana especificada
Name[bg]=Показване в избран прозорец
Name[br]=Diskwel er prenestr spisaet
Name[bs]=Prikaži u određenom prozoru
Name[ca]=Mostra a la finestra especificada
Name[ca@valencia]=Mostra a la finestra especificada
Name[cs]=Zobrazit v určeném okně
Name[cy]=Dangos mewn Ffenestr Benodol
Name[da]=Visning i angivet vindue
Name[de]=In bestimmten Fenster anzeigen
Name[el]=Προβολή στο καθορισμένο παράθυρο
Name[en_GB]=Display in Specified Window
Name[eo]=Montri en indikita fenestro
Name[es]=Mostrar en la ventana especificada
Name[et]=Määratud aknas näitamine
Name[eu]=Bistaratu zehaztutako lehioan
Name[fa]=نمایش در پنجره مشخصشده
Name[fi]=Näytä määrätyssä ikkunassa
Name[fr]=Affichage dans la fenêtre spécifiée
Name[fy]=Werjefte yn in definiearre finster
Name[ga]=Taispeáin san Fhuinneog Sonraithe
Name[gl]=Mostrar na xanela indicada
Name[he]=הצג בחלון המצוין
Name[hne]=िि ि
Name[hr]=Prikaži u određenom prozoru
Name[hu]=Megjelenítés a megadott ablakban
Name[is]=Birta í völdum glugga
Name[it]=Mostra nella finestra specificata
Name[ja]=
Name[kk]=Келтірілген терезеде көрсетілсін
Name[ko]=
Name[lt]=Rodyti nurodytame lange
Name[lv]=Rādīt norādītajā logā
Name[mai]=िि ि ि
Name[mk]=Прикажи во наведениот прозорец
Name[ml]= ിി ി ിി
Name[mr]=ि
Name[ms]=Papar dalam Tetingkap Yang Dinyatakan
Name[nb]=Vis i angitt vindu
Name[nds]=In utsöcht Finster wiesen
Name[ne]=िि
Name[nl]=Weergeven In een opgegeven venster
Name[nn]=Vis i oppgjeve vindauge
Name[pa]= ਿ
Name[pl]=Wyświetl w zadanym oknie
Name[pt]=Mostrar na Janela Indicada
Name[pt_BR]=Exibir na janela indicada
Name[ro]=Afișează în fereastra specificată
Name[ru]=Показывать в указанном окне
Name[sk]=Zobraziť v zadanom okne
Name[sl]=Pokaži v določenem oknu
Name[sq]=Shfaq në Dritaren e Specifikuar
Name[sr]=Прикажи у задатом прозору
Name[sr@ijekavian]=Прикажи у задатом прозору
Name[sr@ijekavianlatin]=Prikaži u zadatom prozoru
Name[sr@latin]=Prikaži u zadatom prozoru
Name[sv]=Visa i angivet fönster
Name[ta]=ி ி
Name[tg]=Дар тирезаи нишондода намоиш намоед
Name[th]=
Name[tr]=Belirtilen Pencerede Göster
Name[ug]=بەلگىلەنگەن كۆزنەكتە كۆرسەت
Name[uk]=Відобразити у вказаному вікні
Name[vi]=Hin th trong Ca s Đã đnh
Name[x-test]=xxDisplay in Specified Windowxx
Name[zh_CN]=
Name[zh_TW]=
NoDisplay=true
[Desktop Action Root]
Exec=keuphoria.kss -root
Name=Display in Root Window
Name[ast]=Amosar na ventana raíz
Name[bg]=Показване в главния прозорец
Name[br]=Diskwel er prenestr gwrizienn
Name[bs]=Prikaži u korijenom prozoru
Name[ca]=Mostra a la finestra arrel
Name[ca@valencia]=Mostra a la finestra arrel
Name[cs]=Zobrazit na pozadí plochy
Name[cy]=Dangos mewn Ffenestr Wraidd
Name[da]=Visning i root-vindue
Name[de]=In Hintergrundfenster anzeigen
Name[el]=Προβολή στο βασικό παράθυρο
Name[en_GB]=Display in Root Window
Name[eo]=Montri en radika fenestro
Name[es]=Mostrar en la ventana raíz
Name[et]=Juuraknas näitamine
Name[eu]=Bistaratu erro lehioan
Name[fa]=نمایش در پنجره ریشه
Name[fi]=Näytä juuri-ikkunassa
Name[fr]=Affichage dans la fenêtre racine
Name[fy]=Werjefte yn haadfinster
Name[ga]=Taispeáin sa Phríomhfhuinneog
Name[gl]=Mostrar na xanela raíz
Name[he]=הצג בחלון השורש
Name[hne]= ि
Name[hr]=Prikaži u ishodišnom prozoru
Name[hu]=Megjelenítés a gyökérablakban
Name[is]=Birta í rótarglugganum
Name[it]=Mostra sullo sfondo
Name[ja]=
Name[kk]=Түбір терезесінде көрсетілсін
Name[ko]=
Name[lt]=Rodyti root lange
Name[lv]=Rādīt saknes logā
Name[mai]= ि ि
Name[mk]=Прикажи во коренскиот прозорец
Name[ml]= ി ിി
Name[mr]=
Name[ms]=Papar dalam Tetingkap Root
Name[nb]=Vis i root-vindu
Name[nds]=In Hööftfinster wiesen
Name[ne]=
Name[nl]=Weergeven in hoofdvenster
Name[nn]=Vis i rotvindauget
Name[pa]=Root ਿ
Name[pl]=Wyświetl w oknie głównym
Name[pt]=Mostrar na Janela de Fundo
Name[pt_BR]=Exibir na janela raiz
Name[ro]=Afișează în fereastra rădăcină
Name[ru]=Показывать в корневом окне
Name[sk]=Zobraziť v koreňovom okne
Name[sl]=Pokaži v določenem oknu
Name[sq]=Shfaq në Dritaren Bazë
Name[sr]=Прикажи у кореном прозору
Name[sr@ijekavian]=Прикажи у корјеном прозору
Name[sr@ijekavianlatin]=Prikaži u korjenom prozoru
Name[sr@latin]=Prikaži u korenom prozoru
Name[sv]=Visa i rotfönstret
Name[ta]= ி
Name[tg]=Дар тирезаи решагӣ намоиш намоед
Name[th]=
Name[tr]=Kök Pencerede Göster
Name[ug]=غول كۆزنەكتە كۆرسەت
Name[uk]=Відобразити в кореневому вікні
Name[vi]=Hin th trong Ca s Gc
Name[x-test]=xxDisplay in Root Windowxx
Name[zh_CN]=
Name[zh_TW]=
NoDisplay=true

View file

@ -0,0 +1,292 @@
[Desktop Entry]
Exec=kfiresaver.kss
Icon=preferences-desktop-screensaver
Type=Service
X-KDE-ServiceTypes=ScreenSaver
Actions=Setup;InWindow;Root;
X-KDE-Category=OpenGL Screen Savers
X-KDE-Type=OpenGL
Name=Fireworks 3D (GL)
Name[ast]=Fuegos artificiales 3D (GL)
Name[bg]=Фойерверки
Name[br]=Fireworks 3D (GL)
Name[bs]=Vatromet 3D (GL)
Name[ca]=Focs d'artifici 3D (GL)
Name[ca@valencia]=Focs d'artifici 3D (GL)
Name[cs]=Ohňostroj (GL)
Name[da]=Fireworks 3D (GL)
Name[de]=Feuerwerk
Name[el]=Fireworks 3D (GL)
Name[en_GB]=Fireworks 3D (GL)
Name[eo]=Artfajraĵo 3D (GL)
Name[es]=Fuegos artificiales 3D (GL)
Name[et]=Tulevärk 3D (GL)
Name[eu]=Su artifizialak 3D (GL)
Name[fa]=آتشبازیهای سه بعدی (GL)
Name[fi]=Ilotulitus 3D (GL)
Name[fr]=Feux d'artifices 3D (GL)
Name[fy]=Fjoerwurk 3D (GL)
Name[ga]=Fireworks 3T (GL)
Name[gl]=Fogos de artificio 3D (GL)
Name[he]=זיקוקי דינור (GL)
Name[hne]=ि 3 ()
Name[hu]=Fireworks 3D (OpenGL)
Name[is]=Flugeldar 3D (GL)
Name[it]=Fuochi d'artificio tridimensionali (GL)
Name[ja]= 3D (GL)
Name[kk]=Отшашу 3D (GL)
Name[ko]=3 (GL)
Name[lt]=Fireworks 3D (GL)
Name[lv]=Uguņošana 3D (GL)
Name[mk]=Огномет 3Д (GL)
Name[ml]= 3D (ി)
Name[ms]=Fireworks 3D (GL)
Name[nb]=Fyrverkeri 3D (GL)
Name[nds]=Füerwark (GL)
Name[ne]=ि-ि (GL)
Name[nl]=Fireworks 3D (GL)
Name[nn]=Fyrverkeri 3D (GL)
Name[pa]=ਿ 3D (GL)
Name[pl]=Sztuczne ognie 3D (GL)
Name[pt]=Fogo de Artifício 3D (GL)
Name[pt_BR]=Fogos de Artifício 3D (GL)
Name[ro]=Focuri de artificii 3D (GL)
Name[ru]=Фейерверк (GL)
Name[sk]=Fireworks 3D (GL)
Name[sl]=Ognjemet 3D (GL)
Name[sq]=Fireworks 3D (GL)
Name[sr]=Ватромети 3Д
Name[sr@ijekavian]=Ватромети 3Д
Name[sr@ijekavianlatin]=Vatrometi 3D
Name[sr@latin]=Vatrometi 3D
Name[sv]=Fyrverkeri 3D (GL)
Name[ta]=Fireworks 3D (GL)
Name[tg]=Оташи тарф (GL)
Name[th]= (GL)
Name[tr]=3B Havai Fişekler (GL)
Name[ug]=Fireworks 3D (GL)
Name[uk]=Феєрверк 3D (GL)
Name[vi]=Pháo hoa 3 chiu (GL)
Name[x-test]=xxFireworks 3D (GL)xx
Name[zh_CN]=(GL)
Name[zh_TW]=3D (GL)
[Desktop Action Setup]
Exec=kfiresaver.kss -setup
Name=Setup...
Name[af]=Opstelling...
Name[ast]=Configuración...
Name[bg]=Настройки...
Name[br]=Kefluniadur ...
Name[bs]=Podesi...
Name[ca]=Arranjament...
Name[ca@valencia]=Arranjament...
Name[cs]=Nastavení...
Name[cy]=Gosod ...
Name[da]=Opsætning...
Name[de]=Einrichtung ...
Name[el]=Ρύθμιση...
Name[en_GB]=Setup...
Name[eo]=Agordo...
Name[es]=Configuración...
Name[et]=Seadistamine...
Name[eu]=Konfiguratu...
Name[fa]=برپایی...
Name[fi]=Asetukset
Name[fr]=Configuration...
Name[fy]=Opset...
Name[ga]=Socrú...
Name[gl]=Configuración...
Name[he]=הגדרות...
Name[hne]=...
Name[hr]=Postavke 
Name[hu]=Beállítás...
Name[is]=Stillingar...
Name[it]=Impostazioni...
Name[ja]=...
Name[kk]=Баптау...
Name[ko]=...
Name[lt]=Sąranka ...
Name[lv]=Iestatījumi...
Name[mai]=...
Name[mk]=Поставување...
Name[ml]=...
Name[mr]= ...
Name[ms]=Setkan...
Name[nb]=Innstillinger 
Name[nds]=Instellen...
Name[ne]=...
Name[nl]=Instellingen...
Name[nn]=Oppsett 
Name[pa]=...
Name[pl]=Ustawienia...
Name[pt]=Configurar...
Name[pt_BR]=Configurar...
Name[ro]=Configurare...
Name[ru]=Настройка...
Name[sk]=Nastavenie...
Name[sl]=Nastavi ...
Name[sq]=Instalimi...
Name[sr]=Подеси...
Name[sr@ijekavian]=Подеси...
Name[sr@ijekavianlatin]=Podesi...
Name[sr@latin]=Podesi...
Name[sv]=Inställningar...
Name[ta]=...
Name[tg]=Барпосозӣ...
Name[th]=...
Name[tr]=Kurulum...
Name[ug]=ئورنات
Name[uk]=Встановити...
Name[uz]=Oʻrnatish
Name[uz@cyrillic]=Ўрнатиш
Name[vi]=Thiết lp...
Name[xh]=Iyacwangciswa...
Name[x-test]=xxSetup...xx
Name[zh_CN]=...
Name[zh_TW]=...
Icon=preferences-desktop-screensaver
[Desktop Action InWindow]
Exec=kfiresaver.kss -window-id %w
Name=Display in Specified Window
Name[ast]=Amosar na ventana especificada
Name[bg]=Показване в избран прозорец
Name[br]=Diskwel er prenestr spisaet
Name[bs]=Prikaži u određenom prozoru
Name[ca]=Mostra a la finestra especificada
Name[ca@valencia]=Mostra a la finestra especificada
Name[cs]=Zobrazit v určeném okně
Name[cy]=Dangos mewn Ffenestr Benodol
Name[da]=Visning i angivet vindue
Name[de]=In bestimmten Fenster anzeigen
Name[el]=Προβολή στο καθορισμένο παράθυρο
Name[en_GB]=Display in Specified Window
Name[eo]=Montri en indikita fenestro
Name[es]=Mostrar en la ventana especificada
Name[et]=Määratud aknas näitamine
Name[eu]=Bistaratu zehaztutako lehioan
Name[fa]=نمایش در پنجره مشخصشده
Name[fi]=Näytä määrätyssä ikkunassa
Name[fr]=Affichage dans la fenêtre spécifiée
Name[fy]=Werjefte yn in definiearre finster
Name[ga]=Taispeáin san Fhuinneog Sonraithe
Name[gl]=Mostrar na xanela indicada
Name[he]=הצג בחלון המצוין
Name[hne]=िि ि
Name[hr]=Prikaži u određenom prozoru
Name[hu]=Megjelenítés a megadott ablakban
Name[is]=Birta í völdum glugga
Name[it]=Mostra nella finestra specificata
Name[ja]=
Name[kk]=Келтірілген терезеде көрсетілсін
Name[ko]=
Name[lt]=Rodyti nurodytame lange
Name[lv]=Rādīt norādītajā logā
Name[mai]=िि ि ि
Name[mk]=Прикажи во наведениот прозорец
Name[ml]= ിി ി ിി
Name[mr]=ि
Name[ms]=Papar dalam Tetingkap Yang Dinyatakan
Name[nb]=Vis i angitt vindu
Name[nds]=In utsöcht Finster wiesen
Name[ne]=िि
Name[nl]=Weergeven In een opgegeven venster
Name[nn]=Vis i oppgjeve vindauge
Name[pa]= ਿ
Name[pl]=Wyświetl w zadanym oknie
Name[pt]=Mostrar na Janela Indicada
Name[pt_BR]=Exibir na janela indicada
Name[ro]=Afișează în fereastra specificată
Name[ru]=Показывать в указанном окне
Name[sk]=Zobraziť v zadanom okne
Name[sl]=Pokaži v določenem oknu
Name[sq]=Shfaq në Dritaren e Specifikuar
Name[sr]=Прикажи у задатом прозору
Name[sr@ijekavian]=Прикажи у задатом прозору
Name[sr@ijekavianlatin]=Prikaži u zadatom prozoru
Name[sr@latin]=Prikaži u zadatom prozoru
Name[sv]=Visa i angivet fönster
Name[ta]=ி ி
Name[tg]=Дар тирезаи нишондода намоиш намоед
Name[th]=
Name[tr]=Belirtilen Pencerede Göster
Name[ug]=بەلگىلەنگەن كۆزنەكتە كۆرسەت
Name[uk]=Відобразити у вказаному вікні
Name[vi]=Hin th trong Ca s Đã đnh
Name[x-test]=xxDisplay in Specified Windowxx
Name[zh_CN]=
Name[zh_TW]=
NoDisplay=true
[Desktop Action Root]
Exec=kfiresaver.kss -root
Name=Display in Root Window
Name[ast]=Amosar na ventana raíz
Name[bg]=Показване в главния прозорец
Name[br]=Diskwel er prenestr gwrizienn
Name[bs]=Prikaži u korijenom prozoru
Name[ca]=Mostra a la finestra arrel
Name[ca@valencia]=Mostra a la finestra arrel
Name[cs]=Zobrazit na pozadí plochy
Name[cy]=Dangos mewn Ffenestr Wraidd
Name[da]=Visning i root-vindue
Name[de]=In Hintergrundfenster anzeigen
Name[el]=Προβολή στο βασικό παράθυρο
Name[en_GB]=Display in Root Window
Name[eo]=Montri en radika fenestro
Name[es]=Mostrar en la ventana raíz
Name[et]=Juuraknas näitamine
Name[eu]=Bistaratu erro lehioan
Name[fa]=نمایش در پنجره ریشه
Name[fi]=Näytä juuri-ikkunassa
Name[fr]=Affichage dans la fenêtre racine
Name[fy]=Werjefte yn haadfinster
Name[ga]=Taispeáin sa Phríomhfhuinneog
Name[gl]=Mostrar na xanela raíz
Name[he]=הצג בחלון השורש
Name[hne]= ि
Name[hr]=Prikaži u ishodišnom prozoru
Name[hu]=Megjelenítés a gyökérablakban
Name[is]=Birta í rótarglugganum
Name[it]=Mostra sullo sfondo
Name[ja]=
Name[kk]=Түбір терезесінде көрсетілсін
Name[ko]=
Name[lt]=Rodyti root lange
Name[lv]=Rādīt saknes logā
Name[mai]= ि ि
Name[mk]=Прикажи во коренскиот прозорец
Name[ml]= ി ിി
Name[mr]=
Name[ms]=Papar dalam Tetingkap Root
Name[nb]=Vis i root-vindu
Name[nds]=In Hööftfinster wiesen
Name[ne]=
Name[nl]=Weergeven in hoofdvenster
Name[nn]=Vis i rotvindauget
Name[pa]=Root ਿ
Name[pl]=Wyświetl w oknie głównym
Name[pt]=Mostrar na Janela de Fundo
Name[pt_BR]=Exibir na janela raiz
Name[ro]=Afișează în fereastra rădăcină
Name[ru]=Показывать в корневом окне
Name[sk]=Zobraziť v koreňovom okne
Name[sl]=Pokaži v določenem oknu
Name[sq]=Shfaq në Dritaren Bazë
Name[sr]=Прикажи у кореном прозору
Name[sr@ijekavian]=Прикажи у корјеном прозору
Name[sr@ijekavianlatin]=Prikaži u korjenom prozoru
Name[sr@latin]=Prikaži u korenom prozoru
Name[sv]=Visa i rotfönstret
Name[ta]= ி
Name[tg]=Дар тирезаи решагӣ намоиш намоед
Name[th]=
Name[tr]=Kök Pencerede Göster
Name[ug]=غول كۆزنەكتە كۆرسەت
Name[uk]=Відобразити в кореневому вікні
Name[vi]=Hin th trong Ca s Gc
Name[x-test]=xxDisplay in Root Windowxx
Name[zh_CN]=
Name[zh_TW]=
NoDisplay=true

View file

@ -0,0 +1,295 @@
[Desktop Entry]
Exec=kflux.kss
Icon=preferences-desktop-screensaver
Type=Service
X-KDE-ServiceTypes=ScreenSaver
Actions=Setup;InWindow;Root;
X-KDE-Category=OpenGL Screen Savers
X-KDE-Type=OpenGL
Name=Flux (GL)
Name[ast]=Fluxu (GL)
Name[bg]=Прилив
Name[br]=Flux (GL)
Name[bs]=Fluks
Name[ca]=Flux (GL)
Name[ca@valencia]=Flux (GL)
Name[cs]=Flux (GL)
Name[cy]=Dylif (GL)
Name[da]=Flux (GL)
Name[de]=Flux
Name[el]=Flux (GL)
Name[en_GB]=Flux (GL)
Name[eo]=Fluo (GL)
Name[es]=Flujo (GL)
Name[et]=Flux (GL)
Name[eu]=Flux (GL)
Name[fa]=شار (GL)
Name[fi]=Flux (GL)
Name[fr]=Flux (GL)
Name[fy]=Fluks (GL)
Name[ga]=Flux (GL)
Name[gl]=Fluxo (GL)
Name[he]=שטף (GL)
Name[hne]=- ()
Name[hu]=Flux (OpenGL)
Name[is]=Flux (GL)
Name[it]=Flusso (GL)
Name[ja]= (GL)
Name[kk]=Ағындар (GL)
Name[ko]=(GL)
Name[lt]=Flux (GL)
Name[lv]=Plūdums (GL)
Name[mk]=Флукс (GL)
Name[ml]= (ി)
Name[ms]=Flux (GL)
Name[nb]=Fluks (GL)
Name[nds]=Flux (GL)
Name[ne]= (GL)
Name[nl]=Flux (GL)
Name[nn]=Pulsar (GL)
Name[pa]= (GL)
Name[pl]=Flux (GL)
Name[pt]=Fluxo (GL)
Name[pt_BR]=Fluxo (GL)
Name[ro]=Flux (GL)
Name[ru]=Флуктуации (GL)
Name[sk]=Flux (GL)
Name[sl]=Pretok (GL)
Name[sq]=Flux (GL)
Name[sr]=Флукс
Name[sr@ijekavian]=Флукс
Name[sr@ijekavianlatin]=Fluks
Name[sr@latin]=Fluks
Name[sv]=Flux (GL)
Name[ta]=(GL)
Name[tg]=Флуктуатсияи (GL)
Name[th]= (GL)
Name[tr]=Flux (GL)
Name[uk]=Флюксія (GL)
Name[uz]=Oqim (GL)
Name[uz@cyrillic]=Оқим (GL)
Name[vi]=Dòng chy (GL)
Name[xh]=Flux (GL)
Name[x-test]=xxFlux (GL)xx
Name[zh_CN]=(GL)
Name[zh_TW]=Flux (GL)
[Desktop Action Setup]
Exec=kflux.kss -setup
Name=Setup...
Name[af]=Opstelling...
Name[ast]=Configuración...
Name[bg]=Настройки...
Name[br]=Kefluniadur ...
Name[bs]=Podesi...
Name[ca]=Arranjament...
Name[ca@valencia]=Arranjament...
Name[cs]=Nastavení...
Name[cy]=Gosod ...
Name[da]=Opsætning...
Name[de]=Einrichtung ...
Name[el]=Ρύθμιση...
Name[en_GB]=Setup...
Name[eo]=Agordo...
Name[es]=Configuración...
Name[et]=Seadistamine...
Name[eu]=Konfiguratu...
Name[fa]=برپایی...
Name[fi]=Asetukset
Name[fr]=Configuration...
Name[fy]=Opset...
Name[ga]=Socrú...
Name[gl]=Configuración...
Name[he]=הגדרות...
Name[hne]=...
Name[hr]=Postavke 
Name[hu]=Beállítás...
Name[is]=Stillingar...
Name[it]=Impostazioni...
Name[ja]=...
Name[kk]=Баптау...
Name[ko]=...
Name[lt]=Sąranka ...
Name[lv]=Iestatījumi...
Name[mai]=...
Name[mk]=Поставување...
Name[ml]=...
Name[mr]= ...
Name[ms]=Setkan...
Name[nb]=Innstillinger 
Name[nds]=Instellen...
Name[ne]=...
Name[nl]=Instellingen...
Name[nn]=Oppsett 
Name[pa]=...
Name[pl]=Ustawienia...
Name[pt]=Configurar...
Name[pt_BR]=Configurar...
Name[ro]=Configurare...
Name[ru]=Настройка...
Name[sk]=Nastavenie...
Name[sl]=Nastavi ...
Name[sq]=Instalimi...
Name[sr]=Подеси...
Name[sr@ijekavian]=Подеси...
Name[sr@ijekavianlatin]=Podesi...
Name[sr@latin]=Podesi...
Name[sv]=Inställningar...
Name[ta]=...
Name[tg]=Барпосозӣ...
Name[th]=...
Name[tr]=Kurulum...
Name[ug]=ئورنات
Name[uk]=Встановити...
Name[uz]=Oʻrnatish
Name[uz@cyrillic]=Ўрнатиш
Name[vi]=Thiết lp...
Name[xh]=Iyacwangciswa...
Name[x-test]=xxSetup...xx
Name[zh_CN]=...
Name[zh_TW]=...
Icon=preferences-desktop-screensaver
[Desktop Action InWindow]
Exec=kflux.kss -window-id %w
Name=Display in Specified Window
Name[ast]=Amosar na ventana especificada
Name[bg]=Показване в избран прозорец
Name[br]=Diskwel er prenestr spisaet
Name[bs]=Prikaži u određenom prozoru
Name[ca]=Mostra a la finestra especificada
Name[ca@valencia]=Mostra a la finestra especificada
Name[cs]=Zobrazit v určeném okně
Name[cy]=Dangos mewn Ffenestr Benodol
Name[da]=Visning i angivet vindue
Name[de]=In bestimmten Fenster anzeigen
Name[el]=Προβολή στο καθορισμένο παράθυρο
Name[en_GB]=Display in Specified Window
Name[eo]=Montri en indikita fenestro
Name[es]=Mostrar en la ventana especificada
Name[et]=Määratud aknas näitamine
Name[eu]=Bistaratu zehaztutako lehioan
Name[fa]=نمایش در پنجره مشخصشده
Name[fi]=Näytä määrätyssä ikkunassa
Name[fr]=Affichage dans la fenêtre spécifiée
Name[fy]=Werjefte yn in definiearre finster
Name[ga]=Taispeáin san Fhuinneog Sonraithe
Name[gl]=Mostrar na xanela indicada
Name[he]=הצג בחלון המצוין
Name[hne]=िि ि
Name[hr]=Prikaži u određenom prozoru
Name[hu]=Megjelenítés a megadott ablakban
Name[is]=Birta í völdum glugga
Name[it]=Mostra nella finestra specificata
Name[ja]=
Name[kk]=Келтірілген терезеде көрсетілсін
Name[ko]=
Name[lt]=Rodyti nurodytame lange
Name[lv]=Rādīt norādītajā logā
Name[mai]=िि ि ि
Name[mk]=Прикажи во наведениот прозорец
Name[ml]= ിി ി ിി
Name[mr]=ि
Name[ms]=Papar dalam Tetingkap Yang Dinyatakan
Name[nb]=Vis i angitt vindu
Name[nds]=In utsöcht Finster wiesen
Name[ne]=िि
Name[nl]=Weergeven In een opgegeven venster
Name[nn]=Vis i oppgjeve vindauge
Name[pa]= ਿ
Name[pl]=Wyświetl w zadanym oknie
Name[pt]=Mostrar na Janela Indicada
Name[pt_BR]=Exibir na janela indicada
Name[ro]=Afișează în fereastra specificată
Name[ru]=Показывать в указанном окне
Name[sk]=Zobraziť v zadanom okne
Name[sl]=Pokaži v določenem oknu
Name[sq]=Shfaq në Dritaren e Specifikuar
Name[sr]=Прикажи у задатом прозору
Name[sr@ijekavian]=Прикажи у задатом прозору
Name[sr@ijekavianlatin]=Prikaži u zadatom prozoru
Name[sr@latin]=Prikaži u zadatom prozoru
Name[sv]=Visa i angivet fönster
Name[ta]=ி ி
Name[tg]=Дар тирезаи нишондода намоиш намоед
Name[th]=
Name[tr]=Belirtilen Pencerede Göster
Name[ug]=بەلگىلەنگەن كۆزنەكتە كۆرسەت
Name[uk]=Відобразити у вказаному вікні
Name[vi]=Hin th trong Ca s Đã đnh
Name[x-test]=xxDisplay in Specified Windowxx
Name[zh_CN]=
Name[zh_TW]=
NoDisplay=true
[Desktop Action Root]
Exec=kflux.kss -root
Name=Display in Root Window
Name[ast]=Amosar na ventana raíz
Name[bg]=Показване в главния прозорец
Name[br]=Diskwel er prenestr gwrizienn
Name[bs]=Prikaži u korijenom prozoru
Name[ca]=Mostra a la finestra arrel
Name[ca@valencia]=Mostra a la finestra arrel
Name[cs]=Zobrazit na pozadí plochy
Name[cy]=Dangos mewn Ffenestr Wraidd
Name[da]=Visning i root-vindue
Name[de]=In Hintergrundfenster anzeigen
Name[el]=Προβολή στο βασικό παράθυρο
Name[en_GB]=Display in Root Window
Name[eo]=Montri en radika fenestro
Name[es]=Mostrar en la ventana raíz
Name[et]=Juuraknas näitamine
Name[eu]=Bistaratu erro lehioan
Name[fa]=نمایش در پنجره ریشه
Name[fi]=Näytä juuri-ikkunassa
Name[fr]=Affichage dans la fenêtre racine
Name[fy]=Werjefte yn haadfinster
Name[ga]=Taispeáin sa Phríomhfhuinneog
Name[gl]=Mostrar na xanela raíz
Name[he]=הצג בחלון השורש
Name[hne]= ि
Name[hr]=Prikaži u ishodišnom prozoru
Name[hu]=Megjelenítés a gyökérablakban
Name[is]=Birta í rótarglugganum
Name[it]=Mostra sullo sfondo
Name[ja]=
Name[kk]=Түбір терезесінде көрсетілсін
Name[ko]=
Name[lt]=Rodyti root lange
Name[lv]=Rādīt saknes logā
Name[mai]= ि ि
Name[mk]=Прикажи во коренскиот прозорец
Name[ml]= ി ിി
Name[mr]=
Name[ms]=Papar dalam Tetingkap Root
Name[nb]=Vis i root-vindu
Name[nds]=In Hööftfinster wiesen
Name[ne]=
Name[nl]=Weergeven in hoofdvenster
Name[nn]=Vis i rotvindauget
Name[pa]=Root ਿ
Name[pl]=Wyświetl w oknie głównym
Name[pt]=Mostrar na Janela de Fundo
Name[pt_BR]=Exibir na janela raiz
Name[ro]=Afișează în fereastra rădăcină
Name[ru]=Показывать в корневом окне
Name[sk]=Zobraziť v koreňovom okne
Name[sl]=Pokaži v določenem oknu
Name[sq]=Shfaq në Dritaren Bazë
Name[sr]=Прикажи у кореном прозору
Name[sr@ijekavian]=Прикажи у корјеном прозору
Name[sr@ijekavianlatin]=Prikaži u korjenom prozoru
Name[sr@latin]=Prikaži u korenom prozoru
Name[sv]=Visa i rotfönstret
Name[ta]= ி
Name[tg]=Дар тирезаи решагӣ намоиш намоед
Name[th]=
Name[tr]=Kök Pencerede Göster
Name[ug]=غول كۆزنەكتە كۆرسەت
Name[uk]=Відобразити в кореневому вікні
Name[vi]=Hin th trong Ca s Gc
Name[x-test]=xxDisplay in Root Windowxx
Name[zh_CN]=
Name[zh_TW]=
NoDisplay=true

View file

@ -0,0 +1,294 @@
[Desktop Entry]
Exec=kfountain.kss
Icon=preferences-desktop-screensaver
Type=Service
X-KDE-ServiceTypes=ScreenSaver
Actions=Setup;InWindow;Root;
X-KDE-Category=OpenGL Screen Savers
X-KDE-Type=OpenGL
Name=Particle Fountain (GL)
Name[af]=Deeltjie Fontein (Gl)
Name[ast]=Fonte de partícules (GL)
Name[bg]=Източник на частици
Name[bs]=Kap iz fontane (GL)
Name[ca]=Font de partícules (GL)
Name[ca@valencia]=Font de partícules (GL)
Name[cs]=Částicová fontána (GL)
Name[cy]=Ffynnon Gronyn (GL)
Name[da]=Partikelbrønd (GL)
Name[de]=Partikelfontäne
Name[el]=Particle Fountain (GL)
Name[en_GB]=Particle Fountain (GL)
Name[eo]=Erofontano (GL)
Name[es]=Fuente de partículas (GL)
Name[et]=Osakeste Fontään (GL)
Name[eu]=Partikula iturria (GL)
Name[fa]=منشأ ذره (GL)
Name[fi]=Hiukkaslähde (GL)
Name[fr]=Fontaine de particules (GL)
Name[fy]=Dieltsjesfontein (GL)
Name[ga]=Particle Fountain (GL)
Name[gl]=Fonte de partículas (GL)
Name[he]=מזרקת חלקיקים (GL)
Name[hne]= ि ()
Name[hu]=Szökőkút (OpenGL)
Name[is]=Eindagosbrunnur (GL)
Name[it]=Fontana di particelle (GL)
Name[ja]= (GL)
Name[kk]=Бүрку (GL)
Name[ko]= (GL)
Name[lt]=Dalelių fontanas (GL)
Name[lv]=Daļiņu strūklaka (GL)
Name[mk]=Фонтана од честички (GL)
Name[ml]= (ി)
Name[ms]=Particle Fountain (GL)
Name[nb]=Partikkelfontene (GL)
Name[nds]=Deeltjeblaser (GL)
Name[ne]=ि (GL)
Name[nl]=Deeltjes-fontijn (GL)
Name[nn]=Partikkelfontene (GL)
Name[pl]=Fontanna cząstek (GL)
Name[pt]=Fonte de Partículas (GL)
Name[pt_BR]=Fonte de Partículas (GL)
Name[ro]=Fîntînă de particule (GL)
Name[ru]=Фонтан частиц (GL)
Name[sk]=Fontána častíc (GL)
Name[sl]=Vodomet delcev (GL)
Name[sq]=Particle Fountain (GL)
Name[sr]=Фонтана честица
Name[sr@ijekavian]=Фонтана честица
Name[sr@ijekavianlatin]=Fontana čestica
Name[sr@latin]=Fontana čestica
Name[sv]=Partikelfontän (GL)
Name[ta]= (GL)
Name[tg]=Қисми фаввораи (GL)
Name[th]= (GL)
Name[tr]=Parçacık Şelalesi (GL)
Name[uk]=Фонтан частинок (GL)
Name[uz]=Zarrachalar favvorasi (GL)
Name[uz@cyrillic]=Заррачалар фаввораси (GL)
Name[vi]=Đài phun Ht (GL)
Name[xh]=Umthombo Womhlaba (GL)
Name[x-test]=xxParticle Fountain (GL)xx
Name[zh_CN]=(GL)
Name[zh_TW]= (GL)
[Desktop Action Setup]
Exec=kfountain.kss -setup
Name=Setup...
Name[af]=Opstelling...
Name[ast]=Configuración...
Name[bg]=Настройки...
Name[br]=Kefluniadur ...
Name[bs]=Podesi...
Name[ca]=Arranjament...
Name[ca@valencia]=Arranjament...
Name[cs]=Nastavení...
Name[cy]=Gosod ...
Name[da]=Opsætning...
Name[de]=Einrichtung ...
Name[el]=Ρύθμιση...
Name[en_GB]=Setup...
Name[eo]=Agordo...
Name[es]=Configuración...
Name[et]=Seadistamine...
Name[eu]=Konfiguratu...
Name[fa]=برپایی...
Name[fi]=Asetukset
Name[fr]=Configuration...
Name[fy]=Opset...
Name[ga]=Socrú...
Name[gl]=Configuración...
Name[he]=הגדרות...
Name[hne]=...
Name[hr]=Postavke 
Name[hu]=Beállítás...
Name[is]=Stillingar...
Name[it]=Impostazioni...
Name[ja]=...
Name[kk]=Баптау...
Name[ko]=...
Name[lt]=Sąranka ...
Name[lv]=Iestatījumi...
Name[mai]=...
Name[mk]=Поставување...
Name[ml]=...
Name[mr]= ...
Name[ms]=Setkan...
Name[nb]=Innstillinger 
Name[nds]=Instellen...
Name[ne]=...
Name[nl]=Instellingen...
Name[nn]=Oppsett 
Name[pa]=...
Name[pl]=Ustawienia...
Name[pt]=Configurar...
Name[pt_BR]=Configurar...
Name[ro]=Configurare...
Name[ru]=Настройка...
Name[sk]=Nastavenie...
Name[sl]=Nastavi ...
Name[sq]=Instalimi...
Name[sr]=Подеси...
Name[sr@ijekavian]=Подеси...
Name[sr@ijekavianlatin]=Podesi...
Name[sr@latin]=Podesi...
Name[sv]=Inställningar...
Name[ta]=...
Name[tg]=Барпосозӣ...
Name[th]=...
Name[tr]=Kurulum...
Name[ug]=ئورنات
Name[uk]=Встановити...
Name[uz]=Oʻrnatish
Name[uz@cyrillic]=Ўрнатиш
Name[vi]=Thiết lp...
Name[xh]=Iyacwangciswa...
Name[x-test]=xxSetup...xx
Name[zh_CN]=...
Name[zh_TW]=...
Icon=preferences-desktop-screensaver
[Desktop Action InWindow]
Exec=kfountain.kss -window-id %w
Name=Display in Specified Window
Name[ast]=Amosar na ventana especificada
Name[bg]=Показване в избран прозорец
Name[br]=Diskwel er prenestr spisaet
Name[bs]=Prikaži u određenom prozoru
Name[ca]=Mostra a la finestra especificada
Name[ca@valencia]=Mostra a la finestra especificada
Name[cs]=Zobrazit v určeném okně
Name[cy]=Dangos mewn Ffenestr Benodol
Name[da]=Visning i angivet vindue
Name[de]=In bestimmten Fenster anzeigen
Name[el]=Προβολή στο καθορισμένο παράθυρο
Name[en_GB]=Display in Specified Window
Name[eo]=Montri en indikita fenestro
Name[es]=Mostrar en la ventana especificada
Name[et]=Määratud aknas näitamine
Name[eu]=Bistaratu zehaztutako lehioan
Name[fa]=نمایش در پنجره مشخصشده
Name[fi]=Näytä määrätyssä ikkunassa
Name[fr]=Affichage dans la fenêtre spécifiée
Name[fy]=Werjefte yn in definiearre finster
Name[ga]=Taispeáin san Fhuinneog Sonraithe
Name[gl]=Mostrar na xanela indicada
Name[he]=הצג בחלון המצוין
Name[hne]=िि ि
Name[hr]=Prikaži u određenom prozoru
Name[hu]=Megjelenítés a megadott ablakban
Name[is]=Birta í völdum glugga
Name[it]=Mostra nella finestra specificata
Name[ja]=
Name[kk]=Келтірілген терезеде көрсетілсін
Name[ko]=
Name[lt]=Rodyti nurodytame lange
Name[lv]=Rādīt norādītajā logā
Name[mai]=िि ि ि
Name[mk]=Прикажи во наведениот прозорец
Name[ml]= ിി ി ിി
Name[mr]=ि
Name[ms]=Papar dalam Tetingkap Yang Dinyatakan
Name[nb]=Vis i angitt vindu
Name[nds]=In utsöcht Finster wiesen
Name[ne]=िि
Name[nl]=Weergeven In een opgegeven venster
Name[nn]=Vis i oppgjeve vindauge
Name[pa]= ਿ
Name[pl]=Wyświetl w zadanym oknie
Name[pt]=Mostrar na Janela Indicada
Name[pt_BR]=Exibir na janela indicada
Name[ro]=Afișează în fereastra specificată
Name[ru]=Показывать в указанном окне
Name[sk]=Zobraziť v zadanom okne
Name[sl]=Pokaži v določenem oknu
Name[sq]=Shfaq në Dritaren e Specifikuar
Name[sr]=Прикажи у задатом прозору
Name[sr@ijekavian]=Прикажи у задатом прозору
Name[sr@ijekavianlatin]=Prikaži u zadatom prozoru
Name[sr@latin]=Prikaži u zadatom prozoru
Name[sv]=Visa i angivet fönster
Name[ta]=ி ி
Name[tg]=Дар тирезаи нишондода намоиш намоед
Name[th]=
Name[tr]=Belirtilen Pencerede Göster
Name[ug]=بەلگىلەنگەن كۆزنەكتە كۆرسەت
Name[uk]=Відобразити у вказаному вікні
Name[vi]=Hin th trong Ca s Đã đnh
Name[x-test]=xxDisplay in Specified Windowxx
Name[zh_CN]=
Name[zh_TW]=
NoDisplay=true
[Desktop Action Root]
Exec=kfountain.kss -root
Name=Display in Root Window
Name[ast]=Amosar na ventana raíz
Name[bg]=Показване в главния прозорец
Name[br]=Diskwel er prenestr gwrizienn
Name[bs]=Prikaži u korijenom prozoru
Name[ca]=Mostra a la finestra arrel
Name[ca@valencia]=Mostra a la finestra arrel
Name[cs]=Zobrazit na pozadí plochy
Name[cy]=Dangos mewn Ffenestr Wraidd
Name[da]=Visning i root-vindue
Name[de]=In Hintergrundfenster anzeigen
Name[el]=Προβολή στο βασικό παράθυρο
Name[en_GB]=Display in Root Window
Name[eo]=Montri en radika fenestro
Name[es]=Mostrar en la ventana raíz
Name[et]=Juuraknas näitamine
Name[eu]=Bistaratu erro lehioan
Name[fa]=نمایش در پنجره ریشه
Name[fi]=Näytä juuri-ikkunassa
Name[fr]=Affichage dans la fenêtre racine
Name[fy]=Werjefte yn haadfinster
Name[ga]=Taispeáin sa Phríomhfhuinneog
Name[gl]=Mostrar na xanela raíz
Name[he]=הצג בחלון השורש
Name[hne]= ि
Name[hr]=Prikaži u ishodišnom prozoru
Name[hu]=Megjelenítés a gyökérablakban
Name[is]=Birta í rótarglugganum
Name[it]=Mostra sullo sfondo
Name[ja]=
Name[kk]=Түбір терезесінде көрсетілсін
Name[ko]=
Name[lt]=Rodyti root lange
Name[lv]=Rādīt saknes logā
Name[mai]= ि ि
Name[mk]=Прикажи во коренскиот прозорец
Name[ml]= ി ിി
Name[mr]=
Name[ms]=Papar dalam Tetingkap Root
Name[nb]=Vis i root-vindu
Name[nds]=In Hööftfinster wiesen
Name[ne]=
Name[nl]=Weergeven in hoofdvenster
Name[nn]=Vis i rotvindauget
Name[pa]=Root ਿ
Name[pl]=Wyświetl w oknie głównym
Name[pt]=Mostrar na Janela de Fundo
Name[pt_BR]=Exibir na janela raiz
Name[ro]=Afișează în fereastra rădăcină
Name[ru]=Показывать в корневом окне
Name[sk]=Zobraziť v koreňovom okne
Name[sl]=Pokaži v določenem oknu
Name[sq]=Shfaq në Dritaren Bazë
Name[sr]=Прикажи у кореном прозору
Name[sr@ijekavian]=Прикажи у корјеном прозору
Name[sr@ijekavianlatin]=Prikaži u korjenom prozoru
Name[sr@latin]=Prikaži u korenom prozoru
Name[sv]=Visa i rotfönstret
Name[ta]= ி
Name[tg]=Дар тирезаи решагӣ намоиш намоед
Name[th]=
Name[tr]=Kök Pencerede Göster
Name[ug]=غول كۆزنەكتە كۆرسەت
Name[uk]=Відобразити в кореневому вікні
Name[vi]=Hin th trong Ca s Gc
Name[x-test]=xxDisplay in Root Windowxx
Name[zh_CN]=
Name[zh_TW]=
NoDisplay=true

View file

@ -0,0 +1,297 @@
[Desktop Entry]
Exec=kgravity.kss
Icon=preferences-desktop-screensaver
Type=Service
X-KDE-ServiceTypes=ScreenSaver
Actions=Setup;InWindow;Root;
X-KDE-Category=OpenGL Screen Savers
X-KDE-Type=OpenGL
Name=Gravity (GL)
Name[af]=Gravitasie (Gl)
Name[ast]=Gravedá (GL)
Name[bg]=Гравитация
Name[br]=Dedennerezh (GL)
Name[bs]=Gravitacija (GL)
Name[ca]=Gravetat (GL)
Name[ca@valencia]=Gravetat (GL)
Name[cs]=Gravitace (GL)
Name[cy]=Disgyrchiant (GL)
Name[da]=Tyngdekraft (GL)
Name[de]=Schwerkraft
Name[el]=Βαρύτητα (GL)
Name[en_GB]=Gravity (GL)
Name[eo]=Gravito (GL)
Name[es]=Gravedad (GL)
Name[et]=Raskusjõud (GL)
Name[eu]=Grabitatea (GL)
Name[fa]=جاذبه (GL)
Name[fi]=Gravitaatio (GL)
Name[fr]=Gravité (GL)
Name[fy]=Swiertekrêft (GL)
Name[ga]=Gravity (GL)
Name[gl]=Gravidade (GL)
Name[he]=חלקיקים (GL)
Name[hne]= ()
Name[hu]=Gravitáció (OpenGL)
Name[is]=Þyngdarafl (GL)
Name[it]=Gravità (GL)
Name[ja]= (GL)
Name[kk]=Гравитация (GL)
Name[ko]=(GL)
Name[lt]=Trauka (GL)
Name[lv]=Gravitācija (GL)
Name[mk]=Гравитација (GL)
Name[ml]= (ി)
Name[ms]=Graviti (GL)
Name[nb]=Gravitasjon (GL)
Name[nds]=Swoorkraft (GL)
Name[ne]= (GL)
Name[nl]=Zwaartekracht (GL)
Name[nn]=Tyngdekraft (GL)
Name[pa]= (GL)
Name[pl]=Grawitacja (GL)
Name[pt]=Gravidade (GL)
Name[pt_BR]=Gravidade (GL)
Name[ro]=Gravitație (GL)
Name[ru]=Гравитация (GL)
Name[sk]=Gravitácia (GL)
Name[sl]=Težnost (GL)
Name[sq]=Gravity (GL)
Name[sr]=Гравитација
Name[sr@ijekavian]=Гравитација
Name[sr@ijekavianlatin]=Gravitacija
Name[sr@latin]=Gravitacija
Name[sv]=Gravitation (GL)
Name[ta]=ிி(GL)
Name[tg]=Ҷозибаи (GL)
Name[th]= (GL)
Name[tr]=Yerçekimi (GL)
Name[uk]=Гравітація (GL)
Name[uz]=Gravitatsiya (GL)
Name[uz@cyrillic]=Гравитация (GL)
Name[vi]=Trng trưng (GL)
Name[xh]=Umoya otsala izinto kumbindi womhlaba (GL)
Name[x-test]=xxGravity (GL)xx
Name[zh_CN]=(GL)
Name[zh_TW]= (GL)
[Desktop Action Setup]
Exec=kgravity.kss -setup
Name=Setup...
Name[af]=Opstelling...
Name[ast]=Configuración...
Name[bg]=Настройки...
Name[br]=Kefluniadur ...
Name[bs]=Podesi...
Name[ca]=Arranjament...
Name[ca@valencia]=Arranjament...
Name[cs]=Nastavení...
Name[cy]=Gosod ...
Name[da]=Opsætning...
Name[de]=Einrichtung ...
Name[el]=Ρύθμιση...
Name[en_GB]=Setup...
Name[eo]=Agordo...
Name[es]=Configuración...
Name[et]=Seadistamine...
Name[eu]=Konfiguratu...
Name[fa]=برپایی...
Name[fi]=Asetukset
Name[fr]=Configuration...
Name[fy]=Opset...
Name[ga]=Socrú...
Name[gl]=Configuración...
Name[he]=הגדרות...
Name[hne]=...
Name[hr]=Postavke 
Name[hu]=Beállítás...
Name[is]=Stillingar...
Name[it]=Impostazioni...
Name[ja]=...
Name[kk]=Баптау...
Name[ko]=...
Name[lt]=Sąranka ...
Name[lv]=Iestatījumi...
Name[mai]=...
Name[mk]=Поставување...
Name[ml]=...
Name[mr]= ...
Name[ms]=Setkan...
Name[nb]=Innstillinger 
Name[nds]=Instellen...
Name[ne]=...
Name[nl]=Instellingen...
Name[nn]=Oppsett 
Name[pa]=...
Name[pl]=Ustawienia...
Name[pt]=Configurar...
Name[pt_BR]=Configurar...
Name[ro]=Configurare...
Name[ru]=Настройка...
Name[sk]=Nastavenie...
Name[sl]=Nastavi ...
Name[sq]=Instalimi...
Name[sr]=Подеси...
Name[sr@ijekavian]=Подеси...
Name[sr@ijekavianlatin]=Podesi...
Name[sr@latin]=Podesi...
Name[sv]=Inställningar...
Name[ta]=...
Name[tg]=Барпосозӣ...
Name[th]=...
Name[tr]=Kurulum...
Name[ug]=ئورنات
Name[uk]=Встановити...
Name[uz]=Oʻrnatish
Name[uz@cyrillic]=Ўрнатиш
Name[vi]=Thiết lp...
Name[xh]=Iyacwangciswa...
Name[x-test]=xxSetup...xx
Name[zh_CN]=...
Name[zh_TW]=...
Icon=preferences-desktop-screensaver
[Desktop Action InWindow]
Exec=kgravity.kss -window-id %w
Name=Display in Specified Window
Name[ast]=Amosar na ventana especificada
Name[bg]=Показване в избран прозорец
Name[br]=Diskwel er prenestr spisaet
Name[bs]=Prikaži u određenom prozoru
Name[ca]=Mostra a la finestra especificada
Name[ca@valencia]=Mostra a la finestra especificada
Name[cs]=Zobrazit v určeném okně
Name[cy]=Dangos mewn Ffenestr Benodol
Name[da]=Visning i angivet vindue
Name[de]=In bestimmten Fenster anzeigen
Name[el]=Προβολή στο καθορισμένο παράθυρο
Name[en_GB]=Display in Specified Window
Name[eo]=Montri en indikita fenestro
Name[es]=Mostrar en la ventana especificada
Name[et]=Määratud aknas näitamine
Name[eu]=Bistaratu zehaztutako lehioan
Name[fa]=نمایش در پنجره مشخصشده
Name[fi]=Näytä määrätyssä ikkunassa
Name[fr]=Affichage dans la fenêtre spécifiée
Name[fy]=Werjefte yn in definiearre finster
Name[ga]=Taispeáin san Fhuinneog Sonraithe
Name[gl]=Mostrar na xanela indicada
Name[he]=הצג בחלון המצוין
Name[hne]=िि ि
Name[hr]=Prikaži u određenom prozoru
Name[hu]=Megjelenítés a megadott ablakban
Name[is]=Birta í völdum glugga
Name[it]=Mostra nella finestra specificata
Name[ja]=
Name[kk]=Келтірілген терезеде көрсетілсін
Name[ko]=
Name[lt]=Rodyti nurodytame lange
Name[lv]=Rādīt norādītajā logā
Name[mai]=िि ि ि
Name[mk]=Прикажи во наведениот прозорец
Name[ml]= ിി ി ിി
Name[mr]=ि
Name[ms]=Papar dalam Tetingkap Yang Dinyatakan
Name[nb]=Vis i angitt vindu
Name[nds]=In utsöcht Finster wiesen
Name[ne]=िि
Name[nl]=Weergeven In een opgegeven venster
Name[nn]=Vis i oppgjeve vindauge
Name[pa]= ਿ
Name[pl]=Wyświetl w zadanym oknie
Name[pt]=Mostrar na Janela Indicada
Name[pt_BR]=Exibir na janela indicada
Name[ro]=Afișează în fereastra specificată
Name[ru]=Показывать в указанном окне
Name[sk]=Zobraziť v zadanom okne
Name[sl]=Pokaži v določenem oknu
Name[sq]=Shfaq në Dritaren e Specifikuar
Name[sr]=Прикажи у задатом прозору
Name[sr@ijekavian]=Прикажи у задатом прозору
Name[sr@ijekavianlatin]=Prikaži u zadatom prozoru
Name[sr@latin]=Prikaži u zadatom prozoru
Name[sv]=Visa i angivet fönster
Name[ta]=ி ி
Name[tg]=Дар тирезаи нишондода намоиш намоед
Name[th]=
Name[tr]=Belirtilen Pencerede Göster
Name[ug]=بەلگىلەنگەن كۆزنەكتە كۆرسەت
Name[uk]=Відобразити у вказаному вікні
Name[vi]=Hin th trong Ca s Đã đnh
Name[x-test]=xxDisplay in Specified Windowxx
Name[zh_CN]=
Name[zh_TW]=
NoDisplay=true
[Desktop Action Root]
Exec=kgravity.kss -root
Name=Display in Root Window
Name[ast]=Amosar na ventana raíz
Name[bg]=Показване в главния прозорец
Name[br]=Diskwel er prenestr gwrizienn
Name[bs]=Prikaži u korijenom prozoru
Name[ca]=Mostra a la finestra arrel
Name[ca@valencia]=Mostra a la finestra arrel
Name[cs]=Zobrazit na pozadí plochy
Name[cy]=Dangos mewn Ffenestr Wraidd
Name[da]=Visning i root-vindue
Name[de]=In Hintergrundfenster anzeigen
Name[el]=Προβολή στο βασικό παράθυρο
Name[en_GB]=Display in Root Window
Name[eo]=Montri en radika fenestro
Name[es]=Mostrar en la ventana raíz
Name[et]=Juuraknas näitamine
Name[eu]=Bistaratu erro lehioan
Name[fa]=نمایش در پنجره ریشه
Name[fi]=Näytä juuri-ikkunassa
Name[fr]=Affichage dans la fenêtre racine
Name[fy]=Werjefte yn haadfinster
Name[ga]=Taispeáin sa Phríomhfhuinneog
Name[gl]=Mostrar na xanela raíz
Name[he]=הצג בחלון השורש
Name[hne]= ि
Name[hr]=Prikaži u ishodišnom prozoru
Name[hu]=Megjelenítés a gyökérablakban
Name[is]=Birta í rótarglugganum
Name[it]=Mostra sullo sfondo
Name[ja]=
Name[kk]=Түбір терезесінде көрсетілсін
Name[ko]=
Name[lt]=Rodyti root lange
Name[lv]=Rādīt saknes logā
Name[mai]= ि ि
Name[mk]=Прикажи во коренскиот прозорец
Name[ml]= ി ിി
Name[mr]=
Name[ms]=Papar dalam Tetingkap Root
Name[nb]=Vis i root-vindu
Name[nds]=In Hööftfinster wiesen
Name[ne]=
Name[nl]=Weergeven in hoofdvenster
Name[nn]=Vis i rotvindauget
Name[pa]=Root ਿ
Name[pl]=Wyświetl w oknie głównym
Name[pt]=Mostrar na Janela de Fundo
Name[pt_BR]=Exibir na janela raiz
Name[ro]=Afișează în fereastra rădăcină
Name[ru]=Показывать в корневом окне
Name[sk]=Zobraziť v koreňovom okne
Name[sl]=Pokaži v določenem oknu
Name[sq]=Shfaq në Dritaren Bazë
Name[sr]=Прикажи у кореном прозору
Name[sr@ijekavian]=Прикажи у корјеном прозору
Name[sr@ijekavianlatin]=Prikaži u korjenom prozoru
Name[sr@latin]=Prikaži u korenom prozoru
Name[sv]=Visa i rotfönstret
Name[ta]= ி
Name[tg]=Дар тирезаи решагӣ намоиш намоед
Name[th]=
Name[tr]=Kök Pencerede Göster
Name[ug]=غول كۆزنەكتە كۆرسەت
Name[uk]=Відобразити в кореневому вікні
Name[vi]=Hin th trong Ca s Gc
Name[x-test]=xxDisplay in Root Windowxx
Name[zh_CN]=
Name[zh_TW]=
NoDisplay=true

View file

@ -0,0 +1,300 @@
[Desktop Entry]
Exec=klines.kss
Icon=preferences-desktop-screensaver
Type=Service
X-KDE-ServiceTypes=ScreenSaver
Actions=Setup;InWindow;Root;
X-KDE-Category=Flying Things
Name=Lines
Name[af]=Lyne
Name[ast]=Llinies
Name[bg]=Линии
Name[br]=Linennoù
Name[bs]=Linije
Name[ca]=Línies
Name[ca@valencia]=Línies
Name[cs]=Linie
Name[cy]=Llinellau
Name[da]=Linjer
Name[de]=Linien
Name[el]=Γραμμές
Name[en_GB]=Lines
Name[eo]=Linioj
Name[es]=Líneas
Name[et]=Jooned
Name[eu]=Lerroak
Name[fa]=خطوط
Name[fi]=Viivat
Name[fr]=Lignes
Name[fy]=Linen
Name[ga]=Línte
Name[gl]=Liñas
Name[he]=קווים
Name[hne]=ि
Name[hu]=Vonalak
Name[is]=Línur
Name[it]=Linee
Name[ja]=
Name[kk]=Сызықтар
Name[ko]=
Name[lt]=Linijos
Name[lv]=Līnijas
Name[mai]=
Name[mk]=Прави
Name[ml]=
Name[mr]=
Name[ms]=Baris
Name[nb]=Linjer
Name[nds]=Lienen
Name[ne]=
Name[nl]=Lijnen
Name[nn]=Linjer
Name[oc]=Linhas
Name[pa]=
Name[pl]=Linie
Name[pt]=Linhas
Name[pt_BR]=Linhas
Name[ro]=Linii
Name[ru]=Линии
Name[sk]=Čiary
Name[sl]=Črte
Name[sq]=Vijat
Name[sr]=Линије
Name[sr@ijekavian]=Линије
Name[sr@ijekavianlatin]=Linije
Name[sr@latin]=Linije
Name[sv]=Linjer
Name[ta]=ி
Name[tg]=Рахҳо
Name[th]=
Name[tr]=Çizgiler
Name[ug]=سىزىقلار
Name[uk]=Лінії
Name[uz]=Chiziqlar
Name[uz@cyrillic]=Чизиқлар
Name[vi]=Dòng k
Name[xh]=Iilayini
Name[x-test]=xxLinesxx
Name[zh_CN]=线
Name[zh_TW]=
[Desktop Action Setup]
Exec=klines.kss -setup
Name=Setup...
Name[af]=Opstelling...
Name[ast]=Configuración...
Name[bg]=Настройки...
Name[br]=Kefluniadur ...
Name[bs]=Podesi...
Name[ca]=Arranjament...
Name[ca@valencia]=Arranjament...
Name[cs]=Nastavení...
Name[cy]=Gosod ...
Name[da]=Opsætning...
Name[de]=Einrichtung ...
Name[el]=Ρύθμιση...
Name[en_GB]=Setup...
Name[eo]=Agordo...
Name[es]=Configuración...
Name[et]=Seadistamine...
Name[eu]=Konfiguratu...
Name[fa]=برپایی...
Name[fi]=Asetukset
Name[fr]=Configuration...
Name[fy]=Opset...
Name[ga]=Socrú...
Name[gl]=Configuración...
Name[he]=הגדרות...
Name[hne]=...
Name[hr]=Postavke 
Name[hu]=Beállítás...
Name[is]=Stillingar...
Name[it]=Impostazioni...
Name[ja]=...
Name[kk]=Баптау...
Name[ko]=...
Name[lt]=Sąranka ...
Name[lv]=Iestatījumi...
Name[mai]=...
Name[mk]=Поставување...
Name[ml]=...
Name[mr]= ...
Name[ms]=Setkan...
Name[nb]=Innstillinger 
Name[nds]=Instellen...
Name[ne]=...
Name[nl]=Instellingen...
Name[nn]=Oppsett 
Name[pa]=...
Name[pl]=Ustawienia...
Name[pt]=Configurar...
Name[pt_BR]=Configurar...
Name[ro]=Configurare...
Name[ru]=Настройка...
Name[sk]=Nastavenie...
Name[sl]=Nastavi ...
Name[sq]=Instalimi...
Name[sr]=Подеси...
Name[sr@ijekavian]=Подеси...
Name[sr@ijekavianlatin]=Podesi...
Name[sr@latin]=Podesi...
Name[sv]=Inställningar...
Name[ta]=...
Name[tg]=Барпосозӣ...
Name[th]=...
Name[tr]=Kurulum...
Name[ug]=ئورنات
Name[uk]=Встановити...
Name[uz]=Oʻrnatish
Name[uz@cyrillic]=Ўрнатиш
Name[vi]=Thiết lp...
Name[xh]=Iyacwangciswa...
Name[x-test]=xxSetup...xx
Name[zh_CN]=...
Name[zh_TW]=...
Icon=preferences-desktop-screensaver
[Desktop Action InWindow]
Exec=klines.kss -window-id %w
Name=Display in Specified Window
Name[ast]=Amosar na ventana especificada
Name[bg]=Показване в избран прозорец
Name[br]=Diskwel er prenestr spisaet
Name[bs]=Prikaži u određenom prozoru
Name[ca]=Mostra a la finestra especificada
Name[ca@valencia]=Mostra a la finestra especificada
Name[cs]=Zobrazit v určeném okně
Name[cy]=Dangos mewn Ffenestr Benodol
Name[da]=Visning i angivet vindue
Name[de]=In bestimmten Fenster anzeigen
Name[el]=Προβολή στο καθορισμένο παράθυρο
Name[en_GB]=Display in Specified Window
Name[eo]=Montri en indikita fenestro
Name[es]=Mostrar en la ventana especificada
Name[et]=Määratud aknas näitamine
Name[eu]=Bistaratu zehaztutako lehioan
Name[fa]=نمایش در پنجره مشخصشده
Name[fi]=Näytä määrätyssä ikkunassa
Name[fr]=Affichage dans la fenêtre spécifiée
Name[fy]=Werjefte yn in definiearre finster
Name[ga]=Taispeáin san Fhuinneog Sonraithe
Name[gl]=Mostrar na xanela indicada
Name[he]=הצג בחלון המצוין
Name[hne]=िि ि
Name[hr]=Prikaži u određenom prozoru
Name[hu]=Megjelenítés a megadott ablakban
Name[is]=Birta í völdum glugga
Name[it]=Mostra nella finestra specificata
Name[ja]=
Name[kk]=Келтірілген терезеде көрсетілсін
Name[ko]=
Name[lt]=Rodyti nurodytame lange
Name[lv]=Rādīt norādītajā logā
Name[mai]=िि ि ि
Name[mk]=Прикажи во наведениот прозорец
Name[ml]= ിി ി ിി
Name[mr]=ि
Name[ms]=Papar dalam Tetingkap Yang Dinyatakan
Name[nb]=Vis i angitt vindu
Name[nds]=In utsöcht Finster wiesen
Name[ne]=िि
Name[nl]=Weergeven In een opgegeven venster
Name[nn]=Vis i oppgjeve vindauge
Name[pa]= ਿ
Name[pl]=Wyświetl w zadanym oknie
Name[pt]=Mostrar na Janela Indicada
Name[pt_BR]=Exibir na janela indicada
Name[ro]=Afișează în fereastra specificată
Name[ru]=Показывать в указанном окне
Name[sk]=Zobraziť v zadanom okne
Name[sl]=Pokaži v določenem oknu
Name[sq]=Shfaq në Dritaren e Specifikuar
Name[sr]=Прикажи у задатом прозору
Name[sr@ijekavian]=Прикажи у задатом прозору
Name[sr@ijekavianlatin]=Prikaži u zadatom prozoru
Name[sr@latin]=Prikaži u zadatom prozoru
Name[sv]=Visa i angivet fönster
Name[ta]=ி ி
Name[tg]=Дар тирезаи нишондода намоиш намоед
Name[th]=
Name[tr]=Belirtilen Pencerede Göster
Name[ug]=بەلگىلەنگەن كۆزنەكتە كۆرسەت
Name[uk]=Відобразити у вказаному вікні
Name[vi]=Hin th trong Ca s Đã đnh
Name[x-test]=xxDisplay in Specified Windowxx
Name[zh_CN]=
Name[zh_TW]=
NoDisplay=true
[Desktop Action Root]
Exec=klines.kss -root
Name=Display in Root Window
Name[ast]=Amosar na ventana raíz
Name[bg]=Показване в главния прозорец
Name[br]=Diskwel er prenestr gwrizienn
Name[bs]=Prikaži u korijenom prozoru
Name[ca]=Mostra a la finestra arrel
Name[ca@valencia]=Mostra a la finestra arrel
Name[cs]=Zobrazit na pozadí plochy
Name[cy]=Dangos mewn Ffenestr Wraidd
Name[da]=Visning i root-vindue
Name[de]=In Hintergrundfenster anzeigen
Name[el]=Προβολή στο βασικό παράθυρο
Name[en_GB]=Display in Root Window
Name[eo]=Montri en radika fenestro
Name[es]=Mostrar en la ventana raíz
Name[et]=Juuraknas näitamine
Name[eu]=Bistaratu erro lehioan
Name[fa]=نمایش در پنجره ریشه
Name[fi]=Näytä juuri-ikkunassa
Name[fr]=Affichage dans la fenêtre racine
Name[fy]=Werjefte yn haadfinster
Name[ga]=Taispeáin sa Phríomhfhuinneog
Name[gl]=Mostrar na xanela raíz
Name[he]=הצג בחלון השורש
Name[hne]= ि
Name[hr]=Prikaži u ishodišnom prozoru
Name[hu]=Megjelenítés a gyökérablakban
Name[is]=Birta í rótarglugganum
Name[it]=Mostra sullo sfondo
Name[ja]=
Name[kk]=Түбір терезесінде көрсетілсін
Name[ko]=
Name[lt]=Rodyti root lange
Name[lv]=Rādīt saknes logā
Name[mai]= ि ि
Name[mk]=Прикажи во коренскиот прозорец
Name[ml]= ി ിി
Name[mr]=
Name[ms]=Papar dalam Tetingkap Root
Name[nb]=Vis i root-vindu
Name[nds]=In Hööftfinster wiesen
Name[ne]=
Name[nl]=Weergeven in hoofdvenster
Name[nn]=Vis i rotvindauget
Name[pa]=Root ਿ
Name[pl]=Wyświetl w oknie głównym
Name[pt]=Mostrar na Janela de Fundo
Name[pt_BR]=Exibir na janela raiz
Name[ro]=Afișează în fereastra rădăcină
Name[ru]=Показывать в корневом окне
Name[sk]=Zobraziť v koreňovom okne
Name[sl]=Pokaži v določenem oknu
Name[sq]=Shfaq në Dritaren Bazë
Name[sr]=Прикажи у кореном прозору
Name[sr@ijekavian]=Прикажи у корјеном прозору
Name[sr@ijekavianlatin]=Prikaži u korjenom prozoru
Name[sr@latin]=Prikaži u korenom prozoru
Name[sv]=Visa i rotfönstret
Name[ta]= ி
Name[tg]=Дар тирезаи решагӣ намоиш намоед
Name[th]=
Name[tr]=Kök Pencerede Göster
Name[ug]=غول كۆزنەكتە كۆرسەت
Name[uk]=Відобразити в кореневому вікні
Name[vi]=Hin th trong Ca s Gc
Name[x-test]=xxDisplay in Root Windowxx
Name[zh_CN]=
Name[zh_TW]=
NoDisplay=true
X-DBUS-StartupType=Multi

View file

@ -0,0 +1,292 @@
[Desktop Entry]
Exec=klorenz.kss
Icon=preferences-desktop-screensaver
Type=Service
X-KDE-ServiceTypes=ScreenSaver
Actions=Setup;InWindow;Root;
X-KDE-Category=Gadgets & Simulations
Name=Lorenz Attractor
Name[af]=Lorenz Aantrekker
Name[ast]=Atractor de Lorenz
Name[bg]=Лоренцо
Name[br]=Dedenner Lorenz
Name[bs]=Lorenz Atraktor
Name[ca]=Lorenz Attractor
Name[ca@valencia]=Lorenz Attractor
Name[cs]=Lorenzův atraktor
Name[cy]=Attynydd Lorenz
Name[da]=Lorenz-attraktor
Name[de]=Lorenz-Attraktor
Name[el]=Ελκυστής Lorenz
Name[en_GB]=Lorenz Attractor
Name[eo]=Lorenza atraktoro
Name[es]=Atractor de Lorenz
Name[et]=Lorenzi atraktor
Name[eu]=Lorenz erakarlea
Name[fa]=رباینده Lorenz
Name[fi]=Lorentz attraktori
Name[fr]=Attracteur de Lorentz
Name[fy]=Lorenz Oanlûker
Name[ga]=Aomthóir Lorenz
Name[gl]=Atractor de Lorenz
Name[he]=מושך לורנץ
Name[hne]=
Name[hu]=Lorenz-féle képernyővédő
Name[is]=Lorenz aðdráttur
Name[it]=Attrattore di Lorenz
Name[ja]=
Name[kk]=Лоренц аттракторы
Name[ko]=
Name[lt]=Lorenz Attractor
Name[lv]=Lorensa atraktors
Name[mk]=Лоренцов атрактор
Name[ml]=
Name[ms]=Lorenz Attractor
Name[nb]=Lorenz-attraktor
Name[nds]=Lorenz-Antrecker
Name[ne]=
Name[nl]=Lorenz Attractor
Name[nn]=Lorenz-tiltrekking
Name[pl]=Atraktor Lorenza
Name[pt]=Força de Lorenz
Name[pt_BR]=Atração Lorenz
Name[ro]=Atracție Lorenz
Name[ru]=Странный аттрактор Лоренца
Name[sk]=Lorenz Attractor
Name[sl]=Lorenzov atraktor
Name[sq]=Lorenz Attractor
Name[sr]=Клоренц
Name[sr@ijekavian]=Клоренц
Name[sr@ijekavianlatin]=Klorenc
Name[sr@latin]=Klorenc
Name[sv]=Lorenz attraktor
Name[ta]=
Name[tg]=Аттракти аҷоиби Лоренс
Name[th]=
Name[tr]=Cazibe
Name[uk]=Атрактор Лоренца
Name[vi]=Đim hút Lorenz
Name[xh]=Umtsali we Lorenz
Name[x-test]=xxLorenz Attractorxx
Name[zh_CN]=
Name[zh_TW]=Lorenz
[Desktop Action Setup]
Exec=klorenz.kss -setup
Name=Setup...
Name[af]=Opstelling...
Name[ast]=Configuración...
Name[bg]=Настройки...
Name[br]=Kefluniadur ...
Name[bs]=Podesi...
Name[ca]=Arranjament...
Name[ca@valencia]=Arranjament...
Name[cs]=Nastavení...
Name[cy]=Gosod ...
Name[da]=Opsætning...
Name[de]=Einrichtung ...
Name[el]=Ρύθμιση...
Name[en_GB]=Setup...
Name[eo]=Agordo...
Name[es]=Configuración...
Name[et]=Seadistamine...
Name[eu]=Konfiguratu...
Name[fa]=برپایی...
Name[fi]=Asetukset
Name[fr]=Configuration...
Name[fy]=Opset...
Name[ga]=Socrú...
Name[gl]=Configuración...
Name[he]=הגדרות...
Name[hne]=...
Name[hr]=Postavke 
Name[hu]=Beállítás...
Name[is]=Stillingar...
Name[it]=Impostazioni...
Name[ja]=...
Name[kk]=Баптау...
Name[ko]=...
Name[lt]=Sąranka ...
Name[lv]=Iestatījumi...
Name[mai]=...
Name[mk]=Поставување...
Name[ml]=...
Name[mr]= ...
Name[ms]=Setkan...
Name[nb]=Innstillinger 
Name[nds]=Instellen...
Name[ne]=...
Name[nl]=Instellingen...
Name[nn]=Oppsett 
Name[pa]=...
Name[pl]=Ustawienia...
Name[pt]=Configurar...
Name[pt_BR]=Configurar...
Name[ro]=Configurare...
Name[ru]=Настройка...
Name[sk]=Nastavenie...
Name[sl]=Nastavi ...
Name[sq]=Instalimi...
Name[sr]=Подеси...
Name[sr@ijekavian]=Подеси...
Name[sr@ijekavianlatin]=Podesi...
Name[sr@latin]=Podesi...
Name[sv]=Inställningar...
Name[ta]=...
Name[tg]=Барпосозӣ...
Name[th]=...
Name[tr]=Kurulum...
Name[ug]=ئورنات
Name[uk]=Встановити...
Name[uz]=Oʻrnatish
Name[uz@cyrillic]=Ўрнатиш
Name[vi]=Thiết lp...
Name[xh]=Iyacwangciswa...
Name[x-test]=xxSetup...xx
Name[zh_CN]=...
Name[zh_TW]=...
Icon=preferences-desktop-screensaver
[Desktop Action InWindow]
Exec=klorenz.kss -window-id %w
Name=Display in Specified Window
Name[ast]=Amosar na ventana especificada
Name[bg]=Показване в избран прозорец
Name[br]=Diskwel er prenestr spisaet
Name[bs]=Prikaži u određenom prozoru
Name[ca]=Mostra a la finestra especificada
Name[ca@valencia]=Mostra a la finestra especificada
Name[cs]=Zobrazit v určeném okně
Name[cy]=Dangos mewn Ffenestr Benodol
Name[da]=Visning i angivet vindue
Name[de]=In bestimmten Fenster anzeigen
Name[el]=Προβολή στο καθορισμένο παράθυρο
Name[en_GB]=Display in Specified Window
Name[eo]=Montri en indikita fenestro
Name[es]=Mostrar en la ventana especificada
Name[et]=Määratud aknas näitamine
Name[eu]=Bistaratu zehaztutako lehioan
Name[fa]=نمایش در پنجره مشخصشده
Name[fi]=Näytä määrätyssä ikkunassa
Name[fr]=Affichage dans la fenêtre spécifiée
Name[fy]=Werjefte yn in definiearre finster
Name[ga]=Taispeáin san Fhuinneog Sonraithe
Name[gl]=Mostrar na xanela indicada
Name[he]=הצג בחלון המצוין
Name[hne]=िि ि
Name[hr]=Prikaži u određenom prozoru
Name[hu]=Megjelenítés a megadott ablakban
Name[is]=Birta í völdum glugga
Name[it]=Mostra nella finestra specificata
Name[ja]=
Name[kk]=Келтірілген терезеде көрсетілсін
Name[ko]=
Name[lt]=Rodyti nurodytame lange
Name[lv]=Rādīt norādītajā logā
Name[mai]=िि ि ि
Name[mk]=Прикажи во наведениот прозорец
Name[ml]= ിി ി ിി
Name[mr]=ि
Name[ms]=Papar dalam Tetingkap Yang Dinyatakan
Name[nb]=Vis i angitt vindu
Name[nds]=In utsöcht Finster wiesen
Name[ne]=िि
Name[nl]=Weergeven In een opgegeven venster
Name[nn]=Vis i oppgjeve vindauge
Name[pa]= ਿ
Name[pl]=Wyświetl w zadanym oknie
Name[pt]=Mostrar na Janela Indicada
Name[pt_BR]=Exibir na janela indicada
Name[ro]=Afișează în fereastra specificată
Name[ru]=Показывать в указанном окне
Name[sk]=Zobraziť v zadanom okne
Name[sl]=Pokaži v določenem oknu
Name[sq]=Shfaq në Dritaren e Specifikuar
Name[sr]=Прикажи у задатом прозору
Name[sr@ijekavian]=Прикажи у задатом прозору
Name[sr@ijekavianlatin]=Prikaži u zadatom prozoru
Name[sr@latin]=Prikaži u zadatom prozoru
Name[sv]=Visa i angivet fönster
Name[ta]=ி ி
Name[tg]=Дар тирезаи нишондода намоиш намоед
Name[th]=
Name[tr]=Belirtilen Pencerede Göster
Name[ug]=بەلگىلەنگەن كۆزنەكتە كۆرسەت
Name[uk]=Відобразити у вказаному вікні
Name[vi]=Hin th trong Ca s Đã đnh
Name[x-test]=xxDisplay in Specified Windowxx
Name[zh_CN]=
Name[zh_TW]=
NoDisplay=true
[Desktop Action Root]
Exec=klorenz.kss -root
Name=Display in Root Window
Name[ast]=Amosar na ventana raíz
Name[bg]=Показване в главния прозорец
Name[br]=Diskwel er prenestr gwrizienn
Name[bs]=Prikaži u korijenom prozoru
Name[ca]=Mostra a la finestra arrel
Name[ca@valencia]=Mostra a la finestra arrel
Name[cs]=Zobrazit na pozadí plochy
Name[cy]=Dangos mewn Ffenestr Wraidd
Name[da]=Visning i root-vindue
Name[de]=In Hintergrundfenster anzeigen
Name[el]=Προβολή στο βασικό παράθυρο
Name[en_GB]=Display in Root Window
Name[eo]=Montri en radika fenestro
Name[es]=Mostrar en la ventana raíz
Name[et]=Juuraknas näitamine
Name[eu]=Bistaratu erro lehioan
Name[fa]=نمایش در پنجره ریشه
Name[fi]=Näytä juuri-ikkunassa
Name[fr]=Affichage dans la fenêtre racine
Name[fy]=Werjefte yn haadfinster
Name[ga]=Taispeáin sa Phríomhfhuinneog
Name[gl]=Mostrar na xanela raíz
Name[he]=הצג בחלון השורש
Name[hne]= ि
Name[hr]=Prikaži u ishodišnom prozoru
Name[hu]=Megjelenítés a gyökérablakban
Name[is]=Birta í rótarglugganum
Name[it]=Mostra sullo sfondo
Name[ja]=
Name[kk]=Түбір терезесінде көрсетілсін
Name[ko]=
Name[lt]=Rodyti root lange
Name[lv]=Rādīt saknes logā
Name[mai]= ि ि
Name[mk]=Прикажи во коренскиот прозорец
Name[ml]= ി ിി
Name[mr]=
Name[ms]=Papar dalam Tetingkap Root
Name[nb]=Vis i root-vindu
Name[nds]=In Hööftfinster wiesen
Name[ne]=
Name[nl]=Weergeven in hoofdvenster
Name[nn]=Vis i rotvindauget
Name[pa]=Root ਿ
Name[pl]=Wyświetl w oknie głównym
Name[pt]=Mostrar na Janela de Fundo
Name[pt_BR]=Exibir na janela raiz
Name[ro]=Afișează în fereastra rădăcină
Name[ru]=Показывать в корневом окне
Name[sk]=Zobraziť v koreňovom okne
Name[sl]=Pokaži v določenem oknu
Name[sq]=Shfaq në Dritaren Bazë
Name[sr]=Прикажи у кореном прозору
Name[sr@ijekavian]=Прикажи у корјеном прозору
Name[sr@ijekavianlatin]=Prikaži u korjenom prozoru
Name[sr@latin]=Prikaži u korenom prozoru
Name[sv]=Visa i rotfönstret
Name[ta]= ி
Name[tg]=Дар тирезаи решагӣ намоиш намоед
Name[th]=
Name[tr]=Kök Pencerede Göster
Name[ug]=غول كۆزنەكتە كۆرسەت
Name[uk]=Відобразити в кореневому вікні
Name[vi]=Hin th trong Ca s Gc
Name[x-test]=xxDisplay in Root Windowxx
Name[zh_CN]=
Name[zh_TW]=
NoDisplay=true

View file

@ -0,0 +1,289 @@
[Desktop Entry]
Exec=kpendulum.kss
Icon=preferences-desktop-screensaver
Type=Service
X-KDE-ServiceTypes=ScreenSaver
Actions=Setup;InWindow;Root;
X-KDE-Category=OpenGL Screen Savers
X-KDE-Type=OpenGL
Name=KPendulum (GL)
Name[ast]=KPendulum (GL)
Name[bg]=Махало
Name[br]=KPendulum (GL)
Name[bs]=KPendulum (GL)
Name[ca]=KPendulum (GL)
Name[ca@valencia]=KPendulum (GL)
Name[cs]=Kyvadlo
Name[da]=KPendulum (GL)
Name[de]=KPendulum
Name[el]=KPendulum (GL)
Name[en_GB]=KPendulum (GL)
Name[eo]=Pendolo (GL)
Name[es]=Péndulo K (GL)
Name[et]=KPendulum (GL)
Name[eu]=KPendulum (GL)
Name[fi]=KPendulum (GL)
Name[fr]=Pendule (GL)
Name[fy]=KPendulum (GL)
Name[ga]=KPendulum (GL)
Name[gl]=KPendulum (GL)
Name[he]=KPendulum (GL)
Name[hne]=- ()
Name[hu]=KPendulum (OpenGL)
Name[is]=KPendúlar (GL)
Name[it]=Pendolo (GL)
Name[ja]= (GL)
Name[kk]=Әткеншек (GL)
Name[ko]=KPendulum (GL)
Name[lt]=KPendulum (GL)
Name[lv]=Svārsts (GL)
Name[mk]=КНишало (GL)
Name[ml]= (ി)
Name[ms]=KPendulum (GL)
Name[nb]=KPendel (GL)
Name[nds]=Pennel (GL)
Name[ne]= (GL)
Name[nl]=KPendulum (GL)
Name[nn]=KPendel (GL)
Name[pl]=KPendulum (GL)
Name[pt]=KPêndulo (GL)
Name[pt_BR]=KPendulum (GL)
Name[ro]=Pendul (GL)
Name[ru]=Маятник (GL)
Name[sk]=KPendulum (GL)
Name[sl]=Nihalo (GL)
Name[sq]=KPendulum (GL)
Name[sr]=Кклатно
Name[sr@ijekavian]=Кклатно
Name[sr@ijekavianlatin]=Kklatno
Name[sr@latin]=Kklatno
Name[sv]=Pendel (GL)
Name[ta]=KPendulum(GL)
Name[tg]=Раққосак (GL)
Name[th]= K (GL)
Name[tr]=Sarkaç (GL)
Name[uk]=Маятник (GL)
Name[vi]=Con lc (GL)
Name[x-test]=xxKPendulum (GL)xx
Name[zh_CN]=K (GL)
Name[zh_TW]=KPendulum (GL)
[Desktop Action Setup]
Exec=kpendulum.kss -setup
Name=Setup...
Name[af]=Opstelling...
Name[ast]=Configuración...
Name[bg]=Настройки...
Name[br]=Kefluniadur ...
Name[bs]=Podesi...
Name[ca]=Arranjament...
Name[ca@valencia]=Arranjament...
Name[cs]=Nastavení...
Name[cy]=Gosod ...
Name[da]=Opsætning...
Name[de]=Einrichtung ...
Name[el]=Ρύθμιση...
Name[en_GB]=Setup...
Name[eo]=Agordo...
Name[es]=Configuración...
Name[et]=Seadistamine...
Name[eu]=Konfiguratu...
Name[fa]=برپایی...
Name[fi]=Asetukset
Name[fr]=Configuration...
Name[fy]=Opset...
Name[ga]=Socrú...
Name[gl]=Configuración...
Name[he]=הגדרות...
Name[hne]=...
Name[hr]=Postavke 
Name[hu]=Beállítás...
Name[is]=Stillingar...
Name[it]=Impostazioni...
Name[ja]=...
Name[kk]=Баптау...
Name[ko]=...
Name[lt]=Sąranka ...
Name[lv]=Iestatījumi...
Name[mai]=...
Name[mk]=Поставување...
Name[ml]=...
Name[mr]= ...
Name[ms]=Setkan...
Name[nb]=Innstillinger 
Name[nds]=Instellen...
Name[ne]=...
Name[nl]=Instellingen...
Name[nn]=Oppsett 
Name[pa]=...
Name[pl]=Ustawienia...
Name[pt]=Configurar...
Name[pt_BR]=Configurar...
Name[ro]=Configurare...
Name[ru]=Настройка...
Name[sk]=Nastavenie...
Name[sl]=Nastavi ...
Name[sq]=Instalimi...
Name[sr]=Подеси...
Name[sr@ijekavian]=Подеси...
Name[sr@ijekavianlatin]=Podesi...
Name[sr@latin]=Podesi...
Name[sv]=Inställningar...
Name[ta]=...
Name[tg]=Барпосозӣ...
Name[th]=...
Name[tr]=Kurulum...
Name[ug]=ئورنات
Name[uk]=Встановити...
Name[uz]=Oʻrnatish
Name[uz@cyrillic]=Ўрнатиш
Name[vi]=Thiết lp...
Name[xh]=Iyacwangciswa...
Name[x-test]=xxSetup...xx
Name[zh_CN]=...
Name[zh_TW]=...
Icon=preferences-desktop-screensaver
[Desktop Action InWindow]
Exec=kpendulum.kss -window-id %w
Name=Display in Specified Window
Name[ast]=Amosar na ventana especificada
Name[bg]=Показване в избран прозорец
Name[br]=Diskwel er prenestr spisaet
Name[bs]=Prikaži u određenom prozoru
Name[ca]=Mostra a la finestra especificada
Name[ca@valencia]=Mostra a la finestra especificada
Name[cs]=Zobrazit v určeném okně
Name[cy]=Dangos mewn Ffenestr Benodol
Name[da]=Visning i angivet vindue
Name[de]=In bestimmten Fenster anzeigen
Name[el]=Προβολή στο καθορισμένο παράθυρο
Name[en_GB]=Display in Specified Window
Name[eo]=Montri en indikita fenestro
Name[es]=Mostrar en la ventana especificada
Name[et]=Määratud aknas näitamine
Name[eu]=Bistaratu zehaztutako lehioan
Name[fa]=نمایش در پنجره مشخصشده
Name[fi]=Näytä määrätyssä ikkunassa
Name[fr]=Affichage dans la fenêtre spécifiée
Name[fy]=Werjefte yn in definiearre finster
Name[ga]=Taispeáin san Fhuinneog Sonraithe
Name[gl]=Mostrar na xanela indicada
Name[he]=הצג בחלון המצוין
Name[hne]=िि ि
Name[hr]=Prikaži u određenom prozoru
Name[hu]=Megjelenítés a megadott ablakban
Name[is]=Birta í völdum glugga
Name[it]=Mostra nella finestra specificata
Name[ja]=
Name[kk]=Келтірілген терезеде көрсетілсін
Name[ko]=
Name[lt]=Rodyti nurodytame lange
Name[lv]=Rādīt norādītajā logā
Name[mai]=िि ि ि
Name[mk]=Прикажи во наведениот прозорец
Name[ml]= ിി ി ിി
Name[mr]=ि
Name[ms]=Papar dalam Tetingkap Yang Dinyatakan
Name[nb]=Vis i angitt vindu
Name[nds]=In utsöcht Finster wiesen
Name[ne]=िि
Name[nl]=Weergeven In een opgegeven venster
Name[nn]=Vis i oppgjeve vindauge
Name[pa]= ਿ
Name[pl]=Wyświetl w zadanym oknie
Name[pt]=Mostrar na Janela Indicada
Name[pt_BR]=Exibir na janela indicada
Name[ro]=Afișează în fereastra specificată
Name[ru]=Показывать в указанном окне
Name[sk]=Zobraziť v zadanom okne
Name[sl]=Pokaži v določenem oknu
Name[sq]=Shfaq në Dritaren e Specifikuar
Name[sr]=Прикажи у задатом прозору
Name[sr@ijekavian]=Прикажи у задатом прозору
Name[sr@ijekavianlatin]=Prikaži u zadatom prozoru
Name[sr@latin]=Prikaži u zadatom prozoru
Name[sv]=Visa i angivet fönster
Name[ta]=ி ி
Name[tg]=Дар тирезаи нишондода намоиш намоед
Name[th]=
Name[tr]=Belirtilen Pencerede Göster
Name[ug]=بەلگىلەنگەن كۆزنەكتە كۆرسەت
Name[uk]=Відобразити у вказаному вікні
Name[vi]=Hin th trong Ca s Đã đnh
Name[x-test]=xxDisplay in Specified Windowxx
Name[zh_CN]=
Name[zh_TW]=
NoDisplay=true
[Desktop Action Root]
Exec=kpendulum.kss -root
Name=Display in Root Window
Name[ast]=Amosar na ventana raíz
Name[bg]=Показване в главния прозорец
Name[br]=Diskwel er prenestr gwrizienn
Name[bs]=Prikaži u korijenom prozoru
Name[ca]=Mostra a la finestra arrel
Name[ca@valencia]=Mostra a la finestra arrel
Name[cs]=Zobrazit na pozadí plochy
Name[cy]=Dangos mewn Ffenestr Wraidd
Name[da]=Visning i root-vindue
Name[de]=In Hintergrundfenster anzeigen
Name[el]=Προβολή στο βασικό παράθυρο
Name[en_GB]=Display in Root Window
Name[eo]=Montri en radika fenestro
Name[es]=Mostrar en la ventana raíz
Name[et]=Juuraknas näitamine
Name[eu]=Bistaratu erro lehioan
Name[fa]=نمایش در پنجره ریشه
Name[fi]=Näytä juuri-ikkunassa
Name[fr]=Affichage dans la fenêtre racine
Name[fy]=Werjefte yn haadfinster
Name[ga]=Taispeáin sa Phríomhfhuinneog
Name[gl]=Mostrar na xanela raíz
Name[he]=הצג בחלון השורש
Name[hne]= ि
Name[hr]=Prikaži u ishodišnom prozoru
Name[hu]=Megjelenítés a gyökérablakban
Name[is]=Birta í rótarglugganum
Name[it]=Mostra sullo sfondo
Name[ja]=
Name[kk]=Түбір терезесінде көрсетілсін
Name[ko]=
Name[lt]=Rodyti root lange
Name[lv]=Rādīt saknes logā
Name[mai]= ि ि
Name[mk]=Прикажи во коренскиот прозорец
Name[ml]= ി ിി
Name[mr]=
Name[ms]=Papar dalam Tetingkap Root
Name[nb]=Vis i root-vindu
Name[nds]=In Hööftfinster wiesen
Name[ne]=
Name[nl]=Weergeven in hoofdvenster
Name[nn]=Vis i rotvindauget
Name[pa]=Root ਿ
Name[pl]=Wyświetl w oknie głównym
Name[pt]=Mostrar na Janela de Fundo
Name[pt_BR]=Exibir na janela raiz
Name[ro]=Afișează în fereastra rădăcină
Name[ru]=Показывать в корневом окне
Name[sk]=Zobraziť v koreňovom okne
Name[sl]=Pokaži v določenem oknu
Name[sq]=Shfaq në Dritaren Bazë
Name[sr]=Прикажи у кореном прозору
Name[sr@ijekavian]=Прикажи у корјеном прозору
Name[sr@ijekavianlatin]=Prikaži u korjenom prozoru
Name[sr@latin]=Prikaži u korenom prozoru
Name[sv]=Visa i rotfönstret
Name[ta]= ி
Name[tg]=Дар тирезаи решагӣ намоиш намоед
Name[th]=
Name[tr]=Kök Pencerede Göster
Name[ug]=غول كۆزنەكتە كۆرسەت
Name[uk]=Відобразити в кореневому вікні
Name[vi]=Hin th trong Ca s Gc
Name[x-test]=xxDisplay in Root Windowxx
Name[zh_CN]=
Name[zh_TW]=
NoDisplay=true

View file

@ -0,0 +1,297 @@
[Desktop Entry]
Exec=kpolygon.kss
Icon=preferences-desktop-screensaver
Type=Service
X-KDE-ServiceTypes=ScreenSaver
Actions=Setup;InWindow;Root;
X-KDE-Category=Rapid Motion
Name=Polygons
Name[af]=Poligone
Name[ast]=Polígonos
Name[bg]=Полигон
Name[br]=Lieskognegoù
Name[bs]=Poligoni
Name[ca]=Polígons
Name[ca@valencia]=Polígons
Name[cs]=Polygony
Name[cy]=Polygonau
Name[da]=Polygoner
Name[de]=Polygon
Name[el]=Polygons
Name[en_GB]=Polygons
Name[eo]=Poligonoj
Name[es]=Polígonos
Name[et]=Polügoonid
Name[eu]=Poligonoak
Name[fa]=چند ضلعیها
Name[fi]=Polygonit
Name[fr]=Polygones
Name[fy]=Polygoanen
Name[ga]=Polagáin
Name[gl]=Polígonos
Name[he]=מצולעים
Name[hne]=
Name[hu]=Poligonok
Name[is]=Marghyrningar
Name[it]=Poligoni
Name[ja]=
Name[kk]=Көпбұрыштар
Name[ko]=
Name[lt]=Daugiakampiai
Name[lv]=Daudzstūri
Name[mai]=
Name[mk]=Полигони
Name[ml]=ി
Name[ms]=Poligon
Name[nb]=Polygoner
Name[nds]=Veelecken
Name[ne]=
Name[nl]=Polygonen
Name[nn]=Polygon
Name[pa]=
Name[pl]=Wielokąty
Name[pt]=Polígonos
Name[pt_BR]=Polígonos
Name[ro]=Poligoane
Name[ru]=Многоугольники
Name[sk]=Polygóny
Name[sl]=Mnogokotniki
Name[sq]=Poligonë
Name[sr]=Полигони
Name[sr@ijekavian]=Полигони
Name[sr@ijekavianlatin]=Poligoni
Name[sr@latin]=Poligoni
Name[sv]=Polygoner
Name[ta]=ி
Name[tg]=Бисёркунҷа
Name[th]=
Name[tr]=Poligonlar
Name[ug]=كۆپ تەرەپلىك
Name[uk]=Багатокутники
Name[uz]=Koʻpburchaklar
Name[uz@cyrillic]=Кўпбурчаклар
Name[vi]=Đa giác
Name[xh]=Iziqu ezinekona namacala amaninzi
Name[x-test]=xxPolygonsxx
Name[zh_CN]=
Name[zh_TW]=
[Desktop Action Setup]
Exec=kpolygon.kss -setup
Name=Setup...
Name[af]=Opstelling...
Name[ast]=Configuración...
Name[bg]=Настройки...
Name[br]=Kefluniadur ...
Name[bs]=Podesi...
Name[ca]=Arranjament...
Name[ca@valencia]=Arranjament...
Name[cs]=Nastavení...
Name[cy]=Gosod ...
Name[da]=Opsætning...
Name[de]=Einrichtung ...
Name[el]=Ρύθμιση...
Name[en_GB]=Setup...
Name[eo]=Agordo...
Name[es]=Configuración...
Name[et]=Seadistamine...
Name[eu]=Konfiguratu...
Name[fa]=برپایی...
Name[fi]=Asetukset
Name[fr]=Configuration...
Name[fy]=Opset...
Name[ga]=Socrú...
Name[gl]=Configuración...
Name[he]=הגדרות...
Name[hne]=...
Name[hr]=Postavke 
Name[hu]=Beállítás...
Name[is]=Stillingar...
Name[it]=Impostazioni...
Name[ja]=...
Name[kk]=Баптау...
Name[ko]=...
Name[lt]=Sąranka ...
Name[lv]=Iestatījumi...
Name[mai]=...
Name[mk]=Поставување...
Name[ml]=...
Name[mr]= ...
Name[ms]=Setkan...
Name[nb]=Innstillinger 
Name[nds]=Instellen...
Name[ne]=...
Name[nl]=Instellingen...
Name[nn]=Oppsett 
Name[pa]=...
Name[pl]=Ustawienia...
Name[pt]=Configurar...
Name[pt_BR]=Configurar...
Name[ro]=Configurare...
Name[ru]=Настройка...
Name[sk]=Nastavenie...
Name[sl]=Nastavi ...
Name[sq]=Instalimi...
Name[sr]=Подеси...
Name[sr@ijekavian]=Подеси...
Name[sr@ijekavianlatin]=Podesi...
Name[sr@latin]=Podesi...
Name[sv]=Inställningar...
Name[ta]=...
Name[tg]=Барпосозӣ...
Name[th]=...
Name[tr]=Kurulum...
Name[ug]=ئورنات
Name[uk]=Встановити...
Name[uz]=Oʻrnatish
Name[uz@cyrillic]=Ўрнатиш
Name[vi]=Thiết lp...
Name[xh]=Iyacwangciswa...
Name[x-test]=xxSetup...xx
Name[zh_CN]=...
Name[zh_TW]=...
Icon=preferences-desktop-screensaver
[Desktop Action InWindow]
Exec=kpolygon.kss -window-id %w
Name=Display in Specified Window
Name[ast]=Amosar na ventana especificada
Name[bg]=Показване в избран прозорец
Name[br]=Diskwel er prenestr spisaet
Name[bs]=Prikaži u određenom prozoru
Name[ca]=Mostra a la finestra especificada
Name[ca@valencia]=Mostra a la finestra especificada
Name[cs]=Zobrazit v určeném okně
Name[cy]=Dangos mewn Ffenestr Benodol
Name[da]=Visning i angivet vindue
Name[de]=In bestimmten Fenster anzeigen
Name[el]=Προβολή στο καθορισμένο παράθυρο
Name[en_GB]=Display in Specified Window
Name[eo]=Montri en indikita fenestro
Name[es]=Mostrar en la ventana especificada
Name[et]=Määratud aknas näitamine
Name[eu]=Bistaratu zehaztutako lehioan
Name[fa]=نمایش در پنجره مشخصشده
Name[fi]=Näytä määrätyssä ikkunassa
Name[fr]=Affichage dans la fenêtre spécifiée
Name[fy]=Werjefte yn in definiearre finster
Name[ga]=Taispeáin san Fhuinneog Sonraithe
Name[gl]=Mostrar na xanela indicada
Name[he]=הצג בחלון המצוין
Name[hne]=िि ि
Name[hr]=Prikaži u određenom prozoru
Name[hu]=Megjelenítés a megadott ablakban
Name[is]=Birta í völdum glugga
Name[it]=Mostra nella finestra specificata
Name[ja]=
Name[kk]=Келтірілген терезеде көрсетілсін
Name[ko]=
Name[lt]=Rodyti nurodytame lange
Name[lv]=Rādīt norādītajā logā
Name[mai]=िि ि ि
Name[mk]=Прикажи во наведениот прозорец
Name[ml]= ിി ി ിി
Name[mr]=ि
Name[ms]=Papar dalam Tetingkap Yang Dinyatakan
Name[nb]=Vis i angitt vindu
Name[nds]=In utsöcht Finster wiesen
Name[ne]=िि
Name[nl]=Weergeven In een opgegeven venster
Name[nn]=Vis i oppgjeve vindauge
Name[pa]= ਿ
Name[pl]=Wyświetl w zadanym oknie
Name[pt]=Mostrar na Janela Indicada
Name[pt_BR]=Exibir na janela indicada
Name[ro]=Afișează în fereastra specificată
Name[ru]=Показывать в указанном окне
Name[sk]=Zobraziť v zadanom okne
Name[sl]=Pokaži v določenem oknu
Name[sq]=Shfaq në Dritaren e Specifikuar
Name[sr]=Прикажи у задатом прозору
Name[sr@ijekavian]=Прикажи у задатом прозору
Name[sr@ijekavianlatin]=Prikaži u zadatom prozoru
Name[sr@latin]=Prikaži u zadatom prozoru
Name[sv]=Visa i angivet fönster
Name[ta]=ி ி
Name[tg]=Дар тирезаи нишондода намоиш намоед
Name[th]=
Name[tr]=Belirtilen Pencerede Göster
Name[ug]=بەلگىلەنگەن كۆزنەكتە كۆرسەت
Name[uk]=Відобразити у вказаному вікні
Name[vi]=Hin th trong Ca s Đã đnh
Name[x-test]=xxDisplay in Specified Windowxx
Name[zh_CN]=
Name[zh_TW]=
NoDisplay=true
[Desktop Action Root]
Exec=kpolygon.kss -root
Name=Display in Root Window
Name[ast]=Amosar na ventana raíz
Name[bg]=Показване в главния прозорец
Name[br]=Diskwel er prenestr gwrizienn
Name[bs]=Prikaži u korijenom prozoru
Name[ca]=Mostra a la finestra arrel
Name[ca@valencia]=Mostra a la finestra arrel
Name[cs]=Zobrazit na pozadí plochy
Name[cy]=Dangos mewn Ffenestr Wraidd
Name[da]=Visning i root-vindue
Name[de]=In Hintergrundfenster anzeigen
Name[el]=Προβολή στο βασικό παράθυρο
Name[en_GB]=Display in Root Window
Name[eo]=Montri en radika fenestro
Name[es]=Mostrar en la ventana raíz
Name[et]=Juuraknas näitamine
Name[eu]=Bistaratu erro lehioan
Name[fa]=نمایش در پنجره ریشه
Name[fi]=Näytä juuri-ikkunassa
Name[fr]=Affichage dans la fenêtre racine
Name[fy]=Werjefte yn haadfinster
Name[ga]=Taispeáin sa Phríomhfhuinneog
Name[gl]=Mostrar na xanela raíz
Name[he]=הצג בחלון השורש
Name[hne]= ि
Name[hr]=Prikaži u ishodišnom prozoru
Name[hu]=Megjelenítés a gyökérablakban
Name[is]=Birta í rótarglugganum
Name[it]=Mostra sullo sfondo
Name[ja]=
Name[kk]=Түбір терезесінде көрсетілсін
Name[ko]=
Name[lt]=Rodyti root lange
Name[lv]=Rādīt saknes logā
Name[mai]= ि ि
Name[mk]=Прикажи во коренскиот прозорец
Name[ml]= ി ിി
Name[mr]=
Name[ms]=Papar dalam Tetingkap Root
Name[nb]=Vis i root-vindu
Name[nds]=In Hööftfinster wiesen
Name[ne]=
Name[nl]=Weergeven in hoofdvenster
Name[nn]=Vis i rotvindauget
Name[pa]=Root ਿ
Name[pl]=Wyświetl w oknie głównym
Name[pt]=Mostrar na Janela de Fundo
Name[pt_BR]=Exibir na janela raiz
Name[ro]=Afișează în fereastra rădăcină
Name[ru]=Показывать в корневом окне
Name[sk]=Zobraziť v koreňovom okne
Name[sl]=Pokaži v določenem oknu
Name[sq]=Shfaq në Dritaren Bazë
Name[sr]=Прикажи у кореном прозору
Name[sr@ijekavian]=Прикажи у корјеном прозору
Name[sr@ijekavianlatin]=Prikaži u korjenom prozoru
Name[sr@latin]=Prikaži u korenom prozoru
Name[sv]=Visa i rotfönstret
Name[ta]= ி
Name[tg]=Дар тирезаи решагӣ намоиш намоед
Name[th]=
Name[tr]=Kök Pencerede Göster
Name[ug]=غول كۆزنەكتە كۆرسەت
Name[uk]=Відобразити в кореневому вікні
Name[vi]=Hin th trong Ca s Gc
Name[x-test]=xxDisplay in Root Windowxx
Name[zh_CN]=
Name[zh_TW]=
NoDisplay=true

View file

@ -0,0 +1,289 @@
[Desktop Entry]
Exec=krotation.kss
Icon=preferences-desktop-screensaver
Type=Service
X-KDE-ServiceTypes=ScreenSaver
Actions=Setup;InWindow;Root;
X-KDE-Category=OpenGL Screen Savers
X-KDE-Type=OpenGL
Name=KRotation (GL)
Name[ast]=KRotation (GL)
Name[bg]=Ротация
Name[br]=KRotation (GL)
Name[bs]=KRotation (GL)
Name[ca]=KRotation (GL)
Name[ca@valencia]=KRotation (GL)
Name[cs]=Rotace
Name[da]=KRotation (GL)
Name[de]=KRotation
Name[el]=KRotation (GL)
Name[en_GB]=KRotation (GL)
Name[eo]=Rotacio (GL)
Name[es]=Rotación K (GL)
Name[et]=KRotation (GL)
Name[eu]=KRotation (GL)
Name[fi]=KRotation (GL)
Name[fr]=Rotation (GL)
Name[fy]=KRotaasje (GL)
Name[ga]=KRotation (GL)
Name[gl]=KRotation (GL)
Name[he]= KRotation(GL)
Name[hne]=- ()
Name[hu]=KRotation (OpenGL)
Name[is]=Ksnúningur (GL)
Name[it]=Rotazione (GL)
Name[ja]= (GL)
Name[kk]=Айналым (GL)
Name[ko]=KRotation (GL)
Name[lt]=KRotation (GL)
Name[lv]=Griešanās (GL)
Name[mk]=КРотација (GL)
Name[ml]= (ി)
Name[ms]=KRotation (GL)
Name[nb]=KRotasjon (GL)
Name[nds]=KRotation (GL)
Name[ne]= ि (GL)
Name[nl]=KRotation (GL)
Name[nn]=KRotasjon (GL)
Name[pl]=KRotation (GL)
Name[pt]=KRotação (GL)
Name[pt_BR]=KRotation (GL)
Name[ro]=Rotire (GL)
Name[ru]=Вращение (GL)
Name[sk]=KRotation (GL)
Name[sl]=Vrtenje (GL)
Name[sq]=KRotation (GL)
Name[sr]=Кротација
Name[sr@ijekavian]=Кротација
Name[sr@ijekavianlatin]=Krotacija
Name[sr@latin]=Krotacija
Name[sv]=Rotation (GL)
Name[ta]=KRotation (GL)
Name[tg]=Тобхурӣ (GL)
Name[th]= K (GL)
Name[tr]=Döndürme (GL)
Name[uk]=Обертання (GL)
Name[vi]=Xoay (GL)
Name[x-test]=xxKRotation (GL)xx
Name[zh_CN]=K (GL)
Name[zh_TW]=KRotation (GL)
[Desktop Action Setup]
Exec=krotation.kss -setup
Name=Setup...
Name[af]=Opstelling...
Name[ast]=Configuración...
Name[bg]=Настройки...
Name[br]=Kefluniadur ...
Name[bs]=Podesi...
Name[ca]=Arranjament...
Name[ca@valencia]=Arranjament...
Name[cs]=Nastavení...
Name[cy]=Gosod ...
Name[da]=Opsætning...
Name[de]=Einrichtung ...
Name[el]=Ρύθμιση...
Name[en_GB]=Setup...
Name[eo]=Agordo...
Name[es]=Configuración...
Name[et]=Seadistamine...
Name[eu]=Konfiguratu...
Name[fa]=برپایی...
Name[fi]=Asetukset
Name[fr]=Configuration...
Name[fy]=Opset...
Name[ga]=Socrú...
Name[gl]=Configuración...
Name[he]=הגדרות...
Name[hne]=...
Name[hr]=Postavke 
Name[hu]=Beállítás...
Name[is]=Stillingar...
Name[it]=Impostazioni...
Name[ja]=...
Name[kk]=Баптау...
Name[ko]=...
Name[lt]=Sąranka ...
Name[lv]=Iestatījumi...
Name[mai]=...
Name[mk]=Поставување...
Name[ml]=...
Name[mr]= ...
Name[ms]=Setkan...
Name[nb]=Innstillinger 
Name[nds]=Instellen...
Name[ne]=...
Name[nl]=Instellingen...
Name[nn]=Oppsett 
Name[pa]=...
Name[pl]=Ustawienia...
Name[pt]=Configurar...
Name[pt_BR]=Configurar...
Name[ro]=Configurare...
Name[ru]=Настройка...
Name[sk]=Nastavenie...
Name[sl]=Nastavi ...
Name[sq]=Instalimi...
Name[sr]=Подеси...
Name[sr@ijekavian]=Подеси...
Name[sr@ijekavianlatin]=Podesi...
Name[sr@latin]=Podesi...
Name[sv]=Inställningar...
Name[ta]=...
Name[tg]=Барпосозӣ...
Name[th]=...
Name[tr]=Kurulum...
Name[ug]=ئورنات
Name[uk]=Встановити...
Name[uz]=Oʻrnatish
Name[uz@cyrillic]=Ўрнатиш
Name[vi]=Thiết lp...
Name[xh]=Iyacwangciswa...
Name[x-test]=xxSetup...xx
Name[zh_CN]=...
Name[zh_TW]=...
Icon=preferences-desktop-screensaver
[Desktop Action InWindow]
Exec=krotation.kss -window-id %w
Name=Display in Specified Window
Name[ast]=Amosar na ventana especificada
Name[bg]=Показване в избран прозорец
Name[br]=Diskwel er prenestr spisaet
Name[bs]=Prikaži u određenom prozoru
Name[ca]=Mostra a la finestra especificada
Name[ca@valencia]=Mostra a la finestra especificada
Name[cs]=Zobrazit v určeném okně
Name[cy]=Dangos mewn Ffenestr Benodol
Name[da]=Visning i angivet vindue
Name[de]=In bestimmten Fenster anzeigen
Name[el]=Προβολή στο καθορισμένο παράθυρο
Name[en_GB]=Display in Specified Window
Name[eo]=Montri en indikita fenestro
Name[es]=Mostrar en la ventana especificada
Name[et]=Määratud aknas näitamine
Name[eu]=Bistaratu zehaztutako lehioan
Name[fa]=نمایش در پنجره مشخصشده
Name[fi]=Näytä määrätyssä ikkunassa
Name[fr]=Affichage dans la fenêtre spécifiée
Name[fy]=Werjefte yn in definiearre finster
Name[ga]=Taispeáin san Fhuinneog Sonraithe
Name[gl]=Mostrar na xanela indicada
Name[he]=הצג בחלון המצוין
Name[hne]=िि ि
Name[hr]=Prikaži u određenom prozoru
Name[hu]=Megjelenítés a megadott ablakban
Name[is]=Birta í völdum glugga
Name[it]=Mostra nella finestra specificata
Name[ja]=
Name[kk]=Келтірілген терезеде көрсетілсін
Name[ko]=
Name[lt]=Rodyti nurodytame lange
Name[lv]=Rādīt norādītajā logā
Name[mai]=िि ि ि
Name[mk]=Прикажи во наведениот прозорец
Name[ml]= ിി ി ിി
Name[mr]=ि
Name[ms]=Papar dalam Tetingkap Yang Dinyatakan
Name[nb]=Vis i angitt vindu
Name[nds]=In utsöcht Finster wiesen
Name[ne]=िि
Name[nl]=Weergeven In een opgegeven venster
Name[nn]=Vis i oppgjeve vindauge
Name[pa]= ਿ
Name[pl]=Wyświetl w zadanym oknie
Name[pt]=Mostrar na Janela Indicada
Name[pt_BR]=Exibir na janela indicada
Name[ro]=Afișează în fereastra specificată
Name[ru]=Показывать в указанном окне
Name[sk]=Zobraziť v zadanom okne
Name[sl]=Pokaži v določenem oknu
Name[sq]=Shfaq në Dritaren e Specifikuar
Name[sr]=Прикажи у задатом прозору
Name[sr@ijekavian]=Прикажи у задатом прозору
Name[sr@ijekavianlatin]=Prikaži u zadatom prozoru
Name[sr@latin]=Prikaži u zadatom prozoru
Name[sv]=Visa i angivet fönster
Name[ta]=ி ி
Name[tg]=Дар тирезаи нишондода намоиш намоед
Name[th]=
Name[tr]=Belirtilen Pencerede Göster
Name[ug]=بەلگىلەنگەن كۆزنەكتە كۆرسەت
Name[uk]=Відобразити у вказаному вікні
Name[vi]=Hin th trong Ca s Đã đnh
Name[x-test]=xxDisplay in Specified Windowxx
Name[zh_CN]=
Name[zh_TW]=
NoDisplay=true
[Desktop Action Root]
Exec=krotation.kss -root
Name=Display in Root Window
Name[ast]=Amosar na ventana raíz
Name[bg]=Показване в главния прозорец
Name[br]=Diskwel er prenestr gwrizienn
Name[bs]=Prikaži u korijenom prozoru
Name[ca]=Mostra a la finestra arrel
Name[ca@valencia]=Mostra a la finestra arrel
Name[cs]=Zobrazit na pozadí plochy
Name[cy]=Dangos mewn Ffenestr Wraidd
Name[da]=Visning i root-vindue
Name[de]=In Hintergrundfenster anzeigen
Name[el]=Προβολή στο βασικό παράθυρο
Name[en_GB]=Display in Root Window
Name[eo]=Montri en radika fenestro
Name[es]=Mostrar en la ventana raíz
Name[et]=Juuraknas näitamine
Name[eu]=Bistaratu erro lehioan
Name[fa]=نمایش در پنجره ریشه
Name[fi]=Näytä juuri-ikkunassa
Name[fr]=Affichage dans la fenêtre racine
Name[fy]=Werjefte yn haadfinster
Name[ga]=Taispeáin sa Phríomhfhuinneog
Name[gl]=Mostrar na xanela raíz
Name[he]=הצג בחלון השורש
Name[hne]= ि
Name[hr]=Prikaži u ishodišnom prozoru
Name[hu]=Megjelenítés a gyökérablakban
Name[is]=Birta í rótarglugganum
Name[it]=Mostra sullo sfondo
Name[ja]=
Name[kk]=Түбір терезесінде көрсетілсін
Name[ko]=
Name[lt]=Rodyti root lange
Name[lv]=Rādīt saknes logā
Name[mai]= ि ि
Name[mk]=Прикажи во коренскиот прозорец
Name[ml]= ി ിി
Name[mr]=
Name[ms]=Papar dalam Tetingkap Root
Name[nb]=Vis i root-vindu
Name[nds]=In Hööftfinster wiesen
Name[ne]=
Name[nl]=Weergeven in hoofdvenster
Name[nn]=Vis i rotvindauget
Name[pa]=Root ਿ
Name[pl]=Wyświetl w oknie głównym
Name[pt]=Mostrar na Janela de Fundo
Name[pt_BR]=Exibir na janela raiz
Name[ro]=Afișează în fereastra rădăcină
Name[ru]=Показывать в корневом окне
Name[sk]=Zobraziť v koreňovom okne
Name[sl]=Pokaži v določenem oknu
Name[sq]=Shfaq në Dritaren Bazë
Name[sr]=Прикажи у кореном прозору
Name[sr@ijekavian]=Прикажи у корјеном прозору
Name[sr@ijekavianlatin]=Prikaži u korjenom prozoru
Name[sr@latin]=Prikaži u korenom prozoru
Name[sv]=Visa i rotfönstret
Name[ta]= ி
Name[tg]=Дар тирезаи решагӣ намоиш намоед
Name[th]=
Name[tr]=Kök Pencerede Göster
Name[ug]=غول كۆزنەكتە كۆرسەت
Name[uk]=Відобразити в кореневому вікні
Name[vi]=Hin th trong Ca s Gc
Name[x-test]=xxDisplay in Root Windowxx
Name[zh_CN]=
Name[zh_TW]=
NoDisplay=true

View file

@ -0,0 +1,300 @@
[Desktop Entry]
Exec=kscience.kss
Icon=preferences-desktop-screensaver
Type=Service
X-KDE-ServiceTypes=ScreenSaver
Actions=Setup;InWindow;Root;
X-KDE-Category=Desktop Distortions
X-KDE-Type=ManipulateScreen
Name=Science
Name[af]=Wetenskap
Name[ast]=Ciencia
Name[bg]=Наука
Name[br]=Skiantoù
Name[bs]=Nauka
Name[ca]=Ciència
Name[ca@valencia]=Ciència
Name[cs]=Věda
Name[cy]=Gwyddoniaeth
Name[da]=Videnskab
Name[de]=Wissenschaft
Name[el]=Science
Name[en_GB]=Science
Name[eo]=Scienco
Name[es]=Ciencia
Name[et]=Teadus
Name[eu]=Zientzia
Name[fa]=علم
Name[fi]=Linssi
Name[fr]=Science
Name[fy]=Wittenskiplik
Name[ga]=Eolaíocht
Name[gl]=Ciencia
Name[he]=מדע
Name[hne]=ि
Name[hu]=Tudomány
Name[is]=Vísindi
Name[it]=Scienza
Name[ja]=
Name[kk]=Ғылым
Name[ko]=
Name[lt]=Mokslas
Name[lv]=Zinātne
Name[mai]=ि
Name[mk]=Наука
Name[ml]=
Name[mr]=ि
Name[ms]=Sains
Name[nb]=Vitenskap
Name[nds]=Wetenschap
Name[ne]=ि
Name[nl]=Wetenschappelijk
Name[nn]=Vitskap
Name[oc]=Sciéncia
Name[pa]=ਿਿ
Name[pl]=Nauka
Name[pt]=Ciência
Name[pt_BR]=Ciências
Name[ro]=Știință
Name[ru]=Наука
Name[sk]=Vedecký
Name[sl]=Znanost
Name[sq]=Shkencë
Name[sr]=Наука
Name[sr@ijekavian]=Наука
Name[sr@ijekavianlatin]=Nauka
Name[sr@latin]=Nauka
Name[sv]=Vetenskap
Name[ta]=ிி
Name[tg]=Илм
Name[th]=
Name[tr]=Bilim
Name[ug]=ئىلىم
Name[uk]=Наука
Name[uz]=Fan
Name[uz@cyrillic]=Фан
Name[vi]=Khoa hc
Name[xh]=Inzulu lwazi
Name[x-test]=xxSciencexx
Name[zh_CN]=
Name[zh_TW]=
[Desktop Action Setup]
Exec=kscience.kss -setup
Name=Setup...
Name[af]=Opstelling...
Name[ast]=Configuración...
Name[bg]=Настройки...
Name[br]=Kefluniadur ...
Name[bs]=Podesi...
Name[ca]=Arranjament...
Name[ca@valencia]=Arranjament...
Name[cs]=Nastavení...
Name[cy]=Gosod ...
Name[da]=Opsætning...
Name[de]=Einrichtung ...
Name[el]=Ρύθμιση...
Name[en_GB]=Setup...
Name[eo]=Agordo...
Name[es]=Configuración...
Name[et]=Seadistamine...
Name[eu]=Konfiguratu...
Name[fa]=برپایی...
Name[fi]=Asetukset
Name[fr]=Configuration...
Name[fy]=Opset...
Name[ga]=Socrú...
Name[gl]=Configuración...
Name[he]=הגדרות...
Name[hne]=...
Name[hr]=Postavke 
Name[hu]=Beállítás...
Name[is]=Stillingar...
Name[it]=Impostazioni...
Name[ja]=...
Name[kk]=Баптау...
Name[ko]=...
Name[lt]=Sąranka ...
Name[lv]=Iestatījumi...
Name[mai]=...
Name[mk]=Поставување...
Name[ml]=...
Name[mr]= ...
Name[ms]=Setkan...
Name[nb]=Innstillinger 
Name[nds]=Instellen...
Name[ne]=...
Name[nl]=Instellingen...
Name[nn]=Oppsett 
Name[pa]=...
Name[pl]=Ustawienia...
Name[pt]=Configurar...
Name[pt_BR]=Configurar...
Name[ro]=Configurare...
Name[ru]=Настройка...
Name[sk]=Nastavenie...
Name[sl]=Nastavi ...
Name[sq]=Instalimi...
Name[sr]=Подеси...
Name[sr@ijekavian]=Подеси...
Name[sr@ijekavianlatin]=Podesi...
Name[sr@latin]=Podesi...
Name[sv]=Inställningar...
Name[ta]=...
Name[tg]=Барпосозӣ...
Name[th]=...
Name[tr]=Kurulum...
Name[ug]=ئورنات
Name[uk]=Встановити...
Name[uz]=Oʻrnatish
Name[uz@cyrillic]=Ўрнатиш
Name[vi]=Thiết lp...
Name[xh]=Iyacwangciswa...
Name[x-test]=xxSetup...xx
Name[zh_CN]=...
Name[zh_TW]=...
Icon=preferences-desktop-screensaver
[Desktop Action InWindow]
Exec=kscience.kss -window-id %w
Name=Display in Specified Window
Name[ast]=Amosar na ventana especificada
Name[bg]=Показване в избран прозорец
Name[br]=Diskwel er prenestr spisaet
Name[bs]=Prikaži u određenom prozoru
Name[ca]=Mostra a la finestra especificada
Name[ca@valencia]=Mostra a la finestra especificada
Name[cs]=Zobrazit v určeném okně
Name[cy]=Dangos mewn Ffenestr Benodol
Name[da]=Visning i angivet vindue
Name[de]=In bestimmten Fenster anzeigen
Name[el]=Προβολή στο καθορισμένο παράθυρο
Name[en_GB]=Display in Specified Window
Name[eo]=Montri en indikita fenestro
Name[es]=Mostrar en la ventana especificada
Name[et]=Määratud aknas näitamine
Name[eu]=Bistaratu zehaztutako lehioan
Name[fa]=نمایش در پنجره مشخصشده
Name[fi]=Näytä määrätyssä ikkunassa
Name[fr]=Affichage dans la fenêtre spécifiée
Name[fy]=Werjefte yn in definiearre finster
Name[ga]=Taispeáin san Fhuinneog Sonraithe
Name[gl]=Mostrar na xanela indicada
Name[he]=הצג בחלון המצוין
Name[hne]=िि ि
Name[hr]=Prikaži u određenom prozoru
Name[hu]=Megjelenítés a megadott ablakban
Name[is]=Birta í völdum glugga
Name[it]=Mostra nella finestra specificata
Name[ja]=
Name[kk]=Келтірілген терезеде көрсетілсін
Name[ko]=
Name[lt]=Rodyti nurodytame lange
Name[lv]=Rādīt norādītajā logā
Name[mai]=िि ि ि
Name[mk]=Прикажи во наведениот прозорец
Name[ml]= ിി ി ിി
Name[mr]=ि
Name[ms]=Papar dalam Tetingkap Yang Dinyatakan
Name[nb]=Vis i angitt vindu
Name[nds]=In utsöcht Finster wiesen
Name[ne]=िि
Name[nl]=Weergeven In een opgegeven venster
Name[nn]=Vis i oppgjeve vindauge
Name[pa]= ਿ
Name[pl]=Wyświetl w zadanym oknie
Name[pt]=Mostrar na Janela Indicada
Name[pt_BR]=Exibir na janela indicada
Name[ro]=Afișează în fereastra specificată
Name[ru]=Показывать в указанном окне
Name[sk]=Zobraziť v zadanom okne
Name[sl]=Pokaži v določenem oknu
Name[sq]=Shfaq në Dritaren e Specifikuar
Name[sr]=Прикажи у задатом прозору
Name[sr@ijekavian]=Прикажи у задатом прозору
Name[sr@ijekavianlatin]=Prikaži u zadatom prozoru
Name[sr@latin]=Prikaži u zadatom prozoru
Name[sv]=Visa i angivet fönster
Name[ta]=ி ி
Name[tg]=Дар тирезаи нишондода намоиш намоед
Name[th]=
Name[tr]=Belirtilen Pencerede Göster
Name[ug]=بەلگىلەنگەن كۆزنەكتە كۆرسەت
Name[uk]=Відобразити у вказаному вікні
Name[vi]=Hin th trong Ca s Đã đnh
Name[x-test]=xxDisplay in Specified Windowxx
Name[zh_CN]=
Name[zh_TW]=
NoDisplay=true
[Desktop Action Root]
Exec=kscience.kss -root
Name=Display in Root Window
Name[ast]=Amosar na ventana raíz
Name[bg]=Показване в главния прозорец
Name[br]=Diskwel er prenestr gwrizienn
Name[bs]=Prikaži u korijenom prozoru
Name[ca]=Mostra a la finestra arrel
Name[ca@valencia]=Mostra a la finestra arrel
Name[cs]=Zobrazit na pozadí plochy
Name[cy]=Dangos mewn Ffenestr Wraidd
Name[da]=Visning i root-vindue
Name[de]=In Hintergrundfenster anzeigen
Name[el]=Προβολή στο βασικό παράθυρο
Name[en_GB]=Display in Root Window
Name[eo]=Montri en radika fenestro
Name[es]=Mostrar en la ventana raíz
Name[et]=Juuraknas näitamine
Name[eu]=Bistaratu erro lehioan
Name[fa]=نمایش در پنجره ریشه
Name[fi]=Näytä juuri-ikkunassa
Name[fr]=Affichage dans la fenêtre racine
Name[fy]=Werjefte yn haadfinster
Name[ga]=Taispeáin sa Phríomhfhuinneog
Name[gl]=Mostrar na xanela raíz
Name[he]=הצג בחלון השורש
Name[hne]= ि
Name[hr]=Prikaži u ishodišnom prozoru
Name[hu]=Megjelenítés a gyökérablakban
Name[is]=Birta í rótarglugganum
Name[it]=Mostra sullo sfondo
Name[ja]=
Name[kk]=Түбір терезесінде көрсетілсін
Name[ko]=
Name[lt]=Rodyti root lange
Name[lv]=Rādīt saknes logā
Name[mai]= ि ि
Name[mk]=Прикажи во коренскиот прозорец
Name[ml]= ി ിി
Name[mr]=
Name[ms]=Papar dalam Tetingkap Root
Name[nb]=Vis i root-vindu
Name[nds]=In Hööftfinster wiesen
Name[ne]=
Name[nl]=Weergeven in hoofdvenster
Name[nn]=Vis i rotvindauget
Name[pa]=Root ਿ
Name[pl]=Wyświetl w oknie głównym
Name[pt]=Mostrar na Janela de Fundo
Name[pt_BR]=Exibir na janela raiz
Name[ro]=Afișează în fereastra rădăcină
Name[ru]=Показывать в корневом окне
Name[sk]=Zobraziť v koreňovom okne
Name[sl]=Pokaži v določenem oknu
Name[sq]=Shfaq në Dritaren Bazë
Name[sr]=Прикажи у кореном прозору
Name[sr@ijekavian]=Прикажи у корјеном прозору
Name[sr@ijekavianlatin]=Prikaži u korjenom prozoru
Name[sr@latin]=Prikaži u korenom prozoru
Name[sv]=Visa i rotfönstret
Name[ta]= ி
Name[tg]=Дар тирезаи решагӣ намоиш намоед
Name[th]=
Name[tr]=Kök Pencerede Göster
Name[ug]=غول كۆزنەكتە كۆرسەت
Name[uk]=Відобразити в кореневому вікні
Name[vi]=Hin th trong Ca s Gc
Name[x-test]=xxDisplay in Root Windowxx
Name[zh_CN]=
Name[zh_TW]=
NoDisplay=true

View file

@ -0,0 +1,300 @@
[Desktop Entry]
Exec=kslideshow.kss
Icon=preferences-desktop-screensaver
Type=Service
X-KDE-ServiceTypes=ScreenSaver
Actions=Setup;InWindow;Root;
X-KDE-Category=Banners & Pictures
Name=Slide Show
Name[af]=Skuif Vertoon
Name[ast]=Presentación
Name[bg]=Прожекция
Name[br]=Diskouezadur skeudennoù
Name[bs]=Slajd-šou
Name[ca]=Passi de diapositives
Name[ca@valencia]=Passe de diapositives
Name[cs]=Promítání
Name[cy]=Sioe Tryloywder
Name[da]=Diasshow
Name[de]=Dia-Schau
Name[el]=Προβολή διαφανειών
Name[en_GB]=Slide Show
Name[eo]=Lumbildoj
Name[es]=Presentación
Name[et]=Slaidishow
Name[eu]=Diapositiba erakusketa
Name[fa]=نمایش اسلاید
Name[fi]=Diaesitys
Name[fr]=Diaporama
Name[fy]=Diafoarstelling
Name[ga]=Taispeántas Sleamhnán
Name[gl]=Presentación
Name[he]=מצגת שקופיות
Name[hne]=
Name[hu]=Diavetítés
Name[is]=Skyggnusýning
Name[it]=Sequenza di immagini
Name[ja]=
Name[kk]=Слайд-шоу
Name[ko]=
Name[lt]=Skaidrių šou
Name[lv]=Slīdrāde
Name[mai]=
Name[mk]=Слајд-шоу
Name[ml]=
Name[mr]=
Name[ms]=Tayangan Slaid
Name[nb]=Lysbildeshow
Name[nds]=Diaschau
Name[ne]=
Name[nl]=Diavoorstelling
Name[nn]=Framvising
Name[oc]=Diaporama
Name[pa]=
Name[pl]=Sekwencja slajdów
Name[pt]=Apresentação
Name[pt_BR]=Apresentação de slides
Name[ro]=Succesiune de imagini
Name[ru]=Слайд-шоу
Name[sk]=Slide Show
Name[sl]=Predstavitev
Name[sq]=Diapozitiv
Name[sr]=Кслајдшоу
Name[sr@ijekavian]=Кслајдшоу
Name[sr@ijekavianlatin]=Kslajdšou
Name[sr@latin]=Kslajdšou
Name[sv]=Bildspel
Name[ta]= ி
Name[tg]=Намоиши слайд
Name[th]=
Name[tr]=Slayt Gösterisi
Name[ug]=تام تەسۋىر كۆرسەت
Name[uk]=Слайди
Name[uz]=Slayd shou
Name[uz@cyrillic]=Слайд шоу
Name[vi]=Trình bày
Name[xh]=Isiboniso esihamba thambileyo
Name[x-test]=xxSlide Showxx
Name[zh_CN]=
Name[zh_TW]=
[Desktop Action Setup]
Exec=kslideshow.kss -setup
Name=Setup...
Name[af]=Opstelling...
Name[ast]=Configuración...
Name[bg]=Настройки...
Name[br]=Kefluniadur ...
Name[bs]=Podesi...
Name[ca]=Arranjament...
Name[ca@valencia]=Arranjament...
Name[cs]=Nastavení...
Name[cy]=Gosod ...
Name[da]=Opsætning...
Name[de]=Einrichtung ...
Name[el]=Ρύθμιση...
Name[en_GB]=Setup...
Name[eo]=Agordo...
Name[es]=Configuración...
Name[et]=Seadistamine...
Name[eu]=Konfiguratu...
Name[fa]=برپایی...
Name[fi]=Asetukset
Name[fr]=Configuration...
Name[fy]=Opset...
Name[ga]=Socrú...
Name[gl]=Configuración...
Name[he]=הגדרות...
Name[hne]=...
Name[hr]=Postavke 
Name[hu]=Beállítás...
Name[is]=Stillingar...
Name[it]=Impostazioni...
Name[ja]=...
Name[kk]=Баптау...
Name[ko]=...
Name[lt]=Sąranka ...
Name[lv]=Iestatījumi...
Name[mai]=...
Name[mk]=Поставување...
Name[ml]=...
Name[mr]= ...
Name[ms]=Setkan...
Name[nb]=Innstillinger 
Name[nds]=Instellen...
Name[ne]=...
Name[nl]=Instellingen...
Name[nn]=Oppsett 
Name[pa]=...
Name[pl]=Ustawienia...
Name[pt]=Configurar...
Name[pt_BR]=Configurar...
Name[ro]=Configurare...
Name[ru]=Настройка...
Name[sk]=Nastavenie...
Name[sl]=Nastavi ...
Name[sq]=Instalimi...
Name[sr]=Подеси...
Name[sr@ijekavian]=Подеси...
Name[sr@ijekavianlatin]=Podesi...
Name[sr@latin]=Podesi...
Name[sv]=Inställningar...
Name[ta]=...
Name[tg]=Барпосозӣ...
Name[th]=...
Name[tr]=Kurulum...
Name[ug]=ئورنات
Name[uk]=Встановити...
Name[uz]=Oʻrnatish
Name[uz@cyrillic]=Ўрнатиш
Name[vi]=Thiết lp...
Name[xh]=Iyacwangciswa...
Name[x-test]=xxSetup...xx
Name[zh_CN]=...
Name[zh_TW]=...
Icon=preferences-desktop-screensaver
[Desktop Action InWindow]
Exec=kslideshow.kss -window-id %w
Name=Display in Specified Window
Name[ast]=Amosar na ventana especificada
Name[bg]=Показване в избран прозорец
Name[br]=Diskwel er prenestr spisaet
Name[bs]=Prikaži u određenom prozoru
Name[ca]=Mostra a la finestra especificada
Name[ca@valencia]=Mostra a la finestra especificada
Name[cs]=Zobrazit v určeném okně
Name[cy]=Dangos mewn Ffenestr Benodol
Name[da]=Visning i angivet vindue
Name[de]=In bestimmten Fenster anzeigen
Name[el]=Προβολή στο καθορισμένο παράθυρο
Name[en_GB]=Display in Specified Window
Name[eo]=Montri en indikita fenestro
Name[es]=Mostrar en la ventana especificada
Name[et]=Määratud aknas näitamine
Name[eu]=Bistaratu zehaztutako lehioan
Name[fa]=نمایش در پنجره مشخصشده
Name[fi]=Näytä määrätyssä ikkunassa
Name[fr]=Affichage dans la fenêtre spécifiée
Name[fy]=Werjefte yn in definiearre finster
Name[ga]=Taispeáin san Fhuinneog Sonraithe
Name[gl]=Mostrar na xanela indicada
Name[he]=הצג בחלון המצוין
Name[hne]=िि ि
Name[hr]=Prikaži u određenom prozoru
Name[hu]=Megjelenítés a megadott ablakban
Name[is]=Birta í völdum glugga
Name[it]=Mostra nella finestra specificata
Name[ja]=
Name[kk]=Келтірілген терезеде көрсетілсін
Name[ko]=
Name[lt]=Rodyti nurodytame lange
Name[lv]=Rādīt norādītajā logā
Name[mai]=िि ि ि
Name[mk]=Прикажи во наведениот прозорец
Name[ml]= ിി ി ിി
Name[mr]=ि
Name[ms]=Papar dalam Tetingkap Yang Dinyatakan
Name[nb]=Vis i angitt vindu
Name[nds]=In utsöcht Finster wiesen
Name[ne]=िि
Name[nl]=Weergeven In een opgegeven venster
Name[nn]=Vis i oppgjeve vindauge
Name[pa]= ਿ
Name[pl]=Wyświetl w zadanym oknie
Name[pt]=Mostrar na Janela Indicada
Name[pt_BR]=Exibir na janela indicada
Name[ro]=Afișează în fereastra specificată
Name[ru]=Показывать в указанном окне
Name[sk]=Zobraziť v zadanom okne
Name[sl]=Pokaži v določenem oknu
Name[sq]=Shfaq në Dritaren e Specifikuar
Name[sr]=Прикажи у задатом прозору
Name[sr@ijekavian]=Прикажи у задатом прозору
Name[sr@ijekavianlatin]=Prikaži u zadatom prozoru
Name[sr@latin]=Prikaži u zadatom prozoru
Name[sv]=Visa i angivet fönster
Name[ta]=ி ி
Name[tg]=Дар тирезаи нишондода намоиш намоед
Name[th]=
Name[tr]=Belirtilen Pencerede Göster
Name[ug]=بەلگىلەنگەن كۆزنەكتە كۆرسەت
Name[uk]=Відобразити у вказаному вікні
Name[vi]=Hin th trong Ca s Đã đnh
Name[x-test]=xxDisplay in Specified Windowxx
Name[zh_CN]=
Name[zh_TW]=
NoDisplay=true
[Desktop Action Root]
Exec=kslideshow.kss -root
Name=Display in Root Window
Name[ast]=Amosar na ventana raíz
Name[bg]=Показване в главния прозорец
Name[br]=Diskwel er prenestr gwrizienn
Name[bs]=Prikaži u korijenom prozoru
Name[ca]=Mostra a la finestra arrel
Name[ca@valencia]=Mostra a la finestra arrel
Name[cs]=Zobrazit na pozadí plochy
Name[cy]=Dangos mewn Ffenestr Wraidd
Name[da]=Visning i root-vindue
Name[de]=In Hintergrundfenster anzeigen
Name[el]=Προβολή στο βασικό παράθυρο
Name[en_GB]=Display in Root Window
Name[eo]=Montri en radika fenestro
Name[es]=Mostrar en la ventana raíz
Name[et]=Juuraknas näitamine
Name[eu]=Bistaratu erro lehioan
Name[fa]=نمایش در پنجره ریشه
Name[fi]=Näytä juuri-ikkunassa
Name[fr]=Affichage dans la fenêtre racine
Name[fy]=Werjefte yn haadfinster
Name[ga]=Taispeáin sa Phríomhfhuinneog
Name[gl]=Mostrar na xanela raíz
Name[he]=הצג בחלון השורש
Name[hne]= ि
Name[hr]=Prikaži u ishodišnom prozoru
Name[hu]=Megjelenítés a gyökérablakban
Name[is]=Birta í rótarglugganum
Name[it]=Mostra sullo sfondo
Name[ja]=
Name[kk]=Түбір терезесінде көрсетілсін
Name[ko]=
Name[lt]=Rodyti root lange
Name[lv]=Rādīt saknes logā
Name[mai]= ि ि
Name[mk]=Прикажи во коренскиот прозорец
Name[ml]= ി ിി
Name[mr]=
Name[ms]=Papar dalam Tetingkap Root
Name[nb]=Vis i root-vindu
Name[nds]=In Hööftfinster wiesen
Name[ne]=
Name[nl]=Weergeven in hoofdvenster
Name[nn]=Vis i rotvindauget
Name[pa]=Root ਿ
Name[pl]=Wyświetl w oknie głównym
Name[pt]=Mostrar na Janela de Fundo
Name[pt_BR]=Exibir na janela raiz
Name[ro]=Afișează în fereastra rădăcină
Name[ru]=Показывать в корневом окне
Name[sk]=Zobraziť v koreňovom okne
Name[sl]=Pokaži v določenem oknu
Name[sq]=Shfaq në Dritaren Bazë
Name[sr]=Прикажи у кореном прозору
Name[sr@ijekavian]=Прикажи у корјеном прозору
Name[sr@ijekavianlatin]=Prikaži u korjenom prozoru
Name[sr@latin]=Prikaži u korenom prozoru
Name[sv]=Visa i rotfönstret
Name[ta]= ி
Name[tg]=Дар тирезаи решагӣ намоиш намоед
Name[th]=
Name[tr]=Kök Pencerede Göster
Name[ug]=غول كۆزنەكتە كۆرسەت
Name[uk]=Відобразити в кореневому вікні
Name[vi]=Hin th trong Ca s Gc
Name[x-test]=xxDisplay in Root Windowxx
Name[zh_CN]=
Name[zh_TW]=
NoDisplay=true

View file

@ -0,0 +1,294 @@
[Desktop Entry]
Exec=ksolarwinds.kss
Icon=preferences-desktop-screensaver
Type=Service
X-KDE-ServiceTypes=ScreenSaver
Actions=Setup;InWindow;Root;
X-KDE-Category=OpenGL Screen Savers
X-KDE-Type=OpenGL
Name=Solar Winds (GL)
Name[ast]=Vientu solar (GL)
Name[bg]=Слънчев вятър
Name[br]=Avelioù an Heol (GL)
Name[bs]=Solarni vjetrovi (GL)
Name[ca]=Vent solar (GL)
Name[ca@valencia]=Vent solar (GL)
Name[cs]=Solar Winds (GL)
Name[cy]=Gwyntoedd o'r Haul (GL)
Name[da]=Solvinde (GL)
Name[de]=Sonnenwind
Name[el]=Solar Winds (GL)
Name[en_GB]=Solar Winds (GL)
Name[eo]=Sunaj ventoj (GL)
Name[es]=Viento solar (GL)
Name[et]=Päikesetuul (GL)
Name[eu]=Eguzki-haizeak (GL)
Name[fa]=پیچشهای خورشیدی (GL)
Name[fi]=Aurinkotuuli (GL)
Name[fr]=Vents solaires (GL)
Name[fy]=Sinnewyn (GL)
Name[ga]=Solar Winds (GL)
Name[gl]=Vento solar (GL)
Name[he]=רוחות סולאריות (GL)
Name[hne]= ()
Name[hu]=Napszél (OpenGL)
Name[is]=Sólvindar (GL)
Name[it]=Venti solari (GL)
Name[ja]= (GL)
Name[kk]=Күн желі (GL)
Name[ko]= (GL)
Name[lt]=Solar Winds (GL)
Name[lv]=Saules vēji (GL)
Name[mk]=Соларни ветрови (GL)
Name[ml]= (ി)
Name[ms]=Solar Winds (GL)
Name[nb]=Solvind (GL)
Name[nds]=Sünnwind
Name[ne]= (GL)
Name[nl]=Zonnewind (GL)
Name[nn]=Solvind (GL)
Name[pl]=Wiatry słoneczne (GL)
Name[pt]=Ventos Solares (GL)
Name[pt_BR]=Ventos Solares (GL)
Name[ro]=Vînturi solare (GL)
Name[ru]=Солнечный ветер (GL)
Name[sk]=Solar Winds (GL)
Name[sl]=Sončevi vetrovi (GL)
Name[sq]=Solar Winds (GL)
Name[sr]=Соларни ветрови
Name[sr@ijekavian]=Соларни вјетрови
Name[sr@ijekavianlatin]=Solarni vjetrovi
Name[sr@latin]=Solarni vetrovi
Name[sv]=Solvindar (GL)
Name[ta]=ி (GL)
Name[tg]=Шамоли офтобӣ (GL)
Name[th]= (GL)
Name[tr]=Güneş Rüzgarı (GL)
Name[uk]=Сонячні вітри (GL)
Name[uz]=Quyosh shamollari (GL)
Name[uz@cyrillic]=Қуёш шамоллари (GL)
Name[vi]=Gió Mt Tri (GL)
Name[xh]=Solar Winds (GL)
Name[x-test]=xxSolar Winds (GL)xx
Name[zh_CN]=(GL)
Name[zh_TW]=Solar Winds (GL)
[Desktop Action Setup]
Exec=ksolarwinds.kss -setup
Name=Setup...
Name[af]=Opstelling...
Name[ast]=Configuración...
Name[bg]=Настройки...
Name[br]=Kefluniadur ...
Name[bs]=Podesi...
Name[ca]=Arranjament...
Name[ca@valencia]=Arranjament...
Name[cs]=Nastavení...
Name[cy]=Gosod ...
Name[da]=Opsætning...
Name[de]=Einrichtung ...
Name[el]=Ρύθμιση...
Name[en_GB]=Setup...
Name[eo]=Agordo...
Name[es]=Configuración...
Name[et]=Seadistamine...
Name[eu]=Konfiguratu...
Name[fa]=برپایی...
Name[fi]=Asetukset
Name[fr]=Configuration...
Name[fy]=Opset...
Name[ga]=Socrú...
Name[gl]=Configuración...
Name[he]=הגדרות...
Name[hne]=...
Name[hr]=Postavke 
Name[hu]=Beállítás...
Name[is]=Stillingar...
Name[it]=Impostazioni...
Name[ja]=...
Name[kk]=Баптау...
Name[ko]=...
Name[lt]=Sąranka ...
Name[lv]=Iestatījumi...
Name[mai]=...
Name[mk]=Поставување...
Name[ml]=...
Name[mr]= ...
Name[ms]=Setkan...
Name[nb]=Innstillinger 
Name[nds]=Instellen...
Name[ne]=...
Name[nl]=Instellingen...
Name[nn]=Oppsett 
Name[pa]=...
Name[pl]=Ustawienia...
Name[pt]=Configurar...
Name[pt_BR]=Configurar...
Name[ro]=Configurare...
Name[ru]=Настройка...
Name[sk]=Nastavenie...
Name[sl]=Nastavi ...
Name[sq]=Instalimi...
Name[sr]=Подеси...
Name[sr@ijekavian]=Подеси...
Name[sr@ijekavianlatin]=Podesi...
Name[sr@latin]=Podesi...
Name[sv]=Inställningar...
Name[ta]=...
Name[tg]=Барпосозӣ...
Name[th]=...
Name[tr]=Kurulum...
Name[ug]=ئورنات
Name[uk]=Встановити...
Name[uz]=Oʻrnatish
Name[uz@cyrillic]=Ўрнатиш
Name[vi]=Thiết lp...
Name[xh]=Iyacwangciswa...
Name[x-test]=xxSetup...xx
Name[zh_CN]=...
Name[zh_TW]=...
Icon=preferences-desktop-screensaver
[Desktop Action InWindow]
Exec=ksolarwinds.kss -window-id %w
Name=Display in Specified Window
Name[ast]=Amosar na ventana especificada
Name[bg]=Показване в избран прозорец
Name[br]=Diskwel er prenestr spisaet
Name[bs]=Prikaži u određenom prozoru
Name[ca]=Mostra a la finestra especificada
Name[ca@valencia]=Mostra a la finestra especificada
Name[cs]=Zobrazit v určeném okně
Name[cy]=Dangos mewn Ffenestr Benodol
Name[da]=Visning i angivet vindue
Name[de]=In bestimmten Fenster anzeigen
Name[el]=Προβολή στο καθορισμένο παράθυρο
Name[en_GB]=Display in Specified Window
Name[eo]=Montri en indikita fenestro
Name[es]=Mostrar en la ventana especificada
Name[et]=Määratud aknas näitamine
Name[eu]=Bistaratu zehaztutako lehioan
Name[fa]=نمایش در پنجره مشخصشده
Name[fi]=Näytä määrätyssä ikkunassa
Name[fr]=Affichage dans la fenêtre spécifiée
Name[fy]=Werjefte yn in definiearre finster
Name[ga]=Taispeáin san Fhuinneog Sonraithe
Name[gl]=Mostrar na xanela indicada
Name[he]=הצג בחלון המצוין
Name[hne]=िि ि
Name[hr]=Prikaži u određenom prozoru
Name[hu]=Megjelenítés a megadott ablakban
Name[is]=Birta í völdum glugga
Name[it]=Mostra nella finestra specificata
Name[ja]=
Name[kk]=Келтірілген терезеде көрсетілсін
Name[ko]=
Name[lt]=Rodyti nurodytame lange
Name[lv]=Rādīt norādītajā logā
Name[mai]=िि ि ि
Name[mk]=Прикажи во наведениот прозорец
Name[ml]= ിി ി ിി
Name[mr]=ि
Name[ms]=Papar dalam Tetingkap Yang Dinyatakan
Name[nb]=Vis i angitt vindu
Name[nds]=In utsöcht Finster wiesen
Name[ne]=िि
Name[nl]=Weergeven In een opgegeven venster
Name[nn]=Vis i oppgjeve vindauge
Name[pa]= ਿ
Name[pl]=Wyświetl w zadanym oknie
Name[pt]=Mostrar na Janela Indicada
Name[pt_BR]=Exibir na janela indicada
Name[ro]=Afișează în fereastra specificată
Name[ru]=Показывать в указанном окне
Name[sk]=Zobraziť v zadanom okne
Name[sl]=Pokaži v določenem oknu
Name[sq]=Shfaq në Dritaren e Specifikuar
Name[sr]=Прикажи у задатом прозору
Name[sr@ijekavian]=Прикажи у задатом прозору
Name[sr@ijekavianlatin]=Prikaži u zadatom prozoru
Name[sr@latin]=Prikaži u zadatom prozoru
Name[sv]=Visa i angivet fönster
Name[ta]=ி ி
Name[tg]=Дар тирезаи нишондода намоиш намоед
Name[th]=
Name[tr]=Belirtilen Pencerede Göster
Name[ug]=بەلگىلەنگەن كۆزنەكتە كۆرسەت
Name[uk]=Відобразити у вказаному вікні
Name[vi]=Hin th trong Ca s Đã đnh
Name[x-test]=xxDisplay in Specified Windowxx
Name[zh_CN]=
Name[zh_TW]=
NoDisplay=true
[Desktop Action Root]
Exec=ksolarwinds.kss -root
Name=Display in Root Window
Name[ast]=Amosar na ventana raíz
Name[bg]=Показване в главния прозорец
Name[br]=Diskwel er prenestr gwrizienn
Name[bs]=Prikaži u korijenom prozoru
Name[ca]=Mostra a la finestra arrel
Name[ca@valencia]=Mostra a la finestra arrel
Name[cs]=Zobrazit na pozadí plochy
Name[cy]=Dangos mewn Ffenestr Wraidd
Name[da]=Visning i root-vindue
Name[de]=In Hintergrundfenster anzeigen
Name[el]=Προβολή στο βασικό παράθυρο
Name[en_GB]=Display in Root Window
Name[eo]=Montri en radika fenestro
Name[es]=Mostrar en la ventana raíz
Name[et]=Juuraknas näitamine
Name[eu]=Bistaratu erro lehioan
Name[fa]=نمایش در پنجره ریشه
Name[fi]=Näytä juuri-ikkunassa
Name[fr]=Affichage dans la fenêtre racine
Name[fy]=Werjefte yn haadfinster
Name[ga]=Taispeáin sa Phríomhfhuinneog
Name[gl]=Mostrar na xanela raíz
Name[he]=הצג בחלון השורש
Name[hne]= ि
Name[hr]=Prikaži u ishodišnom prozoru
Name[hu]=Megjelenítés a gyökérablakban
Name[is]=Birta í rótarglugganum
Name[it]=Mostra sullo sfondo
Name[ja]=
Name[kk]=Түбір терезесінде көрсетілсін
Name[ko]=
Name[lt]=Rodyti root lange
Name[lv]=Rādīt saknes logā
Name[mai]= ि ि
Name[mk]=Прикажи во коренскиот прозорец
Name[ml]= ി ിി
Name[mr]=
Name[ms]=Papar dalam Tetingkap Root
Name[nb]=Vis i root-vindu
Name[nds]=In Hööftfinster wiesen
Name[ne]=
Name[nl]=Weergeven in hoofdvenster
Name[nn]=Vis i rotvindauget
Name[pa]=Root ਿ
Name[pl]=Wyświetl w oknie głównym
Name[pt]=Mostrar na Janela de Fundo
Name[pt_BR]=Exibir na janela raiz
Name[ro]=Afișează în fereastra rădăcină
Name[ru]=Показывать в корневом окне
Name[sk]=Zobraziť v koreňovom okne
Name[sl]=Pokaži v določenem oknu
Name[sq]=Shfaq në Dritaren Bazë
Name[sr]=Прикажи у кореном прозору
Name[sr@ijekavian]=Прикажи у корјеном прозору
Name[sr@ijekavianlatin]=Prikaži u korjenom prozoru
Name[sr@latin]=Prikaži u korenom prozoru
Name[sv]=Visa i rotfönstret
Name[ta]= ி
Name[tg]=Дар тирезаи решагӣ намоиш намоед
Name[th]=
Name[tr]=Kök Pencerede Göster
Name[ug]=غول كۆزنەكتە كۆرسەت
Name[uk]=Відобразити в кореневому вікні
Name[vi]=Hin th trong Ca s Gc
Name[x-test]=xxDisplay in Root Windowxx
Name[zh_CN]=
Name[zh_TW]=
NoDisplay=true

View file

@ -0,0 +1,296 @@
[Desktop Entry]
Exec=kvm.kss
Icon=preferences-desktop-screensaver
Type=Service
X-KDE-ServiceTypes=ScreenSaver
Actions=Setup;InWindow;Root;
X-KDE-Category=Gadgets & Simulations
Name=Virtual Machine
Name[af]=Virtuele Masjien
Name[ast]=Máquina virtual
Name[bg]=Виртуална машина
Name[br]=Ardivink galloudel
Name[bs]=Virtualna mašina
Name[ca]=Màquina virtual
Name[ca@valencia]=Màquina virtual
Name[cs]=Virtuální stroj
Name[cy]=Peiriant Rhith
Name[da]=Virtuel maskine
Name[de]=Virtuelle Maschine
Name[el]=Εικονική μηχανή
Name[en_GB]=Virtual Machine
Name[eo]=Virtuala maŝino
Name[es]=Máquina virtual
Name[et]=Virtuaalne Masin
Name[eu]=Makina birtuala
Name[fa]=ماشین مجازی
Name[fi]=Virtuaalikone
Name[fr]=Machine virtuelle
Name[fy]=Firtuele masine
Name[ga]=Meaisín Fíorúil
Name[gl]=Máquina virtual
Name[he]=מכונה וירטואלית
Name[hne]=
Name[hu]=Virtuális gép
Name[is]=Sýndarvél
Name[it]=Macchina virtuale
Name[ja]=
Name[kk]=Виртуалды компьютер
Name[ko]=
Name[lt]=Virtuali Mašina
Name[lv]=Virtuālā mašīna
Name[mk]=Виртуелна машина
Name[ml]=
Name[ms]=Mesin Maya
Name[nb]=Virtuell maskin
Name[nds]=Virtuell Maschien
Name[ne]=ि ि
Name[nl]=Virtuele machine
Name[nn]=Virtuell maskin
Name[pa]=
Name[pl]=Maszyna wirtualna
Name[pt]=Máquina Virtual
Name[pt_BR]=Máquina Virtual
Name[ro]=Mașină virtuală
Name[ru]=Виртуальная машина
Name[sk]=Virtuálny stroj
Name[sl]=Navidezni stroj
Name[sq]=Virtual Machine
Name[sr]=Виртуелна машина
Name[sr@ijekavian]=Виртуелна машина
Name[sr@ijekavianlatin]=Virtuelna mašina
Name[sr@latin]=Virtuelna mašina
Name[sv]=Virtuell maskin
Name[ta]=
Name[tg]=Мошини уфуқӣ
Name[th]=
Name[tr]=Sanal Makine
Name[ug]=مەۋھۇم كومپيۇتېر
Name[uk]=Віртуальна машина
Name[uz]=Virtual kompyuter
Name[uz@cyrillic]=Виртуал компьютер
Name[vi]=Máy o
Name[xh]=Umatshini onesiqhamo
Name[x-test]=xxVirtual Machinexx
Name[zh_CN]=
Name[zh_TW]=
[Desktop Action Setup]
Exec=kvm.kss -setup
Name=Setup...
Name[af]=Opstelling...
Name[ast]=Configuración...
Name[bg]=Настройки...
Name[br]=Kefluniadur ...
Name[bs]=Podesi...
Name[ca]=Arranjament...
Name[ca@valencia]=Arranjament...
Name[cs]=Nastavení...
Name[cy]=Gosod ...
Name[da]=Opsætning...
Name[de]=Einrichtung ...
Name[el]=Ρύθμιση...
Name[en_GB]=Setup...
Name[eo]=Agordo...
Name[es]=Configuración...
Name[et]=Seadistamine...
Name[eu]=Konfiguratu...
Name[fa]=برپایی...
Name[fi]=Asetukset
Name[fr]=Configuration...
Name[fy]=Opset...
Name[ga]=Socrú...
Name[gl]=Configuración...
Name[he]=הגדרות...
Name[hne]=...
Name[hr]=Postavke 
Name[hu]=Beállítás...
Name[is]=Stillingar...
Name[it]=Impostazioni...
Name[ja]=...
Name[kk]=Баптау...
Name[ko]=...
Name[lt]=Sąranka ...
Name[lv]=Iestatījumi...
Name[mai]=...
Name[mk]=Поставување...
Name[ml]=...
Name[mr]= ...
Name[ms]=Setkan...
Name[nb]=Innstillinger 
Name[nds]=Instellen...
Name[ne]=...
Name[nl]=Instellingen...
Name[nn]=Oppsett 
Name[pa]=...
Name[pl]=Ustawienia...
Name[pt]=Configurar...
Name[pt_BR]=Configurar...
Name[ro]=Configurare...
Name[ru]=Настройка...
Name[sk]=Nastavenie...
Name[sl]=Nastavi ...
Name[sq]=Instalimi...
Name[sr]=Подеси...
Name[sr@ijekavian]=Подеси...
Name[sr@ijekavianlatin]=Podesi...
Name[sr@latin]=Podesi...
Name[sv]=Inställningar...
Name[ta]=...
Name[tg]=Барпосозӣ...
Name[th]=...
Name[tr]=Kurulum...
Name[ug]=ئورنات
Name[uk]=Встановити...
Name[uz]=Oʻrnatish
Name[uz@cyrillic]=Ўрнатиш
Name[vi]=Thiết lp...
Name[xh]=Iyacwangciswa...
Name[x-test]=xxSetup...xx
Name[zh_CN]=...
Name[zh_TW]=...
Icon=preferences-desktop-screensaver
[Desktop Action InWindow]
Exec=kvm.kss -window-id %w
Name=Display in Specified Window
Name[ast]=Amosar na ventana especificada
Name[bg]=Показване в избран прозорец
Name[br]=Diskwel er prenestr spisaet
Name[bs]=Prikaži u određenom prozoru
Name[ca]=Mostra a la finestra especificada
Name[ca@valencia]=Mostra a la finestra especificada
Name[cs]=Zobrazit v určeném okně
Name[cy]=Dangos mewn Ffenestr Benodol
Name[da]=Visning i angivet vindue
Name[de]=In bestimmten Fenster anzeigen
Name[el]=Προβολή στο καθορισμένο παράθυρο
Name[en_GB]=Display in Specified Window
Name[eo]=Montri en indikita fenestro
Name[es]=Mostrar en la ventana especificada
Name[et]=Määratud aknas näitamine
Name[eu]=Bistaratu zehaztutako lehioan
Name[fa]=نمایش در پنجره مشخصشده
Name[fi]=Näytä määrätyssä ikkunassa
Name[fr]=Affichage dans la fenêtre spécifiée
Name[fy]=Werjefte yn in definiearre finster
Name[ga]=Taispeáin san Fhuinneog Sonraithe
Name[gl]=Mostrar na xanela indicada
Name[he]=הצג בחלון המצוין
Name[hne]=िि ि
Name[hr]=Prikaži u određenom prozoru
Name[hu]=Megjelenítés a megadott ablakban
Name[is]=Birta í völdum glugga
Name[it]=Mostra nella finestra specificata
Name[ja]=
Name[kk]=Келтірілген терезеде көрсетілсін
Name[ko]=
Name[lt]=Rodyti nurodytame lange
Name[lv]=Rādīt norādītajā logā
Name[mai]=िि ि ि
Name[mk]=Прикажи во наведениот прозорец
Name[ml]= ിി ി ിി
Name[mr]=ि
Name[ms]=Papar dalam Tetingkap Yang Dinyatakan
Name[nb]=Vis i angitt vindu
Name[nds]=In utsöcht Finster wiesen
Name[ne]=िि
Name[nl]=Weergeven In een opgegeven venster
Name[nn]=Vis i oppgjeve vindauge
Name[pa]= ਿ
Name[pl]=Wyświetl w zadanym oknie
Name[pt]=Mostrar na Janela Indicada
Name[pt_BR]=Exibir na janela indicada
Name[ro]=Afișează în fereastra specificată
Name[ru]=Показывать в указанном окне
Name[sk]=Zobraziť v zadanom okne
Name[sl]=Pokaži v določenem oknu
Name[sq]=Shfaq në Dritaren e Specifikuar
Name[sr]=Прикажи у задатом прозору
Name[sr@ijekavian]=Прикажи у задатом прозору
Name[sr@ijekavianlatin]=Prikaži u zadatom prozoru
Name[sr@latin]=Prikaži u zadatom prozoru
Name[sv]=Visa i angivet fönster
Name[ta]=ி ி
Name[tg]=Дар тирезаи нишондода намоиш намоед
Name[th]=
Name[tr]=Belirtilen Pencerede Göster
Name[ug]=بەلگىلەنگەن كۆزنەكتە كۆرسەت
Name[uk]=Відобразити у вказаному вікні
Name[vi]=Hin th trong Ca s Đã đnh
Name[x-test]=xxDisplay in Specified Windowxx
Name[zh_CN]=
Name[zh_TW]=
NoDisplay=true
[Desktop Action Root]
Exec=kvm.kss -root
Name=Display in Root Window
Name[ast]=Amosar na ventana raíz
Name[bg]=Показване в главния прозорец
Name[br]=Diskwel er prenestr gwrizienn
Name[bs]=Prikaži u korijenom prozoru
Name[ca]=Mostra a la finestra arrel
Name[ca@valencia]=Mostra a la finestra arrel
Name[cs]=Zobrazit na pozadí plochy
Name[cy]=Dangos mewn Ffenestr Wraidd
Name[da]=Visning i root-vindue
Name[de]=In Hintergrundfenster anzeigen
Name[el]=Προβολή στο βασικό παράθυρο
Name[en_GB]=Display in Root Window
Name[eo]=Montri en radika fenestro
Name[es]=Mostrar en la ventana raíz
Name[et]=Juuraknas näitamine
Name[eu]=Bistaratu erro lehioan
Name[fa]=نمایش در پنجره ریشه
Name[fi]=Näytä juuri-ikkunassa
Name[fr]=Affichage dans la fenêtre racine
Name[fy]=Werjefte yn haadfinster
Name[ga]=Taispeáin sa Phríomhfhuinneog
Name[gl]=Mostrar na xanela raíz
Name[he]=הצג בחלון השורש
Name[hne]= ि
Name[hr]=Prikaži u ishodišnom prozoru
Name[hu]=Megjelenítés a gyökérablakban
Name[is]=Birta í rótarglugganum
Name[it]=Mostra sullo sfondo
Name[ja]=
Name[kk]=Түбір терезесінде көрсетілсін
Name[ko]=
Name[lt]=Rodyti root lange
Name[lv]=Rādīt saknes logā
Name[mai]= ि ि
Name[mk]=Прикажи во коренскиот прозорец
Name[ml]= ി ിി
Name[mr]=
Name[ms]=Papar dalam Tetingkap Root
Name[nb]=Vis i root-vindu
Name[nds]=In Hööftfinster wiesen
Name[ne]=
Name[nl]=Weergeven in hoofdvenster
Name[nn]=Vis i rotvindauget
Name[pa]=Root ਿ
Name[pl]=Wyświetl w oknie głównym
Name[pt]=Mostrar na Janela de Fundo
Name[pt_BR]=Exibir na janela raiz
Name[ro]=Afișează în fereastra rădăcină
Name[ru]=Показывать в корневом окне
Name[sk]=Zobraziť v koreňovom okne
Name[sl]=Pokaži v določenem oknu
Name[sq]=Shfaq në Dritaren Bazë
Name[sr]=Прикажи у кореном прозору
Name[sr@ijekavian]=Прикажи у корјеном прозору
Name[sr@ijekavianlatin]=Prikaži u korjenom prozoru
Name[sr@latin]=Prikaži u korenom prozoru
Name[sv]=Visa i rotfönstret
Name[ta]= ி
Name[tg]=Дар тирезаи решагӣ намоиш намоед
Name[th]=
Name[tr]=Kök Pencerede Göster
Name[ug]=غول كۆزنەكتە كۆرسەت
Name[uk]=Відобразити в кореневому вікні
Name[vi]=Hin th trong Ca s Gc
Name[x-test]=xxDisplay in Root Windowxx
Name[zh_CN]=
Name[zh_TW]=
NoDisplay=true

View file

@ -0,0 +1,295 @@
[Desktop Entry]
Exec=kwave.kss
Icon=preferences-desktop-screensaver
Type=Service
X-KDE-ServiceTypes=ScreenSaver
Actions=Setup;InWindow;Root;
X-KDE-Category=OpenGL Screen Savers
X-KDE-Type=OpenGL
Name=Bitmap Flag (GL)
Name[af]=Biskaart Vlag (Gl)
Name[ast]=Bandera de mapa de bits (GL)
Name[bg]=Развяващ се флаг
Name[bs]=Bitmap zastava (GL)
Name[ca]=Bandera de mapa de bits (GL)
Name[ca@valencia]=Bandera de mapa de bits (GL)
Name[cs]=Bitmapová vlajka (GL)
Name[cy]=Baner Didfap (GL)
Name[da]=Bitmapflag (GL)
Name[de]=Bildflagge
Name[el]=Bitmap Flag (GL)
Name[en_GB]=Bitmap Flag (GL)
Name[eo]=Bildflago (GL)
Name[es]=Bandera de mapa de bits (GL)
Name[et]=Pildilipp (GL)
Name[eu]=Bitmap Bandera (GL)
Name[fa]=پرچم نگاشت بیت(GL)
Name[fi]=Bittikarttalippu (GL)
Name[fr]=Drapeau (GL)
Name[fy]=Bitmap flagge (GL)
Name[ga]=Bitmap Flag (GL)
Name[gl]=Bandeira de mapa de bits (GL)
Name[he]=דגל (GL)
Name[hne]=ि ()
Name[hu]=Zászló (OpenGL)
Name[is]=Myndafáni (GL)
Name[it]=Immagine al vento (GL)
Name[ja]= (GL)
Name[kk]=Растр жалауы (GL)
Name[ko]= (GL)
Name[lt]=Taškinės grafikos (bitmap) vėliava (GL)
Name[lv]=Karogs no attēliem (GL)
Name[mk]=Битмапирано знаме (GL)
Name[ml]=ി (ി)
Name[ms]=Bitmap Flag (GL)
Name[nb]=Bittmap-flagg (GL)
Name[nds]=Weihen Flagg (GL)
Name[ne]=ि (GL)
Name[nl]=Bitmap vlag (GL)
Name[nn]=Flagg (GL)
Name[pl]=Bitmapowa flaga (GL)
Name[pt]=Imagem Ondulante (GL)
Name[pt_BR]=Bitmap Flag (GL)
Name[ro]=Steag imagine (GL)
Name[ru]=Растровый флаг (GL)
Name[sk]=Bitmapová vlajka (GL)
Name[sl]=Bitna zastava (GL)
Name[sq]=Bitmap Flag (GL)
Name[sr]=Битмапски талас
Name[sr@ijekavian]=Битмапски талас
Name[sr@ijekavianlatin]=Bitmapski talas
Name[sr@latin]=Bitmapski talas
Name[sv]=Bitmappsflagga (GL)
Name[ta]=ி ி
Name[tg]=Байрақи растрӣ (GL)
Name[th]= (GL)
Name[tr]=Bayrak (GL)
Name[uk]=Растровий прапор (GL)
Name[uz]=Bayroq (GL)
Name[uz@cyrillic]=Байроқ (GL)
Name[vi]=C Mng nh (GL)
Name[xh]=Indwe ye Bitmap (GL)
Name[x-test]=xxBitmap Flag (GL)xx
Name[zh_CN]=(GL)
Name[zh_TW]= (GL)
[Desktop Action Setup]
Exec=kwave.kss -setup
Name=Setup...
Name[af]=Opstelling...
Name[ast]=Configuración...
Name[bg]=Настройки...
Name[br]=Kefluniadur ...
Name[bs]=Podesi...
Name[ca]=Arranjament...
Name[ca@valencia]=Arranjament...
Name[cs]=Nastavení...
Name[cy]=Gosod ...
Name[da]=Opsætning...
Name[de]=Einrichtung ...
Name[el]=Ρύθμιση...
Name[en_GB]=Setup...
Name[eo]=Agordo...
Name[es]=Configuración...
Name[et]=Seadistamine...
Name[eu]=Konfiguratu...
Name[fa]=برپایی...
Name[fi]=Asetukset
Name[fr]=Configuration...
Name[fy]=Opset...
Name[ga]=Socrú...
Name[gl]=Configuración...
Name[he]=הגדרות...
Name[hne]=...
Name[hr]=Postavke 
Name[hu]=Beállítás...
Name[is]=Stillingar...
Name[it]=Impostazioni...
Name[ja]=...
Name[kk]=Баптау...
Name[ko]=...
Name[lt]=Sąranka ...
Name[lv]=Iestatījumi...
Name[mai]=...
Name[mk]=Поставување...
Name[ml]=...
Name[mr]= ...
Name[ms]=Setkan...
Name[nb]=Innstillinger 
Name[nds]=Instellen...
Name[ne]=...
Name[nl]=Instellingen...
Name[nn]=Oppsett 
Name[pa]=...
Name[pl]=Ustawienia...
Name[pt]=Configurar...
Name[pt_BR]=Configurar...
Name[ro]=Configurare...
Name[ru]=Настройка...
Name[sk]=Nastavenie...
Name[sl]=Nastavi ...
Name[sq]=Instalimi...
Name[sr]=Подеси...
Name[sr@ijekavian]=Подеси...
Name[sr@ijekavianlatin]=Podesi...
Name[sr@latin]=Podesi...
Name[sv]=Inställningar...
Name[ta]=...
Name[tg]=Барпосозӣ...
Name[th]=...
Name[tr]=Kurulum...
Name[ug]=ئورنات
Name[uk]=Встановити...
Name[uz]=Oʻrnatish
Name[uz@cyrillic]=Ўрнатиш
Name[vi]=Thiết lp...
Name[xh]=Iyacwangciswa...
Name[x-test]=xxSetup...xx
Name[zh_CN]=...
Name[zh_TW]=...
Icon=preferences-desktop-screensaver
[Desktop Action InWindow]
Exec=kwave.kss -window-id %w
Name=Display in Specified Window
Name[ast]=Amosar na ventana especificada
Name[bg]=Показване в избран прозорец
Name[br]=Diskwel er prenestr spisaet
Name[bs]=Prikaži u određenom prozoru
Name[ca]=Mostra a la finestra especificada
Name[ca@valencia]=Mostra a la finestra especificada
Name[cs]=Zobrazit v určeném okně
Name[cy]=Dangos mewn Ffenestr Benodol
Name[da]=Visning i angivet vindue
Name[de]=In bestimmten Fenster anzeigen
Name[el]=Προβολή στο καθορισμένο παράθυρο
Name[en_GB]=Display in Specified Window
Name[eo]=Montri en indikita fenestro
Name[es]=Mostrar en la ventana especificada
Name[et]=Määratud aknas näitamine
Name[eu]=Bistaratu zehaztutako lehioan
Name[fa]=نمایش در پنجره مشخصشده
Name[fi]=Näytä määrätyssä ikkunassa
Name[fr]=Affichage dans la fenêtre spécifiée
Name[fy]=Werjefte yn in definiearre finster
Name[ga]=Taispeáin san Fhuinneog Sonraithe
Name[gl]=Mostrar na xanela indicada
Name[he]=הצג בחלון המצוין
Name[hne]=िि ि
Name[hr]=Prikaži u određenom prozoru
Name[hu]=Megjelenítés a megadott ablakban
Name[is]=Birta í völdum glugga
Name[it]=Mostra nella finestra specificata
Name[ja]=
Name[kk]=Келтірілген терезеде көрсетілсін
Name[ko]=
Name[lt]=Rodyti nurodytame lange
Name[lv]=Rādīt norādītajā logā
Name[mai]=िि ि ि
Name[mk]=Прикажи во наведениот прозорец
Name[ml]= ിി ി ിി
Name[mr]=ि
Name[ms]=Papar dalam Tetingkap Yang Dinyatakan
Name[nb]=Vis i angitt vindu
Name[nds]=In utsöcht Finster wiesen
Name[ne]=िि
Name[nl]=Weergeven In een opgegeven venster
Name[nn]=Vis i oppgjeve vindauge
Name[pa]= ਿ
Name[pl]=Wyświetl w zadanym oknie
Name[pt]=Mostrar na Janela Indicada
Name[pt_BR]=Exibir na janela indicada
Name[ro]=Afișează în fereastra specificată
Name[ru]=Показывать в указанном окне
Name[sk]=Zobraziť v zadanom okne
Name[sl]=Pokaži v določenem oknu
Name[sq]=Shfaq në Dritaren e Specifikuar
Name[sr]=Прикажи у задатом прозору
Name[sr@ijekavian]=Прикажи у задатом прозору
Name[sr@ijekavianlatin]=Prikaži u zadatom prozoru
Name[sr@latin]=Prikaži u zadatom prozoru
Name[sv]=Visa i angivet fönster
Name[ta]=ி ி
Name[tg]=Дар тирезаи нишондода намоиш намоед
Name[th]=
Name[tr]=Belirtilen Pencerede Göster
Name[ug]=بەلگىلەنگەن كۆزنەكتە كۆرسەت
Name[uk]=Відобразити у вказаному вікні
Name[vi]=Hin th trong Ca s Đã đnh
Name[x-test]=xxDisplay in Specified Windowxx
Name[zh_CN]=
Name[zh_TW]=
NoDisplay=true
[Desktop Action Root]
Exec=kwave.kss -root
Name=Display in Root Window
Name[ast]=Amosar na ventana raíz
Name[bg]=Показване в главния прозорец
Name[br]=Diskwel er prenestr gwrizienn
Name[bs]=Prikaži u korijenom prozoru
Name[ca]=Mostra a la finestra arrel
Name[ca@valencia]=Mostra a la finestra arrel
Name[cs]=Zobrazit na pozadí plochy
Name[cy]=Dangos mewn Ffenestr Wraidd
Name[da]=Visning i root-vindue
Name[de]=In Hintergrundfenster anzeigen
Name[el]=Προβολή στο βασικό παράθυρο
Name[en_GB]=Display in Root Window
Name[eo]=Montri en radika fenestro
Name[es]=Mostrar en la ventana raíz
Name[et]=Juuraknas näitamine
Name[eu]=Bistaratu erro lehioan
Name[fa]=نمایش در پنجره ریشه
Name[fi]=Näytä juuri-ikkunassa
Name[fr]=Affichage dans la fenêtre racine
Name[fy]=Werjefte yn haadfinster
Name[ga]=Taispeáin sa Phríomhfhuinneog
Name[gl]=Mostrar na xanela raíz
Name[he]=הצג בחלון השורש
Name[hne]= ि
Name[hr]=Prikaži u ishodišnom prozoru
Name[hu]=Megjelenítés a gyökérablakban
Name[is]=Birta í rótarglugganum
Name[it]=Mostra sullo sfondo
Name[ja]=
Name[kk]=Түбір терезесінде көрсетілсін
Name[ko]=
Name[lt]=Rodyti root lange
Name[lv]=Rādīt saknes logā
Name[mai]= ि ि
Name[mk]=Прикажи во коренскиот прозорец
Name[ml]= ി ിി
Name[mr]=
Name[ms]=Papar dalam Tetingkap Root
Name[nb]=Vis i root-vindu
Name[nds]=In Hööftfinster wiesen
Name[ne]=
Name[nl]=Weergeven in hoofdvenster
Name[nn]=Vis i rotvindauget
Name[pa]=Root ਿ
Name[pl]=Wyświetl w oknie głównym
Name[pt]=Mostrar na Janela de Fundo
Name[pt_BR]=Exibir na janela raiz
Name[ro]=Afișează în fereastra rădăcină
Name[ru]=Показывать в корневом окне
Name[sk]=Zobraziť v koreňovom okne
Name[sl]=Pokaži v določenem oknu
Name[sq]=Shfaq në Dritaren Bazë
Name[sr]=Прикажи у кореном прозору
Name[sr@ijekavian]=Прикажи у корјеном прозору
Name[sr@ijekavianlatin]=Prikaži u korjenom prozoru
Name[sr@latin]=Prikaži u korenom prozoru
Name[sv]=Visa i rotfönstret
Name[ta]= ி
Name[tg]=Дар тирезаи решагӣ намоиш намоед
Name[th]=
Name[tr]=Kök Pencerede Göster
Name[ug]=غول كۆزنەكتە كۆرسەت
Name[uk]=Відобразити в кореневому вікні
Name[vi]=Hin th trong Ca s Gc
Name[x-test]=xxDisplay in Root Windowxx
Name[zh_CN]=
Name[zh_TW]=
NoDisplay=true

View file

@ -0,0 +1,3 @@
These are native KDE screensavers using the libkscreensaver library.
If you are writing a screensaver for KDE use these as references rather
than the ported savers.

View file

@ -0,0 +1,797 @@
/*
* Terence Welsh Screensaver - Solar Winds
* http://www.reallyslick.com/
*
* Ported to KDE by Karl Robillard
* Copyright (C) 2002 Terence M. Welsh
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <time.h>
#include <qtimer.h>
#include "SolarWinds.h"
#include "SolarWinds.moc"
#include <GL/glu.h>
#define NUMCONSTS 9
#define PIx2 6.28318530718f
#define DEG2RAD 0.0174532925f
// Useful random number macro
// Don't forget to initialize with srand()
// This is the original myRandf() which does not work on Linux.
// I grabed the inline version from Flux.cpp.
//#define myRandf(x) (float(rand()) * (x * 0.0000305185095f))
inline float myRandf(float x){
return(float(rand() * x) / float(RAND_MAX));
}
// Context pointer to allow many instances.
static SWindsWidget* _ec = 0;
struct Emitter
{
float x, y, z;
};
struct Particle
{
float x, y, z;
float r, g, b;
};
class wind
{
public:
wind();
~wind();
void update();
Emitter* emitters;
Particle* particles;
int** linelist;
int* lastparticle;
int whichparticle;
int partCount;
int emitCount;
bool useLines;
float c[NUMCONSTS];
float ct[NUMCONSTS];
float cv[NUMCONSTS];
};
wind::wind()
{
int i;
partCount = _ec->dParticles;
emitCount = _ec->dEmitters;
useLines = (_ec->dGeometry == 2);
emitters = new Emitter[emitCount];
for(i=0; i<emitCount; i++)
{
emitters[i].x = myRandf(60.0f) - 30.0f;
emitters[i].y = myRandf(60.0f) - 30.0f;
emitters[i].z = myRandf(30.0f) - 15.0f;
}
particles = new Particle[partCount];
for(i=0; i<partCount; i++)
{
particles[i].x = 0.0f;
particles[i].y = 0.0f;
particles[i].z = 100.0f; // start particles behind viewer
}
whichparticle = 0;
if( useLines )
{
linelist = new int*[partCount];
for(i=0; i<partCount; i++)
{
linelist[i] = new int[2];
linelist[i][0] = -1;
linelist[i][1] = -1;
}
lastparticle = new int[emitCount];
for(i=0; i<emitCount; i++)
lastparticle[i] = i;
}
float windspeed = (float) (_ec->dWindspeed);
for(i=0; i<NUMCONSTS; i++)
{
ct[i] = myRandf(PIx2);
cv[i] = myRandf(0.00005f * windspeed * windspeed)
+ 0.00001f * windspeed * windspeed;
//printf( "KR ct %g cv %g\n", ct[i], cv[i] );
}
}
wind::~wind()
{
delete[] emitters;
delete[] particles;
if( useLines )
{
int i;
for(i=0; i<partCount; i++)
delete[] linelist[i];
delete[] linelist;
delete[] lastparticle;
}
}
void wind::update()
{
int i;
float x, y, z;
float temp;
float particleSpeed = (float) _ec->dParticlespeed;
float evel = float(_ec->dEmitterspeed) * 0.01f;
float pvel = particleSpeed * 0.01f;
float pointsize = 0.04f * _ec->dSize;
float linesize = 0.005f * _ec->dSize;
// update constants
for(i=0; i<NUMCONSTS; i++)
{
ct[i] += cv[i];
if(ct[i] > PIx2)
ct[i] -= PIx2;
c[i] = cos(ct[i]);
}
// calculate emissions
for(i=0; i<emitCount; i++)
{
emitters[i].z += evel; // emitter moves toward viewer
if(emitters[i].z > 15.0f)
{
// reset emitter
emitters[i].x = myRandf(60.0f) - 30.0f;
emitters[i].y = myRandf(60.0f) - 30.0f;
emitters[i].z = -15.0f;
}
particles[whichparticle].x = emitters[i].x;
particles[whichparticle].y = emitters[i].y;
particles[whichparticle].z = emitters[i].z;
if( useLines )
{
// link particles to form lines
if(linelist[whichparticle][0] >= 0)
linelist[linelist[whichparticle][0]][1] = -1;
linelist[whichparticle][0] = -1;
if(emitters[i].z == -15.0f)
linelist[whichparticle][1] = -1;
else
linelist[whichparticle][1] = lastparticle[i];
linelist[lastparticle[i]][0] = whichparticle;
lastparticle[i] = whichparticle;
}
whichparticle++;
if(whichparticle >= partCount)
whichparticle = 0;
}
// calculate particle positions and colors
// first modify constants that affect colors
c[6] *= 9.0f / particleSpeed;
c[7] *= 9.0f / particleSpeed;
c[8] *= 9.0f / particleSpeed;
// then update each particle
for(i=0; i<partCount; i++)
{
Particle* part = particles + i;
// store old positions
x = part->x;
y = part->y;
z = part->z;
// make new positins
part->x = x + (c[0] * y + c[1] * z) * pvel;
part->y = y + (c[2] * z + c[3] * x) * pvel;
part->z = z + (c[4] * x + c[5] * y) * pvel;
// calculate colors
part->r = fabs((part->x - x) * c[6]);
part->g = fabs((part->y - y) * c[7]);
part->b = fabs((part->z - z) * c[8]);
// clamp colors
if( part->r > 1.0f )
part->r = 1.0f;
if( part->g > 1.0f )
part->g = 1.0f;
if( part->b > 1.0f )
part->b = 1.0f;
}
// draw particles
switch(_ec->dGeometry)
{
case 0: // lights
for(i=0; i<partCount; i++)
{
glColor3fv(&particles[i].r);
glPushMatrix();
glTranslatef(particles[i].x, particles[i].y, particles[i].z);
glCallList(1);
glPopMatrix();
#if 0
if( i == 0 )
printf( "KR %d %g %g %g\n", i,
particles[i].x, particles[i].y, particles[i].z);
#endif
}
break;
case 1: // points
for(i=0; i<partCount; i++)
{
temp = particles[i].z + 40.0f;
if(temp < 0.01f)
temp = 0.01f;
glPointSize(pointsize * temp);
glBegin(GL_POINTS);
glColor3fv(&particles[i].r);
glVertex3fv(&particles[i].x);
glEnd();
}
break;
case 2: // lines
for(i=0; i<partCount; i++)
{
temp = particles[i].z + 40.0f;
if(temp < 0.01f)
temp = 0.01f;
glLineWidth(linesize * temp);
glBegin(GL_LINES);
if(linelist[i][1] >= 0)
{
glColor3fv(&particles[i].r);
if(linelist[i][0] == -1)
glColor3f(0.0f, 0.0f, 0.0f);
glVertex3fv(&particles[i].x);
glColor3fv(&particles[linelist[i][1]].r);
if(linelist[linelist[i][1]][1] == -1)
glColor3f(0.0f, 0.0f, 0.0f);
glVertex3fv(&particles[linelist[i][1]].x);
}
glEnd();
}
}
}
//----------------------------------------------------------------------------
SWindsWidget::SWindsWidget( QWidget* parent )
: QGLWidget(parent), _winds(0)
{
setDefaults( Regular );
_frameTime = 1000 / 60;
_timer = new QTimer( this );
_timer->setSingleShot( true );
connect( _timer, SIGNAL(timeout()), this, SLOT(nextFrame()) );
}
SWindsWidget::~SWindsWidget()
{
// Free memory
delete[] _winds;
}
void SWindsWidget::paintGL()
{
glLoadIdentity();
if( ! dBlur )
{
glClear(GL_COLOR_BUFFER_BIT);
}
else
{
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glColor4f(0.0f, 0.0f, 0.0f, 0.5f - (float(dBlur) * 0.0049f));
glBegin(GL_QUADS);
glVertex3f(-40.0f, -17.0f, 0.0f);
glVertex3f(40.0f, -17.0f, 0.0f);
glVertex3f(40.0f, 17.0f, 0.0f);
glVertex3f(-40.0f, 17.0f, 0.0f);
glEnd();
if(!dGeometry)
glBlendFunc(GL_ONE, GL_ONE);
else
glBlendFunc(GL_SRC_ALPHA, GL_ONE); // Necessary for point and line smoothing (I don't know why)
// Maybe it's just my video card...
}
// You should need to draw twice if using blur, once to each buffer.
// But wglSwapLayerBuffers appears to copy the back to the
// front instead of just switching the pointers to them. It turns
// out that both NVidia and 3dfx prefer to use PFD_SWAP_COPY instead
// of PFD_SWAP_EXCHANGE in the PIXELFORMATDESCRIPTOR. I don't know why...
// So this may not work right on other platforms or all video cards.
// Update surfaces
if( _winds )
{
_ec = this;
int i;
for(i=0; i<dWinds; i++)
_winds[i].update();
}
glFlush();
}
void SWindsWidget::resizeGL( int w, int h )
{
glViewport(0, 0, w, h );
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(90.0, (float) w / (float) h, 1.0, 10000);
glTranslatef(0.0, 0.0, -15.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
// Window initialization
void SWindsWidget::initializeGL()
{
updateParameters();
_timer->start( _frameTime );
}
#ifdef UNIT_TEST
void SWindsWidget::keyPressEvent( QKeyEvent* e )
{
if( e->key() == Qt::Key_0 ) { setDefaults( 0 ); updateParameters(); }
if( e->key() == Qt::Key_1 ) { setDefaults( 1 ); updateParameters(); }
if( e->key() == Qt::Key_2 ) { setDefaults( 2 ); updateParameters(); }
if( e->key() == Qt::Key_3 ) { setDefaults( 3 ); updateParameters(); }
if( e->key() == Qt::Key_4 ) { setDefaults( 4 ); updateParameters(); }
if( e->key() == Qt::Key_5 ) { setDefaults( 5 ); updateParameters(); }
}
#endif
void SWindsWidget::nextFrame()
{
updateGL();
_timer->start( _frameTime );
}
void SWindsWidget::updateParameters()
{
int i, j;
float x, y, temp;
srand((unsigned)time(NULL));
rand(); rand(); rand(); rand(); rand();
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
if(!dGeometry)
glBlendFunc(GL_ONE, GL_ONE);
else
glBlendFunc(GL_SRC_ALPHA, GL_ONE); // Necessary for point and line smoothing (I don't know why)
glEnable(GL_BLEND);
if( ! dGeometry )
{
// Init lights
for(i=0; i<LIGHTSIZE; i++)
{
for(j=0; j<LIGHTSIZE; j++)
{
x = float(i - LIGHTSIZE / 2) / float(LIGHTSIZE / 2);
y = float(j - LIGHTSIZE / 2) / float(LIGHTSIZE / 2);
temp = 1.0f - float(sqrt((x * x) + (y * y)));
if(temp > 1.0f)
temp = 1.0f;
if(temp < 0.0f)
temp = 0.0f;
lightTexture[i][j] = (unsigned char) (255.0f * temp);
}
}
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, 1);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexImage2D(GL_TEXTURE_2D, 0, 1, LIGHTSIZE, LIGHTSIZE, 0,
GL_LUMINANCE, GL_UNSIGNED_BYTE, lightTexture);
temp = 0.02f * dSize;
glNewList(1, GL_COMPILE);
glBindTexture(GL_TEXTURE_2D, 1);
glBegin(GL_TRIANGLE_STRIP);
glTexCoord2f(0.0f, 0.0f);
glVertex3f(-temp, -temp, 0.0f);
glTexCoord2f(1.0f, 0.0f);
glVertex3f(temp, -temp, 0.0f);
glTexCoord2f(0.0f, 1.0f);
glVertex3f(-temp, temp, 0.0f);
glTexCoord2f(1.0f, 1.0f);
glVertex3f(temp, temp, 0.0f);
glEnd();
glEndList();
}
else if(dGeometry == 1)
{
// init point smoothing
glEnable(GL_POINT_SMOOTH);
glHint(GL_POINT_SMOOTH_HINT, GL_NICEST);
glDisable(GL_TEXTURE_2D);
}
else if(dGeometry == 2)
{
// init line smoothing
glEnable(GL_LINE_SMOOTH);
glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
glDisable(GL_TEXTURE_2D);
}
// Initialize surfaces
_ec = this;
delete[] _winds;
_winds = new wind[dWinds];
}
/**
May be called at any time - makes no OpenGL calls.
*/
void SWindsWidget::setDefaults(int which)
{
switch(which)
{
case CosmicStrings:
dWinds = 1;
dEmitters = 50;
dParticles = 3000;
dGeometry = 2;
dSize = 20;
dWindspeed = 10;
dEmitterspeed = 10;
dParticlespeed = 10;
dBlur = 10;
break;
case ColdPricklies:
dWinds = 1;
dEmitters = 300;
dParticles = 3000;
dGeometry = 2;
dSize = 5;
dWindspeed = 20;
dEmitterspeed = 100;
dParticlespeed = 15;
dBlur = 70;
break;
case SpaceFur:
dWinds = 2;
dEmitters = 400;
dParticles = 1600;
dGeometry = 2;
dSize = 15;
dWindspeed = 20;
dEmitterspeed = 15;
dParticlespeed = 10;
dBlur = 0;
break;
case Jiggly:
dWinds = 1;
dEmitters = 40;
dParticles = 1200;
dGeometry = 1;
dSize = 20;
dWindspeed = 100;
dEmitterspeed = 20;
dParticlespeed = 4;
dBlur = 50;
break;
case Undertow:
dWinds = 1;
dEmitters = 400;
dParticles = 1200;
dGeometry = 0;
dSize = 40;
dWindspeed = 20;
dEmitterspeed = 1;
dParticlespeed = 100;
dBlur = 50;
break;
case Regular:
default:
dWinds = 1;
dEmitters = 30;
dParticles = 2000;
dGeometry = 0;
dSize = 50;
dWindspeed = 20;
dEmitterspeed = 15;
dParticlespeed = 10;
dBlur = 40;
break;
}
}
//----------------------------------------------------------------------------
#ifndef UNIT_TEST
#include <klocale.h>
#include <kglobal.h>
#include <kconfig.h>
// libkscreensaver interface
class KSolarWindsSaverInterface : public KScreenSaverInterface
{
public:
virtual KAboutData* aboutData() {
return new KAboutData( "ksolarwinds.kss", "klock", ki18n( "Solar Winds" ), "1.0", ki18n( "Solar Winds" ) );
}
virtual KScreenSaver* create( WId id )
{
return new KSWindsScreenSaver( id );
}
virtual QDialog* setup()
{
return new KSWindsSetup;
}
};
int main( int argc, char *argv[] )
{
KSolarWindsSaverInterface kss;
return kScreenSaverMain( argc, argv, kss );
}
//----------------------------------------------------------------------------
KSWindsScreenSaver::KSWindsScreenSaver( WId id ) : KScreenSaver( id )
{
_flux = new SWindsWidget;
readSettings();
embed( _flux );
_flux->show();
}
KSWindsScreenSaver::~KSWindsScreenSaver()
{
}
static int filterRandom( int n )
{
if( (n < 0) || (n >= SWindsWidget::DefaultModes) )
{
srand((unsigned)time(NULL));
n = rand() % SWindsWidget::DefaultModes;
}
return n;
}
void KSWindsScreenSaver::readSettings()
{
KConfigGroup config(KGlobal::config(), "Settings");
_mode = config.readEntry( "Mode", (int)SWindsWidget::Regular );
_flux->setDefaults( filterRandom(_mode) );
}
/**
Any invalid mode will select one at random.
*/
void KSWindsScreenSaver::setMode( int id )
{
_mode = id;
_flux->setDefaults( filterRandom(id) );
_flux->updateParameters();
}
//----------------------------------------------------------------------------
#include <qlayout.h>
#include <qlabel.h>
#include <qcombobox.h>
#include <kmessagebox.h>
static const char* defaultText[] =
{
I18N_NOOP( "Regular" ),
I18N_NOOP( "Cosmic Strings" ),
I18N_NOOP( "Cold Pricklies" ),
I18N_NOOP( "Space Fur" ),
I18N_NOOP( "Jiggly" ),
I18N_NOOP( "Undertow" ),
I18N_NOOP( "(Random)" ),
0
};
KSWindsSetup::KSWindsSetup( QWidget* parent )
: KDialog( parent)
{
setButtonText( Help, i18n( "A&bout" ) );
setButtons(Ok|Cancel|Help);
setDefaultButton(Ok);
setCaption(i18n( "Setup Solar Wind" ));
setModal(true);
showButtonSeparator(true);
setButtonText( Help, i18n( "A&bout" ) );
QWidget *main = new QWidget(this);
setMainWidget(main);
QHBoxLayout* top = new QHBoxLayout( main );
top->setSpacing( spacingHint() );
QVBoxLayout* leftCol = new QVBoxLayout;
top->addLayout( leftCol );
QLabel* label = new QLabel( i18n("Mode:"), main );
leftCol->addWidget( label );
modeW = new QComboBox( main );
int i = 0;
while (defaultText[i])
modeW->addItem( i18n(defaultText[i++]) );
leftCol->addWidget( modeW );
leftCol->addStretch();
// Preview
QWidget* preview;
preview = new QWidget( main );
preview->setFixedSize( 220, 165 );
{
QPalette palette;
palette.setColor( preview->backgroundRole(), Qt::black );
preview->setPalette( palette );
preview->setAutoFillBackground(true);
}
preview->show(); // otherwise saver does not get correct size
_saver = new KSWindsScreenSaver( preview->winId() );
top->addWidget(preview);
// Now that we have _saver...
modeW->setCurrentIndex( _saver->mode() ); // set before we connect
connect( modeW, SIGNAL(activated(int)), _saver, SLOT(setMode(int)) );
connect( this, SIGNAL(okClicked()), this, SLOT(slotOk()));
connect( this, SIGNAL(helpClicked()),this,SLOT(slotHelp()));
}
KSWindsSetup::~KSWindsSetup()
{
delete _saver;
}
void KSWindsSetup::slotHelp()
{
KMessageBox::about(this,
i18n("<h3>Solar Winds 1.0</h3>\n<p>Copyright (c) 2002 Terence M. Welsh<br>\n<a href=\"http://www.reallyslick.com/\">http://www.reallyslick.com/</a></p>\n\n<p>Ported to KDE by Karl Robillard</p>"),
QString(), KMessageBox::AllowLink);
}
/**
Ok pressed - save settings and exit
*/
void KSWindsSetup::slotOk()
{
KConfigGroup config(KGlobal::config(), "Settings");
QString val;
val.setNum( modeW->currentIndex() );
config.writeEntry("Mode", val );
config.sync();
accept();
}
#endif
//----------------------------------------------------------------------------
#ifdef UNIT_TEST
// moc SolarWinds.h -o SolarWinds.moc
// g++ -g -DUNIT_TEST SolarWinds.cpp -I/usr/lib/qt3/include -lqt -L/usr/lib/qt3/lib -lGLU -lGL
#include <qapplication.h>
int main( int argc, char** argv )
{
QApplication app( argc, argv );
SWindsWidget w;
app.setMainWidget( &w );
w.show();
return app.exec();
}
#endif
//EOF

View file

@ -0,0 +1,150 @@
/*
* Terence Welsh Screensaver - Solar Winds
* http://www.reallyslick.com/
*
* Ported to KDE by Karl Robillard
* Copyright (C) 2002 Terence M. Welsh
*
* 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 <http://www.gnu.org/licenses/>.
*/
#ifndef SOLARWINDS_H
#define SOLARWINDS_H
#include <qgl.h>
#define LIGHTSIZE 64
class wind;
class QTimer;
class SWindsWidget : public QGLWidget
{
Q_OBJECT
public:
enum eDefault
{
Regular,
CosmicStrings,
ColdPricklies,
SpaceFur,
Jiggly,
Undertow,
DefaultModes
};
SWindsWidget( QWidget* parent=0 );
~SWindsWidget();
void updateParameters();
void setDefaults( int which );
protected:
void paintGL();
void resizeGL( int w, int h );
void initializeGL();
#ifdef UNIT_TEST
void keyPressEvent( QKeyEvent* );
#endif
private slots:
void nextFrame();
private:
wind* _winds;
unsigned char lightTexture[LIGHTSIZE][LIGHTSIZE];
int dWinds;
int dEmitters;
int dParticles;
int dGeometry;
float dSize;
int dParticlespeed;
int dEmitterspeed;
int dWindspeed;
int dBlur;
// Using QTimer rather than timerEvent() to avoid getting locked out of
// the QEvent loop on lower-end systems. Ian Geiser <geiseri@kde.org>
// says this is the way to go.
QTimer* _timer;
int _frameTime;
friend class wind;
};
#ifndef UNIT_TEST
#include <kdialog.h>
#include <kscreensaver.h>
class KSWindsScreenSaver : public KScreenSaver
{
Q_OBJECT
public:
KSWindsScreenSaver( WId id );
virtual ~KSWindsScreenSaver();
int mode() const { return _mode; }
public slots:
void setMode( int );
private:
void readSettings();
SWindsWidget* _flux;
int _mode;
};
class QComboBox;
class KSWindsSetup : public KDialog
{
Q_OBJECT
public:
KSWindsSetup( QWidget* parent = 0 );
~KSWindsSetup();
private slots:
void slotHelp();
void slotOk();
private:
QComboBox* modeW;
KSWindsScreenSaver* _saver;
};
#endif
#endif //__SOLARWINDS_H__

View file

@ -0,0 +1,4 @@
File=asciiquarium.kcfg
ClassName=AASaverConfig
Singleton=true
Mutators=true

View file

@ -0,0 +1,18 @@
set(kdeasciiquarium_SRCS
aasaver.cpp
frame.cpp
screen.cpp
sprite.cpp
)
kde4_add_ui_files(kdeasciiquarium_SRCS
settingswidget.ui
)
kde4_add_kcfg_files(kdeasciiquarium_SRCS AASaverConfig.kcfgc)
kde4_add_executable(kdeasciiquarium.kss ${kdeasciiquarium_SRCS})
target_link_libraries(kdeasciiquarium.kss ${KDE4_KDEUI_LIBS} ${KDE4WORKSPACE_KSCREENSAVER_LIBRARY})
install(TARGETS kdeasciiquarium.kss ${INSTALL_TARGETS_DEFAULT_ARGS})
install(FILES asciiquarium.desktop DESTINATION ${SERVICES_INSTALL_DIR}/ScreenSavers)

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,3 @@
#! /usr/bin/env bash
$EXTRACTRC *.ui *.kcfg >> rc.cpp
$XGETTEXT *.cpp -o $podir/kdeasciiquarium.pot

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,215 @@
/*
* Asciiquarium - Native KDE Screensaver based on the Asciiquarium program
* (c) Kirk Baucom <kbaucom@schizoid.com>, which you can find at
* http://www.robobunny.com/projects/asciiquarium/
*
* Ported to KDE by Maksim Orlovich <maksim@kde.org> and
* Michael Pyne <michael.pyne@kdemail.net>.
*
* Copyright (c) 2003 Kirk Baucom <kbaucom@schizoid.com>
* Copyright (c) 2005 Maksim Orlovich <maksim@kde.org>
* Copyright (c) 2005, 2008 Michael Pyne <michael.pyne@kdemail.net>
*
* 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 AA_AASAVER_H
#define AA_AASAVER_H
#include <kscreensaver.h>
#include <KRandomSequence>
class Screen;
class Sprite;
/**
* \mainpage Asciiquarium.
*
* \section intro Introduction
*
* Asciiquarium is a KDE screensaver to draw an ASCII art aquarium. This is the
* documentation of the API used in the program to generate the effect. It should
* be fairly simple, but basically:
*
* class AASaver is the main class, which handles outside events. All of the
* processing happens in the Screen class however, which manages a list of
* Sprites, updating them and drawing them as needed. When AASaver receives a
* paintEvent(), it forwards it on to Screen to handle it.
*
* Each Sprite is composed of 1 or more Frames. When a Screen wants a Sprite
* to draw itself, the Sprite forwards the request to its currently shown Frame.
*
* The Frame is rectangular, and created from textual ASCII art, with a ASCII
* art shape and color mask. The mask is optional. See aasaver.cpp for
* examples for creating a Frame.
*
* The Frame supports transparency and colors, and will convert the textual data
* into a QPixmap representation on demand in order to reduce CPU load (at the
* expense of a slight memory usage increase for each sprite).
*
* Screen handles the timing for the project, and at each timeout will call
* Sprite::tickUpdate() from Screen::doAnimate().
*
* This whole program was inspired/copied from Kirk Baucom's asciiquarium
* program, from http://www.robobunny.com/projects/asciiquarium/
*/
/**
* The main class for the Asciiquarium screensaver.
*/
class AASaver: public KScreenSaver
{
/// Handles the animation and drawing.
Screen* screen;
/// Randomizes the sequence of fish, seaweeds, colors, etc.
KRandomSequence m_randomSequence;
/// Static singleton instance.
static AASaver *m_instance;
public:
/// Construct the screensaver with window id \p id.
AASaver(WId id);
static AASaver *instance();
/**
* Returns a QString holding a color mask, created by choosing random colors
* to replace numbers in \p color_mask.
*/
QString randColor(QString color_mask);
double doubleRand(int max);
/// Adds the castle sprite to the screen.
void addCastle();
/// Adds the environment (sea, etc.) to the screen.
void addEnvironment();
/// Adds the seaweed to the screen.
void addAllSeaweed();
/// Adds the initial layout of fish to the sea, scaling the number of fish
/// based on the current screen size.
void addAllFish();
/**
* Adds a seaweed to a random position of the sea bottom.
*
* @param screen The Screen to add into.
*/
void addSeaweed(Screen* screen);
/**
* Returns a new fish sprite, which has not yet been added to a screen.
*
* @param screen The Screen to use when constructing the Sprite.
* @todo Combine with addFish().
*/
Sprite *newFish(Screen *screen);
/**
* Adds a new fish sprite to \p screen.
*
* @param screen The Screen to add a fish to.
*/
void addFish(Screen *screen);
/**
* Adds a new air bubble sprite to \p screen. The \p x, \p y, and \p z
* coordinates are all in logical coordinates.
*
* @param screen The Screen to add the bubble to.
* @param x The x position to start the bubble at.
* @param y The y position to start the bubble at.
* @param z The z position to start the bubble at.
*/
void addBubble(Screen* screen, int x, int y, int z);
/**
* Adds a Nessie, the Loch Ness Monster sprite to \p screen.
*
* @param screen The Screen to add Nessie to.
*/
void addNessie(Screen* screen);
/**
* Adds a big fish sprite to \p screen.
*
* @param screen The Screen to add the big fish to.
*/
void addBigFish(Screen* screen);
/**
* Adds a whale sprite to \p screen.
*
* @param screen The Screen to add the whale to.
*/
void addWhale(Screen* screen);
/**
* Adds a shark sprite to \p screen. The shark can kill() fish it comes in
* contact with (they will spawn more fish automatically).
*
* @param screen The Screen to add the shark to.
*/
void addShark(Screen* screen);
/**
* Adds a submarine sprite to \p screen. The submarine can kill() fish it
* comes in contact with (they will spawn more fish automatically).
*
* @param screen The Screen to add the submarine to.
* @author Ryan Meldrum <ryjame@cox.net>
* @since KDE SC 4.6
*/
void addSubmarine(Screen* screen);
/**
* Adds a ship sprite to \p screen.
*
* @param screen The Screen to add the ship to.
*/
void addShip(Screen* screen);
/**
* Adds a random object from the set (Shark, Big Fish, Nessie, Whale, Ship, Sub)
* to the sea.
*
* @param screen The Screen to add to.
*/
void addRandom(Screen* screen);
/**
* Reimplemented to update the widget when it gets dirty.
*/
virtual void paintEvent(QPaintEvent* pe);
};
class AASaverInterface : public KScreenSaverInterface
{
public:
virtual ~AASaverInterface();
virtual KAboutData *aboutData();
virtual KScreenSaver *create(WId id);
virtual QDialog *setup();
};
#endif /* AA_AASAVER_H */
// vim: set et ts=8 sw=4:

View file

@ -0,0 +1,232 @@
[Desktop Entry]
Name=Asciiquarium
Name[ast]=Asciiacuariu
Name[bg]=Текстов аквариум
Name[bs]=Asciiquarium
Name[ca]=Asciiquarium
Name[ca@valencia]=Asciiquarium
Name[cs]=ASCIIkvárium
Name[da]=Asciiquarium
Name[de]=Asciiquarium
Name[el]=Asciiquarium
Name[en_GB]=Asciiquarium
Name[es]=Acuario ascii
Name[et]=Asciiquarium
Name[eu]=Asciiquarium
Name[fi]=Asciiquarium
Name[fr]=Asciiquarium
Name[ga]=Asciiquarium
Name[gl]=Asciiquarium
Name[hne]=ि
Name[hu]=Asciiquarium
Name[is]=Asciiquarium
Name[it]=Asciiquario
Name[ja]=
Name[kk]=Ascii-аквариум
Name[ko]=ASCII
Name[lt]=Asciikvariumas
Name[lv]=Asciikvārijs
Name[mk]=Ascii-аквариум
Name[ml]=ിി
Name[nb]=Asciikvarium
Name[nds]=Asciiquarium
Name[nl]=Asciiquarium
Name[nn]=Asciikvarium
Name[pl]=Asciiquarium
Name[pt]=Asciiquarium
Name[pt_BR]=Asciiquarium
Name[ro]=Asciicvariu
Name[ru]=Бумажный аквариум
Name[sk]=Asciiquarium
Name[sl]=Asciiquarium
Name[sq]=Asciiquarium
Name[sr]=Аскикваријум
Name[sr@ijekavian]=Аскикваријум
Name[sr@ijekavianlatin]=Asciiquarium
Name[sr@latin]=Asciiquarium
Name[sv]=Asciikvarium
Name[tr]=Asciivaryum
Name[uk]=Текстовий акваріум
Name[x-test]=xxAsciiquariumxx
Name[zh_CN]=Asciiquarium
Name[zh_TW]=Ascii
Exec=kdeasciiquarium.kss -caption %c
Icon=preferences-desktop-screensaver
Type=Service
X-KDE-ServiceTypes=ScreenSaver
Actions=InWindow;Root;Setup;
[Desktop Action InWindow]
Name=Display in specified window
Name[ast]=Amosar na ventana especificada
Name[bg]=Показване в избран прозорец
Name[bs]=Prikaži u određenom prozoru
Name[ca]=Mostra a la finestra especificada
Name[ca@valencia]=Mostra a la finestra especificada
Name[cs]=Zobrazit v určeném okně
Name[da]=Vis i angivet vindue
Name[de]=In bestimmten Fenster anzeigen
Name[el]=Εμφάνιση σε καθορισμένο παράθυρο
Name[en_GB]=Display in specified window
Name[es]=Mostrar en la ventana especificada
Name[et]=Määratud aknas näitamine
Name[eu]=Bistaratu zehaztutako lehioan
Name[fi]=Näytä määräikkunassa
Name[fr]=Affichage dans la fenêtre spécifiée
Name[ga]=Taispeáin san fhuinneog sonraithe
Name[gl]=Mostrar na xanela indicada
Name[hne]= ि
Name[hr]=Prikaži u određenom prozoru
Name[hu]=Megjelenítés a megadott ablakban
Name[is]=Birta í völdum glugga
Name[it]=Mostra nella finestra specificata
Name[ja]=
Name[kk]=Келтірілген терезеде көрсетілсін
Name[ko]=
Name[lt]=Rodyti nurodytame lange
Name[lv]=Rādīt norādītajā logā
Name[mk]=Прикажи во наведениот прозорец
Name[ml]= ിി ി ിി
Name[mr]=ि
Name[nb]=Vis i angitt vindu
Name[nds]=In angeven Finster wiesen
Name[nl]=In opgegeven venster weergeven
Name[nn]=Vis i oppgjeve vindauge
Name[pa]= ਿ ਿ
Name[pl]=Wyświetl w zadanym oknie
Name[pt]=Mostrar na janela indicada
Name[pt_BR]=Exibir na janela indicada
Name[ro]=Afișează în fereastra specificată
Name[ru]=Показывать в указанном окне
Name[sk]=Zobraziť v zadanom okne
Name[sl]=Pokaži v določenem oknu
Name[sq]=Shfaqe në dritaren e specifikuar
Name[sr]=Прикажи у задатом прозору
Name[sr@ijekavian]=Прикажи у задатом прозору
Name[sr@ijekavianlatin]=Prikaži u zadatom prozoru
Name[sr@latin]=Prikaži u zadatom prozoru
Name[sv]=Visa i angivet fönster
Name[tr]=Belirtilen pencerede göster
Name[ug]=بەلگىلەنگەن كۆزنەكتە كۆرسەت
Name[uk]=Показувати у визначеному вікні
Name[x-test]=xxDisplay in specified windowxx
Name[zh_CN]=
Name[zh_TW]=
Exec=kdeasciiquarium.kss -window-id %w
NoDisplay=true
[Desktop Action Root]
Name=Display in root window
Name[ast]=Amosar na ventana raíz
Name[bg]=Показавне в главния прозорец
Name[bs]=Prikaži u korijenskom prozoru
Name[ca]=Mostra a la finestra arrel
Name[ca@valencia]=Mostra a la finestra arrel
Name[cs]=Zobrazit na pozadí plochy
Name[da]=Vis i rod-vindue
Name[de]=In Hintergrundfenster anzeigen
Name[el]=Εμφάνιση στο ριζικό παράθυρο
Name[en_GB]=Display in root window
Name[es]=Mostrar en la ventana raíz
Name[et]=Juuraknas näitamine
Name[eu]=Bistaratu erroko lehioan
Name[fi]=Näytä juuri-ikkunassa
Name[fr]=Affichage dans la fenêtre racine
Name[ga]=Taispeáin sa phríomhfhuinneog
Name[gl]=Mostrar na xanela raíz
Name[hne]= ि
Name[hr]=Prikaži u ishodišnom prozoru
Name[hu]=Megjelenítés a gyökérablakban
Name[is]=Birta í rótarglugganum
Name[it]=Mostra sullo sfondo
Name[ja]=
Name[kk]=Түбір терезесінде көрсетілсін
Name[ko]=
Name[lt]=Rodyti šakniniame lange
Name[lv]=Rādīt saknes logā
Name[mk]=Прикажи во коренскиот прозорец
Name[ml]= ി ിി
Name[mr]=
Name[nb]=Vis i root-vindu
Name[nds]=In Hööftfinster wiesen
Name[nl]=In hoofdvenster weergeven
Name[nn]=Vis i rotvindauget
Name[pa]= ਿ ਿ
Name[pl]=Wyświetl w oknie głównym
Name[pt]=Mostrar na janela de fundo
Name[pt_BR]=Exibir na janela raiz
Name[ro]=Afișează în fereastra rădăcină
Name[ru]=Показывать в корневом окне
Name[sk]=Zobraziť v koreňovom okne
Name[sl]=Pokaži v korenskem oknu
Name[sq]=Shfaqe në dritaren bazë
Name[sr]=Прикажи у кореном прозору
Name[sr@ijekavian]=Прикажи у корјеном прозору
Name[sr@ijekavianlatin]=Prikaži u korjenom prozoru
Name[sr@latin]=Prikaži u korenom prozoru
Name[sv]=Visa i rotfönstret
Name[tr]=Kök pencerede göster
Name[ug]=باش كۆزنەكتە كۆرسەت
Name[uk]=Показувати у кореневому вікні
Name[x-test]=xxDisplay in root windowxx
Name[zh_CN]=
Name[zh_TW]=
Exec=kdeasciiquarium.kss -root
NoDisplay=true
[Desktop Action Setup]
Name=Display setup dialog
Name[ast]=Amosar el menú de configuración
Name[bg]=Прозорец за настройки
Name[bs]=Prikaži podešavajući dijalog
Name[ca]=Mostra el diàleg de configuració
Name[ca@valencia]=Mostra el diàleg de configuració
Name[cs]=Zobrazit dialog nastavení
Name[da]=Vis opsætningsdialog
Name[de]=Einrichtungsdialog anzeigen
Name[el]=Εμφάνιση διαλόγου ρύθμισης
Name[en_GB]=Display setup dialogue
Name[es]=Mostrar el diálogo de configuración
Name[et]=Seadistustedialoogi näitamine
Name[eu]=Bistaratu konfigurazioko elkarrizketa-koadroa
Name[fi]=Näytä asetusikkuna
Name[fr]=Afficher la boîte de dialogue de configuration
Name[ga]=Taispeáin dialóg shocraithe
Name[gl]=Mostrar o diálogo de configuración
Name[hne]=
Name[hr]=Prikaži dijalog za postavke
Name[hu]=Beállítóablak
Name[is]=Sýna stillingaglugga
Name[it]=Mostra la finestra di configurazione
Name[ja]=
Name[kk]=Баптау диалогын көрсету
Name[ko]=
Name[lt]=Ekrano nustatymų dialogas
Name[lv]=Rādīt konfigurācijas logu
Name[mk]=Прикажи дијалог за поставување
Name[ml]= ി
Name[nb]=Vis oppsettsdialog
Name[nds]=Instelldialoog wiesen
Name[nl]=Instellingendialoog weergeven
Name[nn]=Vis oppsettvindauge
Name[pa]=ਿ
Name[pl]=Wyświetl okno dialogowe
Name[pt]=Mostrar a janela de configuração
Name[pt_BR]=Exibe o diálogo de configurações
Name[ro]=Dialog de configurare a afișajului
Name[ru]=Показать диалог настройки
Name[sk]=Zobraziť dialóg nastavenia
Name[sl]=Prikaži okno za nastavljanje
Name[sq]=Shfaq dialogun e instalimit
Name[sr]=Прикажи дијалог за подешавање
Name[sr@ijekavian]=Прикажи дијалог за подешавање
Name[sr@ijekavianlatin]=Prikaži dijalog za podešavanje
Name[sr@latin]=Prikaži dijalog za podešavanje
Name[sv]=Visa inställningsdialogruta
Name[tr]=Ekran ayarlama penceresi
Name[uk]=Показати діалогове вікно налаштування
Name[x-test]=xxDisplay setup dialogxx
Name[zh_CN]=
Name[zh_TW]=
Exec=kdeasciiquarium.kss -setup
Icon=kscreensaver

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE kcfg SYSTEM "http://www.kde.org/standards/kcfg/1.0/kcfg.dtd">
<kcfg>
<kcfgfile name="asciiquariumrc"/>
<group name="Settings">
<entry name="fishCount" type="Int">
<label>Number of fish to have in the sea.</label>
<default>20</default>
<whatsthis>You can use this value to select the number of fish that will be on screen at a given time.</whatsthis>
</entry>
</group>
</kcfg>
<!-- vim: set noet ts=4: -->

View file

@ -0,0 +1,309 @@
BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV {
font-family: sans-serif, Geneva, Arial, Helvetica;
}
BODY,TD {
font-size: 100%;
}
H1 {
text-align: center;
font-size: 160%;
}
H2 {
font-size: 120%;
}
H3 {
font-size: 110%;
}
CAPTION { font-weight: bold }
DIV.qindex {
width: 100%;
background-color: #eeeeff;
border: 1px solid #b0b0b0;
text-align: center;
margin: 2px;
padding: 2px;
line-height: 140%;
}
DIV.nav {
width: 100%;
background-color: #eeeeff;
border: 1px solid #b0b0b0;
text-align: center;
margin: 2px;
padding: 2px;
line-height: 140%;
}
DIV.navtab {
background-color: #eeeeff;
border: 1px solid #b0b0b0;
text-align: center;
margin: 2px;
margin-right: 15px;
padding: 2px;
}
TD.navtab {
font-size: 80%;
}
A.qindex {
text-decoration: none;
font-weight: bold;
color: #1A419D;
}
A.qindex:visited {
text-decoration: none;
font-weight: bold;
color: #1A419D
}
A.qindex:hover {
text-decoration: none;
background-color: #ddddff;
}
A.qindexHL {
text-decoration: none;
font-weight: bold;
background-color: #6666cc;
color: #ffffff;
border: 1px double #9295C2;
}
A.qindexHL:hover {
text-decoration: none;
background-color: #6666cc;
color: #ffffff;
}
A.qindexHL:visited { text-decoration: none; background-color: #6666cc; color: #ffffff }
A.el { text-decoration: none; font-weight: bold }
A.elRef { font-weight: bold }
A.code:link { text-decoration: none; font-weight: normal; color: #0000FF}
A.code:visited { text-decoration: none; font-weight: normal; color: #0000FF}
A.codeRef:link { font-weight: normal; color: #0000FF}
A.codeRef:visited { font-weight: normal; color: #0000FF}
A:hover { text-decoration: none; background-color: #f2f2ff }
DL.el { margin-left: -1cm }
.fragment {
font-family: monospace;
font-size: 105%;
}
PRE.fragment {
border: 1px solid #CCCCCC;
background-color: #f5f5f5;
margin-top: 4px;
margin-bottom: 4px;
margin-left: 2px;
margin-right: 8px;
padding-left: 6px;
padding-right: 6px;
padding-top: 4px;
padding-bottom: 4px;
}
DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px }
TD.md { background-color: #F4F4FB; font-weight: bold; }
TD.mdPrefix {
background-color: #F4F4FB;
color: #606060;
font-size: 90%;
}
TD.mdname1 { background-color: #F4F4FB; font-weight: bold; color: #602020; }
TD.mdname { background-color: #F4F4FB; font-weight: bold; color: #602020; width: 600px; }
DIV.groupHeader {
margin-left: 16px;
margin-top: 12px;
margin-bottom: 6px;
font-weight: bold;
}
DIV.groupText { margin-left: 16px; font-style: italic; font-size: 95% }
BODY {
background: white;
color: black;
margin-right: 20px;
margin-left: 20px;
}
TD.indexkey {
background-color: #eeeeff;
font-weight: bold;
padding-right : 10px;
padding-top : 2px;
padding-left : 10px;
padding-bottom : 2px;
margin-left : 0px;
margin-right : 0px;
margin-top : 2px;
margin-bottom : 2px;
border: 1px solid #CCCCCC;
}
TD.indexvalue {
background-color: #eeeeff;
font-style: italic;
padding-right : 10px;
padding-top : 2px;
padding-left : 10px;
padding-bottom : 2px;
margin-left : 0px;
margin-right : 0px;
margin-top : 2px;
margin-bottom : 2px;
border: 1px solid #CCCCCC;
}
TR.memlist {
background-color: #f0f0f0;
}
P.formulaDsp { text-align: center; }
IMG.formulaDsp { }
IMG.formulaInl { vertical-align: middle; }
SPAN.keyword { color: #008000 }
SPAN.keywordtype { color: #604020 }
SPAN.keywordflow { color: #e08000 }
SPAN.comment { color: #800000 }
SPAN.preprocessor { color: #806020 }
SPAN.stringliteral { color: #002080 }
SPAN.charliteral { color: #008080 }
.mdTable {
border: 1px solid #868686;
background-color: #F4F4FB;
}
.mdRow {
padding: 8px 10px;
}
.mdescLeft {
padding: 0px 8px 4px 8px;
font-size: 80%;
font-style: italic;
background-color: #FAFAFA;
border-top: 1px none #E0E0E0;
border-right: 1px none #E0E0E0;
border-bottom: 1px none #E0E0E0;
border-left: 1px none #E0E0E0;
margin: 0px;
}
.mdescRight {
padding: 0px 8px 4px 8px;
font-size: 80%;
font-style: italic;
background-color: #FAFAFA;
border-top: 1px none #E0E0E0;
border-right: 1px none #E0E0E0;
border-bottom: 1px none #E0E0E0;
border-left: 1px none #E0E0E0;
margin: 0px;
}
.memItemLeft {
padding: 1px 0px 0px 8px;
margin: 4px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-color: #E0E0E0;
border-right-color: #E0E0E0;
border-bottom-color: #E0E0E0;
border-left-color: #E0E0E0;
border-top-style: solid;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
background-color: #FAFAFA;
font-size: 80%;
}
.memItemRight {
padding: 1px 8px 0px 8px;
margin: 4px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-color: #E0E0E0;
border-right-color: #E0E0E0;
border-bottom-color: #E0E0E0;
border-left-color: #E0E0E0;
border-top-style: solid;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
background-color: #FAFAFA;
font-size: 80%;
}
.memTemplItemLeft {
padding: 1px 0px 0px 8px;
margin: 4px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-color: #E0E0E0;
border-right-color: #E0E0E0;
border-bottom-color: #E0E0E0;
border-left-color: #E0E0E0;
border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
background-color: #FAFAFA;
font-size: 80%;
}
.memTemplItemRight {
padding: 1px 8px 0px 8px;
margin: 4px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-color: #E0E0E0;
border-right-color: #E0E0E0;
border-bottom-color: #E0E0E0;
border-left-color: #E0E0E0;
border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
background-color: #FAFAFA;
font-size: 80%;
}
.memTemplParams {
padding: 1px 0px 0px 8px;
margin: 4px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-color: #E0E0E0;
border-right-color: #E0E0E0;
border-bottom-color: #E0E0E0;
border-left-color: #E0E0E0;
border-top-style: solid;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
color: #606060;
background-color: #FAFAFA;
font-size: 80%;
}
.search { color: #003399;
font-weight: bold;
}
FORM.search {
margin-bottom: 0px;
margin-top: 0px;
}
INPUT.search { font-size: 75%;
color: #000080;
font-weight: normal;
background-color: #eeeeff;
}
TD.tiny { font-size: 75%;
}
a {
color: #252E78;
}
a:visited {
color: #3D2185;
}
.dirtab { padding: 4px;
border-collapse: collapse;
border: 1px solid #b0b0b0;
}
TH.dirtab { background: #eeeeff;
font-weight: bold;
}
HR { height: 1px;
border: none;
border-top: 1px solid black;
}

View file

@ -0,0 +1,208 @@
/*
* Asciiquarium - Native KDE Screensaver based on the Asciiquarium program
* (c) Kirk Baucom <kbaucom@schizoid.com>, which you can find at
* http://www.robobunny.com/projects/asciiquarium/
*
* Ported to KDE by Maksim Orlovich <maksim@kde.org> and
* Michael Pyne <mpyne@kde.org>.
*
* Copyright (c) 2003 Kirk Baucom <kbaucom@schizoid.com>
* Copyright (c) 2005 Maksim Orlovich <maksim@kde.org>
* Copyright (c) 2005, 2008, 2012 Michael Pyne <mpyne@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 "frame.h"
#include <kglobalsettings.h>
#include <kdebug.h>
#include <QtCore/QStringList>
#include <QtGui/QImage>
#include <QtGui/QFontMetrics>
#include <QtGui/QPainter>
void Frame::convertDataToPixmap(const Screen *screen)
{
if(!height() || !width()) {
// Assume we're not ready to go.
return;
}
int w = screen->cellWidth(), h = screen->cellHeight();
QImage pix(width() * w, height() * h, QImage::Format_ARGB32_Premultiplied);
pix.fill(Qt::transparent);
QPainter p;
p.begin(&pix);
p.setCompositionMode(QPainter::CompositionMode_Source);
p.setRenderHint(QPainter::TextAntialiasing);
p.setFont(KGlobalSettings::fixedFont());
QFontMetrics fm(p.fontMetrics());
for(int j = 0; j < m_data.count(); ++j) {
QVector<Screen::Pixel> row = m_data[j];
if(row.isEmpty())
continue;
int first, last;
for (first = 0; first < row.count() && row[first].letter == ' '; ++first)
;
last = row.count() - 1; // Assume the end is already stripped.
for(int i = first; i <= last; ++i) {
if(QLatin1Char( row[i].letter ) == m_transparentChar )
continue;
QRect r(i * w, j * h, w, h);
p.setPen(row[i].color);
p.fillRect(r, Qt::black); // Completely fill since drawText won't even in Opaque.
p.drawText(r, Qt::AlignCenter, QString(QChar(row[i].letter, 0)));
}
}
p.end();
QImage eraseImage(pix.size(), QImage::Format_RGB32);
eraseImage.fill(qRgb(0, 0, 0));
// Since QPixmap::fill() seems broken on some nVidia drivers????
m_erasePixmap = QPixmap::fromImage(eraseImage);
m_pixmap = QPixmap::fromImage(pix);
// Clear m_data to save a wee bit of memory.
m_data.clear();
}
Frame::Frame (const QString& text, const QString& mask, const QRgb& defaultColor, QChar transparent)
{
//First, process the pixels.
QStringList rows = text.split(QLatin1Char( '\n' ));
m_height = rows.size();
m_width = 0;
m_transparentChar = transparent;
// curRow is deliberately not const& as we must modify it a bit in the loop. It does
// not alias strings in rows however otherwise we would have to manually make a copy.
foreach(QString curRow, rows) { //krazy:exclude=foreach
QVector<Screen::Pixel> row;
int strLen = curRow.length(); // make sure this is cached.
// ?? is changed to {} for trigraph purposes, change it back.
curRow.replace(QLatin1String( "{}" ), QLatin1String( "??" ));
for (int pos = 0; pos < strLen; ++pos)
{
Screen::Pixel p;
p.letter = curRow.at(pos).unicode();
p.color = defaultColor;
row.append(p);
}
m_width = qMax(m_width, row.size());
m_data.append(row);
}
// Now, the colors.
QStringList cols = mask.split(QLatin1Char( '\n' ));
int y = 0;
foreach(const QString &curCol, cols) {
if (y >= m_data.size())
break;
for (int pos = 0; pos < curCol.length() && pos < m_data[y].size(); ++pos)
{
switch (curCol.at(pos).unicode())
{
//Colors stolen from konsole, TEWidget.cpp
case 'R':
m_data[y][pos].color = 0xFF5454;
break;
case 'r':
m_data[y][pos].color = 0xB21818;
break;
case 'C':
m_data[y][pos].color = 0x54FFFF;
break;
case 'c':
m_data[y][pos].color = 0x18B2B2;
break;
case 'Y':
m_data[y][pos].color = 0xFFFF54;
break;
case 'y':
m_data[y][pos].color = 0xB26818;
break;
case 'G':
m_data[y][pos].color = 0x54FF54;
break;
case 'g':
m_data[y][pos].color = 0x18B218;
break;
case 'B':
m_data[y][pos].color = 0x5454FF;
break;
case 'b':
m_data[y][pos].color = 0x1818B2;
break;
case 'M':
m_data[y][pos].color = 0xFF54FF;
break;
case 'm':
m_data[y][pos].color = 0xB218B2;
break;
case 'W':
m_data[y][pos].color = 0xFFFFFF;
break;
case 'w':
m_data[y][pos].color = 0xB2B2B2;
break;
case ' ':
break;
default:
kDebug() << "dunno about color code:" << curCol.at(pos);
m_data[y][pos].color = 0xFFFFFF;
}
}
++y;
} // foreach
}
void Frame::paint(Screen* scr, int x, int y)
{
if(m_pixmap.isNull())
convertDataToPixmap(scr);
scr->updateSpan(x, y, m_pixmap);
}
void Frame::erase(Screen* scr, int x, int y)
{
if(m_erasePixmap.isNull())
convertDataToPixmap(scr);
scr->clearSpan(x, y, m_erasePixmap);
}
// vim: set et ts=8 sw=4:

View file

@ -0,0 +1,151 @@
/*
* Asciiquarium - Native KDE Screensaver based on the Asciiquarium program
* (c) Kirk Baucom <kbaucom@schizoid.com>, which you can find at
* http://www.robobunny.com/projects/asciiquarium/
*
* Ported to KDE by Maksim Orlovich <maksim@kde.org> and
* Michael Pyne <michael.pyne@kdemail.net>.
*
* Copyright (c) 2003 Kirk Baucom <kbaucom@schizoid.com>
* Copyright (c) 2005 Maksim Orlovich <maksim@kde.org>
* Copyright (c) 2005, 2008 Michael Pyne <michael.pyne@kdemail.net>
*
* 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 AA_FRAME_H
#define AA_FRAME_H
#include <QtCore/QString>
#include <QtCore/QVector>
#include <QtGui/QPixmap>
#include "screen.h"
/**
* Represents a single frame of a sprite's animation.
*
* @see Sprite
*/
class Frame
{
/**
* Two-dimensional array of Pixels, which represent the appearance of this
* frame. This is used to create m_pixmap and m_erasePixmap when they are
* needed.
*
* @see Pixel
*/
QVector<QVector<Screen::Pixel> > m_data;
/// Masked pixmap of the animation frame. Created by convertDataToPixmap().
QPixmap m_pixmap;
/// Masked pixmap used to clear frame. Created by convertDataToPixmap().
QPixmap m_erasePixmap;
/// Height of this frame of animation in logical coordinates.
int m_height;
/// Width of this frame of animation in logical coordinates.
int m_width;
/// Character to be used as a special 'transparent' character. Normally is
/// the '?' character.
QChar m_transparentChar;
public:
/**
* Constructs an empty animation Frame. Do not insert this into a Sprite.
*/
Frame() : m_height(0), m_width(0)
{
}
/**
* Constructs an animation frame.
*
* @param text Newline-separated text used to construct the Pixel arrays.
* The lines do not have to be equal length, any extra needed
* characters will automatically be filled with transparency.
* Any whitespace at the beginning of a line is converted to
* transparency as well.
*
* @param mask Newline-separated text used to mask \p text's colors. This
* can be empty or null in which case no masking is performed.
* However, if present, there should be the same number of
* lines in \p mask as in \p text, although individual lines
* can be shorter or empty as convienient. You can use letters
* to stand for colors, e.g. 'r' will make the letter in \p
* text at the same position dark red.
*
* @param defaultColor The default color to apply to characters. This
* color is used for all characters in \p text that are
* not altered by \p mask.
*
* @param transparent The character to use to represent transparent areas
* in \p text. This can be useful when the
* auto-transparency feature can't detect transparent
* areas.
*/
Frame(const QString& text, const QString& mask, const QRgb& defaultColor, QChar transparent = QLatin1Char('?'));
/**
* Paints this Frame into the given screen.
*
* @param scr The Screen to draw into.
* @param x The logical x coordinate of the left edge of the update region.
* @param y The logical y coordinate of the top edge of the update region.
*/
void paint(Screen* scr, int x, int y);
/**
* Erases this Frame from the given screen.
*
* @param scr The Screen to draw into.
* @param x The logical x coordinate of the left edge of the update region.
* @param y The logical y coordinate of the top edge of the update region.
*/
void erase(Screen* scr, int x, int y);
/// Returns the logical width of this frame.
int width() const
{
return m_width;
}
/// Returns the logical height of this frame.
int height() const
{
return m_height;
}
protected:
/**
* This function converts the Pixel data in m_data to setup m_pixmap
* and m_erasePixmap, which are not setup until this function is called.
*
* m_data is not valid after this call is performed to save memory.
*
* @param screen The Screen we will be drawing into later.
*/
void convertDataToPixmap(const Screen *screen);
};
#endif
// vim: set et ts=8 sw=4:

View file

@ -0,0 +1,245 @@
/*
* Asciiquarium - Native KDE Screensaver based on the Asciiquarium program
* (c) Kirk Baucom <kbaucom@schizoid.com>, which you can find at
* http://www.robobunny.com/projects/asciiquarium/
*
* Ported to KDE by Maksim Orlovich <maksim@kde.org> and
* Michael Pyne <michael.pyne@kdemail.net>.
*
* Copyright (c) 2003 Kirk Baucom <kbaucom@schizoid.com>
* Copyright (c) 2005 Maksim Orlovich <maksim@kde.org>
* Copyright (c) 2005, 2008 Michael Pyne <michael.pyne@kdemail.net>
*
* 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 "screen.h"
#include <QtCore/QTimer>
#include <QtCore/QList>
#include <QtGui/QColor>
#include <QtGui/QFontMetrics>
#include <QtGui/QPainter>
#include <QtGui/QPixmap>
#include <QtGui/QWidget>
#include <kglobalsettings.h>
#include "sprite.h"
#include "aasaver.h"
Screen::Screen(AASaver* widget): m_widget(widget), m_curPainter(0)
{
QFontMetrics fm(KGlobalSettings::fixedFont());
// Compute cell geometries.
m_cellW = fm.maxWidth();
m_cellH = fm.lineSpacing();
// Computer number of full cells that will fit.
m_width = widget->width() / m_cellW;
m_height = widget->height() / m_cellH;
// Calculate offset needed to evenly distribute excess screen space.
m_offX = (widget->width() - m_width * m_cellW) / 2;
m_offY = (widget->height() - m_height * m_cellH) / 2;
// Setup animation timer.
QTimer* timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), m_widget, SLOT(update()));
timer->start(msPerTick());
}
int Screen::msPerTick() const
{
return 50;
}
Screen::~Screen()
{
}
void Screen::updateSpan(int x, int y, const QPixmap &updatePixmap)
{
if (y < 0 || y >= m_height)
return;
QPoint upperLeft(m_offX + x * m_cellW, m_offY + y * m_cellH);
m_curPainter->drawPixmap(upperLeft, updatePixmap);
}
void Screen::clearSpan(int x, int y, const QPixmap &clearPixmap)
{
if (y < 0 || y >= m_height)
return;
QPoint upperLeft(m_offX + x * m_cellW, m_offY + y * m_cellH);
m_curPainter->fillRect(QRect(upperLeft, clearPixmap.size()), Qt::black);
}
//Actually paints the region on the widget.
void Screen::paint(QPaintEvent *)
{
if(m_backBuffer.isNull()) {
m_backBuffer = QPixmap(m_widget->size());
m_backBuffer.fill(Qt::black);
}
{ // Artificial scoping for the QPainter
QPainter p(&m_backBuffer);
// XXX: This is a hack to allow updateSpan and clearSpan access to the
// current QPainter. Could use some re-architecting. This sequence
// draws onto the back buffer.
m_curPainter = &p;
doAnimate();
m_curPainter = 0;
}
// Draw onto the main widget now.
QPainter p(m_widget);
p.setCompositionMode(QPainter::CompositionMode_Source); // bitBlt ftw
p.drawPixmap(0, 0, m_backBuffer);
}
/**
* Utility type used to faciliate sorting of the Sprite list in order to
* implement the Painter's Algorithm when painting the back buffer.
*/
struct ZKey
{
/**
* Logical depth of sprite. Now 0 is farthest away from the eyes, unlike
* with Sprite::depth().
*/
int z;
Sprite* addr;
ZKey(): z(0), addr(0)
{}
ZKey(Sprite* spr): z(1000 - spr->depth()), addr(spr)
{}
bool operator<(const ZKey& other) const
{
if (z < other.z) return true;
if (z > other.z) return false;
return addr < other.addr;
}
};
void Screen::doAnimate()
{
//First, rebuild a new list of sprites, and build a dirty region
QRegion dirtyRegion;
QList<Sprite*> sprites;
QList<Sprite*> colliders;
// Look for sprites that can suffer a collision.
foreach(Sprite *sprite, m_sprites) {
if(sprite->canCollide())
colliders.append(sprite);
}
// Find collisions.
// FIXME: Use transparent regions for accuracy.
foreach(Sprite *collider, colliders) {
foreach(Sprite *sprite, m_sprites) {
// Can't collide with yourself...
if(sprite == collider)
continue;
if(collider->geom().intersects(sprite->geom()))
collider->collision(sprite);
}
}
//Retain all live existing sprites
foreach(Sprite *sprite, m_sprites) {
QRect oldRect = sprite->geom();
if (!sprite->isKilled()) {
bool dirty = sprite->tickUpdate();
if (dirty)
dirtyRegion |= oldRect | sprite->geom();
if (!sprite->isKilled())
sprites.append(sprite);
}
if (sprite->isKilled()) //note:may be made true by updateTick!
{
dirtyRegion |= oldRect;
delete sprite;
}
}
//Add new sprites.
foreach(Sprite *sprite, m_addedSprites) {
dirtyRegion |= sprite->geom();
sprites.append(sprite);
}
m_addedSprites.clear();
m_sprites = sprites;
//Compute the list of sprites affected. Note that this is
//done iteratively until fixed point.
QList<Sprite*> paintSprites;
QList<Sprite*> remSprites;
bool changed;
do
{
changed = false;
remSprites.clear();
foreach(Sprite *sprite, sprites) {
if (dirtyRegion.intersect(sprite->geom()).isEmpty())
remSprites.append(sprite); //not to be painted thus far
else
{
//This sprite is to be painted
paintSprites.append(sprite);
//make sure we repaint everything overlapping it
dirtyRegion |= sprite->geom();
changed = true;
}
}
sprites = remSprites;
}
while (changed);
//Z-sort the items.
QMap<ZKey, Sprite* > sorted;
foreach(Sprite *sprite, paintSprites)
sorted[ZKey(sprite)] = sprite;
//Paint, in Z-order
foreach(Sprite *sprite, sorted)
sprite->paint();
}
#include "screen.moc"
// vim: set et ts=8 sw=4:

View file

@ -0,0 +1,172 @@
/*
* Asciiquarium - Native KDE Screensaver based on the Asciiquarium program
* (c) Kirk Baucom <kbaucom@schizoid.com>, which you can find at
* http://www.robobunny.com/projects/asciiquarium/
*
* Ported to KDE by Maksim Orlovich <maksim@kde.org> and
* Michael Pyne <michael.pyne@kdemail.net>.
*
* Copyright (c) 2003 Kirk Baucom <kbaucom@schizoid.com>
* Copyright (c) 2005 Maksim Orlovich <maksim@kde.org>
* Copyright (c) 2005, 2008 Michael Pyne <michael.pyne@kdemail.net>
*
* 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 AA_SCREEN_H
#define AA_SCREEN_H
#include <QObject>
#include <QList>
#include <QPixmap>
class Sprite;
class AASaver;
class QPaintEvent;
class QPainter;
/**
* This is the main display class of Asciiquarium. We use a pseudo-terminal-ish
* type coordinate system, where although this is a full fledged GUI application,
* Sprites and most external functions deal with logical text position
* coordinates instead of GUI coordinates. (x, y) starts in the upper-left of
* the real screen at (0, 0), and continues on to (width - 1, height - 1).
*
* Use addSprite() to add new Sprites to the Screen after you have created them
* and added their Frames.
*/
class Screen: public QObject
{
Q_OBJECT
public:
/**
* Represents a logical character on the Screen.
*/
struct Pixel {
char letter; ///< Character to display in the cell.
QRgb color; ///< Color to use for the cell.
/// Default constructor.
Pixel(): letter(' '), color(0)
{
}
};
private:
AASaver* m_widget; ///< Widget that we should paint on.
int m_width; ///< Number of logical columns in the screen.
int m_height; ///< Number of logical rows on the screen.
int m_offX; ///< Number of pixels on left side needed to center image.
int m_offY; ///< Number of pixels on top side needed to center image.
/** Pixmap cache of the image used to speed up rendering. All paints happen
* to the pixmap, which is then bitBlt()'ed to m_widget when the time comes
* to paint.
*/
QPixmap m_backBuffer;
QPainter *m_curPainter;
int m_cellW; ///< The GUI width of a character cell.
int m_cellH; ///< The GUI height of a character cell.
QList<Sprite*> m_sprites; ///< List of Sprites on screen.
QList<Sprite*> m_addedSprites; ///< List of Sprites to be added next frame.
private slots:
/**
* Handles updating the screen buffer to draw the next frame.
*/
void doAnimate();
public:
/**
* Constructor.
*
* @param widget The widget to draw on.
*/
Screen(AASaver* widget);
~Screen();
/// Returns the logical width of the screen.
int width() const
{
return m_width;
}
/// Returns the logical height of the screen.
int height() const
{
return m_height;
}
/// Returns the GUI width of a character cell.
int cellWidth() const
{
return m_cellW;
}
/// Returns the GUI height of a character cell.
int cellHeight() const
{
return m_cellH;
}
/**
* Adds a sprite to the internal sprite list.
*
* @param sprite The Sprite to add. It will show up in the next frame.
*/
void addSprite(Sprite* sprite)
{
m_addedSprites.append(sprite);
}
/// Returns the number of milliseconds separating each animation tick.
int msPerTick() const;
/**
* Updates the backbuffer, and asks the portion of the widget to be
* repainted.
*
* @param x The logical x coordinate of the left edge of the update area.
* @param y The logical y coordinate of the top edge of the update area.
* @param updatePixmap The pixmap to draw into the buffer, which should be
* masked to only draw non-transparent regions.
*/
void updateSpan(int x, int y, const QPixmap &updatePixmap);
/**
* Clear the given portion of the backbuffer, asks for a repaint.
*
* @param x The logical x coordinate of the left edge of the update region.
* @param y The logical y coordinate of the top edge of the update region.
* @param clearPixmap the pixmap to use to clear the span, which should be
* the background color of the Screen, and masked to
* only draw the area that needs cleared.
*/
void clearSpan(int x, int y, const QPixmap &clearPixmap);
/**
* Actually paints the scene on the widget.
*
* @param pe The QPaintEvent given to the updating widget.
*/
void paint(QPaintEvent *pe);
};
#endif
// vim: set et ts=8 sw=4:

View file

@ -0,0 +1,59 @@
<ui version="4.0" >
<class>SettingsWidget</class>
<widget class="QWidget" name="SettingsWidget" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>220</width>
<height>45</height>
</rect>
</property>
<property name="windowTitle" >
<string>Asciiquarium Settings</string>
</property>
<layout class="QHBoxLayout" >
<item>
<widget class="QLabel" name="textLabel1" >
<property name="text" >
<string>Number of Fish:</string>
</property>
<property name="wordWrap" >
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="KIntSpinBox" name="kcfg_fishCount" >
<property name="toolTip" >
<string>Choose number of fish to show at once</string>
</property>
<property name="whatsThis" >
<string>This value controls the number of fish to show on screen at any given time.</string>
</property>
<property name="minimum" >
<number>1</number>
</property>
<property name="maximum" >
<number>50</number>
</property>
<property name="singleStep" >
<number>5</number>
</property>
<property name="value" >
<number>15</number>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KIntSpinBox</class>
<extends>QSpinBox</extends>
<header>knuminput.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View file

@ -0,0 +1,96 @@
/*
* Asciiquarium - Native KDE Screensaver based on the Asciiquarium program
* (c) Kirk Baucom <kbaucom@schizoid.com>, which you can find at
* http://www.robobunny.com/projects/asciiquarium/
*
* Ported to KDE by Maksim Orlovich <maksim@kde.org> and
* Michael Pyne <michael.pyne@kdemail.net>.
*
* Copyright (c) 2003 Kirk Baucom <kbaucom@schizoid.com>
* Copyright (c) 2005 Maksim Orlovich <maksim@kde.org>
* Copyright (c) 2005, 2008 Michael Pyne <michael.pyne@kdemail.net>
*
* 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 "sprite.h"
#include <QtCore/QRect>
Sprite::Sprite(Screen* screen, int x, int y, int z, int frameDelay):
m_screen(screen), m_currentFrame(0), m_x(x), m_y(y), m_z(z),
m_isKilled(false), m_killAfterLastFrame(false),
m_ticksSinceFrameChange(0), m_frameDelay(frameDelay)
{
}
void Sprite::addFrame(const Frame& frame)
{
m_frames.append(frame);
}
void Sprite::erase()
{
m_frames[m_currentFrame].erase(m_screen, m_x, m_y);
}
void Sprite::paint()
{
m_frames[m_currentFrame].paint(m_screen, m_x, m_y);
}
bool Sprite::timerTick()
{
++m_ticksSinceFrameChange;
if (m_ticksSinceFrameChange * m_screen->msPerTick() < m_frameDelay)
return false;
//Ring! Ring!
m_ticksSinceFrameChange = 0;
return true;
}
bool Sprite::tickUpdate()
{
if (m_frames.size() == 1)
return false;
if (!timerTick())
return false;
erase();
++m_currentFrame;
if (m_currentFrame == m_frames.size())
{
m_currentFrame = 0;
if(m_killAfterLastFrame)
{
erase();
kill();
}
}
return true;
}
QRect Sprite::geom() const
{
return QRect(m_x, m_y, m_frames[0].width(), m_frames[0].height());
}
// vim: set et ts=8 sw=4:

View file

@ -0,0 +1,209 @@
/*
* Asciiquarium - Native KDE Screensaver based on the Asciiquarium program
* (c) Kirk Baucom <kbaucom@schizoid.com>, which you can find at
* http://www.robobunny.com/projects/asciiquarium/
*
* Ported to KDE by Maksim Orlovich <maksim@kde.org> and
* Michael Pyne <michael.pyne@kdemail.net>.
*
* Copyright (c) 2003 Kirk Baucom <kbaucom@schizoid.com>
* Copyright (c) 2005 Maksim Orlovich <maksim@kde.org>
* Copyright (c) 2005, 2008 Michael Pyne <michael.pyne@kdemail.net>
*
* 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 AA_SPRITE_H
#define AA_SPRITE_H
#include <QVector>
#include "frame.h"
/**
* This class represents a on-screen character of some sort. These make up
* the building blocks of the animation.
*
* You can use multiple frames of animation, but movement is not supported in
* this class, try MovingSprite. If you use multiple frames, use
* setFrameDelay to control the interval between frames, and use
* setDieAfterLastFrame to set whether the animation should loop or cause
* the Sprite to go away.
*
* Use kill() to get rid of a Sprite, do not delete it by yourself, as Screen
* will do that as needed.
*/
class Sprite
{
protected:
Screen* m_screen; ///< The Screen that we belong to.
int m_currentFrame; ///< The current frame of animation.
int m_x; ///< Our current logical x position.
int m_y; ///< Our current logical y position.
int m_z; ///< Our current depth.
QVector<Frame> m_frames; ///< Array of animation frames.
bool m_isKilled; ///< True if we've been killed.
bool m_killAfterLastFrame; ///< True if we should auto-kill after the last frame.
int m_ticksSinceFrameChange; ///< Number of timer ticks since we last changed frame.
int m_frameDelay; ///< Number of milliseconds to show a frame for.
/**
* Increments the animation timer.
*
* @return true if time has elapsed past m_frameDelay since the last frame
* change.
*/
bool timerTick();
public:
/**
* Construct a sprite without automatically adding it to \p screen.
*
* @param screen The Screen that the sprite belongs to.
* @param x The x column position for the left edge of this sprite.
* @param y The y row position for the upper line of this sprite.
* @param z The depth of the sprite (0 is closest to screen).
* @param frameDelay Amount of milliseconds to elapse between animation
* frames.
*/
Sprite(Screen* screen, int x, int y, int z, int frameDelay = 100);
/**
* Destuctor. Does nothing at this point, present to ensure a continuous
* line of virtual destructors.
*/
virtual ~Sprite()
{
}
/**
* @return true if this sprite can be involved in a collision with another
* Sprite. The other sprite doesn't necessarily have to have this
* also set to true.
*/
virtual bool canCollide() const { return false; }
/**
* Called when a collision occurs with *any* Sprite on-screen if canCollide()
* returns true.
*
* @param sprite The Sprite that a collision happened with. It is safe to
* kill() the Sprite, move it, etc.
*/
virtual void collision (Sprite *sprite)
{
Q_UNUSED(sprite); // Base class does nothing.
}
/**
* Appends a frame of animation to the end of the current list.
*
* @param frame Frame of animation to add. It should be the same size as
* the other frames already in the list.
*/
void addFrame(const Frame& frame);
/**
* Sets the amount of time to show a frame for.
*
* @param delay The frame delay, in milliseconds of time.
*/
void setFrameDelay(int delay)
{
m_frameDelay = delay;
}
/**
* Sets whether this Sprite should automatically call kill() after the
* last frame of animation has run.
*
* @param dieAfterLast If true, this Sprite will automatically call kill()
* after its last frame has elapsed.
*/
void setDieAfterLastFrame(bool dieAfterLast)
{
m_killAfterLastFrame = dieAfterLast;
}
/**
* @return The Screen this Sprite belongs to.
*/
Screen *screen() const
{
return m_screen;
}
/**
* @return true if this Sprite is dead. If true, it will probably soon be
* deleted by its Screen.
*/
bool isKilled() const
{
return m_isKilled;
}
/**
* @return The depth of the Sprite. 0 is closest to the screen.
*/
int depth() const
{
return m_z;
}
/**
* @return The rectangular geometry of this object in the Pixel coordinate
* system.
*/
QRect geom() const;
/**
* Erases this Sprite from its Screen, using the current animation frame to
* form the clear mask. This should be called *before* any change which
* will change the on-screen display of the object, such as motion or
* animation changes.
*/
void erase();
/**
* Draws this Sprite onto the Screen.
*/
void paint();
/**
* Kills this Sprite. The parent Screen will delete this Sprite on the next
* animation cycle.
*/
virtual void kill()
{
m_isKilled = true;
}
//main animation hook. Should return true + erase if something changed
/**
* Called when the current frame expires. This function needs to perform
* any actions necessary to make sure that it is ready to be painted,
* including calling erase(). You do not need to call paint() from this
* function.
*
* @return true if the on-screen representation of this Sprite changed,
* false, otherwise.
*/
virtual bool tickUpdate();
};
#endif
// vim: set et ts=8 sw=4:

View file

@ -0,0 +1,538 @@
//-----------------------------------------------------------------------------
//
// kbanner - Basic screen saver for KDE
//
// Copyright (c) Martin R. Jones 1996
//
// layout management added 1998/04/19 by Mario Weilguni <mweilguni@kde.org>
// clock function and color cycling added 2000/01/09 by Alexander Neundorf <alexander.neundorf@rz.tu-ilmenau.de>
// 2001/03/04 Converted to use libkscreensaver by Martin R. Jones
// 2002/04/07 Added random vertical position of text,
// changed horizontal step size to reduce jerkyness,
// text will return to right margin immediately (and not be drawn half a screen width off-screen)
// Harald H.-J. Bongartz <harald@bongartz.org>
// 2003/09/06 Converted to use KDialog - Nadeem Hasan <nhasan@kde.org>
#include <stdlib.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <qcombobox.h>
#include <qcheckbox.h>
#include <qgroupbox.h>
#include <qslider.h>
#include <qlayout.h>
#include <qdatetime.h>
#include <qfontdatabase.h>
#include <qpainter.h>
#include <kapplication.h>
#include <krandomsequence.h>
#include <kglobal.h>
#include <klocale.h>
#include <kconfig.h>
#include <kmessagebox.h>
#include <kcolorbutton.h>
#include <kfontcombobox.h>
#include "banner.h"
#include "banner.moc"
#include <QDesktopWidget>
// libkscreensaver interface
class KBannerSaverInterface : public KScreenSaverInterface
{
public:
virtual KAboutData* aboutData() {
return new KAboutData( "kbanner.kss", "klock", ki18n( "KBanner" ), "2.2.0", ki18n( "KBanner" ) );
}
virtual KScreenSaver* create( WId id )
{
return new KBannerSaver( id );
}
virtual QDialog* setup()
{
return new KBannerSetup();
}
};
int main( int argc, char *argv[] )
{
KBannerSaverInterface kss;
return kScreenSaverMain( argc, argv, kss );
}
//-----------------------------------------------------------------------------
KBannerSetup::KBannerSetup( QWidget *parent )
: KDialog( parent)
, saver( 0 ), ed(0), speed( 50 )
{
setButtons(Ok|Cancel|Help);
setDefaultButton(Ok);
setCaption(i18n( "Setup Banner Screen Saver" ));
setModal(true);
setButtonText( Help, i18n( "A&bout" ) );
readSettings();
QWidget *main = new QWidget(this);
setMainWidget(main);
QLabel *label;
QVBoxLayout *tl = new QVBoxLayout( main );
QHBoxLayout *tl1 = new QHBoxLayout();
tl->addLayout(tl1);
QVBoxLayout *tl11 = new QVBoxLayout();
tl1->addLayout(tl11);
QGroupBox *group = new QGroupBox( i18n("Font"), main );
QVBoxLayout *vbox = new QVBoxLayout;
group->setLayout(vbox);
QGridLayout *gl = new QGridLayout();
vbox->addLayout(gl);
gl->setSpacing(spacingHint());
label = new QLabel( i18n("Family:"), group );
gl->addWidget(label, 1, 0);
KFontComboBox* comboFonts = new KFontComboBox( group );
comboFonts->setCurrentFont( fontFamily );
gl->addWidget(comboFonts, 1, 1);
connect( comboFonts, SIGNAL(currentFontChanged(QFont)),
SLOT(slotFamily(QFont)) );
label = new QLabel( i18n("Size:"), group );
gl->addWidget(label, 2, 0);
comboSizes = new QComboBox( group );
comboSizes->setEditable( true );
fillFontSizes();
gl->addWidget(comboSizes, 2, 1);
connect( comboSizes, SIGNAL(activated(int)), SLOT(slotSize(int)) );
connect( comboSizes, SIGNAL(editTextChanged(QString)),
SLOT(slotSizeEdit(QString)) );
QCheckBox *cb = new QCheckBox( i18n("Bold"),
group );
cb->setChecked( bold );
connect( cb, SIGNAL(toggled(bool)), SLOT(slotBold(bool)) );
gl->addWidget(cb, 3, 0);
cb = new QCheckBox( i18n("Italic"), group );
cb->setChecked( italic );
gl->addWidget(cb, 3, 1);
connect( cb, SIGNAL(toggled(bool)), SLOT(slotItalic(bool)) );
label = new QLabel( i18n("Color:"), group );
gl->addWidget(label, 4, 0);
colorPush = new KColorButton( fontColor, group );
gl->addWidget(colorPush, 4, 1);
connect( colorPush, SIGNAL(changed(QColor)),
SLOT(slotColor(QColor)) );
QCheckBox *cyclingColorCb=new QCheckBox(i18n("Cycling color"),group);
cyclingColorCb->setMinimumSize(cyclingColorCb->sizeHint());
gl->addWidget(cyclingColorCb, 5, 0,5,1);
connect(cyclingColorCb,SIGNAL(toggled(bool)),this,SLOT(slotCyclingColor(bool)));
cyclingColorCb->setChecked(cyclingColor);
preview = new QWidget( main );
preview->setFixedSize( 220, 170 );
{
QPalette palette;
palette.setColor( preview->backgroundRole(), Qt::black );
preview->setPalette( palette );
preview->setAutoFillBackground(true);
}
preview->show(); // otherwise saver does not get correct size
saver = new KBannerSaver( preview->winId() );
tl1->addWidget(preview);
tl11->addWidget(group);
label = new QLabel( i18n("Speed:"), main );
tl11->addStretch(1);
tl11->addWidget(label);
QSlider *sb = new QSlider( Qt::Horizontal, main );
sb->setMinimum(0);
sb->setMaximum(100);
sb->setPageStep(10);
sb->setValue(speed);
sb->setMinimumWidth( 180);
sb->setFixedHeight(20);
sb->setTickPosition(QSlider::TicksBelow);
sb->setTickInterval(10);
tl11->addWidget(sb);
connect( sb, SIGNAL(valueChanged(int)), SLOT(slotSpeed(int)) );
QHBoxLayout *tl2 = new QHBoxLayout;
tl->addLayout(tl2);
label = new QLabel( i18n("Message:"), main );
tl2->addWidget(label);
ed = new QLineEdit( main );
tl2->addWidget(ed);
ed->setText( message );
connect( ed, SIGNAL(textChanged(QString)),
SLOT(slotMessage(QString)) );
QCheckBox *timeCb=new QCheckBox( i18n("Show current time"), main);
timeCb->setFixedSize(timeCb->sizeHint());
tl->addWidget(timeCb,0,Qt::AlignLeft);
connect(timeCb,SIGNAL(toggled(bool)),this,SLOT(slotTimeToggled(bool)));
timeCb->setChecked(showTime);
connect(this,SIGNAL(okClicked()),this,SLOT(slotOk()));
connect(this,SIGNAL(helpClicked()),this,SLOT(slotHelp()));
tl->addStretch();
}
// read settings from config file
void KBannerSetup::readSettings()
{
KConfigGroup config(KGlobal::config(), "Settings");
speed=config.readEntry("Speed",50);
/* if ( speed > 100 )
speed = 100;
else if ( speed < 50 )
speed = 50;*/
message=config.readEntry("Message","KDE");
showTime=config.readEntry("ShowTime",false);
fontFamily=config.readEntry("FontFamily",(QApplication::font()).family());
fontSize=config.readEntry("FontSize",48);
fontColor.setNamedColor(config.readEntry("FontColor","red"));
cyclingColor=config.readEntry("CyclingColor",false);
bold=config.readEntry("FontBold",false);
italic=config.readEntry("FontItalic",false);
}
void KBannerSetup::fillFontSizes()
{
bool block = comboSizes->signalsBlocked();
comboSizes->blockSignals( true );
comboSizes->clear();
int i = 0;
sizes = QFontDatabase().pointSizes( fontFamily );
sizes << 96 << 128 << 156 << 0;
int current = 0;
while ( sizes[i] )
{
QString num;
num.setNum( sizes[i] );
comboSizes->insertItem( i, num );
if ( fontSize == sizes[i] ) // fontsize equals one of the defined ones
{
current = i;
comboSizes->setCurrentIndex( current );
slotSize( current );
}
i++;
}
if ( current == 0 ) // fontsize seems to be entered by hand
{
QString fsize;
fsize.setNum( fontSize );
comboSizes->setEditText(fsize);
slotSizeEdit( fsize );
}
comboSizes->blockSignals( block );
}
void KBannerSetup::slotFamily( const QFont& f )
{
fontFamily = f.family();
fillFontSizes(); // different font, different sizes
if ( saver )
saver->setFont( fontFamily, fontSize, fontColor, bold, italic );
}
void KBannerSetup::slotSize( int indx )
{
fontSize = sizes[indx];
if ( saver )
saver->setFont( fontFamily, fontSize, fontColor, bold, italic );
}
void KBannerSetup::slotSizeEdit( const QString& fs )
{
bool ok;
fontSize = fs.toInt( &ok, 10 );
if ( ok )
if ( saver )
saver->setFont( fontFamily, fontSize, fontColor, bold, italic );
}
void KBannerSetup::slotColor( const QColor &col )
{
fontColor = col;
if ( saver )
saver->setColor(fontColor);
}
void KBannerSetup::slotCyclingColor(bool on)
{
colorPush->setEnabled(!on);
cyclingColor=on;
if ( saver )
{
saver->setCyclingColor( on );
if ( !on )
saver->setColor( fontColor );
}
}
void KBannerSetup::slotBold( bool state )
{
bold = state;
if ( saver )
saver->setFont( fontFamily, fontSize, fontColor, bold, italic );
}
void KBannerSetup::slotItalic( bool state )
{
italic = state;
if ( saver )
saver->setFont( fontFamily, fontSize, fontColor, bold, italic );
}
void KBannerSetup::slotSpeed( int num )
{
speed = num;
if ( saver )
saver->setSpeed( speed );
}
void KBannerSetup::slotMessage( const QString &msg )
{
message = msg;
if ( saver )
saver->setMessage( message );
}
void KBannerSetup::slotTimeToggled( bool on )
{
ed->setEnabled(!on);
showTime=on;
if (saver)
{
if (showTime)
saver->setTimeDisplay();
else
{
message=ed->text();
saver->setMessage(message);
}
}
}
// Ok pressed - save settings and exit
void KBannerSetup::slotOk()
{
KConfigGroup config(KGlobal::config(), "Settings");
config.writeEntry( "Speed", speed );
config.writeEntry( "Message", message );
config.writeEntry( "ShowTime", showTime );
config.writeEntry( "FontFamily", fontFamily );
QString fsize;
if (fontSize == 0) // an non-number was entered in the font size combo
{
fontSize = 48;
}
fsize.setNum( fontSize );
config.writeEntry( "FontSize", fsize );
QString colName;
colName.sprintf( "#%02x%02x%02x", fontColor.red(), fontColor.green(),
fontColor.blue() );
config.writeEntry( "FontColor", colName );
config.writeEntry( "CyclingColor", cyclingColor );
config.writeEntry( "FontBold", bold );
config.writeEntry( "FontItalic", italic );
config.sync();
accept();
}
void KBannerSetup::slotHelp()
{
KMessageBox::about(this,
i18n("Banner Version 2.2.1\n\nWritten by Martin R. Jones 1996\nmjones@kde.org\nExtended by Alexander Neundorf 2000\nalexander.neundorf@rz.tu-ilmenau.de\n"));
}
//-----------------------------------------------------------------------------
KBannerSaver::KBannerSaver( WId id ) : KScreenSaver( id )
{
krnd = new KRandomSequence();
readSettings();
initialize();
timer.start( speed );
connect( &timer, SIGNAL(timeout()), SLOT(update()) );
setAttribute( Qt::WA_NoSystemBackground );
show();
}
KBannerSaver::~KBannerSaver()
{
timer.stop();
delete krnd;
}
void KBannerSaver::setSpeed( int spd )
{
timer.stop();
int inv = 100 - spd;
speed = 1 + ((inv * inv) / 100);
timer.start( speed );
}
void KBannerSaver::setFont( const QString& family, int size, const QColor &color,
bool b, bool i )
{
fontFamily = family;
fontSize = size;
fontColor = color;
bold = b;
italic = i;
initialize();
}
void KBannerSaver::setColor(QColor &color)
{
fontColor = color;
cyclingColor = false;
needUpdate = true;
}
void KBannerSaver::setCyclingColor( bool on )
{
cyclingColor = on;
needUpdate = true;
}
void KBannerSaver::setMessage( const QString &msg )
{
showTime = false;
message = msg;
pixmapSize = QSize();
cleared = false;
}
void KBannerSaver::setTimeDisplay()
{
showTime = true;
pixmapSize = QSize();
cleared = false;
}
// read settings from config file
void KBannerSaver::readSettings()
{
KConfigGroup config(KGlobal::config(), "Settings");
setSpeed( config.readEntry("Speed",50) );
message=config.readEntry("Message","KDE");
showTime=config.readEntry("ShowTime",false);
fontFamily=config.readEntry("FontFamily",(QApplication::font()).family());
fontSize=config.readEntry("FontSize",48);
fontColor.setNamedColor(config.readEntry("FontColor","red"));
cyclingColor=config.readEntry("CyclingColor",false);
bold=config.readEntry("FontBold",false);
italic=config.readEntry("FontItalic",false);
if ( cyclingColor )
{
currentHue=0;
fontColor.setHsv(0,SATURATION,VALUE);
}
}
// initialize font
void KBannerSaver::initialize()
{
fsize = fontSize * height() / QApplication::desktop()->height();
font = QFont( fontFamily, fsize, bold ? QFont::Bold : QFont::Normal, italic );
pixmapSize = QSize();
cleared = false;
xpos = width();
ypos = fsize + (int) ((double)(height() - 3 * fsize) * krnd->getDouble());
step = 2 * width() / QApplication::desktop()->width(); // 6 -> 2 -hhjb-
if ( step == 0 )
step = 1;
}
// erase old text and draw in new position
void KBannerSaver::paintEvent(QPaintEvent *event)
{
Q_UNUSED( event )
if (cyclingColor)
{
int hueStep = speed/10;
currentHue=(currentHue+hueStep)%360;
fontColor.setHsv(currentHue,SATURATION,VALUE);
}
if (showTime)
{
QString new_message = KGlobal::locale()->formatTime(QTime::currentTime(), true);
if( new_message != message )
needUpdate = true;
message = new_message;
}
if ( !pixmapSize.isValid() || cyclingColor || needUpdate )
{
QRect rect = QFontMetrics( font ).boundingRect( message );
rect.setWidth( rect.width() + step );
if ( rect.width() > pixmapSize.width() )
pixmapSize.setWidth( rect.width() );
if ( rect.height() > pixmapSize.height() )
pixmapSize.setHeight( rect.height() );
pixmap = QPixmap( pixmapSize );
pixmap.fill( Qt::black );
QPainter p( &pixmap );
p.setFont( font );
p.setPen( fontColor );
p.drawText( -rect.x(), -rect.y(), message );
needUpdate = false;
}
xpos -= step;
QPainter p( this );
if (!cleared) {
cleared = true;
p.fillRect(rect(), Qt::black);
}
if ( xpos < -pixmapSize.width() ) {
p.fillRect( xpos + step, ypos, pixmapSize.width(), pixmapSize.height(), Qt::black );
xpos = width();
ypos = fsize + (int) ((double)(height() - 3 * fsize) * krnd->getDouble());
}
p.drawPixmap( xpos, ypos, pixmap );
}

View file

@ -0,0 +1,110 @@
//-----------------------------------------------------------------------------
//
// kbanner - Basic screen saver for KDE
//
// Copyright (c) Martin R. Jones 1996
//
#ifndef BANNER_H
#define BANNER_H
#include <qtimer.h>
#include <kscreensaver.h>
#include <kdialog.h>
#define SATURATION 150
#define VALUE 255
class QLineEdit;
class KColorButton;
class KRandomSequence;
class KBannerSaver : public KScreenSaver
{
Q_OBJECT
public:
KBannerSaver( WId id );
virtual ~KBannerSaver();
void setSpeed( int spd );
void setFont( const QString &family, int size, const QColor &color,
bool b, bool i );
void setMessage( const QString &msg );
void setTimeDisplay();
void setCyclingColor(bool on);
void setColor( QColor &color);
private:
void readSettings();
void initialize();
protected:
void paintEvent(QPaintEvent *event);
QFont font;
QTimer timer;
QString fontFamily;
int fontSize;
bool bold;
bool italic;
QColor fontColor;
bool cyclingColor;
int currentHue;
bool cleared;
bool needUpdate;
QString message;
bool showTime;
int xpos, ypos, step, fsize;
KRandomSequence *krnd;
int speed;
QPixmap pixmap;
QSize pixmapSize;
};
class KBannerSetup : public KDialog
{
Q_OBJECT
public:
KBannerSetup( QWidget *parent = NULL );
protected:
void readSettings();
void fillFontSizes();
private slots:
void slotFamily( const QFont & );
void slotSize( int );
void slotSizeEdit(const QString &);
void slotColor(const QColor &);
void slotCyclingColor(bool on);
void slotBold( bool );
void slotItalic( bool );
void slotSpeed( int );
void slotMessage( const QString & );
void slotOk();
void slotHelp();
void slotTimeToggled(bool on);
private:
QWidget *preview;
KColorButton *colorPush;
KBannerSaver *saver;
QLineEdit *ed;
QComboBox* comboSizes;
QString message;
bool showTime;
QString fontFamily;
int fontSize;
QColor fontColor;
bool cyclingColor;
bool bold;
bool italic;
int speed;
QList<int> sizes;
};
#endif

View file

@ -0,0 +1,537 @@
//-----------------------------------------------------------------------------
//
// kblob - Basic screen saver for KDE
//
// Copyright (c) Tiaan Wessels, 1997
//
// To add new alg :
// - add blob_alg enum in blob.h before ALG_LAST
// - choose 2 letter prefix for alg and add vars needed to private vars
// in KBlobSaver in blob.h
// - add xxSetup and xxNextFrame method definitions in blob.h
// - implement methods in this file. xxSetup to init vars mentioned
// in step 2. xxNextFrame to advance blob painter ( calc tx,ty and
// use box() method to position painter
// - add descriptive string in alg_str array in this file before "Random"
// - add to Algs array in KBlobSaver constructor in this file
// - test by setup saver and choosing alg from list
#include <stdlib.h>
#include <time.h>
#include <limits.h>
#include <math.h>
#include <qcolor.h>
#include <qcolormap.h>
#include <qlabel.h>
#include <QListWidget>
#include <qlayout.h>
#include <qpainter.h>
#include <qpixmap.h>
#include <qimage.h>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <kapplication.h>
#include <kconfig.h>
#include <kmessagebox.h>
#include <knuminput.h>
#include <klocale.h>
#include <kglobal.h>
#include <krandomsequence.h>
#include "blob.moc"
#include "blob.h"
#define SMALLRAND(a) (int)(rnd->getLong(a)+1)
// libkscreensaver interface
class KBlobSaverInterface : public KScreenSaverInterface
{
public:
virtual KAboutData* aboutData() {
return new KAboutData( "kblob.kss", "klock", ki18n( "KBlob" ), "2.2.0", ki18n( "KBlob" ) );
}
virtual KScreenSaver* create( WId id )
{
return new KBlobSaver( id );
}
virtual QDialog* setup()
{
return new KBlobSetup();
}
};
int main( int argc, char *argv[] )
{
KBlobSaverInterface kss;
return kScreenSaverMain( argc, argv, kss );
}
static KRandomSequence *rnd = 0;
QString alg_str[5];
void initAlg()
{
alg_str[0] = i18n("Random Linear");
alg_str[1] = i18n("Horizontal Sine");
alg_str[2] = i18n("Circular Bounce");
alg_str[3] = i18n("Polar Coordinates");
alg_str[4] = i18n("Random");
}
//-----------------------------------------------------------------------------
// the blob screensaver's code
KBlobSaver::KBlobSaver ( WId id)
: KScreenSaver( id )
{
setAttribute( Qt::WA_OpaquePaintEvent, true );
{
QPalette palette;
palette.setColor( backgroundRole(), Qt::black );
setPalette( palette );
setAutoFillBackground(true);
}
rnd = new KRandomSequence();
initAlg();
QColor color;
float ramp = (256.0-64.0)/(float)RAMP;
// if 8-bit, create lookup table for color ramping further down
if (QPixmap::defaultDepth() == 8)
{
QColormap cmap = QColormap::instance();
memset(lookup, 0, 256*sizeof(uint));
int i;
for (i = 0; i < RAMP; i++)
{
color.setRgb(64+(int)(ramp*(float)i), 0, 0);
colors[i] = cmap.pixel(color);
}
memset(lookup, cmap.pixel(Qt::black), sizeof(uint)*256);
for (i = 0; i < RAMP-1; i++)
lookup[colors[i]] = colors[i+1];
lookup[cmap.pixel(Qt::black)] = lookup[colors[RAMP-1]] = colors[0];
}
else
{
// make special provision for preview mode
if (height() < 400)
{
if (QPixmap::defaultDepth() > 8 )
setColorInc(7);
else
setColorInc(4);
}
else
{
if (QPixmap::defaultDepth() > 8 )
setColorInc(3);
else
setColorInc(2);
}
}
// the dimensions of the blob painter
dim = height()/70+1;
// record starting time to know when to change frames
start = time(NULL);
// init some parameters used by all algorithms
xhalf = width()/2;
yhalf = height()/2;
// means a new algorithm should be set at entrance of timer
newalg = newalgp = 1;
// init algorithm space
Algs[0].Name = alg_str[0];
Algs[0].Init = &KBlobSaver::lnSetup;
Algs[0].NextFrame = &KBlobSaver::lnNextFrame;
Algs[1].Name = alg_str[1];
Algs[1].Init = &KBlobSaver::hsSetup;
Algs[1].NextFrame = &KBlobSaver::hsNextFrame;
Algs[2].Name = alg_str[2];
Algs[2].Init = &KBlobSaver::cbSetup;
Algs[2].NextFrame = &KBlobSaver::cbNextFrame;
Algs[3].Name = alg_str[3];
Algs[3].Init = &KBlobSaver::pcSetup;
Algs[3].NextFrame = &KBlobSaver::pcNextFrame;
// get setup from kde registry
readSettings();
// start timer which will update blob painter
timer.start(SPEED);
connect(&timer, SIGNAL(timeout()), SLOT(update()));
show();
}
KBlobSaver::~KBlobSaver()
{
timer.stop();
delete rnd; rnd = 0;
}
void KBlobSaver::setAlgorithm(int a )
{
newalg = newalgp = ((a == ALG_RANDOM) ? 1 : 2);
alg = a;
}
void KBlobSaver::lnSetup()
{
// initialize the blob movement dictators with random vals
// incrementals on axis
ln_xinc = SMALLRAND(3);
ln_yinc = SMALLRAND(2);
// start position
tx = SMALLRAND(width()-dim-ln_xinc*2);
ty = SMALLRAND(height()-dim-ln_yinc*2);
}
void KBlobSaver::hsSetup()
{
hs_per = SMALLRAND(7);
hs_radians = 0.0;
hs_rinc = (hs_per*M_PI)/(hs_per*90*4);
hs_flip = 1.0;
}
void KBlobSaver::cbSetup()
{
cb_radians = 0.0;
cb_rinc = (2.0*M_PI)/360.0;
cb_sradians = 0.0;
cb_deviate = SMALLRAND(height()/20)+(height()/15);
cb_radius = height()/2-cb_deviate*2-2*dim;
cb_devradinc = (rnd->getDouble()*10.0*2.0*M_PI)/360.0;
}
void KBlobSaver::pcSetup()
{
pc_angle = 0.0;
pc_radius = 0.0;
pc_inc = (2.0*M_PI)/720.0;
pc_crot = 0.0;
pc_div = SMALLRAND(4)-1;
}
// render next frame ( or change algorithms )
void KBlobSaver::paintEvent(QPaintEvent *)
{
time_t now = time(NULL);
// should algorithm be changed
if (now-start > showlen)
newalg = newalgp;
// set new algorithm
if (newalg)
{
QPainter p(this);
p.fillRect(rect(), p.background());
if (newalg == 1)
alg = SMALLRAND(ALG_LAST)-1;
(this->*Algs[alg].Init)();
newalg = 0;
start = time(NULL);
}
// gen next fram for current algorithm
(this->*Algs[alg].NextFrame)();
}
void KBlobSaver::lnNextFrame()
{
int dir;
// depending on the algorithm to use, move the blob painter to
// a new location
// check for wall hit to change direction
if (tx+dim+ln_xinc > (int)width()-1 || tx+ln_xinc < 0)
{
if (ln_xinc > 0)
dir = -1;
else
dir = 1;
ln_xinc = SMALLRAND(3)*dir;
}
if (ty+dim+ln_yinc > (int)height()-1 || ty+ln_yinc < 0)
{
if (ln_yinc > 0)
dir = -1;
else
dir = 1;
ln_yinc = SMALLRAND(2)*dir;
}
// move box to new position
tx += ln_xinc;
ty += ln_yinc;
// draw new box
box(tx, ty);
}
void KBlobSaver::hsNextFrame()
{
static int xlen = width()-(4*dim);
static int ylen = height()-(4*dim);
// calc x as offset on angle line and y as vertical offset
// on interval -1..1 sine of angle
tx = (int)((hs_radians/(hs_per*M_PI))*(float)xlen);
ty = (int)((float)(ylen/4)*(hs_flip*sin(hs_radians)))+yhalf;
// draw new box
box(tx, ty);
// set new radians
hs_radians += hs_rinc;
if (hs_radians > hs_per*M_PI)
{
hs_rinc *= -1.0;
hs_radians += hs_rinc;
hs_flip *= -1.0;
}
else if (hs_radians < 0.0)
hsSetup();
}
void KBlobSaver::cbNextFrame()
{
int deviate;
// calculate deviation of circle main radius
deviate = (int)(sin(cb_sradians)*cb_deviate);
// calculate topleft of box as a circle with a sine perturbed radius
tx = (int)(cos(cb_radians)*(cb_radius+deviate))+xhalf;
ty = (int)(sin(cb_radians)*(cb_radius+deviate))+yhalf;
// draw the box
box(tx, ty);
// increase greater circle render angle
cb_radians += cb_rinc;
if (cb_radians > 2.0*M_PI)
cb_radians -= 2.0*M_PI;
// increase radius deviation offset on sine wave
cb_sradians += cb_devradinc;
}
void KBlobSaver::pcNextFrame()
{
static float scale = (float)height()/3.0 - 4.0*dim;
// simple polar coordinate equation
if (pc_div < 1.0)
pc_radius = cos(2.0*pc_angle);
else
pc_radius = 1.0/pc_div + cos(2.0*pc_angle);
tx = (int)(scale*pc_radius*cos(pc_angle+pc_crot))+xhalf;
ty = (int)(scale*pc_radius*sin(pc_angle+pc_crot))+yhalf;
// advance blob painter
box(tx, ty);
// new movement parameters
pc_angle += pc_inc;
if (pc_angle > 2.0*M_PI)
{
pc_angle -= 2.0*M_PI;
pc_crot += M_PI/45.0;
}
}
void KBlobSaver::box ( int x, int y )
{
// for bad behaving algorithms that wants to cause an X trap
// confine to the valid region before using potentially fatal XGetImage
if ((x+dim) >= width())
x = width()-dim-1;
else if (x < 0)
x = 0;
if ((y+dim) > height())
y = height()-dim-1;
else if (y < 0)
y = 0;
// get the box region from the display to upgrade
QImage img = QPixmap::grabWindow(winId(), x, y, dim, dim).toImage();
// depending on the depth of the display, use either lookup table for
// next rgb val ( 8-bit ) or ramp the color directly for other displays
if ( img.depth() == 8)
{
// manipulate image by upgrading each pixel with 1 using a lookup
// table as the color allocation could have resulted in a spread out
// configuration of the color ramp
for (int j = 0; j < img.height(); j++)
{
for (int i = 0; i < img.width(); i++)
{
img.scanLine(j)[i] = lookup[img.scanLine(j)[i]];
}
}
}
else
{
for (int j = 0; j < img.height(); j++)
{
for (int i = 0; i < img.width(); i++)
{
QRgb p = img.pixel( i, j );
p += (colorInc<<18);
img.setPixel( i, j, p );
}
}
}
// put the image back onto the screen
QPainter p(this);
p.drawImage( x, y, img );
}
void KBlobSaver::readSettings()
{
KConfigGroup config(KGlobal::config(), "Settings");
// number of seconds to spend on a frame
showlen = config.readEntry("Showtime", 3*60);
// algorithm to use. if not set then use random
alg = config.readEntry("Algorithm", int(ALG_RANDOM));
if (alg == ALG_RANDOM)
newalg = 1;
else
newalg = 2;
newalgp = newalg;
}
//-----------------------------------------------------------------------------
// dialog to setup screen saver parameters
//
KBlobSetup::KBlobSetup(QWidget *parent)
: KDialog( parent)
{
setCaption(i18n( "Setup Blob Screen Saver" ));
setButtons(Ok|Cancel|Help);
setDefaultButton(Ok);
setModal(true);
initAlg();
// get saver configuration from kde registry
readSettings();
setButtonText( Help, i18n( "A&bout" ) );
QWidget *main = new QWidget(this);
setMainWidget(main);
QHBoxLayout *tl = new QHBoxLayout( main );
//tl->setContentsMargins(0, 0, 0, 0);
tl->setSpacing(spacingHint());
QVBoxLayout *vbox = new QVBoxLayout;
tl->addLayout(vbox);
// seconds to generate on a frame
QLabel *label = new QLabel(i18n("Frame duration:"), main);
stime = new KIntNumInput( showtime, main );
stime->setSuffix( i18n( " sec" ) );
vbox->addWidget(label);
vbox->addWidget(stime);
// available algorithms
label = new QLabel(i18n("Algorithm:"), main);
algs = new QListWidget(main);
algs->setMinimumSize(150, 105);
for (int i = 0; i <= ALG_RANDOM; i++)
algs->addItem(alg_str[i]);
algs->setCurrentRow(alg);
vbox->addWidget(label);
vbox->addWidget(algs);
// preview window
QWidget *preview = new QWidget( main );
preview->setFixedSize(220, 170);
{
QPalette palette;
palette.setColor( preview->backgroundRole(), Qt::black );
preview->setPalette( palette );
}
preview->show();
tl->addWidget(preview);
saver = new KBlobSaver(preview->winId());
saver->setDimension(3);
if (QPixmap::defaultDepth() > 8)
saver->setColorInc(7);
else
saver->setColorInc(4);
tl->addStretch();
// so selecting an algorithm will start previewing that alg
connect(algs, SIGNAL(itemChanged(QListWidgetItem*)), this,
SLOT(setAlgorithm(QListWidgetItem*)));
connect(this,SIGNAL(okClicked()),this,SLOT(slotOk()));
connect(this,SIGNAL(helpClicked()),this, SLOT(slotHelp()));
}
void KBlobSetup::setAlgorithm(QListWidgetItem* item)
{
if(!item)
return;
int pos = algs->currentRow();
saver->setAlgorithm(pos);
}
void KBlobSetup::readSettings()
{
KConfigGroup config(KGlobal::config(), "Settings");
// number of seconds to spend on a frame
showtime = config.readEntry("Showtime", 3*60);
// algorithm to use. if not set then use random
alg = config.readEntry("Algorithm", (int)ALG_LAST);
}
// Ok pressed - save settings and exit
void KBlobSetup::slotOk()
{
KConfigGroup config( KGlobal::config(), "Settings");
config.writeEntry("Showtime", stime->value());
config.writeEntry("Algorithm", algs->currentRow());
config.sync();
accept();
}
void KBlobSetup::slotHelp()
{
KMessageBox::about(this,
i18n("Blobsaver Version 0.1\n\nWritten by Tiaan Wessels 1997\ntiaan@netsys.co.za"));
if (saver)
setAlgorithm(algs->currentItem());
}

View file

@ -0,0 +1,117 @@
//-----------------------------------------------------------------------------
//
// kblob - Basic screen saver for KDE
//
// Copyright (c) Tiaan Wessels, 1997
//
#ifndef BLOB_H
#define BLOB_H
#include <qtimer.h>
#include <kdialog.h>
#include <kscreensaver.h>
class QListWidgetItem;
#define RAMP 64
#define SPEED 10
enum blob_alg {
ALG_LINEAR,
ALG_HSINE,
ALG_CIRB,
ALG_POLARC,
ALG_LAST,
ALG_RANDOM = ALG_LAST };
class KBlobSaver : public KScreenSaver
{
Q_OBJECT
public:
KBlobSaver( WId id );
virtual ~KBlobSaver();
void setDimension(int d)
{ dim = d; }
void setShowlen(time_t s)
{ showlen = s; }
void setColorInc(int c)
{ colorInc = c; }
public slots:
void setAlgorithm(int pos);
public:
typedef void (KBlobSaver::*AlgFunc)();
struct KBSAlg
{
QString Name;
AlgFunc Init;
AlgFunc NextFrame;
};
private:
QTimer timer;
uint colors[RAMP];
uint lookup[256];
int colorInc;
int tx, ty;
int dim;
int xhalf, yhalf;
int alg, newalg, newalgp;
time_t showlen, start;
KBSAlg Algs[ALG_LAST];
int ln_xinc, ln_yinc;
float hs_radians, hs_rinc, hs_flip, hs_per;
float cb_radians, cb_rinc, cb_sradians, cb_radius, cb_devradinc;
float cb_deviate;
float pc_angle, pc_radius, pc_inc, pc_crot, pc_div;
void lnSetup();
void hsSetup();
void cbSetup();
void pcSetup();
void lnNextFrame();
void hsNextFrame();
void cbNextFrame();
void pcNextFrame();
void box(int, int);
void readSettings();
protected:
void paintEvent(QPaintEvent *event);
};
class QListWidget;
class KIntNumInput;
class KBlobSetup : public KDialog
{
Q_OBJECT
int showtime;
int alg;
QListWidget *algs;
KIntNumInput *stime;
public:
KBlobSetup( QWidget *parent = NULL );
protected:
void readSettings();
private slots:
void slotOk();
void slotHelp();
void setAlgorithm(QListWidgetItem* item);
private:
KBlobSaver *saver;
};
#endif

View file

@ -0,0 +1,5 @@
if(OPENGL_FOUND AND OPENGL_GLU_FOUND)
install( FILES kfs_particle.png kfs_particle_flare.png kfs_particle_diastar.png kfs_kde.png kfs_tux.png kfs_letters1.png kfs_letters2.png kfs_letters.desc kfs_explode.ogg kfs_debris.ogg DESTINATION ${DATA_INSTALL_DIR}/kfiresaver )
endif(OPENGL_FOUND AND OPENGL_GLU_FOUND)

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

View file

@ -0,0 +1,84 @@
#first map and its coordinates
#note that capitals are used for lowercase also
"kfs_letters1.png"
A 0 0 48 63
a 0 0 48 63
B 48 0 87 63
b 48 0 87 63
C 87 0 132 63
c 87 0 132 63
D 132 0 178 63
d 132 0 178 63
E 179 0 222 63
e 179 0 222 63
F 0 64 40 127
f 0 64 40 127
G 41 64 89 127
g 41 64 89 127
H 89 64 142 127
h 89 64 142 127
I 142 64 180 127
i 142 64 180 127
J 180 64 227 127
j 180 64 227 127
K 0 128 40 191
k 0 128 40 191
L 41 128 80 191
l 41 128 80 191
M 80 128 142 191
m 80 128 142 191
N 142 128 196 191
n 142 128 196 191
O 196 128 252 191
o 196 128 252 191
P 0 192 36 255
p 0 192 36 255
Q 36 192 97 255
q 36 192 97 255
R 97 192 142 255
r 97 192 142 255
S 142 192 189 255
s 142 192 189 255
T 189 192 244 255
t 189 192 244 255
"kfs_letters2.png"
U 0 0 50 63
u 0 0 50 63
V 50 0 97 63
v 50 0 97 63
W 97 0 169 63
w 97 0 169 63
X 169 0 220 63
x 169 0 220 63
, 220 0 239 63
. 239 0 254 63
Y 0 64 48 127
y 0 64 48 127
Z 48 64 99 127
z 48 64 99 127
! 99 64 119 127
? 119 64 157 127
- 157 64 188 127
: 188 64 205 127
; 205 64 226 127
0 0 128 45 191
1 45 128 75 191
2 75 128 118 191
3 118 128 158 191
4 158 128 203 191
5 203 128 245 191
6 0 192 41 255
7 41 192 86 255
8 86 192 127 255
9 127 192 169 255

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 598 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 495 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4 KiB

View file

@ -0,0 +1,106 @@
2004-06-29 Enrico Ros <eros.kde@email.it>
* general : added support for 'per particle' texture with
smart binding. added 2 textures (explosion light / toxxic)
* firesaverparticle : finished TurningParticle class. moved
some code from the header to the cpp.
* firesaver : added 'Toxic spirals' fireworks, disabled
supernova in .ui since after 3.3. fixed monochrome<->monotype
bug.
* firesaverwriter : bugfix on word's color (blinking on start).
2004-05-30 Enrico Ros <eros.kde@email.it>
* this file : renamed Changelog to firesaver.ChangeLog
* general : moved / renamed files and chaged stuff to get ready
to be imported into kdeartwork.
* general : all images are .png, all sounds are .ogg.
2004-02-07 Enrico Ros <eros.kde@email.it>
* firesaver.cpp : implemented trail and alpha on explosions.
* firesaver : damn dirty bug! reordered projection lines. Looks
way cooler now. trimmed defaults.
* firesaversetup : config dialog redone from scratch. Now it is
more usable and ready for translation into different languages.
Also added many new features.
* firesaver : adapted to setup dialog changes (also embeds the
setup widget into a KDialog). Implemented some new features
added in the setup dialog.
2004-02-06 Enrico Ros <eros.kde@email.it>
* all : optimized logic and math.. kcachegrind rules.
* firesaverparticle : inheritance test on particle class.
Implemented a "funny phisics" on the TurningParticle class. This
will lead to strange fireworks (spirals, fountains... )
2004-01-31 Enrico Ros <eros.kde@email.it>
* all : leak checked and fixed uninitialized values. optimized
the code for less cpu consumption (reduced 7% over the 19% of
internal code cpu consumption (the remaining 81% of cpu time is
spent into GL libraries!!..) seems there's a limit to the code
optimization!).
* firesaver : added KDE icons as exploding elements and checked
the explode logo routine.
* fw_letters* : added support for overlay writings. cleaned api.
* firesaver.cpp/.h : implemented texture loader. some fixes and
a major speedup. again more changes to the graphical pipeline.
2004-01-30 Enrico Ros <eros.kde@email.it>
* firesaverparticle.cpp/.h: cleaned a lot; changed the interface.
It's not completely decoupled from the 'firework' entity yet.
* fw_debris.ogg: added a second sound (used only on logo explosion
for now).
* firesaver.cpp: reworked the generation of image logos (new
default: 64x64 pixel for hi-res).
2004-01-29 Enrico Ros <eros.kde@email.it>
* firesaver.cpp: fix: screen blink. add: particle size not
dependant from screen size.
* firesaver.cpp: optimized the rendering core for particles.
Computation takes now less than half of the time than before.
Set a capacity of 20000 simultaneous particles; more will be
dropped (but a progressive 'resize' is done..)
* fw_explode.ogg: converted sound file to ogg format.
* firesaver.cpp/.h: redone the audio engine (limited by default
to 4 mixer channels).
* firesaver.cpp: use the .mp3 sound that is "auto-mixed" by the
sound system. The old Wav was played sequentially (a boom is heard
after the previous one terminates). The Ogg format has the same
problem as the wave one (plus it goes on playing many booms after
the program is exited).
2004-01-28 Enrico Ros <eros.kde@email.it>
* firesaverparticle.cpp: keep a particle independent from the
'shape' of the firework it belongs to. Added depth (level) of
explosion (normal particles reach level 1, splitters reach 2).
* name syntax: converted filenames to match the style of the ones
in kdeartwork/kscreensaver/kdesavers.
* merging: merged some file's content to lower the number of files
before initial import.

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,170 @@
// This file is part of KFireSaver3D.
// KFireSaver3D 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.
// KFireSaver3D 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 KFireSaver3D; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
// Author: Enrico Ros, based on the great work of David Sansome (kfiresaver)
// Email: asy@libero.it
#ifndef KFIRESAVER_H
#define KFIRESAVER_H
#define PERSP_MAG_FACTOR 8.0
#define NUMBER_OF_FIREPARTICLES 180
#define MSECPERIOD 17 // 1000ms / 60fps = 16.6667 ~= 17 [ms/frame]
#define FIELDWIDTH 30.0
#define FIELDW_2 (FIELDWIDTH/2.0)
#define FIELDW_4 (FIELDWIDTH/4.0)
#include <qgl.h>
#include <qlist.h>
#include <qimage.h>
#include <qstring.h>
#include <qcolor.h>
#include <arts/kplayobject.h>
#include <arts/kartsserver.h>
#include <arts/kartsdispatcher.h>
class Particle;
class Writer;
class KFireSaver : public QGLWidget
{
public:
KFireSaver( QWidget *parent=0 );
~KFireSaver();
protected:
void initializeGL();
void resizeGL( int, int );
void paintGL();
void timerEvent( class QTimerEvent * );
private:
enum enumFireworkType
{
Sphere = 0,
NoFW = 1,
Circle = 2,
BiCircle = 3,
AngelHairs = 4,
Splitter = 5,
Spirals = 6,
SuperNova = 7,
NoRender = 8
};
inline enumFireworkType pickType();
inline int pickColour();
void explodeFirework(Particle* fireWorkLeaderParticle);
void burnLogo(QImage * image);
void playSound(QString file);
bool loadTexture(QString file, unsigned int & textureID);
void freeTexture(unsigned int & textureID);
void readConfig();
//list of particles and stars
QList<Particle *>
particleList,
starList;
//stuff for 'exploding' pixmaps (kde, tux, icons..)
QList<QImage *>
imageList;
//texture stuff
unsigned int
currentTexture,
particleTexture,
starTexture,
flareTexture,
diastarTexture; // (to add) novaTexture cometTexture
//sound stuff
KArtsDispatcher artsDispatcher;
KArtsServer artsServer;
QList<KPlayObject *> playObjectList;
QString sound_explosion,
sound_debris;
//other stuff
class Writer * writer;
float unitX,
unitY;
double timeStampFrame;
bool firstGLFrame;
struct {
bool enableBottomFire, //show
enableSound,
enableNoOverhead,
enableRealtime,
enableCombos, //fireworks
enableLogos, //specials
enableReduceLogo,
enableStars,
enableStarFlickering,
enableStarGradient,
enableWritings,
enableSphereLight, //effects
enableFlash,
enableFade,
enableMegaFlares,
enableTrails;
int fireworksFrequency, //show
particleSize,
logoFrequency, //specials
starsNumber,
flashOpacity, //effects
fadeAmount,
megaFlares;
QColor
bottomFireColor;
int colorsCount,
colorsT[8],
typesCount;
enumFireworkType
typesT[9];
} parameters;
enum enumShowType {
Show = 0,
Random = 1,
Monotype = 2,
Monochrome = 3
};
struct {
enum enumShowType ShowType;
int colour,
colourSec;
enumFireworkType
type,
typeSec;
bool forceBicolour,
forceColour,
forcePower,
forceType;
float powerEnvelop;
double timeStamp,
timeGap;
} showp;
};
#endif

View file

@ -0,0 +1,273 @@
// This file is part of KFireSaver3D.
// KFireSaver3D 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.
// KFireSaver3D 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 KFireSaver3D; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
// Author: Enrico Ros, based on the great work of David Sansome (kfiresaver)
// Email: asy@libero.it
#include <math.h>
#include <stdlib.h>
#include "firesaverparticle.h"
#include "firesaver.h"
//current color scheme : red orng grn blue w m c
static const GLfloat c_red_min[7] = { 0.4, 0.9, 0, 0, 1, 0, 0 };
static const GLfloat c_red_max[7] = { 1, 1, 0, 0, 1, 1, 0 };
static const GLfloat c_green_min[7] = { 0, 0.4, 0.4, 0, 1, 0, 0 };
static const GLfloat c_green_max[7] = { 0, 0.5, 1, 0.5, 1, 0, 1 };
static const GLfloat c_blue_min[7] = { 0, 0.1, 0, 0.5, 1, 0, 0 };
static const GLfloat c_blue_max[7] = { 0, 0.2, 0, 1, 1, 1, 1 };
//default initialization (good for Leader / Fire)
Particle :: Particle( ParticleType pT )
: particleType( pT ), explosionsDepth( 0 ), texture( 0 ),
xpos( 0.0 ), ypos( 0.0 ), zpos( -9.9 ),
xspeed( 0.0 ), yspeed( 0.0 ), zspeed( 0.0 ), zacc( -9.807 ),
life( 0.0 ), startLife( 0.0 ),
pixelSize( 5.0 ), useLife( true ), flicker( 0 )
{
colour[0] = 0;
colour[1] = 0;
colour[2] = 0;
colour[3] = 1;
}
void Particle :: initializeValues (
int cs,
Particle* debrisParent,
GLfloat powermin, GLfloat powermax,
bool flickers,
GLfloat *displace )
//note: this function is called when a particle needs a set of default parameters.
// these depends on the ParticleType.
{
switch (particleType)
{
// -- FireParticle (params: [cs])
// born in a rectangle centered in { 0, 0, -9.9 }
// speed 3-6 [m/s] blue/cyan colored
// this is only done at the beginning or when a particle dies
case FireParticle:
xpos = DRAND * FIELDWIDTH - FIELDW_2;
ypos = DRAND - 2.0;
xspeed = DRAND * 4.0 - 2.0;
yspeed = DRAND * 2.0;
zspeed = DRAND * 3.0 + 3.0;
useLife = false;
pixelSize = 2.0 + DRAND * 2.0;
break;
// -- FireWorkLeaderParticle (params: none)
// they start in a rectangle at the same height but
// with different power and the same 'orange' colour
case FireWorkLeaderParticle:
xpos = DRAND * 14.0 - 7.0;
ypos = DRAND * 2.0 - 1.0;
xspeed = DRAND * 8.0 - 4.0 - (xpos / 2.0)*DRAND;
yspeed = DRAND * 8.0 - 4.0;
zspeed = DRAND * 6.5 + 18.0;
colour[0] = 0.6;
colour[1] = DRAND * 0.4;
colour[2] = 0.0;
useLife = false;
break;
// -- LogoParticle (params: none)
// they start in the middle of the screen.
// little g-force, constant life, weavy-y
case LogoParticle:
yspeed = 3*(DRAND - DRAND);
zacc = -9.807f / 5.0f;
startLife = 0.7f;
life = 1.7f;
break;
// -- StarParticle (params: none)
// spherically distributed. xpos and ypos are the
// transformed screen positions of the star.
case StarParticle:
colour[0] = DRAND * 0.2 + 0.5;
colour[1] = DRAND * 0.2 + 0.5;
colour[2] = DRAND * 0.2 + 0.5;
{bool accepted = false;
while (!accepted) {
float module = 30,
theta = DRAND * M_PI * 2.0,
u = DRAND * 2.0 - 1.0,
root = sqrt( 1 - u*u );
xpos = module * root * cos(theta);
ypos = fabs(module * root * sin(theta)) - 10.0;
zpos = fabs(module * u);
float sfactor = 256.0 / (256.0 + PERSP_MAG_FACTOR*ypos);
xpos *= sfactor;
ypos = sfactor * zpos - FIELDW_2;
pixelSize = sfactor * (2.0 + 3.0*DRAND);
accepted = xpos > -FIELDW_2 && xpos < FIELDW_2 &&
ypos > -FIELDW_2 && ypos < FIELDW_2;
}}
break;
// -- FireWorkDebrisParticle (params: cs, parent, [powerm], [powerM], [flickers], [displace])
// parameters are randomized for a 'spherical' explosion.
// power{min,max}, flickers and displace applies only for that
// kind of ParticleType.
case FireWorkDebrisParticle:
//same origin of the dead leader
xpos = debrisParent->xpos;
ypos = debrisParent->ypos;
zpos = debrisParent->zpos;
//true spherical randomization
float module = powermin + DRAND * (powermax - powermin),
theta = DRAND * M_PI * 2.0,
u = DRAND * 2.0 - 1.0,
root = sqrt( 1 - u*u );
xspeed = debrisParent->xspeed + module * root * cos(theta) * (1.0 + DRAND/3.0);
yspeed = debrisParent->yspeed + module * root * sin(theta) * (1.0 + DRAND/3.0);
zspeed = module * u * (1.0 + DRAND/3.0); //was 0.9 + DRAND/3
//if set add a displace to speed
if ( displace ) {
xspeed += displace[0];
yspeed += displace[1];
zspeed += displace[2];
}
//randomize the color choosing on current palette
colour[0] = c_red_min[cs] + (c_red_max[cs]-c_red_min[cs]) * DRAND;
colour[1] = c_green_min[cs] + (c_green_max[cs]-c_green_min[cs]) * DRAND;
colour[2] = c_blue_min[cs] + (c_blue_max[cs]-c_blue_min[cs]) * DRAND;
pixelSize = DRAND * 2.0 + 2.0;
zacc = -9.807 / (6.0 - pixelSize);
life = startLife = pixelSize / 2.0;
//if flickers is set the current visible delay is randomized
if ( flickers )
flicker = (int) ((DRAND * 2.0 - 1.0) * (float)FLICKER_FRAMES_DELAY);
break;
}
}
void Particle :: updateParameters( float dT )
//note: this procedure uses a reduced set of parameters
// x and y axis acceleration is no more used
// the only external iterations are:
// - the g force
// - a sort of air friction that limits speed in x,y and
// acceleration on z
{
xpos += xspeed * dT;
ypos += yspeed * dT;
zpos += (zspeed + zacc*dT/2) * dT;
zspeed += zacc * dT;
xspeed *= 0.998;
yspeed *= 0.998;
zspeed *= 0.999;
if (useLife)
life -= dT;
}
// BEGIN TurningParticle class
TurningParticle :: TurningParticle( ParticleType pT )
: Particle( pT ) {}
void TurningParticle :: initializeValues (
int cs,
Particle* leader,
GLfloat powermin,
GLfloat powermax,
bool /*flickers*/,
GLfloat * /*displace*/ )
{
//same origin of the parent
xpos = leader->xpos;
ypos = leader->ypos;
zpos = leader->zpos;
//velocity : true spherical randomization
float module = powermin + (powermax - powermin) * DRAND * 0.6,
theta = DRAND * M_PI * 2.0,
u = DRAND * 2.0 - 1.0,
root = sqrt( 1 - u*u );
xspeed = -module * root * cos(theta);
yspeed = -module * root * sin(theta);
zspeed = module * u;
//spin axis : in quadrature with velocity
module = (1 + DRAND) / 40;
u = DRAND * 2.0 - 1.0;
root = sqrt( 1 - u*u );
// axis to spin around
wx = module * root * cos(theta + M_PI_2);
wy = module * root * sin(theta + M_PI_2);
wz = module * u;
//randomize the color choosing on current palette
colour[0] = c_red_min[cs] + (c_red_max[cs]-c_red_min[cs]) * DRAND;
colour[1] = c_green_min[cs] + (c_green_max[cs]-c_green_min[cs]) * DRAND;
colour[2] = c_blue_min[cs] + (c_blue_max[cs]-c_blue_min[cs]) * DRAND;
pixelSize = DRAND * 2.0 + 2.0;
zacc = -9.807 / 5.0;
life = startLife = pixelSize / 2.0;
}
void TurningParticle :: updateParameters ( float dT )
{
//update position
xpos += xspeed * dT;
ypos += yspeed * dT;
zpos += zspeed * dT;
//tan vector = velocity vector (vect producted by) spin axis
float vx = yspeed * wz - zspeed * wy,
vy = zspeed * wx - xspeed * wz,
vz = xspeed * wy - yspeed * wx;
//update velocity adding a tangential component (aka infinitesimally
//rotating the vector)
xspeed += vx;
yspeed += vy;
zspeed += vz + zacc * dT;
if (useLife)
life -= dT;
}
//END TurningParticle

View file

@ -0,0 +1,105 @@
// This file is part of KFireSaver3D.
// KFireSaver3D 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.
// KFireSaver3D 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 KFireSaver3D; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
// Author: Enrico Ros, based on the great work of David Sansome (kfiresaver)
// Email: asy@libero.it
#ifndef KFIRESAVER_PARTICLE_H
#define KFIRESAVER_PARTICLE_H
#include <qgl.h>
#define FLICKER_FRAMES_DELAY 8
#define DRAND ((float)rand() / (float)RAND_MAX) /*random float between 0 and 1*/
/* -- Particle class.
* Sets initial parameters and takes care of updating physics for a single
* fireworks particle. The physics model is the Newtonian one.
*/
class Particle
{
public:
//enum definitions for type of particle
enum ParticleType
{
FireParticle,
FireWorkLeaderParticle,
FireWorkDebrisParticle,
LogoParticle,
StarParticle
};
Particle( ParticleType pT );
//public methods for initializing default parameters and update them
virtual void initializeValues (
int color_scheme = 0,
Particle* leader = 0L,
GLfloat powermin = 5.0,
GLfloat powermax = 10.0,
bool flickers = false,
GLfloat *displace = 0L );
virtual void updateParameters ( float timeGap );
//public accessible variables of the class
ParticleType particleType;
int explosionsDepth;
unsigned int texture;
GLfloat xpos, ypos, zpos,
xspeed, yspeed, zspeed,
zacc;
GLfloat colour[4],
life, startLife,
pixelSize;
bool useLife;
int flicker;
private:
Particle();
};
/* -- TurningParticle class.
* Randomize initial parameters similar to a standard 'spherical' particle
* and takes care of updating physics. The physics model is a funny 'bees'
* (vectorial-product) one.
*/
class TurningParticle : public Particle
{
public:
TurningParticle( ParticleType pT );
virtual void initializeValues (
int color_scheme = 0,
Particle* leader = 0L,
GLfloat powermin = 5.0,
GLfloat powermax = 10.0,
bool flickers = false,
GLfloat *displace = 0L );
virtual void updateParameters ( float dT );
private:
float wx, wy, wz;
TurningParticle();
};
#endif

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,400 @@
/****************************************************************************
** ui.h extension file, included from the uic-generated form implementation.
**
** If you wish to add, delete or rename functions or slots use
** Qt Designer which will update this file, preserving your code. Create an
** init() function in place of a constructor, and a destroy() function in
** place of a destructor.
*****************************************************************************/
#ifndef KFIRESAVER_SETUP_H
#define KFIRESAVER_SETUP_H
#include <qcolor.h>
#include <qtimer.h>
#include <kconfig.h>
void KFireSaverSetup::init()
{
readConfig();
fireSaverWidget = NULL;
updatePreview();
}
void KFireSaverSetup::destroy()
{
if ( fireSaverWidget )
delete fireSaverWidget;
}
void KFireSaverSetup::applyButton_clicked()
{
writeConfig();
updatePreview();
}
void KFireSaverSetup::updatePreview()
{
if ( fireSaverWidget )
delete fireSaverWidget;
if ( detachBox->isChecked() ) {
previewLabel->show();
fireSaverWidget = new KFireSaver;
fireSaverWidget->resize(640,480);
} else {
previewLabel->hide();
fireSaverWidget = new KFireSaver( previewFrame );
fireSaverWidget->move(1,1);
fireSaverWidget->resize(
previewFrame->width() - 2,
previewFrame->height() - 2 );
}
fireSaverWidget->show();
}
void KFireSaverSetup::writeConfig()
{
KConfig config("kfiresaverrc",false,false);
// show
config.setGroup( "Show" );
config.writeEntry( "ShowType", showCombo->currentItem() );
config.writeEntry( "FireworksFrequency", fireworksSlider->value() );
config.writeEntry( "ParticlesSize", particlesSlider->value() );
config.writeEntry( "enable-BottomFire", bottomfireBox->isChecked() );
config.writeEntry( "BottomFireColor", bottomfireColorButton->color() );
config.writeEntry( "enable-Sounds", soundsBox->isChecked() );
config.writeEntry( "enable-NoOverhead", overheadBox->isChecked() );
config.writeEntry( "enable-FrameSkip", frameskipBox->isChecked() );
// fireworks
config.setGroup( "Fireworks" );
if (!fire1Box->isChecked() && !fire2Box->isChecked() &&
!fire3Box->isChecked() && !fire4Box->isChecked() &&
!fire5Box->isChecked() && !fire6Box->isChecked() &&
!fire7Box->isChecked() && !fire8Box->isChecked())
fire1Box->setChecked(true);
config.writeEntry( "use-Classic", fire1Box->isChecked() );
config.writeEntry( "use-Explosion", fire2Box->isChecked() );
config.writeEntry( "use-FlameRing", fire3Box->isChecked() );
config.writeEntry( "use-FlameWorld", fire4Box->isChecked() );
config.writeEntry( "use-Fall", fire5Box->isChecked() );
config.writeEntry( "use-Splitter", fire6Box->isChecked() );
config.writeEntry( "use-Spirals", fire7Box->isChecked() );
config.writeEntry( "use-SuperNova", fire8Box->isChecked() );
if (!redBox->isChecked() && !orangeBox->isChecked() &&
!greenBox->isChecked() && !blueBox->isChecked() &&
!whiteBox->isChecked() && !purpleBox->isChecked() &&
!seagreenBox->isChecked())
whiteBox->setChecked(true);
config.writeEntry( "use-White", whiteBox->isChecked() );
config.writeEntry( "use-Blue", blueBox->isChecked() );
config.writeEntry( "use-DeepGreen", seagreenBox->isChecked() );
config.writeEntry( "use-Purple", purpleBox->isChecked() );
config.writeEntry( "use-Orange", orangeBox->isChecked() );
config.writeEntry( "use-Red", redBox->isChecked() );
config.writeEntry( "use-Green", greenBox->isChecked() );
config.writeEntry( "use-Multicolor", combosBox->isChecked() );
// specials
config.setGroup( "Specials" );
config.writeEntry( "enable-Logos", logosBox->isChecked() );
config.writeEntry( "LogosKonqui", logosKonquiBox->isChecked() );
config.writeEntry( "LogosTux", logosTuxBox->isChecked() );
config.writeEntry( "LogosKDEIcons", logosIconsBox->isChecked() );
config.writeEntry( "LogosReduceDetail", logosDetailBox->isChecked() );
config.writeEntry( "LogosFrequency", logosSlider->value() );
config.writeEntry( "enable-Stars", starsBox->isChecked() );
config.writeEntry( "StarsFlicker", starsFlickerBox->isChecked() );
config.writeEntry( "StarsGradient", starsGradientBox->isChecked() );
config.writeEntry( "StarsNumber", starsSlider->value() );
config.writeEntry( "enable-Writings", writingsBox->isChecked() );
// effects
config.setGroup( "Effects" );
config.writeEntry( "enable-SphericalLight", lightBox->isChecked() );
config.writeEntry( "enable-Flash", flashBox->isChecked() );
config.writeEntry( "FlashOpacity", flashSlider->value() );
config.writeEntry( "enable-Fade", fadeBox->isChecked() );
config.writeEntry( "FadeIntensity", fadeSlider->value() );
config.writeEntry( "enable-Flares", flaresBox->isChecked() );
config.writeEntry( "FlaresDimension", flaresSlider->value() );
config.writeEntry( "enable-Trail", trailBox->isChecked() );
}
void KFireSaverSetup::readConfig()
{
KConfig config("kfiresaverrc",true,false);
// show
config.setGroup( "Show" );
showCombo->setCurrentItem(config.readEntry( "ShowType", 1 ));
fireworksSlider->setValue(config.readEntry( "FireworksFrequency", 7 ));
particlesSlider->setValue(config.readEntry( "ParticlesSize", 0 ));
bottomfireBox->setChecked(config.readEntry( "enable-BottomFire", true ));
QColor Qt::blue = Qt::darkBlue;
bottomfireColorButton->setColor(config.readColorEntry( "BottomFireColor", &Qt::blue ));
soundsBox->setChecked(config.readEntry( "enable-Sounds", false ));
overheadBox->setChecked(config.readEntry( "enable-NoOverhead", true ));
frameskipBox->setChecked(config.readEntry( "enable-FrameSkip", true ));
// fireworks
config.setGroup( "Fireworks" );
fire1Box->setChecked(config.readEntry( "use-Classic", true ));
fire2Box->setChecked(config.readEntry( "use-Explosion", false ));
fire3Box->setChecked(config.readEntry( "use-FlameRing", false ));
fire4Box->setChecked(config.readEntry( "use-FlameWorld", false ));
fire5Box->setChecked(config.readEntry( "use-Fall", false ));
fire6Box->setChecked(config.readEntry( "use-Splitter", false ));
fire7Box->setChecked(config.readEntry( "use-Spirals", false ));
fire8Box->setChecked(config.readEntry( "use-SuperNova", false ));
whiteBox->setChecked(config.readEntry( "use-White", true ));
blueBox->setChecked(config.readEntry( "use-Blue", false ));
seagreenBox->setChecked(config.readEntry( "use-DeepGreen", true ));
purpleBox->setChecked(config.readEntry( "use-Purple", false ));
orangeBox->setChecked(config.readEntry( "use-Orange", true ));
redBox->setChecked(config.readEntry( "use-Red", false ));
greenBox->setChecked(config.readEntry( "use-Green", false ));
combosBox->setChecked(config.readEntry( "use-Multicolor", true ));
// specials
config.setGroup( "Specials" );
logosBox->setChecked(config.readEntry( "enable-Logos", true ));
logosKonquiBox->setChecked(config.readEntry( "LogosKonqui", true ));
logosTuxBox->setChecked(config.readEntry( "LogosTux", true ));
logosIconsBox->setChecked(config.readEntry( "LogosKDEIcons", true ));
logosDetailBox->setChecked(config.readEntry( "LogosReduceDetail", true ));
logosSlider->setValue(config.readEntry( "LogosFrequency", 4 ));
starsBox->setChecked(config.readEntry( "enable-Stars", true ));
starsFlickerBox->setChecked(config.readEntry( "StarsFlicker", false ));
starsGradientBox->setChecked(config.readEntry( "StarsGradient", true ));
starsSlider->setValue(config.readEntry( "StarsNumber", 4 ));
writingsBox->setChecked(config.readEntry( "enable-Writings", true ));
// effects
config.setGroup( "Effects" );
lightBox->setChecked(config.readEntry( "enable-SphericalLight", true ));
flashBox->setChecked(config.readEntry( "enable-Flash", false ));
flashSlider->setValue(config.readEntry( "FlashOpacity", 5 ));
fadeBox->setChecked(config.readEntry( "enable-Fade", false ));
fadeSlider->setValue(config.readEntry( "FadeIntensity", 3 ));
flaresBox->setChecked(config.readEntry( "enable-Flares", true ));
flaresSlider->setValue(config.readEntry( "FlaresDimension", 5 ));
trailBox->setChecked(config.readEntry( "enable-Trail", false ));
}
void KFireSaverSetup::useButton_clicked()
{
int ci = presetCombo->currentItem();
showCombo->setCurrentItem( 0 );
particlesSlider->setValue( 0 );
overheadBox->setChecked( true );
flashBox->setChecked( false );
//flashSlider->setValue( );
//soundsBox->setChecked( );
//logosDetailBox->setChecked( );
switch (ci){
case 0: // KDE default
showCombo->setCurrentItem( 1 );
fireworksSlider->setValue( 7 );
bottomfireBox->setChecked( true );
bottomfireColorButton->setColor( Qt::darkBlue );
frameskipBox->setChecked( true );
fire1Box->setChecked( true );
fire2Box->setChecked( false );
fire3Box->setChecked( false );
fire4Box->setChecked( false );
fire5Box->setChecked( false );
fire6Box->setChecked( false );
fire7Box->setChecked( false );
fire8Box->setChecked( false );
whiteBox->setChecked( true );
blueBox->setChecked( false );
seagreenBox->setChecked( true );
purpleBox->setChecked( false );
orangeBox->setChecked( true );
redBox->setChecked( false );
greenBox->setChecked( false );
combosBox->setChecked( true );
logosBox->setChecked( true );
logosKonquiBox->setChecked( true );
logosTuxBox->setChecked( true );
logosIconsBox->setChecked( true );
logosSlider->setValue( 4 );
starsBox->setChecked( true );
starsFlickerBox->setChecked( false );
starsGradientBox->setChecked( true );
starsSlider->setValue( 4 );
writingsBox->setChecked( true );
lightBox->setChecked( true );
fadeBox->setChecked( false );
//fadeSlider->setValue( );
flaresBox->setChecked( true );
flaresSlider->setValue( 5 );
trailBox->setChecked( false );
break;
case 1: // Elegant white
fireworksSlider->setValue( 7 );
bottomfireBox->setChecked( true );
bottomfireColorButton->setColor( Qt::blue );
frameskipBox->setChecked( true );
fire1Box->setChecked( true );
fire2Box->setChecked( false );
fire3Box->setChecked( false );
fire4Box->setChecked( false );
fire5Box->setChecked( true );
fire6Box->setChecked( true );
fire7Box->setChecked( false );
fire8Box->setChecked( false );
whiteBox->setChecked( true );
blueBox->setChecked( true );
seagreenBox->setChecked( false );
purpleBox->setChecked( false );
orangeBox->setChecked( false );
redBox->setChecked( false );
greenBox->setChecked( false );
combosBox->setChecked( true );
logosBox->setChecked( true );
logosKonquiBox->setChecked( true );
logosTuxBox->setChecked( false );
logosIconsBox->setChecked( false );
logosSlider->setValue( 3 );
starsBox->setChecked( true );
starsFlickerBox->setChecked( true );
starsGradientBox->setChecked( false );
starsSlider->setValue( 4 );
writingsBox->setChecked( true );
lightBox->setChecked( true );
fadeBox->setChecked( true );
fadeSlider->setValue( 3 );
flaresBox->setChecked( true );
flaresSlider->setValue( 6 );
trailBox->setChecked( true );
break;
case 2: // Quick simple
showCombo->setCurrentItem(1);
fireworksSlider->setValue( 4 );
bottomfireBox->setChecked( false );
//bottomfireColorButton->setColor( );
frameskipBox->setChecked( false );
fire1Box->setChecked( true );
fire2Box->setChecked( true );
fire3Box->setChecked( false );
fire4Box->setChecked( false );
fire5Box->setChecked( false );
fire6Box->setChecked( false );
fire7Box->setChecked( false );
fire8Box->setChecked( false );
whiteBox->setChecked( true );
blueBox->setChecked( true );
seagreenBox->setChecked( false );
purpleBox->setChecked( false );
orangeBox->setChecked( false );
redBox->setChecked( true );
greenBox->setChecked( true );
combosBox->setChecked( false );
logosBox->setChecked( true );
logosKonquiBox->setChecked( true );
logosTuxBox->setChecked( true );
logosIconsBox->setChecked( true );
logosSlider->setValue( 2 );
starsBox->setChecked( false );
//starsFlickerBox->setChecked( );
//starsGradientBox->setChecked( );
//starsSlider->setValue( );
writingsBox->setChecked( false );
lightBox->setChecked( false );
fadeBox->setChecked( false );
//fadeSlider->setValue( );
flaresBox->setChecked( false );
//flaresSlider->setValue( );
trailBox->setChecked( false );
break;
case 3: //Enhanced reality
fireworksSlider->setValue( 8 );
bottomfireBox->setChecked( true );
bottomfireColorButton->setColor( Qt::magenta );
frameskipBox->setChecked( true );
fire1Box->setChecked( true );
fire2Box->setChecked( true );
fire3Box->setChecked( true );
fire4Box->setChecked( true );
fire5Box->setChecked( true );
fire6Box->setChecked( true );
fire7Box->setChecked( false );
fire8Box->setChecked( false );
whiteBox->setChecked( true );
blueBox->setChecked( true );
seagreenBox->setChecked( true );
purpleBox->setChecked( true );
orangeBox->setChecked( true );
redBox->setChecked( true );
greenBox->setChecked( true );
combosBox->setChecked( true );
logosBox->setChecked( true );
logosKonquiBox->setChecked( false );
logosTuxBox->setChecked( true );
logosIconsBox->setChecked( false );
logosSlider->setValue( 2 );
starsBox->setChecked( true );
starsFlickerBox->setChecked( true );
starsGradientBox->setChecked( true );
starsSlider->setValue( 5 );
writingsBox->setChecked( true );
lightBox->setChecked( false );
fadeBox->setChecked( true );
fadeSlider->setValue( 3 );
flaresBox->setChecked( false );
//flaresSlider->setValue( );
trailBox->setChecked( true );
break;
case 4: //Hypnotic illusions
fireworksSlider->setValue( 9 );
bottomfireBox->setChecked( true );
bottomfireColorButton->setColor( Qt::red );
frameskipBox->setChecked( true );
fire1Box->setChecked( true );
fire2Box->setChecked( true );
fire3Box->setChecked( true );
fire4Box->setChecked( true );
fire5Box->setChecked( true );
fire6Box->setChecked( true );
fire7Box->setChecked( false );
fire8Box->setChecked( false );
whiteBox->setChecked( true );
blueBox->setChecked( true );
seagreenBox->setChecked( true );
purpleBox->setChecked( true );
orangeBox->setChecked( true );
redBox->setChecked( true );
greenBox->setChecked( true );
combosBox->setChecked( true );
logosBox->setChecked( false );
//logosKonquiBox->setChecked( true );
//logosTuxBox->setChecked( true );
//logosIconsBox->setChecked( true );
//logosSlider->setValue( 5 );
starsBox->setChecked( true );
starsFlickerBox->setChecked( true );
starsGradientBox->setChecked( true );
starsSlider->setValue( 8 );
writingsBox->setChecked( false );
lightBox->setChecked( false );
fadeBox->setChecked( true );
fadeSlider->setValue( 7 );
flaresBox->setChecked( true );
flaresSlider->setValue( 8 );
trailBox->setChecked( false );
break;
}
//applyButton_clicked();
}
#endif

View file

@ -0,0 +1,248 @@
/***************************************************************************
* Copyright (C) 2004 by E.Ros *
* rosenric@dei.unipd.it *
* *
* 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. *
* *
***************************************************************************/
#include <math.h>
#include <stdlib.h>
#include <qimage.h>
#include <qgl.h>
#include <qfile.h>
#include <qstring.h>
#include <kdebug.h>
#include <kstandarddirs.h>
#include <kdeversion.h>
#include <klocale.h>
#include "firesaverwriter.h"
/* Word: SINGLE WORD */
Word::Word( const char * _text, QMap<char, Symbol *> * sMap, float _scale )
: width(0), scale(_scale), cX(0), cY(0), vScale(0), vX(0), vY(0),
activateTime(0.0), lifeTime(2), currentTime(0)
{
for ( ; *_text != 0 && *_text != ' '; _text++ )
{
char c = *_text;
if ( !sMap->contains(c) ) //search for a symbol in the map
continue;
Symbol * symbol = (*sMap)[c]; //get the symbol*
width += symbol->scale; //increase word's half-width
symbolList.append( symbol ); //insert it to the list
}
color[0] = 0;
color[1] = 0.8 * drand48();
color[2] = 0.2 + 0.8 * drand48();
color[3] = 1;
}
inline void Word::renderWord( double dT )
{
if ( (currentTime += dT) < activateTime )
return;
//update coloring
if ( activateTime >= 0 ) {
if ( currentTime < activateTime + 0.4 )
color[3] = (currentTime - activateTime) / 0.4;
else
color[3] = 1 - (currentTime - activateTime - 0.4) / (lifeTime - 0.4);
} else
color[3] = 1 - currentTime / lifeTime;
//word's global transforms
glPushMatrix();
glTranslatef( cX - scale * width, cY, 0 );
glScalef( scale, scale, 1 );
glColor4fv( color );
//for each symbol draw it!
Symbol * symbol = symbolList.first();
for( ; symbol; symbol = symbolList.next() )
symbol->renderSymbol();
glPopMatrix();
//physical update to position and scale
cX += vX * dT;
cY += vY * dT;
scale += scale * vScale * dT;
}
inline bool Word::isDead()
{
if ( activateTime > 0 )
return (currentTime - activateTime) >= lifeTime;
return currentTime >= lifeTime;
}
/* Writer: engine that spawns and manages words */
Writer::Writer( QString descFileName )
: numTextures(0)
{
wordList.setAutoDelete( true );
if ( !loadMap( descFileName ) )
return;
QString welcomeString = i18n("Welcome to KDE %1.%2.%3",
KDE_VERSION_MAJOR,
KDE_VERSION_MINOR,
KDE_VERSION_RELEASE);
spawnWords(welcomeString, Fun1);
}
Writer::~ Writer()
{
glDeleteTextures( numTextures, texArray );
wordList.clear();
QMap<char, Symbol *>::Iterator it = symbolMap.begin();
for ( ; it != symbolMap.end(); ++it )
delete (Symbol *)it.data();
}
void Writer::spawnWords( QString phrase, effectType fX )
{
int wordCount = 0;
float xCenter = 0,
yCenter = drand48()*40 - 20,
wordsWidth = 0;
QList<Word *> localWords;
while ( phrase.length() > 0 )
{
QString letters = phrase.section(' ',0,0);
Word * word = new Word( letters.latin1(), &symbolMap );
wordList.append( word );
localWords.append( word );
word->cX = xCenter;
word->cY = yCenter;
switch ( fX ) {
case Fun1:{
float angle = 2*M_PI * drand48(),
module = 0.25 * (drand48() + drand48());
word->vX = module * cos( angle );
word->vY = module * sin( angle );
word->vScale = 0.6;
word->scale = 0.7 + 0.3*(drand48() + drand48());}
word->activateTime = 0.3 * wordCount;
//fall to the case below for word spacing
default:
case NoEffect:
wordsWidth += word->width;
word->cX += wordsWidth;
wordsWidth += word->width + 1;
break;
case Sequence:
word->lifeTime = 1.2;
word->activateTime = 0.6 + 0.9 * wordCount;
// word->vY = -5;
break;
}
wordCount ++;
phrase.remove(0, letters.length() + 1);
}
if ( localWords.count() < 1 )
return;
//some computations to 'center' the string
float displace = -(wordsWidth - 1) / 2;
Word * word = localWords.first();
for( ; word; word = localWords.next() )
word->cX += displace;
}
void Writer::render( double dT )
{
if ( !numTextures )
return;
glEnable( GL_TEXTURE_2D );
glPushMatrix();
glScalef( 0.6, 0.6, 1.0 );
Word * word = wordList.first();
while( word ) {
word->renderWord( dT );
if ( word->isDead() ) {
wordList.remove();
word = wordList.current();
} else
word = wordList.next();
}
glPopMatrix();
}
/* loadMap()
* parses the description file to create the internal symbols map.
* This map is then used when building words.
**/
bool Writer::loadMap( QString descFile )
{
QFile desc( locate("data","kfiresaver/"+descFile) );
if ( !desc.open( QIODevice::ReadOnly ) )
return false;
unsigned int currentNumber;
float xres = 0, yres = 0;
bool generatedFirst = false;
while ( !desc.atEnd() )
{
QString line;
int count = desc.readLine( line, 100 );
//skip comments / invalid lines
if ( count < 6 || line.at(0) == '#')
continue;
//load texture maps
if ( line.at(0) == '"' && numTextures < 15 )
{
//load and generate texture
QString fileName = line.section("\"", 1,1 );
QImage tmp;
if ( !tmp.load( locate("data","kfiresaver/"+fileName) ) ) {
kWarning() << "can't load filename:" << fileName ;
generatedFirst = false;
continue;
}
glGenTextures( 1, &currentNumber );
texArray[ numTextures++ ] = currentNumber;
glBindTexture(GL_TEXTURE_2D, currentNumber);
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
QImage texture = QGLWidget::convertToGLFormat( tmp );
xres = (float)texture.width();
yres = (float)texture.height();
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, (int)xres, (int)yres, 0,
GL_RGBA, GL_UNSIGNED_BYTE, texture.bits());
generatedFirst = true;
continue;
}
if ( !generatedFirst )
continue;
if ( line.contains(' ') != 4 ) {
kWarning() << "wrong line on symbols.desc (4 spaces expected):" ;
kWarning() << " '" << line << "'" ;
continue;
}
//parse the line describing a symbol and create it
char p = *(line.latin1());
if ( symbolMap.contains(p) )
continue;
float left = (float)(line.section(' ',1,1).toInt())/xres,
top = (float)(line.section(' ',2,2).toInt())/yres,
right = (float)(line.section(' ',3,3).toInt() + 1)/xres,
bottom = (float)(line.section(' ',4,4).toInt() + 1)/yres;
symbolMap[p] = new Symbol( currentNumber, left,top,right,bottom );
}
return symbolMap.size() > 0;
}

View file

@ -0,0 +1,113 @@
/***************************************************************************
* Copyright (C) 2004 by E.Ros *
* rosenric@dei.unipd.it *
* *
* 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. *
* *
***************************************************************************/
#ifndef FIRESAVER_WRITER_H
#define FIRESAVER_WRITER_H
#include <qgl.h>
#include <qlist.h>
#include <qmap.h>
#include <qstring.h>
class Symbol
{
public:
Symbol( unsigned int textureNumber, float l, float t, float r, float b )
: scale((r - l) / (b - t)), texNum(textureNumber), L(l), T(1-t), R(r), B(1-b)
{
v1[0] = -scale; v1[1] = 1;
v2[0] = -scale; v2[1] = -1;
v3[0] = scale; v3[1] = 1;
v4[0] = scale; v4[1] = -1;
}
float scale;
inline void renderSymbol()
{
//draw the symbol and update "cursor"'s position
glBindTexture( GL_TEXTURE_2D, texNum );
glTranslatef( scale, 0, 0 );
glBegin( GL_TRIANGLE_STRIP );
glTexCoord2f( L, T );
glVertex2fv( v1 );
glTexCoord2f( L, B );
glVertex2fv( v2 );
glTexCoord2f( R, T );
glVertex2fv( v3 );
glTexCoord2f( R, B );
glVertex2fv( v4 );
glEnd();
glTranslatef( scale, 0, 0 );
}
private:
float v1[2], v2[2], v3[2], v4[2];
unsigned int texNum; //number of texture to activate
float L, T, R, B; //coordinates for mapping
};
class Word
{
friend class Writer;
public:
Word( const char * text, QMap<char, Symbol *> * map, float scale = 1.0 );
inline void renderWord( double dT );
inline bool isDead();
private:
float width, scale, cX, cY;
float vScale, vX, vY;
float activateTime, lifeTime, currentTime;
float color[4];
Q3PtrList<Symbol> symbolList;
};
/*
*
**/
class Writer
{
public:
Writer( QString descFileName );
~Writer();
//types of effects implemented
enum effectType { NoEffect = 0, Sequence, Fun1, Fun2 };
//call this function to add a sentence to the renderer
void spawnWords( QString phrase, effectType fx = NoEffect );
//called to get the words on screen using OpenGL
//Note: the context must be set up. Words are drawn on XY plane
//inside a rectangle with 10 units's side.
void render( double dT );
private:
//misc utility functions
bool loadMap( QString );
//texture 'references' used by GL to delete allocated textures
int numTextures;
unsigned int texArray[16];
//list of words and map of symbols
QList<Word *> wordList;
QMap<char, Symbol *> symbolMap;
//disables standard constructor
Writer();
};
#endif

View file

@ -0,0 +1,466 @@
//-----------------------------------------------------------------------------
//
// kfountain - Partical Fountain Screen Saver for KDE
//
// Copyright (c) Ian Reinhart Geiser 2001
//
// KConfig code and KScreenSaver "Setup..." improvements by
// Nick Betcher <nbetcher@usinternet.com> 2001
//
#include <stdlib.h>
#include <qlabel.h>
#include <qlayout.h>
#include <kapplication.h>
#include <klocale.h>
#include <kconfig.h>
#include <kcolordialog.h>
#include <kcolorbutton.h>
#include <kglobal.h>
#include "fountain.h"
#include "fountain.moc"
#ifdef Q_WS_MACX
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#else
#include <GL/glu.h>
#include <GL/gl.h>
#endif
#include <qimage.h>
#include <kdebug.h>
#include <qpainter.h>
#include <qradiobutton.h>
#include <qspinbox.h>
#include <kstandarddirs.h>
#include <math.h>
#include <kmessagebox.h>
#include <krandom.h>
// libkscreensaver interface
class KFountainSaverInterface : public KScreenSaverInterface
{
public:
virtual KAboutData* aboutData() {
return new KAboutData( "kfountain.kss", "klock", ki18n( "Particle Fountain Screen Saver" ), "2.2.0", ki18n( "Particle Fountain Screen Saver" ) );
}
virtual KScreenSaver* create( WId id )
{
return new KFountainSaver( id );
}
virtual QDialog* setup()
{
return new KFountainSetup();
}
};
int main( int argc, char *argv[] )
{
KFountainSaverInterface kss;
return kScreenSaverMain( argc, argv, kss );
}
//-----------------------------------------------------------------------------
// dialog to setup screen saver parameters
//
KFountainSetup::KFountainSetup( QWidget *parent )
: KDialog( parent)
{
setCaption(i18n( "Particle Fountain Setup" ));
setButtons(Ok|Cancel|Help);
setDefaultButton(Ok);
setModal(true);
setButtonText( Help, i18n( "A&bout" ) );
QWidget *main = new QWidget(this);
setMainWidget(main);
cfg = new FountainWidget(main);
readSettings();
cfg->preview->setFixedSize( 220, 170 );
{
QPalette palette;
palette.setColor( cfg->preview->backgroundRole(), Qt::black );
cfg->preview->setPalette( palette );
cfg->preview->setAutoFillBackground(true);
}
cfg->preview->show(); // otherwise saver does not get correct size
saver = new KFountainSaver( cfg->preview->winId() );
connect( this, SIGNAL(okClicked()), SLOT(slotOkPressed()) );
connect( this, SIGNAL(helpClicked()), SLOT(aboutPressed()) );
connect( cfg->SpinBox1, SIGNAL(valueChanged(int)), saver, SLOT(updateSize(int)));
connect( cfg->RadioButton1, SIGNAL(toggled(bool)), saver, SLOT(doStars(bool)));
}
KFountainSetup::~KFountainSetup()
{
}
// read settings from config file
void KFountainSetup::readSettings()
{
KConfig config(QLatin1String( "kssfountainrc" ), KConfig::NoGlobals);
KConfigGroup grp = config.group("Settings");
bool boolval = grp.readEntry( "Stars", false );
if (boolval) {
cfg->RadioButton1->setChecked(true);
} else {
cfg->RadioButton1_2->setChecked(true);
}
int starammount = grp.readEntry("StarSize", 75);
cfg->SpinBox1->setValue(starammount);
}
// Ok pressed - save settings and exit
void KFountainSetup::slotOkPressed()
{
KConfig _config(QLatin1String( "kssfountainrc" ), KConfig::NoGlobals);
KConfigGroup config(&_config, "Settings" );
if (cfg->RadioButton1->isChecked() == true)
{
config.writeEntry( "Stars", true );
} else {
if (cfg->RadioButton1_2->isChecked() == true)
{
config.writeEntry( "Stars", false );
}
}
config.writeEntry( "StarSize", cfg->SpinBox1->value() );
config.sync();
accept();
}
void KFountainSetup::aboutPressed()
{
KMessageBox::about(this,
i18n("<h3>Particle Fountain</h3>\n<p>Particle Fountain Screen Saver for KDE</p>\nCopyright (c) Ian Reinhart Geiser 2001<br>\n\n<p>KConfig code and KScreenSaver \"Setup...\" improvements by Nick Betcher <nbetcher@usinternet.com> 2001</p>"));
}
//-----------------------------------------------------------------------------
KFountainSaver::KFountainSaver( WId id ) : KScreenSaver( id )
{
kDebug() << "Blank";
timer = new QTimer( this );
timer->setSingleShot( true );
timer->start( 25 );
{
QPalette palette;
palette.setColor( backgroundRole(), Qt::black );
setPalette( palette );
}
update();
fountain = new Fountain();
embed(fountain);
fountain->show();
connect( timer, SIGNAL(timeout()), this, SLOT(blank()) );
show();
}
KFountainSaver::~KFountainSaver()
{
}
// read configuration settings from config file
void KFountainSaver::readSettings()
{
// Please remove me
}
void KFountainSaver::blank()
{
// Play fountain
fountain->updateGL();
timer->setSingleShot(true);
timer->start( 25);
}
Fountain::Fountain( QWidget * parent ) : QGLWidget (parent)
{
rainbow=true;
slowdown=2.0f;
zoom=-40.0f;
index=0;
size = 0.75f;
obj = gluNewQuadric();
// This has to be here because you can't update the fountain until 'fountain' is created!
KConfig _config(QLatin1String( "kssfountainrc" ), KConfig::NoGlobals);
KConfigGroup config(&_config, "Settings" );
bool boolval = config.readEntry( "Stars", false );
setStars(boolval);
int starammount = config.readEntry("StarSize", 75);
float passvalue = (starammount / 100.0);
setSize(passvalue);
}
Fountain::~Fountain()
{
glDeleteTextures( 1, &texture[0] );
gluDeleteQuadric(obj);
}
/** load the particle file */
bool Fountain::loadParticle()
{
/* Status indicator */
bool Status = true;
QImage buf;
kDebug() << "Loading: " << KStandardDirs::locate("data", QLatin1String( "kscreensaver/particle.png" ));
if (buf.load( KStandardDirs::locate("data", QLatin1String( "kscreensaver/particle.png" )) ) )
{
tex = convertToGLFormat(buf); // flipped 32bit RGBA
kDebug() << "Texture loaded: " << tex.numBytes ();
}
else
{
QImage dummy( 32, 32, QImage::Format_RGB32 );
dummy.fill( Qt::white );
buf = dummy;
tex = convertToGLFormat( buf );
}
/* Set the status to true */
//Status = true;
glGenTextures(1, &texture[0]); /* create three textures */
glBindTexture(GL_TEXTURE_2D, texture[0]);
/* use linear filtering */
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
/* actually generate the texture */
glTexImage2D(GL_TEXTURE_2D, 0, 4, tex.width(), tex.height(), 0,
GL_RGBA, GL_UNSIGNED_BYTE, tex.bits());
return Status;
}
/** setup the GL environment */
void Fountain::initializeGL ()
{
kDebug() << "InitGL";
GLfloat colors[12][3]=
{{1.0f,0.5f,0.5f},{1.0f,0.75f,0.5f},{1.0f,1.0f,0.5f},{0.75f,1.0f,0.5f},
{0.5f,1.0f,0.5f},{0.5f,1.0f,0.75f},{0.5f,1.0f,1.0f},{0.5f,0.75f,1.0f},
{0.5f,0.5f,1.0f},{0.75f,0.5f,1.0f},{1.0f,0.5f,1.0f},{1.0f,0.5f,0.75f}};
if (loadParticle()) // Jump To Texture Loading Routine
{
/* Enable smooth shading */
glShadeModel( GL_SMOOTH );
/* Set the background black */
glClearColor( 0.0f, 0.0f, 0.0f, 0.0f );
/* Depth buffer setup */
glClearDepth( 1.0f );
/* Enables Depth Testing */
glDisable( GL_DEPTH_TEST );
/* Enable Blending */
glEnable( GL_BLEND );
/* Type Of Blending To Perform */
glBlendFunc( GL_SRC_ALPHA, GL_ONE );
/* Really Nice Perspective Calculations */
glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST );
/* Really Nice Point Smoothing */
glHint( GL_POINT_SMOOTH_HINT, GL_NICEST );
/* Enable Texture Mapping */
glEnable( GL_TEXTURE_2D );
/* Select Our Texture */
glBindTexture( GL_TEXTURE_2D, texture[0] );
for (loop=0;loop<MAX_PARTICLES;loop++) // Initials All The Textures
{
particle[loop].active=true; // Make All The Particles Active
particle[loop].life=1.0f; // Give All The Particles Full Life
particle[loop].fade=float(KRandom::random()%100)/1000.0f+0.003f; // Random Fade Speed
int color_index = (loop+1)/(MAX_PARTICLES/12);
color_index = qMin(11, color_index);
particle[loop].r=colors[color_index][0]; // Select Red Rainbow Color
particle[loop].g=colors[color_index][1]; // Select Green Rainbow Color
particle[loop].b=colors[color_index][2]; // Select Blue Rainbow Color
particle[loop].xi=float((KRandom::random()%50)-26.0f)*10.0f; // Random Speed On X Axis
particle[loop].yi=float((KRandom::random()%50)-25.0f)*10.0f; // Random Speed On Y Axis
particle[loop].zi=float((KRandom::random()%50)-25.0f)*10.0f; // Random Speed On Z Axis
particle[loop].xg=0.0f; // Set Horizontal Pull To Zero
particle[loop].yg=-0.8f; // Set Vertical Pull Downward
particle[loop].zg=0.0f; // Set Pull On Z Axis To Zero
particle[loop].size=size; // Set particle size.
}
}
else
exit(0);
}
/** resize the gl view */
void Fountain::resizeGL ( int width, int height )
{
kDebug() << "ResizeGL " << width << "," <<height;
if (height==0) // Prevent A Divide By Zero By
{
height=1; // Making Height Equal One
}
glViewport(0,0,width,height); // Reset The Current Viewport
glMatrixMode(GL_PROJECTION); // Select The Projection Matrix
glLoadIdentity(); // Reset The Projection Matrix
// Calculate The Aspect Ratio Of The Window
gluPerspective(45.0f,(GLfloat)width/(GLfloat)height,0.1f,200.0f);
glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix
glLoadIdentity();
}
/** paint the GL view */
void Fountain::paintGL ()
{
//kDebug() << "PaintGL";
GLfloat colors[12][3]=
{{1.0f,0.5f,0.5f},{1.0f,0.75f,0.5f},{1.0f,1.0f,0.5f},{0.75f,1.0f,0.5f},
{0.5f,1.0f,0.5f},{0.5f,1.0f,0.75f},{0.5f,1.0f,1.0f},{0.5f,0.75f,1.0f},
{0.5f,0.5f,1.0f},{0.75f,0.5f,1.0f},{1.0f,0.5f,1.0f},{1.0f,0.5f,0.75f}};
col = ( col + 1 ) % 12;
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear Screen And Depth Buffer
glLoadIdentity();
// Reset The ModelView Matrix
transIndex++;
glTranslatef( GLfloat(5.0*sin(4*3.14*transIndex/360)), GLfloat(4.0*cos(2*3.14*transIndex/360)), 0.0 );
xspeed = GLfloat(100.0*cos(3*3.14*transIndex/360)+100);
yspeed = GLfloat(100.0*sin(3*3.14*transIndex/360)+100);
//slowdown = GLfloat(4.0*sin(2*3.14*transIndex/360)+4.01);
for (loop=0;loop<MAX_PARTICLES;loop++) // Loop Through All The Particles
{
if (particle[loop].active) // If The Particle Is Active
{
float x=particle[loop].x; // Grab Our Particle X Position
float y=particle[loop].y; // Grab Our Particle Y Position
float z=particle[loop].z+zoom; // Particle Z Pos + Zoom
/* Select Our Texture */
/* Draw The Particle Using Our RGB Values,
* Fade The Particle Based On It's Life
*/
glColor4f( particle[loop].r,
particle[loop].g,
particle[loop].b,
particle[loop].life );
/* Build Quad From A Triangle Strip */
if( !stars )
glBegin( GL_TRIANGLE_STRIP );
else
glBegin( GL_TRIANGLE_FAN );
/* Top Right */
glTexCoord2d( 1, 1 );
glVertex3f( x + particle[loop].size, y + particle[loop].size, z );
/* Top Left */
glTexCoord2d( 0, 1 );
glVertex3f( x - particle[loop].size, y + particle[loop].size, z );
/* Bottom Right */
glTexCoord2d( 1, 0 );
glVertex3f( x + particle[loop].size, y - particle[loop].size, z );
/* Bottom Left */
glTexCoord2d( 0, 0 );
glVertex3f( x - particle[loop].size, y - particle[loop].size, z );
glEnd( );
particle[loop].x+=particle[loop].xi/(slowdown*1000);// Move On The X Axis By X Speed
particle[loop].y+=particle[loop].yi/(slowdown*1000);// Move On The Y Axis By Y Speed
particle[loop].z+=particle[loop].zi/(slowdown*1000);// Move On The Z Axis By Z Speed
particle[loop].xi+=particle[loop].xg; // Take Pull On X Axis Into Account
particle[loop].yi+=particle[loop].yg; // Take Pull On Y Axis Into Account
particle[loop].zi+=particle[loop].zg; // Take Pull On Z Axis Into Account
particle[loop].life-=particle[loop].fade; // Reduce Particles Life By 'Fade'
if (particle[loop].life<0.0f) // If Particle Is Burned Out
{
particle[loop].life=2.0f; // Give It New Life
particle[loop].fade=float(KRandom::random()%100)/1000.0f+0.003f; // Random Fade Value
particle[loop].x=0.0f; // Center On X Axis
particle[loop].y=0.0f; // Center On Y Axis
particle[loop].z=0.0f; // Center On Z Axis
particle[loop].xi=xspeed+float((KRandom::random()%60)-32.0f); // X Axis Speed And Direction
particle[loop].yi=yspeed+float((KRandom::random()%60)-30.0f); // Y Axis Speed And Direction
particle[loop].zi=float((KRandom::random()%60)-30.0f); // Z Axis Speed And Direction
particle[loop].r=colors[col][0]; // Select Red From Color Table
particle[loop].g=colors[col][1]; // Select Green From Color Table
particle[loop].b=colors[col][2]; // Select Blue From Color Table
particle[loop].size=size;
if ((1+(random()%20)) == 10)
{
// Explode
particle[loop].active=true; // Make All The Particles Active
particle[loop].life=1.0f; // Give All The Particles Full Life
particle[loop].fade=float(KRandom::random()%100)/1000.0f+0.003f; // Random Fade Speed
int color_index = (loop+1)/(MAX_PARTICLES/12);
color_index = qMin(11, color_index);
particle[loop].r=colors[color_index][0]; // Select Red Rainbow Color
particle[loop].g=colors[color_index][1]; // Select Green Rainbow Color
particle[loop].b=colors[color_index][2]; // Select Blue Rainbow Color
particle[loop].xi=float((KRandom::random()%50)-26.0f)*10.0f; // Random Speed On X Axis
particle[loop].yi=float((KRandom::random()%50)-25.0f)*10.0f; // Random Speed On Y Axis
particle[loop].zi=float((KRandom::random()%50)-25.0f)*10.0f; // Random Speed On Z Axis
particle[loop].xg=0.0f; // Set Horizontal Pull To Zero
particle[loop].yg=-0.8f; // Set Vertical Pull Downward
particle[loop].zg=0.0f; // Set Pull On Z Axis To Zero
particle[loop].size=size; // Set particle size.
}
}
// Lets stir some things up
index += 0.001;
particle[loop].yg =2.0*sin(2*3.14*transIndex/360);
particle[loop].xg =2.0*cos(2*3.14*transIndex/360);
particle[loop].zg =4.0+(4.0*cos(2*3.14*transIndex/360));
}
}
glFlush();
}
void Fountain::setSize( float newSize )
{
size = newSize;
}
void Fountain::setStars( bool doStars )
{
stars = doStars;
}
void KFountainSaver::updateSize(int newSize)
{
fountain->setSize(newSize/100);
}
void KFountainSaver::doStars(bool starState)
{
fountain->setStars(starState);
}

View file

@ -0,0 +1,150 @@
//-----------------------------------------------------------------------------
//
// kfountain - Partical Fountain Screen Saver for KDE 2
//
// Copyright (c) Ian Reinhart Geiser 2001
//
/////
//NOTE:
// The base particle engine did not come from me, it was designed by Jeff Molofee <nehe@connect.ab.ca>
// I did some extensive modifications to make it work with QT's OpenGL but the base principal is about
// the same.
////
#ifndef FOUNTAIN_H
#define FOUNTAIN_H
#include <QDebug>
#include <qdialog.h>
#include <qgl.h>
#ifdef Q_WS_MACX
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#else
#include <GL/glu.h>
#include <GL/gl.h>
#endif
#include <kscreensaver.h>
#include <qtimer.h>
#include <qimage.h>
#include "ui_fountaincfg.h"
#include <kcomponentdata.h>
#include <qfile.h>
#include <qtextstream.h>
#define MAX_PARTICLES 1000
class Fountain : public QGLWidget
{
Q_OBJECT
class particles // Create A Structure For Particle
{
public:
bool active; // Active (Yes/No)
float life; // Particle Life
float fade; // Fade Speed
float r; // Red Value
float g; // Green Value
float b; // Blue Value
float x; // X Position
float y; // Y Position
float z; // Z Position
float xi; // X Direction
float yi; // Y Direction
float zi; // Z Direction
float xg; // X Gravity
float yg; // Y Gravity
float zg; // Z Gravity
float size; // Particle Size
};
public:
Fountain( QWidget * parent=0 );
~Fountain();
void setSize( float newSize );
void setStars( bool doStars );
protected:
/** paint the GL view */
void paintGL ();
/** resize the gl view */
void resizeGL ( int w, int h );
/** setup the GL environment */
void initializeGL ();
private:
/** load the partical file */
bool loadParticle();
particles particle[MAX_PARTICLES];
bool rainbow; // Rainbow Mode?
bool sp; // Spacebar Pressed?
bool rp; // Enter Key Pressed?
float slowdown; // Slow Down Particles
float xspeed; // Base X Speed (To Allow Keyboard Direction Of Tail)
float yspeed; // Base Y Speed (To Allow Keyboard Direction Of Tail)
float zoom; // Used To Zoom Out
float size;
float stars;
GLuint loop; // Misc Loop Variable
GLuint col; // Current Color Selection
GLuint delay; // Rainbow Effect Delay
GLuint texture[1];
QImage tex;
float index;
float transIndex;
GLfloat scale;
GLUquadricObj *obj;
};
class KFountainSaver : public KScreenSaver
{
Q_OBJECT
public:
KFountainSaver( WId drawable );
virtual ~KFountainSaver();
void readSettings();
public slots:
void blank();
void updateSize(int newSize);
void doStars(bool starState);
// void loadTextures(bool textures);
private:
Fountain *fountain;
QTimer *timer;
};
class FountainWidget : public QWidget, public Ui::FountainWidget
{
public:
FountainWidget( QWidget *parent ) : QWidget( parent ) {
setupUi( parent );
}
};
class KFountainSetup : public KDialog
{
Q_OBJECT
public:
KFountainSetup( QWidget *parent =0L);
virtual ~KFountainSetup();
protected:
void readSettings();
private slots:
void slotOkPressed();
void aboutPressed();
private:
KFountainSaver *saver;
float size;
float stars;
FountainWidget *cfg;
};
#endif

View file

@ -0,0 +1,135 @@
<ui version="4.0" stdsetdef="1" >
<class>FountainWidget</class>
<widget class="QWidget" name="FountainWidget" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>209</height>
</rect>
</property>
<property name="minimumSize" >
<size>
<width>400</width>
<height>209</height>
</size>
</property>
<property name="baseSize" >
<size>
<width>400</width>
<height>250</height>
</size>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>11</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="0" column="0" >
<layout class="QGridLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="1" column="0" >
<widget class="KIntSpinBox" name="SpinBox1" >
<property name="maximum" >
<number>500</number>
</property>
<property name="minimum" >
<number>25</number>
</property>
<property name="singleStep" >
<number>10</number>
</property>
<property name="value" >
<number>75</number>
</property>
</widget>
</item>
<item row="2" column="0" >
<widget class="QGroupBox" name="GroupBox1" >
<property name="title" >
<string>Shapes</string>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>11</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="0" column="0" >
<layout class="QVBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QRadioButton" name="RadioButton1" >
<property name="text" >
<string>Stars</string>
</property>
<property name="checked" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="RadioButton1_2" >
<property name="text" >
<string>Flares</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item rowspan="4" row="0" column="1" colspan="2" >
<widget class="QWidget" name="preview" />
</item>
<item row="0" column="0" >
<widget class="QLabel" name="TextLabel1" >
<property name="text" >
<string>Particle size:</string>
</property>
<property name="wordWrap" >
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KIntSpinBox</class>
<extends>QSpinBox</extends>
<header>knuminput.h</header>
</customwidget>
</customwidgets>
<connections>
<connection>
<sender>RadioButton1_2</sender>
<signal>pressed()</signal>
<receiver>RadioButton1</receiver>
<slot>toggle()</slot>
</connection>
<connection>
<sender>RadioButton1</sender>
<signal>pressed()</signal>
<receiver>RadioButton1_2</receiver>
<slot>toggle()</slot>
</connection>
</connections>
</ui>

View file

@ -0,0 +1,435 @@
//-----------------------------------------------------------------------------
//
// kgravity - Partical Gravity Screen Saver for KDE 2
//
// Copyright (c) Ian Reinhart Geiser 2001
//
// KConfig code and KScreenSaver "Setup..." improvements by
// Nick Betcher <nbetcher@usinternet.com> 2001
//
#include <stdlib.h>
#include <qlabel.h>
#include <qlayout.h>
#include <kapplication.h>
#include <klocale.h>
#include <kconfig.h>
#include <kcolordialog.h>
#include <kcolorbutton.h>
#include "gravity.h"
#include "gravity.moc"
#ifdef Q_WS_MACX
#include <OpenGL/glu.h>
#include <OpenGL/gl.h>
#else
#include <GL/glu.h>
#include <GL/gl.h>
#endif
#include <qimage.h>
#include <kdebug.h>
#include <qpainter.h>
#include <qradiobutton.h>
#include <qspinbox.h>
#include <kstandarddirs.h>
#include <math.h>
#include <kmessagebox.h>
#include <krandom.h>
// libkscreensaver interface
class KGravitySaverInterface : public KScreenSaverInterface
{
public:
virtual KAboutData* aboutData() {
return new KAboutData( "kgravity.kss", "klock", ki18n( "Particle Gravity Screen Saver" ), "2.2.0", ki18n( "Particle Gravity Screen Saver" ) );
}
virtual KScreenSaver* create( WId id )
{
return new KGravitySaver( id );
}
virtual QDialog* setup()
{
return new KGravitySetup();
}
};
int main( int argc, char *argv[] )
{
KGravitySaverInterface kss;
return kScreenSaverMain( argc, argv, kss );
}
//-----------------------------------------------------------------------------
// dialog to setup screen saver parameters
//
KGravitySetup::KGravitySetup( QWidget *parent )
: KDialog(parent)
{
setCaption(i18n( "Gravity Setup" ));
setButtons(Ok|Cancel|Help);
setDefaultButton(Ok);
setModal(true);
setButtonText( Help, i18n( "A&bout" ) );
QWidget *main = new QWidget(this);
setMainWidget(main);
cfg = new GravityWidget(main);
connect(this,SIGNAL(okClicked()),this,SLOT(slotOkPressed()));
connect(this,SIGNAL(helpClicked()),this,SLOT(aboutPressed()));
readSettings();
cfg->preview->setFixedSize( 220, 170 );
{
QPalette palette;
palette.setColor( cfg->preview->backgroundRole(), Qt::black );
cfg->preview->setPalette( palette );
cfg->preview->setAutoFillBackground(true);
}
#ifdef Q_WS_X11
cfg->preview->show(); // otherwise saver does not get correct size
#endif
saver = new KGravitySaver( cfg->preview->winId() );
;
connect( cfg->SpinBox1, SIGNAL(valueChanged(int)), saver, SLOT(updateSize(int)));
connect( cfg->RadioButton1, SIGNAL(toggled(bool)), saver, SLOT(doStars(bool)));
}
KGravitySetup::~KGravitySetup()
{
delete saver;
}
// read settings from config file
void KGravitySetup::readSettings()
{
KConfig config(QLatin1String( "kssgravityrc" ), KConfig::NoGlobals);
KConfigGroup grp = config.group( "Settings" );
bool boolval = grp.readEntry( "Stars", false );
if (boolval) {
cfg->RadioButton1->setChecked(true);
} else {
cfg->RadioButton1_2->setChecked(true);
}
int starammount = grp.readEntry("StarSize", 75);
cfg->SpinBox1->setValue(starammount);
}
// Ok pressed - save settings and exit
void KGravitySetup::slotOkPressed()
{
KConfig _config(QLatin1String( "kssgravityrc" ), KConfig::NoGlobals);
KConfigGroup config(&_config, "Settings" );
if (cfg->RadioButton1->isChecked())
{
config.writeEntry( "Stars", true );
} else {
if (cfg->RadioButton1_2->isChecked() == true)
{
config.writeEntry( "Stars", false );
}
}
config.writeEntry( "StarSize", cfg->SpinBox1->value() );
config.sync();
accept();
}
void KGravitySetup::aboutPressed()
{
KMessageBox::about(this,
i18n("<h3>Gravity</h3>\n<p>Particle Gravity Screen Saver for KDE</p>\nCopyright (c) Ian Reinhart Geiser 2001<br>\n\n<p>KConfig code and KScreenSaver \"Setup...\" improvements by Nick Betcher <nbetcher@usinternet.com> 2001</p>"));
}
//-----------------------------------------------------------------------------
KGravitySaver::KGravitySaver( WId id ) : KScreenSaver( id )
{
kDebug() << "Blank";
timer = new QTimer( this );
timer->setSingleShot(true);
timer->start( 25);
{
QPalette palette;
palette.setColor( backgroundRole(), Qt::black );
setPalette( palette );
}
update();
gravity = new Gravity();
embed(gravity);
#ifdef Q_WS_X11
gravity->show();
#endif
connect( timer, SIGNAL(timeout()), this, SLOT(blank()) );
}
KGravitySaver::~KGravitySaver()
{
}
// read configuration settings from config file
void KGravitySaver::readSettings()
{
// Please remove me
}
void KGravitySaver::blank()
{
// Play gravity
gravity->updateGL();
timer->setSingleShot(true);
timer->start( 25);
}
Gravity::Gravity( QWidget * parent ) : QGLWidget (parent)
{
rainbow=true;
slowdown=2.0f;
zoom=-50.0f;
index=0;
size = 3.95f;
// obj = gluNewQuadric();
// This has to be here because you can't update the gravity until 'gravity' is created!
KConfig _config(QLatin1String( "kssgravityrc" ), KConfig::NoGlobals);
KConfigGroup config(&_config, "Settings" );
bool boolval = config.readEntry( "Stars", false );
setStars(boolval);
int starammount = config.readEntry("StarSize", 75);
float passvalue = (starammount / 100.0);
setSize(passvalue);
}
Gravity::~Gravity()
{
glDeleteTextures( 1, &texture[0] );
gluDeleteQuadric(obj);
}
/** load the particle file */
bool Gravity::loadParticle()
{
/* Status indicator */
bool Status = true;
QImage buf;
kDebug() << "Loading: " << KStandardDirs::locate("data", QLatin1String( "kscreensaver/particle.png" ));
if (buf.load( KStandardDirs::locate("data", QLatin1String( "kscreensaver/particle.png" )) ) )
{
tex = convertToGLFormat(buf); // flipped 32bit RGBA
kDebug() << "Texture loaded: " << tex.numBytes ();
}
else
{
QImage dummy( 32, 32, QImage::Format_RGB32 );
dummy.fill( Qt::white );
buf = dummy;
tex = convertToGLFormat( buf );
}
/* Set the status to true */
//Status = true;
glGenTextures(1, &texture[0]); /* create three textures */
glBindTexture(GL_TEXTURE_2D, texture[0]);
/* use linear filtering */
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
/* actually generate the texture */
glTexImage2D(GL_TEXTURE_2D, 0, 4, tex.width(), tex.height(), 0,
GL_RGBA, GL_UNSIGNED_BYTE, tex.bits());
return Status;
}
/** setup the GL environment */
void Gravity::initializeGL ()
{
kDebug() << "InitGL";
if (loadParticle()) // Jump To Texture Loading Routine
{
/* Enable smooth shading */
glShadeModel( GL_SMOOTH );
/* Set the background black */
glClearColor( 0.0f, 0.0f, 0.0f, 0.0f );
/* Depth buffer setup */
glClearDepth( 1.0f );
/* Enables Depth Testing */
glDisable( GL_DEPTH_TEST );
/* Enable Blending */
glEnable( GL_BLEND );
/* Type Of Blending To Perform */
glBlendFunc( GL_SRC_ALPHA, GL_ONE );
/* Really Nice Perspective Calculations */
glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST );
/* Really Nice Point Smoothing */
glHint( GL_POINT_SMOOTH_HINT, GL_NICEST );
/* Enable Texture Mapping */
glEnable( GL_TEXTURE_2D );
/* Select Our Texture */
glBindTexture( GL_TEXTURE_2D, texture[0] );
for (loop=0;loop<MAX_PARTICLES;loop++) // Initials All The Textures
{
buildParticle(loop);
}
}
else
exit(0);
}
/** resize the gl view */
void Gravity::resizeGL ( int width, int height )
{
kDebug() << "ResizeGL " << width << "," <<height;
if (height==0) // Prevent A Divide By Zero By
{
height=1; // Making Height Equal One
}
glViewport(0,0,width,height); // Reset The Current Viewport
glMatrixMode(GL_PROJECTION); // Select The Projection Matrix
glLoadIdentity(); // Reset The Projection Matrix
// Calculate The Aspect Ratio Of The Window
gluPerspective(45.0f,(GLfloat)width/(GLfloat)height,0.1f,100.0f);
glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix
glLoadIdentity();
}
/** paint the GL view */
void Gravity::paintGL ()
{
//kDebug() << "PaintGL";
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear Screen And Depth Buffer
glLoadIdentity();
// Reset The ModelView Matrix
transIndex++;
//glRotatef(transIndex, 1,0,0);
//glRotatef(transIndex, 0,1,0);
//glRotatef(transIndex, 0,0,1);
float xmax = 5.0;
float ymax = 5.0;
glTranslatef( GLfloat(xmax*sin(3.14*transIndex/360)-xmax),
GLfloat(ymax*cos(3.14*transIndex/360)-ymax),
0.0 );
//glRotatef(transIndex, 0,GLfloat(zmax*cos(3.14*transIndex/360000)), GLfloat(zmax*cos(3.14*transIndex/360000)));
for (loop=0;loop<MAX_PARTICLES;loop++) // Loop Through All The Particles
{
if (particle[loop].active) // If The Particle Is Active
{
float x=particle[loop].x; // Grab Our Particle X Position
float y=particle[loop].y; // Grab Our Particle Y Position
float z=particle[loop].z+zoom; // Particle Z Pos + Zoom
/* Select Our Texture */
/* Draw The Particle Using Our RGB Values,
* Fade The Particle Based On It's Life
*/
particle[loop].life=(particle[loop].index/particle[loop].indexo)*2.0f;
glColor4f( particle[loop].r,
particle[loop].g,
particle[loop].b,
particle[loop].life );
/* Build Quad From A Triangle Strip */
if( !stars )
glBegin( GL_TRIANGLE_STRIP );
else
glBegin( GL_TRIANGLE_FAN );
/* Top Right */
glTexCoord2d( 1, 1 );
glVertex3f( x + particle[loop].size, y + particle[loop].size, z );
/* Top Left */
glTexCoord2d( 0, 1 );
glVertex3f( x - particle[loop].size, y + particle[loop].size, z );
/* Bottom Right */
glTexCoord2d( 1, 0 );
glVertex3f( x + particle[loop].size, y - particle[loop].size, z );
/* Bottom Left */
glTexCoord2d( 0, 0 );
glVertex3f( x - particle[loop].size, y - particle[loop].size, z );
glEnd( );
particle[loop].x=(particle[loop].xo*sin(particle[loop].index))*pow((double) particle[loop].index/particle[loop].indexo,(double) 8.0);
particle[loop].y=(particle[loop].yo*sin(particle[loop].index))*pow((double) particle[loop].index/particle[loop].indexo,(double) 8.0);
particle[loop].z=(particle[loop].zo*sin(particle[loop].index))*pow((double) particle[loop].index/particle[loop].indexo,(double) 8.0);
particle[loop].index-=0.05;
if (particle[loop].index<0.0f ) // If Particle Is Burned Out
{
buildParticle(loop);
}
// Lets stir some things up
}
}
glFlush();
}
void Gravity::setSize( float newSize )
{
size = newSize;
}
void Gravity::setStars( bool doStars )
{
stars = doStars;
}
void KGravitySaver::updateSize(int newSize)
{
gravity->setSize(newSize/100);
}
void KGravitySaver::doStars(bool starState)
{
gravity->setStars(starState);
}
void Gravity::buildParticle(int loop)
{
GLfloat colors[12][3]=
{{1.0f,0.5f,0.5f},{1.0f,0.75f,0.5f},{1.0f,1.0f,0.5f},{0.75f,1.0f,0.5f},
{0.5f,1.0f,0.5f},{0.5f,1.0f,0.75f},{0.5f,1.0f,1.0f},{0.5f,0.75f,1.0f},
{0.5f,0.5f,1.0f},{0.75f,0.5f,1.0f},{1.0f,0.5f,1.0f},{1.0f,0.5f,0.75f}};
col = ( col + 1 ) % 12;
particle[loop].active=true;
particle[loop].index=KRandom::random()%100;
particle[loop].indexo=particle[loop].index;
particle[loop].fade=float(KRandom::random()%100)/1000.0f+0.003f; // Random Fade Value
particle[loop].r=colors[col][0]; // Select Red From Color Table
particle[loop].g=colors[col][1]; // Select Green From Color Table
particle[loop].b=colors[col][2]; // Select Blue From Color Table
particle[loop].size=size;
particle[loop].x = float(KRandom::random()%100-50)*4.0;
particle[loop].y = float(KRandom::random()%20-10)*4.0;
particle[loop].z = float(KRandom::random()%100-50)*4.0;
particle[loop].xo = particle[loop].x;
if ((1+(KRandom::random() % 10) > 5))
particle[loop].yo = particle[loop].y;
else
particle[loop].yo = 0.0;
particle[loop].zo = particle[loop].z;
}

View file

@ -0,0 +1,150 @@
///-----------------------------------------------------------------------------
//
// kgravity - Partical gravity Screen Saver for KDE 2
//
// Copyright (c) Ian Reinhart Geiser 2001
//
/////
//NOTE:
// The base particle engine did not come from me, it was designed by Jeff Molofee <nehe@connect.ab.ca>
// I did some extensive modifications to make it work with QT's OpenGL but the base principal is about
// the same.
////
#ifndef GRAVITY_H
#define GRAVITY_H
#include <kdialog.h>
#include <qgl.h>
#ifdef Q_WS_MACX
#include <OpenGL/glu.h>
#include <OpenGL/gl.h>
#else
#include <GL/glu.h>
#include <GL/gl.h>
#endif
#include <kscreensaver.h>
#include <qtimer.h>
#include <qimage.h>
#include "ui_gravitycfg.h"
#include <kcomponentdata.h>
#include <qfile.h>
#include <qtextstream.h>
#define MAX_PARTICLES 100
class Gravity : public QGLWidget
{
Q_OBJECT
class particles // Create A Structure For Particle
{
public:
bool active; // Active (Yes/No)
float life; // Particle Life
float fade; // Fade Speed
float r; // Red Value
float g; // Green Value
float b; // Blue Value
float x; // X Position
float y; // Y Position
float z; // Z Position
float xo; // X Position
float yo; // Y Position
float zo; // Z Position
float index; // Index
float indexo;
float size; // Particle Size
};
public:
Gravity( QWidget * parent=0 );
~Gravity();
void setSize( float newSize );
void setStars( bool doStars );
protected:
/** paint the GL view */
void paintGL ();
/** resize the gl view */
void resizeGL ( int w, int h );
/** setup the GL environment */
void initializeGL ();
void buildParticle(int loop);
private:
/** load the partical file */
bool loadParticle();
particles particle[MAX_PARTICLES];
bool rainbow; // Rainbow Mode?
bool sp; // Spacebar Pressed?
bool rp; // Enter Key Pressed?
float slowdown; // Slow Down Particles
float xspeed; // Base X Speed (To Allow Keyboard Direction Of Tail)
float yspeed; // Base Y Speed (To Allow Keyboard Direction Of Tail)
float zoom; // Used To Zoom Out
float size;
float stars;
GLuint loop; // Misc Loop Variable
GLuint col; // Current Color Selection
GLuint delay; // Rainbow Effect Delay
GLuint texture[1];
QImage tex;
float index;
float transIndex;
GLfloat scale;
GLUquadricObj *obj;
};
class KGravitySaver : public KScreenSaver
{
Q_OBJECT
public:
KGravitySaver( WId drawable );
virtual ~KGravitySaver();
void readSettings();
public slots:
void blank();
void updateSize(int newSize);
void doStars(bool starState);
// void loadTextures(bool textures);
private:
Gravity *gravity;
QTimer *timer;
};
class GravityWidget : public QWidget, public Ui::GravityWidget
{
public:
GravityWidget( QWidget *parent ) : QWidget( parent ) {
setupUi( parent );
}
};
class KGravitySetup : public KDialog
{
Q_OBJECT
public:
KGravitySetup( QWidget *parent = 0L);
~KGravitySetup();
protected:
void readSettings();
private slots:
void slotOkPressed();
void aboutPressed();
private:
KGravitySaver *saver;
float size;
float stars;
float zoom;
float speed;
GravityWidget *cfg;
};
#endif

View file

@ -0,0 +1,125 @@
<ui version="4.0" stdsetdef="1" >
<class>GravityWidget</class>
<widget class="QWidget" name="GravityWidget" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>209</height>
</rect>
</property>
<property name="minimumSize" >
<size>
<width>400</width>
<height>220</height>
</size>
</property>
<property name="baseSize" >
<size>
<width>400</width>
<height>250</height>
</size>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>11</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="0" column="0" >
<layout class="QGridLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="1" column="0" >
<widget class="KIntSpinBox" name="SpinBox1" >
<property name="maximum" >
<number>500</number>
</property>
<property name="minimum" >
<number>25</number>
</property>
<property name="singleStep" >
<number>10</number>
</property>
<property name="value" >
<number>75</number>
</property>
</widget>
</item>
<item row="2" column="0" >
<widget class="QGroupBox" name="GroupBox1" >
<property name="title" >
<string>Shapes</string>
</property>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QRadioButton" name="RadioButton1" >
<property name="text" >
<string>Stars</string>
</property>
<property name="checked" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="RadioButton1_2" >
<property name="text" >
<string>Flares</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item rowspan="4" row="0" column="1" colspan="2" >
<widget class="QWidget" name="preview" />
</item>
<item row="0" column="0" >
<widget class="QLabel" name="TextLabel1" >
<property name="text" >
<string>Particle size:</string>
</property>
<property name="wordWrap" >
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KIntSpinBox</class>
<extends>QSpinBox</extends>
<header>knuminput.h</header>
</customwidget>
</customwidgets>
<connections>
<connection>
<sender>RadioButton1_2</sender>
<signal>pressed()</signal>
<receiver>RadioButton1</receiver>
<slot>toggle()</slot>
</connection>
<connection>
<sender>RadioButton1</sender>
<signal>pressed()</signal>
<receiver>RadioButton1_2</receiver>
<slot>toggle()</slot>
</connection>
</connections>
</ui>

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

View file

@ -0,0 +1,518 @@
// kclock - Clock screen saver for KDE
//
// Copyright (c) 2003, 2006, 2007, 2008 Melchior FRANZ <mfranz # 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 <QCheckBox>
#include <QColor>
#include <QGridLayout>
#include <QGroupBox>
#include <QHBoxLayout>
#include <QImage>
#include <QLabel>
#include <QSlider>
#include <QVBoxLayout>
#include <KColorButton>
#include <KConfig>
#include <KGlobal>
#include <KHBox>
#include <KLocale>
#include <KMessageBox>
#include "kclock.h"
#include "kclock.moc"
const int COLOR_BUTTON_WIDTH = 80;
const int TIMER_INTERVAL = 100;
const int MAX_CLOCK_SIZE = 10;
const unsigned int DEFAULT_CLOCK_SIZE = 8;
const bool DEFAULT_KEEP_CENTERED = false;
class KClockSaverInterface : public KScreenSaverInterface {
public:
virtual KAboutData *aboutData() {
return new KAboutData("kclock.kss", "klock", ki18n("Clock"), "2.0", ki18n("Clock"));
}
virtual KScreenSaver *create(WId id) {
return new KClockSaver(id);
}
virtual QDialog *setup() {
return new KClockSetup();
}
};
int main(int argc, char *argv[])
{
KClockSaverInterface kss;
return kScreenSaverMain(argc, argv, kss);
}
//-----------------------------------------------------------------------------
KClockSetup::KClockSetup(QWidget *parent) :
KDialog(parent),
_saver(0)
{
setCaption(i18n("Setup Clock Screen Saver"));
setModal(true);
setButtons(Ok|Cancel|Help);
setDefaultButton(Ok);
readSettings();
setButtonText(Help, i18n("A&bout"));
QWidget *main = new QWidget(this);
setMainWidget(main);
QVBoxLayout *top = new QVBoxLayout(main);
QHBoxLayout *hbox = new QHBoxLayout;
top->addLayout(hbox);
QGroupBox *colgroup = new QGroupBox(i18n("Colors"), main);
QGridLayout *grid = new QGridLayout();
QLabel *label;
KColorButton *colorButton;
label = new QLabel(i18n("&Hour-hand:"));
colorButton = new KColorButton(_hourColor);
colorButton->setFixedWidth(COLOR_BUTTON_WIDTH);
label->setBuddy(colorButton);
connect(colorButton, SIGNAL(changed(QColor)),
SLOT(slotHourColor(QColor)));
grid->addWidget(label, 1, 1);
grid->addWidget(colorButton, 1, 2);
label = new QLabel(i18n("&Minute-hand:"));
colorButton = new KColorButton(_minColor);
colorButton->setFixedWidth(COLOR_BUTTON_WIDTH);
label->setBuddy(colorButton);
connect(colorButton, SIGNAL(changed(QColor)),
SLOT(slotMinColor(QColor)));
grid->addWidget(label, 2, 1);
grid->addWidget(colorButton, 2, 2);
label = new QLabel(i18n("&Second-hand:"));
colorButton = new KColorButton(_secColor);
colorButton->setFixedWidth(COLOR_BUTTON_WIDTH);
label->setBuddy(colorButton);
connect(colorButton, SIGNAL(changed(QColor)),
SLOT(slotSecColor(QColor)));
grid->addWidget(label, 3, 1);
grid->addWidget(colorButton, 3, 2);
label = new QLabel(i18n("Scal&e:"));
colorButton = new KColorButton(_scaleColor);
colorButton->setFixedWidth(COLOR_BUTTON_WIDTH);
label->setBuddy(colorButton);
connect(colorButton, SIGNAL(changed(QColor)),
SLOT(slotScaleColor(QColor)));
grid->addWidget(label, 4, 1);
grid->addWidget(colorButton, 4, 2);
label = new QLabel(i18n("&Background:"));
colorButton = new KColorButton(_bgndColor);
colorButton->setFixedWidth(COLOR_BUTTON_WIDTH);
label->setBuddy(colorButton);
connect(colorButton, SIGNAL(changed(QColor)),
SLOT(slotBgndColor(QColor)));
grid->addWidget(label, 5, 1);
grid->addWidget(colorButton, 5, 2);
hbox->addWidget(colgroup);
colgroup->setLayout(grid);
QWidget *_preview = new QWidget(main);
_preview->setFixedSize(220, 165);
_preview->show();
_saver = new KClockSaver(_preview->winId());
hbox->addWidget(_preview);
label = new QLabel(i18n("Si&ze:"), main);
top->addWidget(label);
QSlider *qs = new QSlider(Qt::Horizontal);
label->setBuddy(qs);
qs->setRange(0, MAX_CLOCK_SIZE);
qs->setSliderPosition(_size);
qs->setTickInterval(1);
qs->setTickPosition(QSlider::TicksBelow);
connect(qs, SIGNAL(valueChanged(int)), this, SLOT(slotSliderMoved(int)));
top->addWidget(qs);
KHBox *qsscale = new KHBox(main);
label = new QLabel(i18n("Small"), qsscale);
label->setAlignment(Qt::AlignLeading);
label = new QLabel(i18n("Medium"), qsscale);
label->setAlignment(Qt::AlignHCenter);
label = new QLabel(i18n("Big"), qsscale);
label->setAlignment(Qt::AlignTrailing);
top->addWidget(qsscale);
QCheckBox *keepCentered = new QCheckBox(i18n("&Keep clock centered"), main);
keepCentered->setChecked(_keepCentered);
connect(keepCentered, SIGNAL(stateChanged(int)), SLOT(slotKeepCenteredChanged(int)));
top->addWidget(keepCentered);
top->addStretch();
connect(this, SIGNAL(okClicked()), this, SLOT(slotOk()));
connect(this, SIGNAL(helpClicked()), this, SLOT(slotHelp()));
}
KClockSetup::~KClockSetup()
{
delete _saver;
}
void KClockSetup::readSettings()
{
KConfigGroup settings(KGlobal::config(), "Settings");
_keepCentered = settings.readEntry("KeepCentered", DEFAULT_KEEP_CENTERED);
_size = settings.readEntry("Size", DEFAULT_CLOCK_SIZE);
if (_size > MAX_CLOCK_SIZE)
_size = MAX_CLOCK_SIZE;
KConfigGroup colors(KGlobal::config(), "Colors");
QColor c = Qt::black;
_bgndColor = colors.readEntry("Background", c);
c = Qt::white;
_scaleColor = colors.readEntry("Scale", c);
_hourColor = colors.readEntry("HourHand", c);
_minColor = colors.readEntry("MinuteHand", c);
c = Qt::red;
_secColor = colors.readEntry("SecondHand", c);
if (_saver) {
_saver->setBgndColor(_bgndColor);
_saver->setScaleColor(_scaleColor);
_saver->setHourColor(_hourColor);
_saver->setMinColor(_minColor);
_saver->setSecColor(_secColor);
}
}
void KClockSetup::slotOk()
{
KConfigGroup settings(KGlobal::config(), "Settings");
settings.writeEntry("Size", _size);
settings.writeEntry("KeepCentered", _keepCentered);
settings.sync();
KConfigGroup colors(KGlobal::config(), "Colors");
colors.writeEntry("Background", _bgndColor);
colors.writeEntry("Scale", _scaleColor);
colors.writeEntry("HourHand", _hourColor);
colors.writeEntry("MinuteHand", _minColor);
colors.writeEntry("SecondHand", _secColor);
colors.sync();
accept();
}
void KClockSetup::slotHelp()
{
KMessageBox::about(this, QLatin1String("<qt>") + i18n(
"Clock Screen Saver<br>"
"Version 2.0<br>"
"<nobr>Melchior FRANZ (c) 2003, 2006, 2007</nobr>") +
QLatin1String("<br><a href=\"mailto:mfranz@kde.org\">mfranz@kde.org</a>"
"</qt>"), QString(), KMessageBox::AllowLink);
}
void KClockSetup::slotBgndColor(const QColor &color)
{
_bgndColor = color;
if (_saver)
_saver->setBgndColor(_bgndColor);
}
void KClockSetup::slotScaleColor(const QColor &color)
{
_scaleColor = color;
if (_saver)
_saver->setScaleColor(_scaleColor);
}
void KClockSetup::slotHourColor(const QColor &color)
{
_hourColor = color;
if (_saver)
_saver->setHourColor(_hourColor);
}
void KClockSetup::slotMinColor(const QColor &color)
{
_minColor = color;
if (_saver)
_saver->setMinColor(_minColor);
}
void KClockSetup::slotSecColor(const QColor &color)
{
_secColor = color;
if (_saver)
_saver->setSecColor(_secColor);
}
void KClockSetup::slotSliderMoved(int v)
{
if (_saver)
_saver->resizeClock(_size = v);
}
void KClockSetup::slotKeepCenteredChanged(int c)
{
if (_saver)
_saver->setKeepCentered(_keepCentered = c);
}
//-----------------------------------------------------------------------------
ClockPainter::ClockPainter(QPaintDevice *device, int diameter) :
QPainter(device)
{
setRenderHint(QPainter::Antialiasing);
translate(diameter / 2.0, diameter / 2.0);
scale(diameter / 2000.0, -diameter / 2000.0);
setPen(Qt::NoPen);
}
void ClockPainter::drawTick(double angle, double from, double to, double width, const QColor &color, bool shadow)
{
save();
rotate(90.0 - angle);
if (shadow) {
width += 1.0;
setBrush(QColor(100, 100, 100));
} else {
setBrush(color);
}
drawRect(QRectF(from, -width / 2.0, to - from, width));
restore();
}
void ClockPainter::drawDisc(double width, const QColor &color, bool shadow)
{
if (shadow) {
width += 1.0;
setBrush(QColor(100, 100, 100));
} else {
setBrush(color);
}
drawEllipse(QRectF(-width, -width, 2.0 * width, 2.0 * width));
}
void ClockPainter::drawHand(double angle, double length, double width, const QColor &color, bool disc)
{
if (disc)
drawDisc(width * 1.3, color, true);
drawTick(angle, 0.0, length, width, color, true);
if (disc)
drawDisc(width * 1.3, color, false);
drawTick(angle, 0.0, length, width, color, false);
}
void ClockPainter::drawScale(const QColor &color)
{
for (int i = 0; i < 360; i += 6)
if (i % 30)
drawTick(i, 920.0, 980.0, 15.0, color);
else
drawTick(i, 825.0, 980.0, 40.0, color);
}
//-----------------------------------------------------------------------------
KClockSaver::KClockSaver(WId id) :
KScreenSaver(id),
_timer(this),
_xstep(1),
_ystep(-1),
_hour(-1),
_minute(-1),
_second(-1)
{
setAttribute(Qt::WA_NoSystemBackground);
setMinimumSize(50, 50);
readSettings();
resizeClock(_size);
QPalette p = palette();
p.setColor(backgroundRole(), _bgndColor);
setPalette(p);
connect(&_timer, SIGNAL(timeout()), this, SLOT(slotTimeout()));
show();
}
void KClockSaver::readSettings()
{
KConfigGroup settings(KGlobal::config(), "Settings");
_keepCentered = settings.readEntry("KeepCentered", DEFAULT_KEEP_CENTERED);
_size = settings.readEntry("Size", DEFAULT_CLOCK_SIZE);
if (_size > MAX_CLOCK_SIZE)
_size = MAX_CLOCK_SIZE;
KConfigGroup colors(KGlobal::config(), "Colors");
QColor c = Qt::black;
setBgndColor(colors.readEntry("Background", c));
c = Qt::white;
setScaleColor(colors.readEntry("Scale", c));
setHourColor(colors.readEntry("HourHand", c));
setMinColor(colors.readEntry("MinuteHand", c));
c = Qt::red;
setSecColor(colors.readEntry("SecondHand", c));
}
void KClockSaver::setKeepCentered(bool b)
{
_keepCentered = b;
if (b) {
_x = (width() - _diameter) / 2;
_y = (height() - _diameter) / 2;
}
update();
}
void KClockSaver::resizeClock(int size)
{
_size = size;
_diameter = qMin(width(), height()) * (_size + 4) / 14;
_x = (width() - _diameter) / 2;
_y = (height() - _diameter) / 2;
update();
}
void KClockSaver::resizeEvent(QResizeEvent *)
{
resizeClock(_size);
}
void KClockSaver::showEvent(QShowEvent *)
{
_second = -1;
slotTimeout();
_timer.start(TIMER_INTERVAL);
}
void KClockSaver::hideEvent(QHideEvent *)
{
_timer.stop();
}
void KClockSaver::slotTimeout()
{
QTime t = QTime::currentTime();
int s = t.second();
if (s == _second)
return;
_second = _secColor != _bgndColor ? s : 0;
_hour = t.hour();
_minute = t.minute();
if (!_keepCentered) {
int i;
_x += _xstep;
if (_x <= 0)
_x = 0, _xstep = 1;
else if (_x >= (i = width() - _diameter))
_x = i, _xstep = -1;
_y += _ystep;
if (_y <= 0)
_y = 0, _ystep = 1;
else if (_y >= (i = height() - _diameter))
_y = i, _ystep = -1;
}
update();
}
void KClockSaver::paintEvent(QPaintEvent *)
{
double hour_angle = _hour * 30.0 + _minute * .5 + _second / 120.0;
double minute_angle = _minute * 6.0 + _second * .1;
double second_angle = _second * 6.0;
QImage clock(_diameter, _diameter, QImage::Format_RGB32);
ClockPainter c(&clock, _diameter);
c.fillRect(-1000, -1000, 2000, 2000, _bgndColor);
if (_scaleColor != _bgndColor)
c.drawScale(_scaleColor);
if (_hourColor != _bgndColor)
c.drawHand(hour_angle, 600.0, 55.0, _hourColor, false);
if (_minColor != _bgndColor)
c.drawHand(minute_angle, 900.0, 40.0, _minColor);
if (_secColor != _bgndColor)
c.drawHand(second_angle, 900.0, 30.0, _secColor);
QPainter p(this);
p.drawImage(_x, _y, clock);
p.eraseRect(0, 0, _x, height()); // left ver
p.eraseRect(_x + _diameter, 0, width(), height()); // right ver
p.eraseRect(_x, 0, _diameter, _y); // top hor
p.eraseRect(_x, _y + _diameter, _diameter, height() - _y - _diameter); // bottom hor
}

View file

@ -0,0 +1,118 @@
// kclock - Clock screen saver for KDE
//
// Copyright (c) 2003, 2006, 2007, 2008 Melchior FRANZ <mfranz # 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 KCLOCK_H
#define KCLOCK_H
#include <QTimer>
#include <QPainter>
#include <KDialog>
#include <kscreensaver.h>
class KClockSaver;
class KClockSetup : public KDialog {
Q_OBJECT
public:
KClockSetup(QWidget *parent = 0);
~KClockSetup();
private slots:
void slotOk();
void slotHelp();
void slotBgndColor(const QColor &);
void slotScaleColor(const QColor &);
void slotHourColor(const QColor &);
void slotMinColor(const QColor &);
void slotSecColor(const QColor &);
void slotSliderMoved(int);
void slotKeepCenteredChanged(int);
private:
void readSettings();
KClockSaver *_saver;
QColor _bgndColor;
QColor _scaleColor;
QColor _hourColor;
QColor _minColor;
QColor _secColor;
int _size;
bool _keepCentered;
};
class ClockPainter : public QPainter {
public:
ClockPainter(QPaintDevice *device, int diameter);
void drawTick(double angle, double from, double to, double width, const QColor &, bool shadow = false);
void drawDisc(double width, const QColor &, bool shadow = false);
void drawHand(double angle, double length, double width, const QColor &, bool disc = true);
void drawScale(const QColor &);
};
class KClockSaver : public KScreenSaver {
Q_OBJECT
public:
KClockSaver(WId id);
inline void setBgndColor(const QColor &c) { _second = -1; setPalette(QPalette(_bgndColor = c)); }
inline void setScaleColor(const QColor &c) { _second = -1; _scaleColor = c; }
inline void setHourColor(const QColor &c) { _second = -1; _hourColor = c; }
inline void setMinColor(const QColor &c) { _second = -1; _minColor = c; }
inline void setSecColor(const QColor &c) { _second = -1; _secColor = c; }
void setKeepCentered(bool b);
void resizeClock(int size);
void paintEvent(QPaintEvent *);
void resizeEvent(QResizeEvent *);
void showEvent(QShowEvent *);
void hideEvent(QHideEvent *);
private slots:
void slotTimeout();
private:
void readSettings();
QTimer _timer;
QColor _bgndColor;
QColor _scaleColor;
QColor _hourColor;
QColor _minColor;
QColor _secColor;
bool _keepCentered;
int _size;
int _x;
int _y;
int _xstep;
int _ystep;
int _diameter;
int _hour;
int _minute;
int _second;
};
#endif

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

View file

@ -0,0 +1,394 @@
/*-
* kvm.cpp - The Vm screensaver for KDE
* Copyright (c) 2000 by Artur Rataj
* This file is distributed under the terms of the GNU General Public License
*
* This file is partially based on kmatrix screen saver -- original copyright follows:
* kmatrix.c - The Matrix screensaver for KDE
* by Eric Plante Copyright (c) 1999
* Distributed under the Gnu Public License
*
* Much of this code taken from xmatrix.c from xscreensaver;
* original copyright follows:
* xscreensaver, Copyright (c) 1999 Jamie Zawinski <jwz@jwz.org>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation. No representations are made about the suitability of this
* software for any purpose. It is provided "as is" without express or
* implied warranty.
*
*/
// layout management added 1998/04/19 by Mario Weilguni <mweilguni@kde.org>
#include <stdio.h>
#include <stdlib.h>
/* for AIX at least */
#include <time.h>
#include <qcolor.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qslider.h>
#include <qpainter.h>
#include <qbitmap.h>
#include <kapplication.h>
#include <kconfig.h>
#include <klocale.h>
#include <kglobal.h>
#include <kmessagebox.h>
#ifdef DEBUG_MEM
#include <mcheck.h>
#endif
#include "kvm.h"
#include "vm.xpm"
#include "vm.xbm"
#define CHAR_HEIGHT 22
// libkscreensaver interface
class kVmSaverInterface : public KScreenSaverInterface
{
public:
virtual KAboutData* aboutData() {
return new KAboutData( "kvm.kss", "klock", ki18n( "Virtual Machine" ), "2.2.0", ki18n( "Virtual Machine" ) );
}
virtual KScreenSaver* create( WId id )
{
return new kVmSaver( id );
}
virtual QDialog* setup()
{
return new kVmSetup();
}
};
int main( int argc, char *argv[] )
{
kVmSaverInterface kss;
return kScreenSaverMain( argc, argv, kss );
}
static void
load_images (m_state *state)
{
if ( QPixmap::defaultDepth() > 1 )
{
state->images = QPixmap( vm );
}
else
{
state->images = QBitmap::fromData( QSize(vm_width, vm_height), vm_bits );
}
state->image_width = state->images.width();
state->image_height = state->images.height();
state->nglyphs = state->image_height / CHAR_HEIGHT;
}
static m_state *
init_pool ( QWidget *w )
{
m_state *state = new m_state;
state->w = w;
load_images (state);
state->char_width = state->image_width / 4;
state->char_height = CHAR_HEIGHT;
state->grid_width = w->width() / state->char_width;
state->grid_height = w->height() / state->char_height;
state->grid_margin_x = w->width()%state->char_width/2;
state->grid_margin_y = w->height()%state->char_height/2;
state->show_threads = 1;
vm_init_pool( &(state->pool), state->grid_width*state->grid_height,
THREAD_MAX_STACK_SIZE, MAX_THREADS_NUM );
//vm_enable_reverse( state->pool, 1 );
state->modified = new char[state->grid_height*state->grid_width];
for( int x = 0; x < state->grid_width*state->grid_height; ++x )
state->modified[x] = 1;
return state;
}
static void
draw_pool (m_state *state)
{
int x, y;
struct tvm_process* curr_thread;
if( state->show_threads ) {
curr_thread = state->pool->processes;
while( curr_thread ) {
state->modified[curr_thread->position] = 2;
curr_thread = curr_thread->next;
}
}
for (y = 0; y < state->grid_height; y++)
for (x = 0; x < state->grid_width; x++) {
int index = state->grid_width * y + x;
if( state->modified[index] )
{
int op = state->pool->area[index];
int pos_y;
int pos_x = 0;
switch( op ) {
case VM_OP_STOP:
pos_y = 14;
break;
case VM_OP_EXEC:
pos_y = 15;
break;
case VM_OP_COPY:
pos_y = 12;
break;
default:
pos_y = op - VM_OP_PUSH;
if( pos_y < 0 ) {
pos_y = -pos_y;
pos_x = 1;
}
break;
}
if( state->show_threads )
if( state->modified[index] == 1 )
pos_x += 2;
QPainter p(state->w);
p.setPen( Qt::green );
p.setBrush( Qt::black );
p.drawPixmap( state->grid_margin_x + x*state->char_width,
state->grid_margin_y + y*state->char_height,
state->images, pos_x*state->char_width,
pos_y*state->char_height,
state->char_width, state->char_height );
--state->modified[index];
}
}
}
//-----------------------------------------------------------------------------
kVmSaver::kVmSaver( WId id ) : KScreenSaver( id )
{
readSettings();
setSpeed( speed );
setRefreshTimeout( refreshTimeout );
refreshStep = 0;
pool_state = init_pool( this );
vm_default_initstate( time(0), &(pool_state->pool->vm_random_data) );
connect( &timer, SIGNAL(timeout()), SLOT(update()) );
timer.start( 100 - speed );
setAttribute( Qt::WA_NoSystemBackground );
cleared = false;
show();
}
kVmSaver::~kVmSaver()
{
timer.stop();
vm_done_pool( pool_state->pool );
delete[] pool_state->modified;
}
void kVmSaver::setSpeed( int spd )
{
speed = spd;
// timer.start( (100 - speed)*(100 - speed)*(100 - speed)/10000 );
timer.start( (100 - speed) );
}
void kVmSaver::setRefreshTimeout( const int refreshTimeout )
{
this->refreshTimeout = refreshTimeout;
}
void kVmSaver::readSettings()
{
KConfigGroup config(KGlobal::config(), "Settings");
speed = config.readEntry( "Speed", 50 );
refreshTimeout = config.readEntry( "DisplayRefreshTimeout", 0 );
}
int kVmSaver::getRandom( const int max_value ) {
return (int)( vm_random(&(pool_state->pool->vm_random_data))*1.0*(max_value + 1.0)/
(VM_RAND_MAX + 1.0) );
// return (int)( rand()*1.0*(max_value + 1.0)/
// (RAND_MAX + 1.0) );
}
void kVmSaver::modifyArea( const int op ) {
int position;
vm_modify( pool_state->pool, position =
getRandom(pool_state->pool->area_size - 1), op );
pool_state->modified[position] = 1;
}
void kVmSaver::paintEvent(QPaintEvent *)
{
if (!cleared) {
cleared = true;
QPainter(this).fillRect(rect(), Qt::black);
}
for( int i = 0; i < 1; ++i ) {
if( getRandom(2) == 0 )
modifyArea( VM_OP_PUSH + getRandom(11) - getRandom(11) );
if( getRandom(8) == 0 )
modifyArea( VM_OP_STOP );
if( getRandom(8) == 0 )
modifyArea( VM_OP_COPY );
if( getRandom(8) == 0 )
modifyArea( VM_OP_EXEC );
// if( getRandom(5) == 0 )
// modifyArea( VM_OP_WAIT );
}
if( getRandom(0) == 0 )
vm_exec( pool_state->pool, getRandom(pool_state->pool->area_size - 1), 0,
vm_get_reverse( pool_state->pool ) );
vm_iterate( pool_state->pool, pool_state->modified );
// if( refreshStep++ >= refreshTimeout*refreshTimeout*refreshTimeout ) {
if( refreshStep++ >= refreshTimeout ) {
draw_pool( pool_state );
refreshStep = 0;
}
}
//-----------------------------------------------------------------------------
kVmSetup::kVmSetup( QWidget *parent )
: KDialog( parent)
{
setCaption(i18n( "Setup Virtual Machine" ));
setButtons(Ok|Cancel|Help);
setDefaultButton(Ok);
setModal(true);
readSettings();
setButtonText( Help, i18n( "A&bout" ) );
QWidget *main = new QWidget(this);
setMainWidget(main);
QHBoxLayout *tl = new QHBoxLayout( main );
tl->setSpacing( spacingHint() );
QVBoxLayout *tl1 = new QVBoxLayout();
tl->addLayout(tl1);
QLabel *label = new QLabel( i18n("Virtual machine speed:"), main );
tl1->addWidget(label);
QSlider *slider = new QSlider( Qt::Horizontal, main );
slider->setMinimumSize( 120, 20 );
slider->setRange( 0, 100 );
slider->setSingleStep( 10 );
slider->setPageStep( 20 );
slider->setTickPosition( QSlider::TicksBelow );
slider->setTickInterval( 10 );
slider->setValue( speed );
connect( slider, SIGNAL(valueChanged(int)),
SLOT(slotSpeed(int)) );
tl1->addWidget(slider);
label = new QLabel( i18n("Display update speed:"), main );
tl1->addWidget(label);
slider = new QSlider( Qt::Horizontal, main );
slider->setMinimumSize( 120, 20 );
slider->setRange( 0, MAX_REFRESH_TIMEOUT );
slider->setSingleStep( MAX_REFRESH_TIMEOUT/10 );
slider->setPageStep( MAX_REFRESH_TIMEOUT/5 );
slider->setTickPosition( QSlider::TicksBelow );
slider->setTickInterval( MAX_REFRESH_TIMEOUT/10 );
slider->setValue( MAX_REFRESH_TIMEOUT - refreshTimeout );
connect( slider, SIGNAL(valueChanged(int)),
SLOT(slotRefreshTimeout(int)) );
tl1->addWidget(slider);
tl1->addStretch();
preview = new QWidget( main );
preview->setFixedSize( 220, 165 );
preview->show(); // otherwise saver does not get correct size
saver = new kVmSaver( preview->winId() );
tl->addWidget(preview);
connect(this,SIGNAL(okClicked()),this,SLOT(slotOk()));
connect(this,SIGNAL(helpClicked()),this,SLOT(slotHelp()));
}
kVmSetup::~kVmSetup()
{
delete saver;
}
void kVmSetup::readSettings()
{
KConfigGroup config(KGlobal::config(), "Settings");
speed = config.readEntry( "Speed", 50 );
if ( speed > 100 )
speed = 100;
else if ( speed < 0 )
speed = 0;
refreshTimeout = config.readEntry( "DisplayRefreshTimeout", 0 );
if ( refreshTimeout > MAX_REFRESH_TIMEOUT )
refreshTimeout = MAX_REFRESH_TIMEOUT;
else if ( refreshTimeout < 0 )
refreshTimeout = 0;
}
void kVmSetup::slotSpeed( int num )
{
speed = num;
if ( saver )
saver->setSpeed( num );
}
void kVmSetup::slotRefreshTimeout( int num )
{
refreshTimeout = MAX_REFRESH_TIMEOUT - num;
if ( saver )
saver->setRefreshTimeout( refreshTimeout );
}
void kVmSetup::slotOk()
{
KConfigGroup config(KGlobal::config(), "Settings");
QString sspeed;
sspeed.setNum( speed );
config.writeEntry( "Speed", sspeed );
sspeed.setNum( refreshTimeout );
config.writeEntry( "DisplayRefreshTimeout", sspeed );
config.sync();
accept();
}
void kVmSetup::slotHelp()
{
KMessageBox::about(this,
i18n("Virtual Machine Version 0.1\n\nCopyright (c) 2000 Artur Rataj <art@zeus.polsl.gliwice.pl>\n"),
i18n("About Virtual Machine")
);
}
#include "kvm.moc"

View file

@ -0,0 +1,95 @@
//-----------------------------------------------------------------------------
//
// kvm screensaver
//
#ifndef KVM_H
#define KVM_H
#include <qtimer.h>
#include <kdialog.h>
#include <kscreensaver.h>
extern "C" {
#include "vm.h"
#include "vm_random.h"
}
#define THREAD_MAX_STACK_SIZE 10
#define MAX_THREADS_NUM 20
#define MAX_REFRESH_TIMEOUT 40
typedef struct {
QWidget *w;
int grid_width, grid_height;
int grid_margin_x;
int grid_margin_y;
int char_width, char_height;
bool insert_top_p, insert_bottom_p;
int density;
struct tvm_pool* pool;
char* modified;
int show_threads;
QPixmap images;
int image_width, image_height;
int nglyphs;
} m_state;
class kVmSaver : public KScreenSaver
{
Q_OBJECT
public:
kVmSaver( WId id );
virtual ~kVmSaver();
void setSpeed( int spd );
void setRefreshTimeout( const int refreshTimeout );
protected:
void readSettings();
int getRandom( const int max_value );
void modifyArea( const int op );
void paintEvent(QPaintEvent *event);
protected:
QTimer timer;
bool cleared;
int speed;
m_state* pool_state;
int refreshStep;
int refreshTimeout;
};
class kVmSetup : public KDialog
{
Q_OBJECT
public:
kVmSetup( QWidget *parent = NULL );
~kVmSetup();
protected:
void readSettings();
private slots:
void slotSpeed( int );
void slotRefreshTimeout( int num );
void slotOk();
void slotHelp();
private:
QWidget *preview;
kVmSaver *saver;
int speed;
int refreshTimeout;
};
#endif

View file

@ -0,0 +1,430 @@
//-----------------------------------------------------------------------------
//
// klines 0.1.1 - Basic screen saver for KDE
// by Dirk Staneker 1997
// based on kpolygon from Martin R. Jones 1996
// mailto:dirk.staneker@student.uni-tuebingen.de
//
// layout management added 1998/04/19 by Mario Weilguni <mweilguni@kde.org>
// 2001/03/04 Converted to libkscreensaver by Martin R. Jones
#include <stdlib.h>
#include <time.h>
#include <qcolor.h>
#include <qlabel.h>
#include <qslider.h>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <kconfig.h>
#include <kapplication.h>
#include <kmessagebox.h>
#include <kcolorbutton.h>
#include "kcolordialog.h"
#include "lines.h"
#include "lines.moc"
#include <qlayout.h>
#include <klocale.h>
#include <kglobal.h>
#include <qpainter.h>
#define MAXLENGTH 256
// libkscreensaver interface
class kLinesSaverInterface : public KScreenSaverInterface
{
public:
virtual KAboutData* aboutData() {
return new KAboutData( "klines.kss", "klock", ki18n( "KLines" ), "2.2.0", ki18n( "KLines" ) );
}
virtual KScreenSaver* create( WId id )
{
return new kLinesSaver( id );
}
virtual QDialog* setup()
{
return new kLinesSetup();
}
};
int main( int argc, char *argv[] )
{
kLinesSaverInterface kss;
return kScreenSaverMain( argc, argv, kss );
}
// Methods of the Lines-class
Lines::Lines(int x){
uint i;
numLn=x;
offx1=12;
offy1=16;
offx2=9;
offy2=10;
start=new Ln;
end=start;
for(i=1; i<numLn; i++){
end->next=new Ln;
end=end->next;
}
end->next=start;
akt=start;
}
Lines::~Lines(){
uint i;
for(i=0; i<numLn; i++){
end=start->next;
delete start;
start=end;
}
}
inline void Lines::reset(){ akt=start; }
inline void Lines::getKoord(int& a, int& b, int& c, int& d){
a=akt->x1; b=akt->y1;
c=akt->x2; d=akt->y2;
akt=akt->next;
}
inline void Lines::setKoord(const int& a, const int& b, const int& c, const int& d){
akt->x1=a; akt->y1=b;
akt->x2=c; akt->y2=d;
}
inline void Lines::next(void){ akt=akt->next; }
void Lines::turn(const int& w, const int& h){
start->x1=end->x1+offx1;
start->y1=end->y1+offy1;
start->x2=end->x2+offx2;
start->y2=end->y2+offy2;
if(start->x1>=w) offx1=-8;
if(start->x1<=0) offx1=7;
if(start->y1>=h) offy1=-11;
if(start->y1<=0) offy1=13;
if(start->x2>=w) offx2=-17;
if(start->x2<=0) offx2=15;
if(start->y2>=h) offy2=-10;
if(start->y2<=0) offy2=13;
end->next=start;
start=start->next;
end=end->next;
}
//-----------------------------------------------------------------------------
// dialog to setup screen saver parameters
//
kLinesSetup::kLinesSetup(QWidget *parent)
: KDialog(parent)
, saver( 0 ), length( 10 ), speed( 50 )
{
setCaption(i18n( "Setup Lines Screen Saver" ));
setModal(true);
setButtons(Ok|Cancel|Help);
setDefaultButton(Ok);
readSettings();
setButtonText( Help, i18n( "A&bout" ) );
QWidget *main = new QWidget(this);
setMainWidget(main);
QHBoxLayout *tl = new QHBoxLayout(main);
tl->setSpacing( spacingHint() );
QVBoxLayout *tl1 = new QVBoxLayout;
tl->addLayout(tl1);
QLabel *label=new QLabel(i18n("Length:"), main);
tl1->addWidget(label);
QSlider *sb= new QSlider(Qt::Horizontal, main);
sb->setMinimum(1);
sb->setMaximum(MAXLENGTH + 1);
sb->setPageStep(16);
sb->setValue(length);
sb->setMinimumSize(120, 20);
sb->setTickPosition(QSlider::TicksBelow);
sb->setTickInterval(32);
connect(sb, SIGNAL(valueChanged(int)), SLOT(slotLength(int)));
tl1->addWidget(sb);
label=new QLabel(i18n("Speed:"), main);
tl1->addWidget(label);
sb = new QSlider(Qt::Horizontal, main);
sb->setMinimum(0);
sb->setMaximum(100);
sb->setPageStep(10);
sb->setValue(speed);
sb->setMinimumSize(120, 20);
sb->setTickPosition(QSlider::TicksBelow);
sb->setTickInterval(10);
connect( sb, SIGNAL(valueChanged(int)), SLOT(slotSpeed(int)) );
tl1->addWidget(sb);
label=new QLabel(i18n("Beginning:"), main);
tl1->addWidget(label);
colorPush0=new KColorButton(colstart, main);
connect(colorPush0, SIGNAL(changed(QColor)),
SLOT(slotColstart(QColor)));
tl1->addWidget(colorPush0);
label=new QLabel(i18n("Middle:"), main);
tl1->addWidget(label);
colorPush1=new KColorButton(colmid, main);
connect(colorPush1, SIGNAL(changed(QColor)),
SLOT(slotColmid(QColor)));
tl1->addWidget(colorPush1);
label=new QLabel(i18n("End:"), main);
tl1->addWidget(label);
colorPush2=new KColorButton(colend, main);
connect(colorPush2, SIGNAL(changed(QColor)),
SLOT(slotColend(QColor)));
tl1->addWidget(colorPush2);
tl1->addStretch();
preview = new QWidget( main );
preview->setFixedSize( 220, 170 );
{
QPalette palette;
palette.setColor( preview->backgroundRole(), Qt::black );
preview->setPalette( palette );
preview->setAutoFillBackground(true);
}
preview->show(); // otherwise saver does not get correct size
saver=new kLinesSaver(preview->winId());
tl->addWidget(preview);
connect(this,SIGNAL(okClicked()),this,SLOT(slotOk()));
connect(this,SIGNAL(helpClicked()),this,SLOT(slotHelp()));
}
kLinesSetup::~kLinesSetup()
{
delete saver;
}
// read settings from config file
void kLinesSetup::readSettings(){
KConfigGroup config(KGlobal::config(), "Settings");
QString str;
length = config.readEntry("Length", length);
if(length>MAXLENGTH) length=MAXLENGTH;
else if(length<1) length=1;
speed = config.readEntry("Speed", speed);
if(speed>100) speed=100;
else if(speed<50) speed=50;
str=config.readEntry("StartColor");
if(!str.isNull()) colstart.setNamedColor(str);
else colstart=Qt::white;
str=config.readEntry("MidColor");
if(!str.isNull()) colmid.setNamedColor(str);
else colmid=Qt::blue;
str=config.readEntry("EndColor");
if(!str.isNull()) colend.setNamedColor(str);
else colend=Qt::black;
}
void kLinesSetup::slotLength(int len){
length=len;
if(saver) saver->setLines(length);
}
void kLinesSetup::slotSpeed(int num){
speed=num;
if(saver) saver->setSpeed(speed);
}
void kLinesSetup::slotColstart(const QColor &col){
colstart = col;
if(saver) saver->setColor(colstart, colmid, colend);
}
void kLinesSetup::slotColmid(const QColor &col){
colmid = col;
if(saver) saver->setColor(colstart, colmid, colend);
}
void kLinesSetup::slotColend(const QColor &col){
colend = col;
if(saver) saver->setColor(colstart, colmid, colend);
}
void kLinesSetup::slotHelp(){
KMessageBox::about(this,
i18n("Lines Version 2.2.0\n\n"
"Written by Dirk Staneker 1997\n"
"dirk.stanerker@student.uni-tuebingen.de"));
}
// Ok pressed - save settings and exit
void kLinesSetup::slotOk(){
KConfigGroup config(KGlobal::config(), "Settings");
QString slength;
slength.setNum(length);
config.writeEntry("Length", slength);
QString sspeed;
sspeed.setNum( speed );
config.writeEntry( "Speed", sspeed );
QString colName0, colName1, colName2;
colName0.sprintf("#%02x%02x%02x", colstart.red(),
colstart.green(), colstart.blue() );
config.writeEntry( "StartColor", colName0 );
colName1.sprintf("#%02x%02x%02x", colmid.red(),
colmid.green(), colmid.blue() );
config.writeEntry( "MidColor", colName1 );
colName2.sprintf("#%02x%02x%02x", colend.red(),
colend.green(), colend.blue() );
config.writeEntry( "EndColor", colName2 );
config.sync();
accept();
}
//-----------------------------------------------------------------------------
kLinesSaver::kLinesSaver( WId id ) : KScreenSaver( id ){
readSettings();
lines=new Lines(numLines);
initialiseColor();
initialiseLines();
timer.start(speed);
connect(&timer, SIGNAL(timeout()), SLOT(update()));
setAttribute( Qt::WA_NoSystemBackground );
cleared = false;
show();
}
kLinesSaver::~kLinesSaver(){
timer.stop();
delete lines;
}
// set lines properties
void kLinesSaver::setLines(int len){
timer.stop();
numLines=len;
initialiseLines();
initialiseColor();
timer.start(speed);
}
// set the speed
void kLinesSaver::setSpeed(int spd){
timer.stop();
speed=100-spd;
timer.start(speed);
}
void kLinesSaver::setColor(const QColor& cs, const QColor& cm, const QColor& ce){
colstart=cs;
colmid=cm;
colend=ce;
initialiseColor();
}
// read configuration settings from config file
void kLinesSaver::readSettings(){
KConfigGroup config(KGlobal::config(), "Settings");
numLines=config.readEntry("Length", 10);
speed = 100- config.readEntry("Speed", 50);
if(numLines>MAXLENGTH) numLines=MAXLENGTH;
else if(numLines<1) numLines = 1;
colstart=config.readEntry("StartColor", QColor(Qt::white));
colmid=config.readEntry("MidColor", QColor(Qt::blue));
colend=config.readEntry("EndColor", QColor(Qt::black));
}
void kLinesSaver::paintEvent(QPaintEvent *)
{
uint i;
int x1,y1,x2,y2;
int col=0;
lines->reset();
QPainter p( this );
p.setPen( Qt::black );
if (!cleared) {
cleared = true;
p.fillRect(rect(), Qt::black);
}
for(i=0; i<numLines; i++){
lines->getKoord(x1,y1,x2,y2);
p.drawLine( x1, y1, x2, y2 );
p.setPen( colors[col] );
col=(int)(i*colscale);
if(col>63) col=0;
}
lines->turn(width(), height());
}
// initialise the lines
void kLinesSaver::initialiseLines(){
uint i;
int x1,y1,x2,y2;
delete lines;
lines=new Lines(numLines);
lines->reset();
x1=rnd.getLong(width());
y1=rnd.getLong(height());
x2=rnd.getLong(width());
y2=rnd.getLong(height());
for(i=0; i<numLines; i++){
lines->setKoord(x1,y1,x2,y2);
lines->next();
}
}
// create a color table of 64 colors
void kLinesSaver::initialiseColor(){
int i;
double mr, mg, mb;
double cr, cg, cb;
mr=(double)(colmid.red()-colstart.red())/32;
mg=(double)(colmid.green()-colstart.green())/32;
mb=(double)(colmid.blue()-colstart.blue())/32;
cr=colstart.red();
cg=colstart.green();
cb=colstart.blue();
for(i=0; i<32; i++){
colors[63-i].setRgb((int)(mr*i+cr), (int)(mg*i+cg), (int)(mb*i+cb));
}
mr=(double)(colend.red()-colmid.red())/32;
mg=(double)(colend.green()-colmid.green())/32;
mb=(double)(colend.blue()-colmid.blue())/32;
cr=colmid.red();
cg=colmid.green();
cb=colmid.blue();
for(i=0; i<32; i++){
colors[31-1].setRgb((int)(mr*i+cr), (int)(mg*i+cg), (int)(mb*i+cb));
}
colscale=64.0/(double)numLines;
}

View file

@ -0,0 +1,95 @@
//-----------------------------------------------------------------------------
//
// klines 0.1.1 - Basic screen saver for KDE
// by Dirk Staneker 1997
// based on kpolygon 0.3 by Martin R. Jones 1996
//
#ifndef LINES_H
#define LINES_H
#include <qtimer.h>
#include <kdialog.h>
#include <krandomsequence.h>
#include <kscreensaver.h>
class KColorButton;
class Lines{
private:
struct Ln{
Ln* next;
int x1, y1, x2, y2;
};
Ln *start, *end, *akt;
int offx1, offy1, offx2, offy2;
uint numLn;
public:
Lines(int);
~Lines();
inline void reset();
inline void getKoord(int&, int&, int&, int&);
inline void setKoord(const int&, const int&, const int&, const int&);
inline void next(void);
void turn(const int&, const int&);
};
class kLinesSaver:public KScreenSaver{
Q_OBJECT
public:
kLinesSaver( WId id );
virtual ~kLinesSaver();
void setLines(int len);
void setSpeed(int spd);
void setColor(const QColor&, const QColor&, const QColor&);
private:
void readSettings();
void initialiseLines();
void initialiseColor();
protected:
void paintEvent(QPaintEvent *event);
protected:
bool cleared;
KRandomSequence rnd;
QTimer timer;
unsigned numLines;
int speed;
QColor colors[64];
QColor colstart, colmid, colend;
double colscale;
Lines* lines;
};
class kLinesSetup : public KDialog{
Q_OBJECT
public:
kLinesSetup(QWidget *parent=NULL);
~kLinesSetup();
protected:
void readSettings();
private slots:
void slotLength(int);
void slotSpeed(int);
void slotColstart(const QColor &);
void slotColmid(const QColor &);
void slotColend(const QColor &);
void slotOk();
void slotHelp();
private:
KColorButton *colorPush0, *colorPush1, *colorPush2;
QWidget *preview;
kLinesSaver *saver;
int length, speed;
QColor colstart, colmid, colend;
};
#endif

View file

@ -0,0 +1,617 @@
//-----------------------------------------------------------------------------
//
// Lorenz - Lorenz Attractor screen saver
// Nicolas Brodu, brodu@kde.org, 2000
//
// Portions of code from kblankscrn and khop.
// See authors there.
//
// I release my code as GPL, but see the other headers and the README
#include <math.h>
#include <stdlib.h>
#include <qpainter.h>
#include <qslider.h>
#include <qlayout.h>
#include <qcolor.h>
#include <qcolormap.h>
#include <qlabel.h>
#include <kapplication.h>
#include <klocale.h>
#include <kglobal.h>
#include <kconfig.h>
#include <kmessagebox.h>
#include <krandom.h>
#include "lorenz.h"
#include "lorenz.moc"
// libkscreensaver interface
class KLorenzSaverInterface : public KScreenSaverInterface
{
public:
virtual KAboutData* aboutData() {
return new KAboutData( "klorenz.kss", "klock", ki18n( "KLorenz" ), "2.2.0", ki18n( "KLorenz" ) );
}
virtual KScreenSaver* create( WId id )
{
return new KLorenzSaver( id );
}
virtual QDialog* setup()
{
return new KLorenzSetup();
}
};
int main( int argc, char *argv[] )
{
KLorenzSaverInterface kss;
return kScreenSaverMain( argc, argv, kss );
}
#define MINSPEED 1
#define MAXSPEED 1500
#define DEFSPEED 150
#define MINZROT -180
#define MAXZROT 180
#define DEFZROT 104 //100
#define MINYROT -180
#define MAXYROT 180
#define DEFYROT -19 //80
#define MINXROT -180
#define MAXXROT 180
#define DEFXROT 25 //20
#define MINEPOCH 1
#define MAXEPOCH 30000
#define DEFEPOCH 5800
#define MINCOLOR 1
#define MAXCOLOR 100
#define DEFCOLOR 20
//-----------------------------------------------------------------------------
// dialog to setup screen saver parameters
//
KLorenzSetup::KLorenzSetup( QWidget *parent )
: KDialog( parent)
{
setCaption(i18n( "Setup Lorenz Attractor" ));
setButtons(Ok|Cancel|Default|Help);
setDefaultButton(Ok);
setModal(true);
readSettings();
setButtonText( Help, i18n( "A&bout" ) );
QWidget *main = new QWidget(this);
setMainWidget(main);
QHBoxLayout *tl = new QHBoxLayout( main );
tl->setSpacing( spacingHint() );
QVBoxLayout *tl1 = new QVBoxLayout;
tl->addLayout(tl1);
QLabel *label = new QLabel( i18n("Speed:"), main );
tl1->addWidget(label);
sps = new QSlider(Qt::Horizontal, main);
sps->setMinimum(MINSPEED);
sps->setMaximum(MAXSPEED);
sps->setPageStep(10);
sps->setValue(speed);
sps->setMinimumSize( 120, 20 );
sps->setTickPosition(QSlider::TicksBelow);
sps->setTickInterval(150);
connect( sps, SIGNAL(valueChanged(int)), SLOT(slotSpeed(int)) );
tl1->addWidget(sps);
label = new QLabel( i18n("Epoch:"), main );
tl1->addWidget(label);
eps = new QSlider(Qt::Horizontal, main);
eps->setMinimum(MINEPOCH);
eps->setMaximum(MAXEPOCH);
eps->setPageStep(100);
eps->setValue(epoch);
eps->setMinimumSize( 120, 20 );
eps->setTickPosition(QSlider::TicksBelow);
eps->setTickInterval(3000);
connect( eps, SIGNAL(valueChanged(int)), SLOT(slotEpoch(int)) );
tl1->addWidget(eps);
label = new QLabel( i18n("Color rate:"), main );
tl1->addWidget(label);
crs = new QSlider(Qt::Horizontal, main);
crs->setMinimum(MINCOLOR);
crs->setMaximum(MAXCOLOR);
crs->setPageStep(5);
crs->setValue(crate);
crs->setMinimumSize( 120, 20 );
crs->setTickPosition(QSlider::TicksBelow);
crs->setTickInterval(10);
connect( crs, SIGNAL(valueChanged(int)), SLOT(slotCRate(int)) );
tl1->addWidget(crs);
label = new QLabel( i18n("Rotation Z:"), main );
tl1->addWidget(label);
zrs = new QSlider(Qt::Horizontal, main);
zrs->setMinimum(MINZROT);
zrs->setMaximum(MAXZROT);
zrs->setPageStep(18);
zrs->setValue(zrot);
zrs->setMinimumSize( 120, 20 );
zrs->setTickPosition(QSlider::TicksBelow);
zrs->setTickInterval(36);
connect( zrs, SIGNAL(valueChanged(int)), SLOT(slotZRot(int)) );
tl1->addWidget(zrs);
label = new QLabel( i18n("Rotation Y:"), main );
tl1->addWidget(label);
yrs = new QSlider(Qt::Horizontal, main);
yrs->setMinimum(MINYROT);
yrs->setMaximum(MAXYROT);
yrs->setPageStep(18);
yrs->setValue(yrot);
yrs->setMinimumSize( 120, 20 );
yrs->setTickPosition(QSlider::TicksBelow);
yrs->setTickInterval(36);
connect( yrs, SIGNAL(valueChanged(int)), SLOT(slotYRot(int)) );
tl1->addWidget(yrs);
label = new QLabel( i18n("Rotation X:"), main );
tl1->addWidget(label);
xrs = new QSlider(Qt::Horizontal, main);
xrs->setMinimum(MINXROT);
xrs->setMaximum(MAXXROT);
xrs->setPageStep(18);
xrs->setValue(xrot);
xrs->setMinimumSize( 120, 20 );
xrs->setTickPosition(QSlider::TicksBelow);
xrs->setTickInterval(36);
connect( xrs, SIGNAL(valueChanged(int)), SLOT(slotXRot(int)) );
tl1->addWidget(xrs);
preview = new QWidget( main );
preview->setFixedSize( 220, 165 );
{
QPalette palette;
palette.setColor( preview->backgroundRole(), Qt::black );
preview->setPalette( palette );
preview->setAutoFillBackground(true);
}
preview->show(); // otherwise saver does not get correct size
saver = new KLorenzSaver( preview->winId() );
tl->addWidget(preview);
connect(this,SIGNAL(okClicked()),this,SLOT(slotOk()));
connect(this,SIGNAL(helpClicked()),this,SLOT(slotHelp()));
connect(this,SIGNAL(defaultClicked()),this,SLOT(slotDefault()));
}
KLorenzSetup::~KLorenzSetup()
{
delete saver;
}
// read settings from config file
void KLorenzSetup::readSettings()
{
KConfigGroup config(KGlobal::config(), "Settings");
speed = config.readEntry( "Speed", DEFSPEED );
epoch = config.readEntry( "Epoch", DEFEPOCH );
crate = config.readEntry( "Color Rate", DEFCOLOR );
zrot = config.readEntry( "ZRot", DEFZROT );
yrot = config.readEntry( "YRot", DEFZROT );
xrot = config.readEntry( "XRot", DEFZROT );
}
void KLorenzSetup::slotSpeed(int num)
{
speed = num;
if (saver) saver->setSpeed(speed);
}
void KLorenzSetup::slotEpoch(int num)
{
epoch = num;
if (saver) saver->setEpoch(epoch);
}
void KLorenzSetup::slotCRate(int num)
{
crate = num;
if (saver) saver->setCRate(crate);
}
void KLorenzSetup::slotZRot(int num)
{
zrot = num;
if (saver) {
saver->setZRot(zrot);
saver->updateMatrix();
saver->newEpoch();
}
}
void KLorenzSetup::slotYRot(int num)
{
yrot = num;
if (saver) {
saver->setYRot(yrot);
saver->updateMatrix();
saver->newEpoch();
}
}
void KLorenzSetup::slotXRot(int num)
{
xrot = num;
if (saver) {
saver->setXRot(xrot);
saver->updateMatrix();
saver->newEpoch();
}
}
void KLorenzSetup::slotHelp()
{
KMessageBox::about(this,i18n("Lorenz Attractor screen saver for KDE\n\nCopyright (c) 2000 Nicolas Brodu"));
}
// Ok pressed - save settings and exit
void KLorenzSetup::slotOk()
{
KConfigGroup config(KGlobal::config(), "Settings");
config.writeEntry( "Speed", speed );
config.writeEntry( "Epoch", epoch );
config.writeEntry( "Color Rate", crate );
config.writeEntry( "ZRot", zrot );
config.writeEntry( "YRot", yrot );
config.writeEntry( "XRot", xrot );
config.sync();
accept();
}
void KLorenzSetup::slotDefault()
{
speed = DEFSPEED;
epoch = DEFEPOCH;
crate = DEFCOLOR;
zrot = DEFZROT;
yrot = DEFYROT;
xrot = DEFXROT;
if (saver) {
saver->setSpeed(speed);
saver->setEpoch(epoch);
saver->setCRate(crate);
saver->setZRot(zrot);
saver->setYRot(yrot);
saver->setXRot(xrot);
saver->updateMatrix();
saver->newEpoch();
}
sps->setValue(speed);
eps->setValue(epoch);
crs->setValue(crate);
zrs->setValue(zrot);
yrs->setValue(yrot);
xrs->setValue(xrot);
/* // User can cancel, or save defaults?
KSharedConfig::Ptr config = KGlobal::config();
config.setGroup( "Settings" );
config.writeEntry( "Speed", speed );
config.writeEntry( "Epoch", epoch );
config.writeEntry( "Color Rate", crate );
config.writeEntry( "ZRot", zrot );
config.writeEntry( "YRot", yrot );
config.writeEntry( "XRot", xrot );
config.sync();
*/
}
//-----------------------------------------------------------------------------
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
const double pi = M_PI;
// Homogeneous coordinate transform matrix
// I initially wrote it for a Java applet, it is inspired from a
// Matrix class in the JDK.
// Nicolas Brodu, 1998-2000
class Matrix3D
{
// All coefficients
double xx, xy, xz, xo;
double yx, yy, yz, yo;
double zx, zy, zz, zo;
// 0, 0, 0, 1 are implicit
public:
void unit()
{
xx=1.0; xy=0.0; xz=0.0; xo=0.0;
yx=0.0; yy=1.0; yz=0.0; yo=0.0;
zx=0.0; zy=0.0; zz=1.0; zo=0.0;
}
Matrix3D ()
{
unit();
}
// Translation
void translate(double x, double y, double z)
{
xo += x;
yo += y;
zo += z;
}
// Rotation, in degrees, around the Y axis
void rotY(double theta)
{
theta *= pi / 180;
double ct = cos(theta);
double st = sin(theta);
double Nxx = xx * ct + zx * st;
double Nxy = xy * ct + zy * st;
double Nxz = xz * ct + zz * st;
double Nxo = xo * ct + zo * st;
double Nzx = zx * ct - xx * st;
double Nzy = zy * ct - xy * st;
double Nzz = zz * ct - xz * st;
double Nzo = zo * ct - xo * st;
xo = Nxo;
xx = Nxx;
xy = Nxy;
xz = Nxz;
zo = Nzo;
zx = Nzx;
zy = Nzy;
zz = Nzz;
}
// Rotation, in degrees, around the X axis
void rotX(double theta)
{
theta *= pi / 180;
double ct = cos(theta);
double st = sin(theta);
double Nyx = yx * ct + zx * st;
double Nyy = yy * ct + zy * st;
double Nyz = yz * ct + zz * st;
double Nyo = yo * ct + zo * st;
double Nzx = zx * ct - yx * st;
double Nzy = zy * ct - yy * st;
double Nzz = zz * ct - yz * st;
double Nzo = zo * ct - yo * st;
yo = Nyo;
yx = Nyx;
yy = Nyy;
yz = Nyz;
zo = Nzo;
zx = Nzx;
zy = Nzy;
zz = Nzz;
}
// Rotation, in degrees, around the Z axis
void rotZ(double theta)
{
theta *= pi / 180;
double ct = cos(theta);
double st = sin(theta);
double Nyx = yx * ct + xx * st;
double Nyy = yy * ct + xy * st;
double Nyz = yz * ct + xz * st;
double Nyo = yo * ct + xo * st;
double Nxx = xx * ct - yx * st;
double Nxy = xy * ct - yy * st;
double Nxz = xz * ct - yz * st;
double Nxo = xo * ct - yo * st;
yo = Nyo;
yx = Nyx;
yy = Nyy;
yz = Nyz;
xo = Nxo;
xx = Nxx;
xy = Nxy;
xz = Nxz;
}
// Multiply by a projection matrix, with camera f
// f 0 0 0 x f*x
// 0 f 0 0 * y = f*y
// 0 0 1 f z z+f
// 0 0 0 1 1 1
// So, it it easy to find the 2D coordinates after the transform
// u = f*x / (z+f)
// v = f*y / (z+f)
void proj(double f)
{
xx*=f;
xy*=f;
xz*=f;
xo*=f;
yx*=f;
yy*=f;
yz*=f;
yo*=f;
zo+=f;
}
// Apply the transformation 3D => 2D
void transform(double x, double y, double z, double &u, double& v, double& w)
{
u = x * xx + y * xy + z * xz + xo;
v = x * yx + y * yy + z * yz + yo;
w = x * zx + y * zy + z * zz + zo;
}
};
KLorenzSaver::KLorenzSaver( WId id ) : KScreenSaver( id )
{
readSettings();
// Create a transform matrix with the parameters
mat = new Matrix3D();
updateMatrix();
newEpoch();
timer.start( 10 );
connect( &timer, SIGNAL(timeout()), SLOT(update()) );
setAttribute( Qt::WA_NoSystemBackground );
show();
}
KLorenzSaver::~KLorenzSaver()
{
delete mat;
mat=0;
timer.stop();
}
// read configuration settings from config file
void KLorenzSaver::readSettings()
{
KConfigGroup config(KGlobal::config(), "Settings");
speed = config.readEntry( "Speed", DEFSPEED );
epoch = config.readEntry( "Epoch", DEFEPOCH );
zrot = config.readEntry( "ZRot", DEFZROT );
yrot = config.readEntry( "YRot", DEFZROT );
xrot = config.readEntry( "XRot", DEFZROT );
int crate_num = config.readEntry( "Color Rate", DEFCOLOR );
crate = (double)crate_num / (double)MAXCOLOR;
}
void KLorenzSaver::setSpeed(int num)
{
speed = num;
}
void KLorenzSaver::setEpoch(int num)
{
epoch = num;
}
void KLorenzSaver::setZRot(int num)
{
zrot = num;
}
void KLorenzSaver::setYRot(int num)
{
yrot = num;
}
void KLorenzSaver::setXRot(int num)
{
xrot = num;
}
void KLorenzSaver::setCRate(int num)
{
crate = (double)num / (double)MAXCOLOR;
}
void KLorenzSaver::updateMatrix()
{
// reset matrix
mat->unit();
// Remove the mean before the rotations...
mat->translate(-0.95413, -0.96740, -23.60065);
mat->rotZ(zrot);
mat->rotY(yrot);
mat->rotX(xrot);
mat->translate(0, 0, 100);
mat->proj(1);
}
void KLorenzSaver::newEpoch()
{
// Start at a random position, somewhere around the mean
x = 0.95-25.0+50.0*KRandom::random() / (RAND_MAX+1.0);
y = 0.97-25.0+50.0*KRandom::random() / (RAND_MAX+1.0);
z = 23.6-25.0+50.0*KRandom::random() / (RAND_MAX+1.0);
// start at some random 'time' as well to have different colors
t = 10000.0*KRandom::random() / (RAND_MAX+1.0);
e=0; // reset epoch counter
}
// Computes the derivatives using Lorenz equations
static void lorenz(double x, double y, double z, double& dx, double& dy, double& dz)
{
dx = 10*(y-x);
dy = 28*x - y - x*z;
dz = x*y - z*8.0/3.0;
}
// Use a simple Runge-Kutta formula to draw a few points
// No need to go beyond 2nd order for a screensaver!
void KLorenzSaver::paintEvent(QPaintEvent *)
{
double kx, ky, kz, dx, dy, dz;
const double h = 0.0001;
const double tqh = h * 3.0 / 4.0;
QPainter p(this);
if ( !e )
p.fillRect(rect(), Qt::black);
QColormap cmap = QColormap::instance();
for (int i=0; i<speed; i++) {
// Runge-Kutta formula
lorenz(x,y,z,dx,dy,dz);
lorenz(x + tqh*dx, y + tqh*dy, z + tqh*dz, kx, ky, kz);
x += h*(dx/3.0+2*kx/3.0);
y += h*(dy/3.0+2*ky/3.0);
z += h*(dz/3.0+2*kz/3.0);
// Apply transform
mat->transform(x,y,z,kx,ky,kz);
// Choose a color
p.setPen(
cmap.pixel(QColor((int)(sin(t*crate/pi)*127+128),
(int)(sin(t*crate/(pi-1))*127+128),
(int)(sin(t*crate/(pi-2))*127+128))) );
// Draw a point
p.drawPoint( (int)(kx*width()*1.5/kz)+(int)(width()/2),
(int)(ky*height()*1.5/kz)+(int)(height()/2));
t+=h;
}
if (++e>=epoch)
newEpoch();
}

View file

@ -0,0 +1,85 @@
//-----------------------------------------------------------------------------
//
// Lorenz - Lorenz Attractor screen saver
// Nicolas Brodu, brodu@kde.org, 2000
//
// Portions of code from kblankscrn and khop.
// See authors there.
//
// I release my code as GPL, but see the other headers and the README
#ifndef LORENZKSCRN_H
#define LORENZKSCRN_H
#include <qtimer.h>
#include <qcolor.h>
#include <kscreensaver.h>
#include <kdialog.h>
// See lorenz.cpp for this private class
class Matrix3D;
class KLorenzSaver : public KScreenSaver
{
Q_OBJECT
public:
KLorenzSaver( WId id );
virtual ~KLorenzSaver();
void setSpeed(int num);
void setEpoch(int num);
void setCRate(int num);
void setZRot(int num);
void setYRot(int num);
void setXRot(int num);
void updateMatrix();
void newEpoch();
protected:
void paintEvent(QPaintEvent *);
protected:
QTimer timer;
private:
void readSettings();
private:
double x, y, z, t;
double speed, epoch, zrot, yrot, xrot, crate;
int e;
Matrix3D *mat;
};
class QSlider;
class KLorenzSetup : public KDialog
{
Q_OBJECT
public:
KLorenzSetup(QWidget *parent = 0 );
~KLorenzSetup();
protected:
void readSettings();
private slots:
void slotSpeed(int num);
void slotEpoch(int num);
void slotCRate(int num);
void slotZRot(int num);
void slotYRot(int num);
void slotXRot(int num);
void slotOk();
void slotHelp();
void slotDefault();
private:
QWidget *preview;
QSlider *sps, *eps, *zrs, *yrs, *xrs, *crs;
KLorenzSaver *saver;
int speed, epoch, zrot, yrot, xrot, crate;
};
#endif

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

@ -0,0 +1,980 @@
/** @file
*
* KPendulum screen saver for KDE
*
* The screen saver displays a physically realistic simulation of a two-part
* pendulum.
*
* Copyright (C) 2004 Georg Drenkhahn, Georg.Drenkhahn@gmx.net
*
* 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) version 3 or
* any later version accepted by the membership of KDE e.V. (or its successor
* approved by the membership of KDE e.V.), which shall act as a proxy defined
* in Section 14 of version 3 of the license.
*
* 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.
*/
#define QT_NO_COMPAT
// std. C++ headers
#include <cstdlib>
// Qt headers
#include <QLineEdit>
#include <QSpinBox>
#include <QValidator>
#include <QColorDialog>
#include <QPushButton>
#include <QToolTip>
#include <QResizeEvent>
// KDE headers
#include <KLocale>
#include <KGlobal>
#include <KConfig>
#include <KDebug>
#include <KMessageBox>
// Eigen2 from KDE support
#include <Eigen/Core>
#include <Eigen/Geometry>
// import most common Eigen types
using namespace Eigen;
// the screen saver preview area class
#include "sspreviewarea.h"
#include "pendulum.h" // own interfaces
#include <kcolordialog.h>
#include "pendulum.moc"
#define KPENDULUM_VERSION "2.0"
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
// libkscreensaver interface
class KPendulumSaverInterface : public KScreenSaverInterface
{
public:
/// aboutdata instance for libkscreensaver interface
virtual KAboutData* aboutData()
{
return new KAboutData(
"kpendulum.kss", 0,
ki18n("Simulation of a two-part pendulum"),
KPENDULUM_VERSION,
ki18n("Simulation of a two-part pendulum"));
}
/// function to create screen saver object
virtual KScreenSaver* create(WId id)
{
return new KPendulumSaver(id);
}
/// function to create setup dialog for screen saver
virtual QDialog* setup()
{
return new KPendulumSetup();
}
};
int main( int argc, char *argv[] )
{
KPendulumSaverInterface kss;
return kScreenSaverMain(argc, argv, kss);
}
//-----------------------------------------------------------------------------
// PendulumOdeSolver
//-----------------------------------------------------------------------------
PendulumOdeSolver::PendulumOdeSolver(
const double& t,
const double& dt,
const Vector4d& y,
const double& eps,
const double& m1,
const double& m2,
const double& l1,
const double& l2,
const double& g)
: RkOdeSolver<double,4>(t, y, dt, eps),
// constants for faster numeric calculation, derived from m1,m2,l1,l2,g
m_A(1.0/(m2*l1*l1)),
m_B1(m2*l1*l2),
m_B(1.0/m_B1),
m_C((m1+m2)/(m2*m2*l2*l2)),
m_D(g*(m1+m2)*l1),
m_E(g*m2*l2),
m_M((m1+m2)/m2)
{
}
Vector4d PendulumOdeSolver::f(const double& x, const Vector4d& y) const
{
(void)x; // unused
const double& q1 = y[0];
const double& q2 = y[1];
const double& p1 = y[2];
const double& p2 = y[3];
const double cosDq = std::cos(q1-q2);
const double iden = 1.0/(m_M - cosDq*cosDq); // invers denominator
const double dq1dt = (m_A*p1 - m_B*cosDq*p2)*iden;
const double dq2dt = (m_C*p2 - m_B*cosDq*p1)*iden;
Vector4d ypr;
ypr[0] = dq1dt;
ypr[1] = dq2dt;
const double K = m_B1 * dq1dt*dq2dt * std::sin(q1-q2);
ypr[2] = -K - m_D * std::sin(q1);
ypr[3] = K - m_E * std::sin(q2);
return ypr;
}
//-----------------------------------------------------------------------------
// Rotation: screen saver widget
//-----------------------------------------------------------------------------
PendulumGLWidget::PendulumGLWidget(QWidget* parent)
: QGLWidget(parent),
m_eyeR(30), // eye coordinates (polar)
m_eyeTheta(M_PI*0.45),
m_eyePhi(0),
m_lightR(m_eyeR), // light coordinates (polar)
m_lightTheta(M_PI*0.25),
m_lightPhi(M_PI*0.25),
m_quadM1(gluNewQuadric()),
m_barColor(KPendulumSaver::sm_barColorDefault),
m_m1Color(KPendulumSaver::sm_m1ColorDefault),
m_m2Color(KPendulumSaver::sm_m2ColorDefault)
{
}
PendulumGLWidget::~PendulumGLWidget(void)
{
gluDeleteQuadric(m_quadM1);
}
void PendulumGLWidget::setEyePhi(double phi)
{
m_eyePhi = phi;
while (m_eyePhi < 0)
{
m_eyePhi += 2.*M_PI;
}
while (m_eyePhi > 2*M_PI)
{
m_eyePhi -= 2.*M_PI;
}
// get the view port
GLint vp[4];
glGetIntegerv(GL_VIEWPORT, vp);
// calc new perspective, a resize event is simulated here
resizeGL(static_cast<int>(vp[2]), static_cast<int>(vp[3]));
}
void PendulumGLWidget::setAngles(const double& q1, const double& q2)
{
m_ang1 = static_cast<GLfloat>(q1*180./M_PI);
m_ang2 = static_cast<GLfloat>(q2*180./M_PI);
}
void PendulumGLWidget::setMasses(const double& m1, const double& m2)
{
m_sqrtm1 = static_cast<GLfloat>(std::sqrt(m1));
m_sqrtm2 = static_cast<GLfloat>(std::sqrt(m2));
}
void PendulumGLWidget::setLengths(const double& l1, const double& l2)
{
m_l1 = static_cast<GLfloat>(l1);
m_l2 = static_cast<GLfloat>(l2);
}
void PendulumGLWidget::setBarColor(const QColor& c)
{
if (c.isValid())
{
m_barColor = c;
}
}
void PendulumGLWidget::setM1Color(const QColor& c)
{
if (c.isValid())
{
m_m1Color = c;
}
}
void PendulumGLWidget::setM2Color(const QColor& c)
{
if (c.isValid())
{
m_m2Color = c;
}
}
/* --------- protected methods ----------- */
void PendulumGLWidget::initializeGL(void)
{
qglClearColor(QColor(Qt::black)); // set color to clear the background
glClearDepth(1); // depth buffer setup
glEnable(GL_DEPTH_TEST); // depth testing
glDepthFunc(GL_LEQUAL); // type of depth test
glShadeModel(GL_SMOOTH); // smooth color shading in poygons
// nice perspective calculation
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
// set up the light
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
glEnable(GL_LIGHT1);
glMatrixMode(GL_MODELVIEW); // select modelview matrix
glLoadIdentity();
// set position of light0
GLfloat lightPos[4]=
{GLfloat(m_lightR * std::sin(m_lightTheta) * std::sin(m_lightPhi)),
GLfloat(m_lightR * std::sin(m_lightTheta) * std::cos(m_lightPhi)),
GLfloat(m_lightR * std::cos(m_lightTheta)),
0};
glLightfv(GL_LIGHT0, GL_POSITION, lightPos);
// set position of light1
lightPos[0] = m_lightR * std::sin(m_lightTheta) * std::sin(m_lightPhi+M_PI);
lightPos[1] = m_lightR * std::sin(m_lightTheta) * std::cos(m_lightPhi+M_PI);
glLightfv(GL_LIGHT1, GL_POSITION, lightPos);
// only for lights #>0
GLfloat spec[] = {1,1,1,1};
glLightfv(GL_LIGHT1, GL_SPECULAR, spec);
glLightfv(GL_LIGHT1, GL_DIFFUSE, spec);
// enable setting the material colour by glColor()
glEnable(GL_COLOR_MATERIAL);
GLfloat emi[4] = {.13, .13, .13, 1};
glMaterialfv(GL_FRONT, GL_EMISSION, emi);
}
void PendulumGLWidget::paintGL(void)
{
// clear color and depth buffer
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_MODELVIEW); // select modelview matrix
glLoadIdentity();
const GLfloat width = 2.0;
const GLfloat masswidth = 1.0;
const int noOfSlices = 20;
// top axis, left (x>0)
glTranslatef(0.5*width, 0, 0);
glRotatef(90, 0, 1, 0);
qglColor(m_barColor);
gluCylinder(m_quadM1, 0.2, 0.2, 5, 10, 1);
gluSphere(m_quadM1, 0.2, 10, 10);
// top axis, right
glLoadIdentity();
glTranslatef(-0.5*width, 0, 0);
glRotatef(-90, 0, 1, 0);
gluCylinder(m_quadM1, 0.2, 0.2, 5, 10, 1);
gluSphere(m_quadM1, 0.2, 10, 10);
// 1. part, left
glLoadIdentity();
glRotatef(m_ang1, 1, 0, 0);
glPushMatrix();
glTranslatef(0.5*width, 0, -m_l1);
gluCylinder(m_quadM1, 0.2, 0.2, m_l1, 10, 1);
glPopMatrix();
// 1. part, right
glPushMatrix();
glTranslatef(-0.5*width, 0, -m_l1);
gluCylinder(m_quadM1, 0.2, 0.2, m_l1, 10, 1);
// 1. part, bottom
glRotatef(90, 0, 1, 0);
gluSphere(m_quadM1, 0.2, 10, 10); // bottom corner 1
gluCylinder(m_quadM1, 0.2, 0.2, width, 10, 1); // connection
glTranslatef(0, 0, 0.5*(width-masswidth));
qglColor(m_m1Color);
gluCylinder(m_quadM1, m_sqrtm1, m_sqrtm1, masswidth, noOfSlices, 1); // mass 1
gluQuadricOrientation(m_quadM1, GLU_INSIDE);
gluDisk(m_quadM1, 0, m_sqrtm1, noOfSlices, 1); // bottom of mass
gluQuadricOrientation(m_quadM1, GLU_OUTSIDE);
glTranslatef(0, 0, masswidth);
gluDisk(m_quadM1, 0, m_sqrtm1, noOfSlices, 1); // top of mass
glTranslatef(0, 0, 0.5*(width-masswidth));
qglColor(m_barColor);
gluSphere(m_quadM1, 0.2, 10, 10); // bottom corner 2
glPopMatrix();
// 2. pendulum bar
glLoadIdentity();
glTranslatef(0, m_l1*std::sin(m_ang1*M_PI/180.), -m_l1*std::cos(m_ang1*M_PI/180.));
glRotatef(m_ang2, 1, 0, 0);
glTranslatef(0, 0, -m_l2);
qglColor(m_barColor);
gluCylinder(m_quadM1, 0.2, 0.2, m_l2, 10, 1);
// mass 2
glRotatef(90, 0, 1, 0);
glTranslatef(0, 0, -0.5*masswidth);
qglColor(m_m2Color);
gluCylinder(m_quadM1, m_sqrtm2, m_sqrtm2, masswidth, noOfSlices, 1);
gluQuadricOrientation(m_quadM1, GLU_INSIDE);
gluDisk(m_quadM1, 0, m_sqrtm2, noOfSlices, 1); // bottom of mass
gluQuadricOrientation(m_quadM1, GLU_OUTSIDE);
glTranslatef(0, 0, masswidth);
gluDisk(m_quadM1, 0, m_sqrtm2, noOfSlices, 1); // top of mass
glFlush();
}
void PendulumGLWidget::resizeGL(int w, int h)
{
kDebug() << "w=" << w << ", h=" << h << "\n";
// prevent a divide by zero
if (h == 0)
{
return;
}
// set the new view port
glViewport(0, 0, static_cast<GLint>(w), static_cast<GLint>(h));
// set up projection matrix
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
// Perspective view
gluPerspective(
40.0f,
static_cast<GLdouble>(w)/static_cast<GLdouble>(h),
1.0, 100.0f);
// Viewing transformation, position for better view
// Theta is polar angle 0<Theta<Pi
gluLookAt(
m_eyeR * std::sin(m_eyeTheta) * std::sin(m_eyePhi),
m_eyeR * std::sin(m_eyeTheta) * std::cos(m_eyePhi),
m_eyeR * std::cos(m_eyeTheta),
0,0,0,
0,0,1);
}
//-----------------------------------------------------------------------------
// KPendulumSaver: screen saver class
//-----------------------------------------------------------------------------
// class methods
KPendulumSaver::KPendulumSaver(WId id) :
KScreenSaver(id),
m_solver(0),
m_massRatio(sm_massRatioDefault),
m_lengthRatio(sm_lengthRatioDefault),
m_g(sm_gDefault),
m_E(sm_EDefault),
m_persChangeInterval(sm_persChangeIntervalDefault)
{
// no need to set our parent widget's background here, the GL widget sets its
// own background color
m_glArea = new PendulumGLWidget(); // create gl widget w/o parent
m_glArea->setEyePhi(sm_eyePhiDefault);
readSettings(); // read global settings into pars
// init m_glArea with read settings, construct and init m_solver
initData();
embed(m_glArea); // embed gl widget and resize it
m_glArea->show(); // show embedded gl widget
// set up and start cyclic timer
m_timer = new QTimer(this);
m_timer->start(sm_deltaT);
connect(m_timer, SIGNAL(timeout()), this, SLOT(doTimeStep()));
}
KPendulumSaver::~KPendulumSaver()
{
m_timer->stop();
// m_timer is automatically deleted with parent KPendulumSaver
delete m_solver;
delete m_glArea;
}
void KPendulumSaver::readSettings()
{
// read configuration settings from config file
KConfigGroup config(KGlobal::config(), "Settings");
// internal saver parameters are set to stored values or left at their
// default values if stored values are out of range
setMassRatio(
config.readEntry(
"mass ratio",
KPendulumSaver::sm_massRatioDefault));
setLengthRatio(
config.readEntry(
"length ratio",
KPendulumSaver::sm_lengthRatioDefault));
setG(
config.readEntry(
"g",
KPendulumSaver::sm_gDefault));
setE(
config.readEntry(
"E",
KPendulumSaver::sm_EDefault));
setPersChangeInterval(
config.readEntry(
"perspective change interval",
(uint)KPendulumSaver::sm_persChangeIntervalDefault));
// set the colours
setBarColor(config.readEntry("bar color", sm_barColorDefault));
setM1Color( config.readEntry("m1 color", sm_m1ColorDefault));
setM2Color( config.readEntry("m2 color", sm_m2ColorDefault));
}
void KPendulumSaver::initData()
{
const double m1plusm2 = 2; // m1+m2
const double m2 = m_massRatio * m1plusm2;
const double m1 = m1plusm2 - m2;
m_glArea->setMasses(m1, m2);
m_glArea->setAngles(0, 0);
const double l1plusl2 = 9; // l1+l2
const double l2 = m_lengthRatio * l1plusl2;
const double l1 = l1plusl2 - l2;
m_glArea->setLengths(l1, l2);
// kinetic energy of m2 and m1
const double kin_energy = m_E * m_g * (l1*m1 + (m1+m2)*(l1+l2));
// angular velocity for 1. and 2. pendulum
const double qp = std::sqrt(2.*kin_energy/((m1+m2)*l1*l1 + m2*l2*l2 + m2*l1*l2));
// assemble initial y for solver
Vector4d y;
y[0] = 0; // q1
y[1] = 0; // q2
y[2] = (m1+m2)*l1*l1*qp + 0.5*m2*l1*l2*qp; // p1
y[3] = m2*l2*l2*qp + 0.5*m2*l1*l2*qp; // p2
// delete old solver
if (m_solver!=0)
{
delete m_solver;
}
// init new solver
m_solver = new PendulumOdeSolver(
0.0, // t
0.01, // first dt step size estimation
y,
1e-5, // eps
m1,
m2,
l1,
l2,
m_g);
}
void KPendulumSaver::setBarColor(const QColor& c)
{
m_glArea->setBarColor(c);
}
QColor KPendulumSaver::barColor(void) const
{
return m_glArea->barColor();
}
void KPendulumSaver::setM1Color(const QColor& c)
{
m_glArea->setM1Color(c);
}
QColor KPendulumSaver::m1Color(void) const
{
return m_glArea->m1Color();
}
void KPendulumSaver::setM2Color(const QColor& c)
{
m_glArea->setM2Color(c);
}
QColor KPendulumSaver::m2Color(void) const
{
return m_glArea->m2Color();
}
void KPendulumSaver::setMassRatio(const double& massRatio)
{
// range check is not necessary in normal operation because validators check
// the values at input. But the validators do not check for corrupted
// settings read from disk.
if ((massRatio >= sm_massRatioLimitLower)
&& (massRatio <= sm_massRatioLimitUpper)
&& (m_massRatio != massRatio))
{
m_massRatio = massRatio;
if (m_timer!=0)
{
initData();
}
}
}
void KPendulumSaver::setLengthRatio(const double& lengthRatio)
{
if ((lengthRatio >= sm_lengthRatioLimitLower)
&& (lengthRatio <= sm_lengthRatioLimitUpper)
&& (m_lengthRatio != lengthRatio))
{
m_lengthRatio = lengthRatio;
if (m_timer!=0)
{
initData();
}
}
}
void KPendulumSaver::setG(const double& g)
{
if ((g >= sm_gLimitLower)
&& (g <= sm_gLimitUpper)
&& (m_g != g))
{
m_g = g;
if (m_timer!=0)
{
initData();
}
}
}
void KPendulumSaver::setE(const double& E)
{
if ((E >= sm_ELimitLower)
&& (E <= sm_ELimitUpper)
&& (m_E != E))
{
m_E = E;
if (m_timer!=0)
{
initData();
}
}
}
void KPendulumSaver::setPersChangeInterval(
const unsigned int& persChangeInterval)
{
if ((persChangeInterval >= sm_persChangeIntervalLimitLower)
&& (persChangeInterval <= sm_persChangeIntervalLimitUpper)
&& (m_persChangeInterval != persChangeInterval))
{
m_persChangeInterval = persChangeInterval;
// do not restart simulation here
}
}
void KPendulumSaver::doTimeStep()
{
/* time (in seconds) of perspective change.
* - t<0: no change yet
* - t=0: change starts
* - 0<t<moving time: change takes place
* - t=moving time: end of the change */
static double persChangeTime = -5;
// integrate a step ahead
m_solver->integrate(0.001 * sm_deltaT);
// read new y from solver
const Vector4d& y = m_solver->Y();
// tell glArea the new coordinates/angles of the pendulum
m_glArea->setAngles(y[0], y[1]);
// handle perspective change
persChangeTime += 0.001 * sm_deltaT;
if (persChangeTime > 0)
{
// phi value at the start of a perspective change
static double eyePhi0 = sm_eyePhiDefault;
// phi value at the end of a perspective change
static double eyePhi1 = 0.75*M_PI;
static double deltaEyePhi = eyePhi1-eyePhi0;
// movement acceleration/deceleration
const double a = 3;
// duration of the change period
const double movingTime = 2.*std::sqrt(std::abs(deltaEyePhi)/a);
// new current phi of eye
double eyePhi = persChangeTime < 0.5*movingTime ?
// accelerating phase
eyePhi0 + (deltaEyePhi>0?1:-1)
* 0.5*a*persChangeTime*persChangeTime:
// decellerating phase
eyePhi1 - (deltaEyePhi>0?1:-1)
* 0.5*a*(movingTime-persChangeTime)*(movingTime-persChangeTime);
if (persChangeTime > movingTime)
{ // perspective change has finished
// set new time till next change
persChangeTime = -double(m_persChangeInterval);
eyePhi0 = eyePhi = eyePhi1;
// find new phi value with angleLimit < phi < Pi-angleLimit or
// Pi+angleLimit < phi < 2*Pi-angleLimit
const double angleLimit = M_PI*0.2;
for (eyePhi1 = 0;
(eyePhi1<angleLimit)
|| ((eyePhi1<M_PI+angleLimit) && (eyePhi1>M_PI-angleLimit))
|| (eyePhi1>2*M_PI-angleLimit);
eyePhi1 = double(rand())/RAND_MAX * 2*M_PI)
{
}
// new delta phi for next change
deltaEyePhi = eyePhi1 - eyePhi0;
// find shortest perspective change
if (deltaEyePhi < -M_PI)
{
deltaEyePhi += 2*M_PI;
}
}
m_glArea->setEyePhi(eyePhi); // set new perspective
}
m_glArea->updateGL(); // repaint scenery
// restarting timer not necessary here, it is a cyclic timer
}
// public slot of KPendulumSaver, forward resize event to public slot of glArea
// to allow the resizing of the gl area withing the setup dialog
void KPendulumSaver::resizeGlArea(QResizeEvent* e)
{
m_glArea->resize(e->size());
}
// public static class member variables
const QColor KPendulumSaver::sm_barColorDefault(255, 255, 127);
const QColor KPendulumSaver::sm_m1ColorDefault( 170, 0, 127);
const QColor KPendulumSaver::sm_m2ColorDefault( 85, 170, 127);
const double KPendulumSaver::sm_massRatioLimitLower = 0.01;
const double KPendulumSaver::sm_massRatioLimitUpper = 0.99;
const double KPendulumSaver::sm_massRatioDefault = 0.5;
const double KPendulumSaver::sm_lengthRatioLimitLower = 0.01;
const double KPendulumSaver::sm_lengthRatioLimitUpper = 0.99;
const double KPendulumSaver::sm_lengthRatioDefault = 0.5;
const double KPendulumSaver::sm_gLimitLower = 0.1;
const double KPendulumSaver::sm_gLimitUpper = 300.0;
const double KPendulumSaver::sm_gDefault = 40.0;
const double KPendulumSaver::sm_ELimitLower = 0.0;
const double KPendulumSaver::sm_ELimitUpper = 5.0;
const double KPendulumSaver::sm_EDefault = 1.2;
const unsigned int KPendulumSaver::sm_persChangeIntervalLimitLower = 5;
const unsigned int KPendulumSaver::sm_persChangeIntervalLimitUpper = 600;
const unsigned int KPendulumSaver::sm_persChangeIntervalDefault = 15;
// private static class member variables
const unsigned int KPendulumSaver::sm_deltaT = 20;
const double KPendulumSaver::sm_eyePhiDefault = 0.25 * M_PI;
//-----------------------------------------------------------------------------
// KPendulumSetup: dialog to setup screen saver parameters
//-----------------------------------------------------------------------------
KPendulumSetup::KPendulumSetup(QWidget* parent)
: KDialog(parent)
{
// the dialog should block, no other control center input should be possible
// until the dialog is closed
setModal(true);
setCaption(i18n( "KPendulum Setup" ));
setButtons(Ok|Cancel|Help);
setDefaultButton(Ok);
setButtonText( Help, i18n( "A&bout" ) );
QWidget *main = new QWidget(this);
setMainWidget(main);
cfg = new PendulumWidget();
cfg->setupUi( main );
// create input validators
cfg->m_mEdit->setValidator(
new QDoubleValidator(
KPendulumSaver::sm_massRatioLimitLower,
KPendulumSaver::sm_massRatioLimitUpper,
5, cfg->m_mEdit));
cfg->m_lEdit->setValidator(
new QDoubleValidator(
KPendulumSaver::sm_lengthRatioLimitLower,
KPendulumSaver::sm_lengthRatioLimitUpper,
5, cfg->m_lEdit));
cfg->m_gEdit->setValidator(
new QDoubleValidator(
KPendulumSaver::sm_gLimitLower,
KPendulumSaver::sm_gLimitUpper,
5, cfg->m_gEdit));
cfg->m_eEdit->setValidator(
new QDoubleValidator(
KPendulumSaver::sm_ELimitLower,
KPendulumSaver::sm_ELimitUpper,
5, cfg->m_eEdit));
// set input limits for the perspective change interval time
cfg->m_persSpinBox->setMinimum(KPendulumSaver::sm_persChangeIntervalLimitLower);
cfg->m_persSpinBox->setMaximum(KPendulumSaver::sm_persChangeIntervalLimitUpper);
// set tool tips of editable fields
cfg->m_mEdit->setToolTip(
ki18n("Ratio of 2nd mass to sum of both masses.\nValid values from %1 to %2.")
.subs(KPendulumSaver::sm_massRatioLimitLower, 0, 'f', 2)
.subs(KPendulumSaver::sm_massRatioLimitUpper, 0, 'f', 2)
.toString());
cfg->m_lEdit->setToolTip(
ki18n("Ratio of 2nd pendulum part length to the sum of both part lengths.\nValid values from %1 to %2.")
.subs(KPendulumSaver::sm_lengthRatioLimitLower, 0, 'f', 2)
.subs(KPendulumSaver::sm_lengthRatioLimitUpper, 0, 'f', 2)
.toString());
cfg->m_gEdit->setToolTip(
ki18n("Gravitational constant in arbitrary units.\nValid values from %1 to %2.")
.subs(KPendulumSaver::sm_gLimitLower, 0, 'f', 2)
.subs(KPendulumSaver::sm_gLimitUpper, 0, 'f', 2)
.toString());
cfg->m_eEdit->setToolTip(
ki18n("Energy in units of the maximum potential energy of the given configuration.\nValid values from %1 to %2.")
.subs(KPendulumSaver::sm_ELimitLower, 0, 'f', 2)
.subs(KPendulumSaver::sm_ELimitUpper, 0, 'f', 2)
.toString());
cfg->m_persSpinBox->setToolTip(
ki18n("Time in seconds after which a random perspective change occurs.\nValid values from %1 to %2.")
.subs(KPendulumSaver::sm_persChangeIntervalLimitLower)
.subs(KPendulumSaver::sm_persChangeIntervalLimitUpper)
.toString());
// init preview area
QPalette palette;
palette.setColor(cfg->m_preview->backgroundRole(), Qt::black);
cfg->m_preview->setPalette(palette);
cfg->m_preview->setAutoFillBackground(true);
cfg->m_preview->show(); // otherwise saver does not get correct size
// create saver and give it the WinID of the preview area
m_saver = new KPendulumSaver(cfg->m_preview->winId());
// read settings from saver and update GUI elements with these values, saver
// has read settings in its constructor
// set editable fields with stored values as defaults
QString text;
text.setNum(m_saver->massRatio());
cfg->m_mEdit->setText(text);
text.setNum(m_saver->lengthRatio());
cfg->m_lEdit->setText(text);
text.setNum(m_saver->g());
cfg->m_gEdit->setText(text);
text.setNum(m_saver->E());
cfg->m_eEdit->setText(text);
cfg->m_persSpinBox->setValue(m_saver->persChangeInterval());
palette.setColor(cfg->m_barColorButton->backgroundRole(), m_saver->barColor());
cfg->m_barColorButton->setPalette(palette);
palette.setColor(cfg->m_m1ColorButton->backgroundRole(), m_saver->m1Color());
cfg->m_m1ColorButton->setPalette(palette);
palette.setColor(cfg->m_m2ColorButton->backgroundRole(), m_saver->m2Color());
cfg->m_m2ColorButton->setPalette(palette);
// if the preview area is resized it emits the resized() event which is
// caught by m_saver. The embedded GLArea is resized to fit into the preview
// area.
connect(cfg->m_preview, SIGNAL(resized(QResizeEvent*)),
m_saver, SLOT(resizeGlArea(QResizeEvent*)));
connect(this, SIGNAL(okClicked()), this, SLOT(okButtonClickedSlot()));
connect(this, SIGNAL(helpClicked()), this, SLOT(aboutButtonClickedSlot()));
connect(cfg->m_lEdit, SIGNAL(lostFocus()), this, SLOT(lEditLostFocusSlot()));
connect(cfg->m_gEdit, SIGNAL(lostFocus()), this, SLOT(gEditLostFocusSlot()));
connect(cfg->m_eEdit, SIGNAL(lostFocus()), this, SLOT(eEditLostFocusSlot()));
connect(cfg->m_persSpinBox, SIGNAL(valueChanged(int)), this, SLOT(persChangeEnteredSlot(int)));
connect(cfg->m_mEdit, SIGNAL(lostFocus()), this, SLOT(mEditLostFocusSlot()));
connect(cfg->m_barColorButton, SIGNAL(clicked()), this, SLOT(barColorButtonClickedSlot()));
connect(cfg->m_m1ColorButton, SIGNAL(clicked()), this, SLOT(m1ColorButtonClickedSlot()));
connect(cfg->m_m2ColorButton, SIGNAL(clicked()), this, SLOT(m2ColorButtonClickedSlot()));
}
KPendulumSetup::~KPendulumSetup()
{
delete m_saver;
delete cfg;
}
// Ok pressed - save settings and exit
void KPendulumSetup::okButtonClickedSlot()
{
KConfigGroup config(KGlobal::config(), "Settings");
config.writeEntry("mass ratio", m_saver->massRatio());
config.writeEntry("length ratio", m_saver->lengthRatio());
config.writeEntry("g", m_saver->g());
config.writeEntry("E", m_saver->E());
config.writeEntry("perspective change interval",
m_saver->persChangeInterval());
config.writeEntry("bar color", m_saver->barColor());
config.writeEntry("m1 color", m_saver->m1Color());
config.writeEntry("m2 color", m_saver->m2Color());
config.sync();
accept();
}
void KPendulumSetup::aboutButtonClickedSlot()
{
KMessageBox::about(this, i18n("\
<h3>KPendulum Screen Saver for KDE</h3>\
<p>Simulation of a two-part pendulum</p>\
<p>Copyright (c) Georg&nbsp;Drenkhahn 2004</p>\
<p><tt>Georg.Drenkhahn@gmx.net</tt></p>"));
}
void KPendulumSetup::mEditLostFocusSlot(void)
{
if (cfg->m_mEdit->hasAcceptableInput())
{
m_saver->setMassRatio(cfg->m_mEdit->text().toDouble());
}
else
{ // write current setting back into input field
QString text;
text.setNum(m_saver->massRatio());
cfg->m_mEdit->setText(text);
}
}
void KPendulumSetup::lEditLostFocusSlot(void)
{
if (cfg->m_lEdit->hasAcceptableInput())
{
m_saver->setLengthRatio(cfg->m_lEdit->text().toDouble());
}
else
{ // write current setting back into input field
QString text;
text.setNum(m_saver->lengthRatio());
cfg->m_lEdit->setText(text);
}
}
void KPendulumSetup::gEditLostFocusSlot(void)
{
if (cfg->m_gEdit->hasAcceptableInput())
{
m_saver->setG(cfg->m_gEdit->text().toDouble());
}
else
{ // write current setting back into input field
QString text;
text.setNum(m_saver->g());
cfg->m_gEdit->setText(text);
}
}
void KPendulumSetup::eEditLostFocusSlot(void)
{
if (cfg->m_eEdit->hasAcceptableInput())
{
m_saver->setE(cfg->m_eEdit->text().toDouble());
}
else
{ // write current setting back into input field
QString text;
text.setNum(m_saver->E());
cfg->m_eEdit->setText(text);
}
}
void KPendulumSetup::persChangeEnteredSlot(int t)
{
m_saver->setPersChangeInterval(t);
}
void KPendulumSetup::barColorButtonClickedSlot(void)
{
QColor color = m_saver->barColor();
if ( KColorDialog::getColor( color, this) )
{
if (color.isValid())
{
m_saver->setBarColor(color);
QPalette palette;
palette.setColor(cfg->m_barColorButton->backgroundRole(), color);
cfg->m_barColorButton->setPalette(palette);
}
}
}
void KPendulumSetup::m1ColorButtonClickedSlot(void)
{
QColor color =m_saver->m1Color();
if ( KColorDialog::getColor( color, this) )
{
if (color.isValid())
{
m_saver->setM1Color(color);
QPalette palette;
palette.setColor(cfg->m_m1ColorButton->backgroundRole(), color);
cfg->m_m1ColorButton->setPalette(palette);
}
}
}
void KPendulumSetup::m2ColorButtonClickedSlot(void)
{
QColor color = m_saver->m2Color();
if ( KColorDialog::getColor( color, this) )
{
if (color.isValid())
{
m_saver->setM2Color(color);
QPalette palette;
palette.setColor(cfg->m_m2ColorButton->backgroundRole(), color);
cfg->m_m2ColorButton->setPalette(palette);
}
}
}

View file

@ -0,0 +1,430 @@
/*============================================================================
*
* KPendulum screen saver for KDE
*
* The screen saver displays a physically realistic simulation of a two-part
* pendulum.
*
* Copyright (C) 2004 Georg Drenkhahn, Georg.Drenkhahn@gmx.net
*
* 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) version 3 or
* any later version accepted by the membership of KDE e.V. (or its successor
* approved by the membership of KDE e.V.), which shall act as a proxy defined
* in Section 14 of version 3 of the license.
*
* 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.
*
*============================================================================*/
#ifndef PENDULUM_H
#define PENDULUM_H
// STL headers
#include <valarray>
// Qt headers
#include <QWidget>
#include <QTimer>
#include <QGLWidget>
// GL headers
#include <GL/glu.h>
#include <GL/gl.h>
// KDE headers
#include <kscreensaver.h>
#include "rkodesolver.h"
// KPendulumSetupUi
#include "ui_pendulumcfg.h"
//--------------------------------------------------------------------
/** @brief ODE solver for the Pendulum equations */
class PendulumOdeSolver : public RkOdeSolver<double,4>
{
public:
/** @brief Constuctor for the RK solver of the pendulum equation of motion
* @param t initial time in seconds
* @param dt initial time increment in seconds, just a hint for solver
* @param y generalized coordinates of pendulum system
* @param eps relative precision
* @param m1 mass of upper pendulum
* @param m2 mass of lower pendulum
* @param l1 length of upper pendulum
* @param l2 length of lower pendulum
* @param g gravitational constant */
PendulumOdeSolver(
const double& t,
const double& dt,
const Vector4d& y,
const double& eps,
const double& m1,
const double& m2,
const double& l1,
const double& l2,
const double& g);
protected:
/** @brief ODE function for the pendulum equation of motion system
* @param x time
* @param y generalized coordinates of pendulum system
* @return derivation dy/dx */
Vector4d f(const double& x, const Vector4d& y) const;
private:
/** These private variables contain constants for faster numeric calculation.
* They are derived from the constructor arguments m1,m2,l1,l2,g. */
const double m_A, m_B1, m_B, m_C, m_D, m_E, m_M;
};
//--------------------------------------------------------------------
/** @brief GL widget class for the KPendulum screen saver
*
* Class implements QGLWidget to display the KPendulum screen saver. */
class PendulumGLWidget : public QGLWidget
{
Q_OBJECT
public:
/** @brief Constructor of KPendulum's GL widget
* @param parent parent widget, passed to QGLWidget's constructor */
PendulumGLWidget(QWidget* parent=0);
/** @brief Destructor of KPendulum's GL widget */
~PendulumGLWidget(void);
/** @brief Set phi angle of viewpoint
* @param phi angle in sterad */
void setEyePhi(double phi);
/** @brief Set angles of pendulum configuration
* @param q1 angle of 1. pendulum in sterad
* @param q2 angle of 2. pendulum in sterad */
void setAngles(const double& q1, const double& q2);
/** @brief Set masses of pendulum configuration
* @param m1 mass of 1. pendulum
* @param m2 mass of 2. pendulum */
void setMasses(const double& m1, const double& m2);
/** @brief Set lengths of pendulum configuration
* @param l1 length of 1. pendulum
* @param l2 length of 2. pendulum */
void setLengths(const double& l1, const double& l2);
/* accessors for colour settings */
/** @brief set color of the bars
* @param c color */
void setBarColor(const QColor& c);
/** @brief get color of the bars
* @return color */
inline QColor barColor(void) const {return m_barColor;}
/** @brief set color of mass 1
* @param c color */
void setM1Color(const QColor& c);
/** @brief get color of mass 1
* @return color */
inline QColor m1Color(void) const {return m_m1Color;}
/** @brief set color of mass 2
* @param c color */
void setM2Color(const QColor& c);
/** @brief get color of mass 2
* @return color */
inline QColor m2Color(void) const {return m_m2Color;}
protected:
/** paint the GL view */
virtual void paintGL();
/** resize the gl view */
virtual void resizeGL(int w, int h);
/** setup the GL environment */
virtual void initializeGL();
private: // Private attributes
/** Eye position distance from coordinate zero point */
GLfloat m_eyeR;
/** Eye position theta angle from z axis in sterad */
double m_eyeTheta;
/** Eye position phi angle (longitude) in sterad */
double m_eyePhi;
/** Light position distance from coordinate zero point */
GLfloat m_lightR;
/** Light position theta angle from z axis in sterad */
double m_lightTheta;
/** Light position phi angle (longitude) in sterad */
double m_lightPhi;
/** 1. pendulum's angle, degree */
GLfloat m_ang1;
/** 2. pendulum's angle, degree */
GLfloat m_ang2;
/** 1. pendulum's square root of mass */
GLfloat m_sqrtm1;
/** 2. pendulum's square root of mass */
GLfloat m_sqrtm2;
/** 1. pendulum's length */
GLfloat m_l1;
/** 2. pendulum's length */
GLfloat m_l2;
/** Pointer to a quadric object used in the rendering function paintGL() */
GLUquadricObj* const m_quadM1;
/** color of the pendulum bars */
QColor m_barColor;
/** color of the 1. mass */
QColor m_m1Color;
/** color of the 2. mass */
QColor m_m2Color;
};
//--------------------------------------------------------------------
/** @brief Main class of the KPendulum screen saver
*
* This class implements KScreenSaver for the KPendulum screen saver. */
class KPendulumSaver : public KScreenSaver
{
Q_OBJECT
public:
/** @brief Constructor of the KPendulum screen saver object
* @param drawable Id of the window in which the screen saver is drawed
*
* Initial settings are read from disk, the GL widget is set up and displayed
* and the eq. of motion solver is started. */
KPendulumSaver(WId drawable);
/** @brief Destructor of the KPendulum screen saver object
*
* Only KPendulumSaver::solver is destoyed. */
~KPendulumSaver();
/** read the saved settings from disk */
void readSettings();
/** init physical quantities, set up the GL area and (re)start the ode
* solver. Called if new parameters are specified in the setup dialog and at
* startup. */
void initData();
/* accessors for PendulumGLWidget member variables */
/** Set the displayed bar color of the pendulum */
void setBarColor(const QColor& c);
/** Get the displayed bar color of the pendulum */
QColor barColor(void) const;
/** Set the displayed color of the 1. pendulum mass */
void setM1Color(const QColor& c);
/** Get the displayed color of the 1. pendulum mass */
QColor m1Color(void) const;
/** Set the displayed color of the 2. pendulum mass */
void setM2Color(const QColor& c);
/** Get the displayed color of the 2. pendulum mass */
QColor m2Color(void) const;
/* accessors for own member variables */
/** Set the mass ratio of the pendulum system. @sa
* KPendulumSaver::m_massRatio */
void setMassRatio(const double& massRatio);
/** Get the mass ratio of the pendulum system. @sa
* KPendulumSaver::m_massRatio */
inline double massRatio(void) const
{
return m_massRatio;
}
/** Set the length ratio of the pendulum system. @sa
* KPendulumSaver::m_lengthRatio */
void setLengthRatio(const double& lengthRatio);
/** Get the length ratio of the pendulum system. @sa
* KPendulumSaver::m_lengthRatio */
inline double lengthRatio(void) const
{
return m_lengthRatio;
}
/** Set the gravitational constant. @sa KPendulumSaver::m_g */
void setG(const double& g);
/** Get the gravitational constant. @sa KPendulumSaver::m_g */
inline double g(void) const
{
return m_g;
}
/** Set the total energy. @sa KPendulumSaver::m_E */
void setE(const double& E);
/** Get the total energy. @sa KPendulumSaver::m_E */
inline double E(void) const
{
return m_E;
}
/** Set the time interval for the periodic perspective change. @sa
* KPendulumSaver::m_persChangeInterval */
void setPersChangeInterval(const unsigned int& persChangeInterval);
/** Get the time interval for the periodic perspective change. @sa
* KPendulumSaver::m_persChangeInterval */
inline unsigned int persChangeInterval(void) const
{
return m_persChangeInterval;
}
/* public static class member variables */
static const QColor sm_barColorDefault;
static const QColor sm_m1ColorDefault;
static const QColor sm_m2ColorDefault;
/** lower, upper limits (inclusive) and default values for the setup
* parameter massRatio */
static const double sm_massRatioLimitUpper;
static const double sm_massRatioLimitLower;
static const double sm_massRatioDefault;
/** lower, upper limits (inclusive) and default values for the setup
* parameter lengthRatio */
static const double sm_lengthRatioLimitLower;
static const double sm_lengthRatioLimitUpper;
static const double sm_lengthRatioDefault;
/** lower, upper limits (inclusive) and default values for the setup
* parameter g */
static const double sm_gLimitLower;
static const double sm_gLimitUpper;
static const double sm_gDefault;
/** lower, upper limits (inclusive) and default values for the setup
* parameter E */
static const double sm_ELimitLower;
static const double sm_ELimitUpper;
static const double sm_EDefault;
/** lower, upper limits (inclusive) and default values for the setup
* parameter persChangeInterval */
static const unsigned int sm_persChangeIntervalLimitLower;
static const unsigned int sm_persChangeIntervalLimitUpper;
static const unsigned int sm_persChangeIntervalDefault;
public slots:
/** slot is called if integration should proceed by ::deltaT */
void doTimeStep();
/** slot is called if setup dialog changes in size and the GL are should be
* adjusted */
void resizeGlArea(QResizeEvent* e);
private:
/** Time step size for the integration in milliseconds. 20 ms corresponds to
* a frame rate of 50 fps. */
static const unsigned int sm_deltaT;
/** Default angle phi for the eye to look onto the pendulum */
static const double sm_eyePhiDefault;
/** The ode solver which is used to integrate the equations of motion */
PendulumOdeSolver* m_solver;
/** Gl widget of simulation */
PendulumGLWidget* m_glArea;
/** Timer for the real time integration of the eqs. of motion */
QTimer* m_timer;
// persistent configurtion settings
/** Mass ratio m2/(m1+m2) of the pendulum masses. Value is determined by the
* setup dialog. Variable is accessed by setMassRatio() and massRatio(). */
double m_massRatio;
/** Length ratio l2/(l1+l2) of the pendulums. Value is determined by the
* setup dialog. Variable is accessed by setLengthRatio() and
* lengthRatio(). */
double m_lengthRatio;
/** Gravitational constant (in arbitrary units). Value is determined by the
* setup dialog. Variable is accessed by setG() and g(). */
double m_g;
/** Total energy of the system in units of the maximum possible potential
* energy. Value is determined by the setup dialog. Variable is accessed by
* setE() and E(). */
double m_E;
/** Time interval after which a new perspective changed happens. Value is
* determined by the setup dialog. Variable is accessed by
* setPersChangeInterval() and persChangeInterval(). */
unsigned int m_persChangeInterval;
};
//--------------------------------------------------------------------
class PendulumWidget : public QWidget, public Ui::PendulumWidget
{
public:
PendulumWidget( QWidget *parent = 0L ) : QWidget( parent ) {
setupUi( this );
}
};
/** @brief KPendulum screen saver setup dialog.
*
* This class handles the KPendulum screen saver setup dialog. */
class KPendulumSetup : public KDialog
{
Q_OBJECT
public:
/** @brief Constructor for the KPendulum screen saver setup dialog
* @param parent Pointer to the parent widget, passed to KPendulumSetupUi
*
* The dialog box is set up and the screen saver object KPendulumSetup::saver
* is instantiated. */
KPendulumSetup(QWidget* parent = 0);
/** @brief Destructor of the KPendulum screen saver setup dialog
*
* Only KPendulumSetup::saver is deleted. */
~KPendulumSetup(void);
public slots:
/** slot for the "OK" button: save settings and exit */
void okButtonClickedSlot(void);
/** slot for the "About" button: show the About dialog */
void aboutButtonClickedSlot(void);
/** slot is called if the mass ratio edit field looses its focus. If the
* input is acceptable KPendulumSaver::setMassRatio() is called. */
void mEditLostFocusSlot(void);
/** slot is called if the length ratio edit field looses its focus. If the
* input is acceptable KPendulumSaver::setLengthRatio() is called. */
void lEditLostFocusSlot(void);
/** slot is called if the gravitational constant edit field looses its focus.
* If the input is acceptable KPendulumSaver::setG() is called. */
void gEditLostFocusSlot(void);
/** slot is called if the energy edit field looses its focus. If the input
* is acceptable KPendulumSaver::setE() is called. */
void eEditLostFocusSlot(void);
/** slot is called if the perspective change interval spin box changed. If
* the input is acceptable KPendulumSaver::setPersChangeInterval() is
* called. */
void persChangeEnteredSlot(int t);
/** slot is called if the bar color button was clicked. A color dialog is
* opened and the result is given to KPendulumSaver::setBarColor(). */
void barColorButtonClickedSlot(void);
/** slot is called if the mass 1 color button was clicked. A color dialog is
* opened and the result is given to KPendulumSaver::setM1Color(). */
void m1ColorButtonClickedSlot(void);
/** slot is called if the mass 2 color button was clicked. A color dialog is
* opened and the result is given to KPendulumSaver::setM2Color(). */
void m2ColorButtonClickedSlot(void);
private:
/** Pointer to the screen saver object. Its member KPendulumSaver::glArea is
* displayed in the preview area */
KPendulumSaver* m_saver;
PendulumWidget *cfg;
};
#endif

View file

@ -0,0 +1,335 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PendulumWidget</class>
<widget class="QWidget" name="PendulumWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>464</width>
<height>384</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>2</horstretch>
<verstretch>2</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>1200</width>
<height>900</height>
</size>
</property>
<property name="baseSize">
<size>
<width>400</width>
<height>250</height>
</size>
</property>
<layout class="QVBoxLayout">
<property name="sizeConstraint">
<enum>QLayout::SetMinimumSize</enum>
</property>
<item>
<layout class="QHBoxLayout">
<item>
<layout class="QVBoxLayout">
<item>
<layout class="QHBoxLayout">
<item>
<widget class="QLabel" name="textLabel1">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="text">
<string>&lt;p align=&quot;center&quot;&gt;
m&lt;sub&gt;2&lt;/sub&gt;&lt;br&gt;
-----------&lt;br&gt;
m&lt;sub&gt;1&lt;/sub&gt;+m&lt;sub&gt;2&lt;/sub&gt;
&lt;/p&gt;</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="m_mEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>60</width>
<height>32767</height>
</size>
</property>
<property name="maxLength">
<number>5</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout">
<item>
<widget class="QLabel" name="textLabel2">
<property name="text">
<string>&lt;p align=&quot;center&quot;&gt;
l&lt;sub&gt;2&lt;/sub&gt;&lt;br&gt;
------&lt;br&gt;
l&lt;sub&gt;1&lt;/sub&gt;+l&lt;sub&gt;2&lt;/sub&gt;
&lt;/p&gt;</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="m_lEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>60</width>
<height>32767</height>
</size>
</property>
<property name="maxLength">
<number>5</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout">
<item>
<widget class="QLabel" name="textLabel3">
<property name="text">
<string>g</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="m_gEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>60</width>
<height>32767</height>
</size>
</property>
<property name="maxLength">
<number>5</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout">
<item>
<widget class="QLabel" name="textLabel4">
<property name="text">
<string>E</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="m_eEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>60</width>
<height>32767</height>
</size>
</property>
<property name="maxLength">
<number>5</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout">
<item>
<widget class="QLabel" name="textLabel2_2">
<property name="toolTip">
<string>specify the time in seconds after which a random perspective change occurs</string>
</property>
<property name="text">
<string>Perspective&lt;br&gt;
Change [s]</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="KIntSpinBox" name="m_persSpinBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>60</width>
<height>32767</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout">
<item>
<widget class="QPushButton" name="m_barColorButton">
<property name="maximumSize">
<size>
<width>40</width>
<height>32767</height>
</size>
</property>
<property name="text">
<string>Bars</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="m_m1ColorButton">
<property name="maximumSize">
<size>
<width>40</width>
<height>32767</height>
</size>
</property>
<property name="text">
<string>M1</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="m_m2ColorButton">
<property name="maximumSize">
<size>
<width>40</width>
<height>32767</height>
</size>
</property>
<property name="text">
<string>M2</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="spacer4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="SsPreviewArea" name="m_preview" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>2</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>260</width>
<height>260</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KIntSpinBox</class>
<extends>QSpinBox</extends>
<header>knuminput.h</header>
</customwidget>
<customwidget>
<class>SsPreviewArea</class>
<extends>QWidget</extends>
<header location="global">sspreviewarea.h</header>
</customwidget>
</customwidgets>
<includes>
<include location="local">sspreviewarea.h</include>
</includes>
<resources/>
<connections/>
</ui>

View file

@ -0,0 +1,386 @@
//-----------------------------------------------------------------------------
//
// kpolygon - Basic screen saver for KDE
//
// Copyright (c) Martin R. Jones 1996
//
// layout management added 1998/04/19 by Mario Weilguni <mweilguni@kde.org>
// 2001/03/04 Converted to libkscreensaver by Martin R. Jones
#include <stdlib.h>
#include <time.h>
#include <qcolor.h>
#include <qlabel.h>
#include <qslider.h>
#include <qlayout.h>
#include <QPolygon>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <klocale.h>
#include <kconfig.h>
#include <kglobal.h>
#include <kmessagebox.h>
#include "polygon.h"
#include <qpainter.h>
#include "polygon.moc"
#define MAXLENGTH 65
#define MAXVERTICES 19
// libkscreensaver interface
class KPolygonSaverInterface : public KScreenSaverInterface
{
public:
virtual KAboutData* aboutData() {
return new KAboutData( "kpolygon.kss", "klock", ki18n( "KPolygon" ), "2.2.0", ki18n( "KPolygon" ) );
}
virtual KScreenSaver* create( WId id )
{
return new kPolygonSaver( id );
}
virtual QDialog* setup()
{
return new kPolygonSetup();
}
};
int main( int argc, char *argv[] )
{
KPolygonSaverInterface kss;
return kScreenSaverMain( argc, argv, kss );
}
//-----------------------------------------------------------------------------
// dialog to setup screen saver parameters
//
kPolygonSetup::kPolygonSetup( QWidget *parent )
: KDialog( parent)
, saver( 0 ), length( 10 ), vertices( 3 ),
speed( 50 )
{
setCaption(i18n( "Setup Polygon Screen Saver" ));
setButtons(Ok|Cancel|Help);
setDefaultButton(Ok);
setModal(true);
readSettings();
QWidget *main = new QWidget(this);
setMainWidget(main);
setButtonText( Help, i18n( "A&bout" ) );
QHBoxLayout *tl = new QHBoxLayout(main);
tl->setSpacing(spacingHint());
QVBoxLayout *tl1 = new QVBoxLayout;
tl->addLayout(tl1);
QLabel *label = new QLabel( i18n("Length:"), main );
tl1->addWidget(label);
QSlider *sb = new QSlider(Qt::Horizontal, main);
sb->setMinimum(1);
sb->setMaximum(MAXLENGTH);
sb->setPageStep(10);
sb->setValue(length);
sb->setMinimumSize( 90, 20 );
sb->setTickPosition(QSlider::TicksBelow);
sb->setTickInterval(10);
connect( sb, SIGNAL(valueChanged(int)), SLOT(slotLength(int)) );
tl1->addWidget(sb);
label = new QLabel( i18n("Vertices:"), main );
tl1->addWidget(label);
sb = new QSlider(Qt::Horizontal, main);
sb->setMinimum(3);
sb->setMaximum(MAXVERTICES);
sb->setPageStep(2);
sb->setValue(vertices);
sb->setMinimumSize( 90, 20 );
sb->setTickPosition(QSlider::TicksBelow);
sb->setTickInterval(2);
connect( sb, SIGNAL(valueChanged(int)), SLOT(slotVertices(int)) );
tl1->addWidget(sb);
label = new QLabel( i18n("Speed:"), main );
tl1->addWidget(label);
sb = new QSlider(Qt::Horizontal, main);
sb->setMinimum(0);
sb->setMaximum(100);
sb->setPageStep(10);
sb->setValue(speed);
sb->setMinimumSize( 90, 20 );
sb->setTickPosition(QSlider::TicksBelow);
sb->setTickInterval(10);
connect( sb, SIGNAL(valueChanged(int)), SLOT(slotSpeed(int)) );
tl1->addWidget(sb);
tl1->addStretch();
preview = new QWidget( main );
preview->setFixedSize( 220, 170 );
preview->show(); // otherwise saver does not get correct size
saver = new kPolygonSaver( preview->winId() );
tl->addWidget(preview);
connect(this,SIGNAL(okClicked()),this,SLOT(slotOk()));
connect(this,SIGNAL(helpClicked()),this,SLOT(slotHelp()));
setMinimumSize( sizeHint() );
}
kPolygonSetup::~kPolygonSetup()
{
delete saver;
}
// read settings from config file
void kPolygonSetup::readSettings()
{
KConfigGroup config(KGlobal::config(), "Settings");
length = config.readEntry( "Length", length );
if ( length > MAXLENGTH )
length = MAXLENGTH;
else if ( length < 1 )
length = 1;
vertices = config.readEntry( "Vertices", vertices );
if ( vertices > MAXVERTICES )
vertices = MAXVERTICES;
else if ( vertices < 3 )
vertices = 3;
speed = config.readEntry( "Speed", speed );
if ( speed > 100 )
speed = 100;
else if ( speed < 50 )
speed = 50;
}
void kPolygonSetup::slotLength( int len )
{
length = len;
if ( saver )
saver->setPolygon( length, vertices );
}
void kPolygonSetup::slotVertices( int num )
{
vertices = num;
if ( saver )
saver->setPolygon( length, vertices );
}
void kPolygonSetup::slotSpeed( int num )
{
speed = num;
if ( saver )
saver->setSpeed( speed );
}
// Ok pressed - save settings and exit
void kPolygonSetup::slotOk()
{
KConfigGroup config(KGlobal::config(), "Settings");
QString slength;
slength.setNum( length );
config.writeEntry( "Length", slength );
QString svertices;
svertices.setNum( vertices );
config.writeEntry( "Vertices", svertices );
QString sspeed;
sspeed.setNum( speed );
config.writeEntry( "Speed", sspeed );
config.sync();
accept();
}
void kPolygonSetup::slotHelp()
{
KMessageBox::information(this,
i18n("Polygon Version 2.2.0\n\n"\
"Written by Martin R. Jones 1996\n"\
"mjones@kde.org"));
}
//-----------------------------------------------------------------------------
kPolygonSaver::kPolygonSaver( WId id ) : KScreenSaver( id )
{
readSettings();
directions.resize( numVertices );
initialiseColor();
initialisePolygons();
timer.start( speed );
connect( &timer, SIGNAL(timeout()), SLOT(update()) );
setAttribute( Qt::WA_NoSystemBackground );
cleared = false;
show();
}
kPolygonSaver::~kPolygonSaver()
{
timer.stop();
}
// set polygon properties
void kPolygonSaver::setPolygon( int len, int ver )
{
timer.stop();
numLines = len;
numVertices = ver;
directions.resize( numVertices );
polygons.clear();
initialisePolygons();
timer.start( speed );
}
// set the speed
void kPolygonSaver::setSpeed( int spd )
{
timer.stop();
speed = 100-spd;
timer.start( speed );
}
// read configuration settings from config file
void kPolygonSaver::readSettings()
{
KConfigGroup config(KGlobal::config(), "Settings");
numLines = config.readEntry( "Length", 10 );
if ( numLines > 50 )
numLines = 50;
else if ( numLines < 1 )
numLines = 1;
numVertices = config.readEntry( "Vertices", 3 );
if ( numVertices > 20 )
numVertices = 20;
else if ( numVertices < 3 )
numVertices = 3;
speed = 100 - config.readEntry( "Speed", 50 );
}
// draw next polygon and erase tail
void kPolygonSaver::paintEvent(QPaintEvent *)
{
QPainter p( this );
if (!cleared) {
cleared = true;
p.fillRect(rect(), Qt::black);
}
if ( polygons.count() > numLines )
{
p.setPen( Qt::black );
p.drawPolyline( polygons.first() );
}
nextColor();
p.setPen( colors[currentColor] );
p.drawPolyline( polygons.last() );
if ( polygons.count() > numLines )
polygons.removeFirst();
polygons.append( QPolygon( polygons.last() ) );
moveVertices();
}
// initialise the polygon
void kPolygonSaver::initialisePolygons()
{
int i;
polygons.append( QPolygon( numVertices + 1 ) );
QPolygon &poly = polygons.last();
for ( i = 0; i < numVertices; i++ )
{
poly.setPoint( i, rnd.getLong(width()), rnd.getLong(height()) );
directions[i].setX( 16 - rnd.getLong(8) * 4 );
if ( directions[i].x() == 0 )
directions[i].setX( 1 );
directions[i].setY( 16 - rnd.getLong(8) * 4 );
if ( directions[i].y() == 0 )
directions[i].setY( 1 );
}
poly.setPoint( i, poly.point(0) );
}
// move polygon in current direction and change direction if a border is hit
void kPolygonSaver::moveVertices()
{
int i;
QPolygon &poly = polygons.last();
for ( i = 0; i < numVertices; i++ )
{
poly.setPoint( i, poly.point(i) + directions[i] );
if ( poly[i].x() >= (int)width() )
{
directions[i].setX( -(rnd.getLong(4) + 1) * 4 );
poly[i].setX( (int)width() );
}
else if ( poly[i].x() < 0 )
{
directions[i].setX( (rnd.getLong(4) + 1) * 4 );
poly[i].setX( 0 );
}
if ( poly[i].y() >= (int)height() )
{
directions[i].setY( -(rnd.getLong(4) + 1) * 4 );
poly[i].setY( height() );
}
else if ( poly[i].y() < 0 )
{
directions[i].setY( (rnd.getLong(4) + 1) * 4 );
poly[i].setY( 0 );
}
}
poly.setPoint( i, poly.point(0) );
}
// create a color table of 64 colors
void kPolygonSaver::initialiseColor()
{
for ( int i = 0; i < 64; i++ )
{
colors[i].setHsv( i * 360 / 64, 255, 255 );
}
currentColor = 0;
}
// set foreground color to next in the table
void kPolygonSaver::nextColor()
{
currentColor++;
if ( currentColor > 63 )
currentColor = 0;
}

View file

@ -0,0 +1,81 @@
//-----------------------------------------------------------------------------
//
// kpolygon - Basic screen saver for KDE
//
// Copyright (c) Martin R. Jones 1996
//
#ifndef POLYGON_H
#define POLYGON_H
#include <qtimer.h>
#include <QVector>
#include <QList>
#include <kdialog.h>
#include <kscreensaver.h>
#include <krandomsequence.h>
class QPolygon;
class kPolygonSaver : public KScreenSaver
{
Q_OBJECT
public:
kPolygonSaver( WId id );
virtual ~kPolygonSaver();
void setPolygon( int len, int ver );
void setSpeed( int spd );
private:
void readSettings();
void initialisePolygons();
void moveVertices();
void initialiseColor();
void nextColor();
protected:
void paintEvent(QPaintEvent *event);
protected:
QTimer timer;
bool cleared;
int numLines;
int numVertices;
int speed;
QColor colors[64];
int currentColor;
QList<QPolygon> polygons;
QVector<QPoint> directions;
KRandomSequence rnd;
};
class kPolygonSetup : public KDialog
{
Q_OBJECT
public:
kPolygonSetup( QWidget *parent = 0 );
~kPolygonSetup();
protected:
void readSettings();
private slots:
void slotLength( int );
void slotVertices( int );
void slotSpeed( int );
void slotOk();
void slotHelp();
private:
QWidget *preview;
kPolygonSaver *saver;
int length;
int vertices;
int speed;
};
#endif

View file

@ -0,0 +1,422 @@
/** @file
*
* Ordinary differential equation solver using the Runge-Kutta method.
*
* Copyright (C) 2004 Georg Drenkhahn, Georg.Drenkhahn@gmx.net
*
* 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) version 3 or
* any later version accepted by the membership of KDE e.V. (or its successor
* approved by the membership of KDE e.V.), which shall act as a proxy defined
* in Section 14 of version 3 of the license.
*
* 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.
*/
#ifndef RKODESOLVER_H
#define RKODESOLVER_H
#include <KDebug>
/* vector and matrix classes */
#include <Eigen/Core>
/* import most common Eigen types */
using namespace Eigen;
/** @brief Solver class to integrate a first-order ordinary differential
* equation (ODE) by means of a 6. order Runge-Kutta method.
*
* See the article about the Cash-Karp method
* (http://en.wikipedia.org/wiki/Cash%E2%80%93Karp_method) for details on this
* algorithm.
*
* The ODE system must be given as the derivative
* dy/dx = f(x,y)
* with x in R and y in R^n.
*
* Within this class the function f() is a pure virtual function, which must be
* reimplemented in a derived class. */
template<typename T, int D>
class RkOdeSolver
{
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
/** @brief Constructor
* @param x Initial integration parameter
* @param y Initial function values of function to integrate
* @param dx Initial guess for step size. Will be automatically adjusted to
* guarantee required precision. @a dx > 0
* @param eps Relative precision. @a eps > 0.
*
* Initialises the solver with start conditions. */
RkOdeSolver(
const T& x,// = 0.0,
const Matrix<T,D,1>& y,// = Matrix<T,D,1>::Zero(),
const T& dx = 0.0,
const T& eps = 1e-6);
/** @brief Destructor */
virtual ~RkOdeSolver(void);
/** @brief Integrates the ordinary differential equation from the current x
* value to x+@a dx.
* @param dx x-interval size to integrate over starting from x. dx may be
* negative.
*
* The integration is performed by calling rkStepCheck() repeatedly until the
* desired x value is reached. */
void integrate(const T& dx);
// Accessors
/** @brief Get current x value.
* @return Reference of x value. */
const T& X(void) const;
/** @brief Set current x value.
* @param a The value to be set. */
void X(const T& a);
/** @brief Get current y value.
* @return Reference of y vector. */
const Matrix<T,D,1>& Y(void) const;
/** @brief Set current y values.
* @param a The vector to be set. */
void Y(const Matrix<T,D,1>& a);
/** @brief Get current dy/dx value.
* @return Reference of dy/dx vector. */
const Matrix<T,D,1>& dYdX(void) const;
/** @brief Get current estimated step size dX.
* @return Reference of dX value. */
const T& dX(void) const;
/** @brief Set estimated step size dX.
* @param a The value to be set. */
void dX(const T& a);
/** @brief Get current presision.
* @return Reference of precision value. */
const T& Eps(void) const;
/** @brief Set estimated presision.
* @param a The value to be set. */
void Eps(const T& a);
protected:
/** @brief ODE function
* @param x Integration value
* @param y Function value
* @return Derivation
*
* This purely virtual function returns the value of dy/dx for the given
* parameter values of x and y. This function is integrated by the
* Runge-Kutta algorithm. */
virtual Matrix<T,D,1>
f(const T& x, const Matrix<T,D,1>& y) const = 0;
private:
/** @brief Perform one integration step with a tolerable relative error given
* by ::mErr.
* @param dx Maximal step size, may be positive or negative depending on
* integration direction.
* @return Flag indicating if made absolute integration step was equal |@a dx
* | (true) less than |@a dx | (false).
*
* A new estimate for the maximum next step size is saved to ::m_step. The
* new values for x, y and f are saved in ::m_x, ::m_y and ::m_dydx. */
bool rkStepCheck(const T& dx);
/** @brief Perform one Runge-Kutta integration step forward with step size
* ::m_step
* @param dx Step size relative to current x value.
* @param yerr Reference to vector in which the estimated error made in y is
* returned.
* @return The y value after the step at x+@a dx.
*
* Stored current x,y values are not adjusted. */
Matrix<T,D,1> rkStep(
const T& dx, Matrix<T,D,1>& yerr) const;
/** current x value */
T m_x;
/** current y value */
Matrix<T,D,1> m_y;
/** current value of dy/dx */
Matrix<T,D,1> m_dydx;
/** allowed relative error */
T m_eps;
/** estimated step size for next Runge-Kutta step */
T m_step;
};
// inline accessors
template<typename T, int D>
inline const T&
RkOdeSolver<T, D>::X(void) const
{
return m_x;
}
template<typename T, int D>
inline void
RkOdeSolver<T, D>::X(const T &a)
{
m_x = a;
}
template<typename T, int D>
inline const Matrix<T,D,1>&
RkOdeSolver<T, D>::Y(void) const
{
return m_y;
}
template<typename T, int D>
inline void
RkOdeSolver<T, D>::Y(const Matrix<T,D,1>& a)
{
m_y = a;
}
template<typename T, int D>
inline const Matrix<T,D,1>&
RkOdeSolver<T, D>::dYdX(void) const
{
return m_dydx;
}
template<typename T, int D>
inline const T&
RkOdeSolver<T, D>::dX(void) const
{
return m_step;
}
template<typename T, int D>
inline const T&
RkOdeSolver<T, D>::Eps(void) const
{
return m_eps;
}
template<typename T, int D>
RkOdeSolver<T, D>::RkOdeSolver(
const T& x,
const Matrix<T,D,1>& y,
const T& dx,
const T& eps)
: m_x(x)
{
Y(y);
dX(dx);
Eps(eps);
}
// virtual dtor
template<typename T, int D>
RkOdeSolver<T, D>::~RkOdeSolver(void)
{
}
// accessors
template<typename T, int D>
void
RkOdeSolver<T, D>::dX(const T& a)
{
if (a <= 0.0)
{
kError() << "RkOdeSolver: dx must be > 0";
m_step = 0.001; // a very arbitrary value
return;
}
m_step = a;
}
template<typename T, int D>
void
RkOdeSolver<T, D>::Eps(const T& a)
{
if (a <= 0.0)
{
kError() << "RkOdeSolver: eps must be > 0";
m_eps = 1e-5; // a very arbitrary value
return;
}
m_eps = a;
}
// public member functions
template<typename T, int D>
void
RkOdeSolver<T, D>::integrate(const T& deltaX)
{
if (deltaX == 0)
{
return; // nothing to integrate
}
// init dydx
m_dydx = f(m_x, m_y);
static const unsigned int maxiter = 10000;
const T x2 = m_x + deltaX;
unsigned int iter;
for (iter=0;
iter<maxiter && !rkStepCheck(x2-m_x);
++iter)
{
}
if (iter > maxiter)
{
kWarning()
<< "RkOdeSolver: More than " << maxiter
<< " iterations in RkOdeSolver::integrate" << endl;
}
}
// private member functions
template<typename T, int D>
bool
RkOdeSolver<T, D>::rkStepCheck(const T& dx_requested)
{
static const T safety = 0.9;
static const T pshrnk = -0.25;
static const T pgrow = -0.2;
// reduce step size by no more than a factor 10
static const T shrinkLimit = 0.1;
// enlarge step size by no more than a factor 5
static const T growthLimit = 5.0;
// errmax_sl = 6561.0
static const T errmax_sl = std::pow(shrinkLimit/safety, 1.0/pshrnk);
// errmax_gl = 1.89e-4
static const T errmax_gl = std::pow(growthLimit/safety, 1.0/pgrow);
static const unsigned int maxiter = 100;
if (dx_requested == 0)
{
return true; // integration done
}
Matrix<T,D,1> ytmp, yerr, t;
bool stepSizeWasMaximal;
T dx;
if (std::abs(dx_requested) > m_step)
{
stepSizeWasMaximal = true;
dx = dx_requested>0 ? m_step : -m_step;
}
else
{
stepSizeWasMaximal = false;
dx = dx_requested;
}
// generic scaling factor
// |y| + |dx * dy/dx| + 1e-15
Matrix<T,D,1> yscal
= (m_y.cwise().abs() + (dx*m_dydx).cwise().abs()).cwise()
+ 1e-15;
unsigned int iter = 0;
T errmax = 0;
do
{
if (errmax >= 1.0)
{
// reduce step size
dx *= errmax<errmax_sl ? safety * pow(errmax, pshrnk) : shrinkLimit;
stepSizeWasMaximal = true;
if (m_x == m_x + dx)
{
// stepsize below numerical resolution
kError()
<< "RkOdeSolver: stepsize underflow in rkStepCheck"
<< endl;
}
// new dx -> update scaling vector
yscal
= (m_y.cwise().abs()
+ (dx*m_dydx).cwise().abs()).cwise()
+ 1e-15;
}
ytmp = rkStep(dx, yerr); // try to make a step forward
t = (yerr.cwise() / yscal).cwise().abs(); // calc the error vector
errmax = t.maxCoeff()/m_eps; // calc the rel. maximal error
++iter;
} while ((iter < maxiter) && (errmax >= 1.0));
if (iter >= maxiter)
{
kError()
<< "RkOdeSolver: too many iterations in rkStepCheck()";
}
if (stepSizeWasMaximal)
{
// estimate next step size if used step size was maximal
m_step =
std::abs(dx)
* (errmax>errmax_gl ? safety * pow(errmax, pgrow) : growthLimit);
}
m_x += dx; // make step forward
m_y = ytmp; // save new function values
m_dydx = f(m_x,m_y); // and update derivatives
return (std::abs(dx) < std::abs(dx_requested));
}
template<typename T, int D>
Matrix<T,D,1>
RkOdeSolver<T, D>::rkStep(const T& dx, Matrix<T,D,1>& yerr) const
{
static const T
a2=0.2, a3=0.3, a4=0.6, a5=1.0, a6=0.875,
b21=0.2,
b31=3.0/40.0, b32=9.0/40.0,
b41=0.3, b42=-0.9, b43=1.2,
b51=-11.0/54.0, b52=2.5, b53=-70.0/27.0, b54=35.0/27.0,
b61=1631.0/55296.0, b62=175.0/512.0, b63=575.0/13824.0,
b64=44275.0/110592.0, b65=253.0/4096.0,
c1=37.0/378.0, c3=250.0/621.0, c4=125.0/594.0, c6=512.0/1771.0,
dc1=c1-2825.0/27648.0, dc3=c3-18575.0/48384.0,
dc4=c4-13525.0/55296.0, dc5=-277.0/14336.0, dc6=c6-0.25;
Matrix<T,D,1> ak2 = f(m_x + a2*dx,
m_y + dx*b21*m_dydx); // 2. step
Matrix<T,D,1> ak3 = f(m_x + a3*dx,
m_y + dx*(b31*m_dydx + b32*ak2)); // 3.step
Matrix<T,D,1> ak4 = f(m_x + a4*dx,
m_y + dx*(b41*m_dydx + b42*ak2
+ b43*ak3)); // 4.step
Matrix<T,D,1> ak5 = f(m_x + a5*dx,
m_y + dx*(b51*m_dydx + b52*ak2
+ b53*ak3 + b54*ak4)); // 5.step
Matrix<T,D,1> ak6 = f(m_x + a6*dx,
m_y + dx*(b61*m_dydx + b62*ak2
+ b63*ak3 + b64*ak4
+ b65*ak5)); // 6.step
yerr = dx*(dc1*m_dydx + dc3*ak3 + dc4*ak4 + dc5*ak5 + dc6*ak6);
return m_y + dx*( c1*m_dydx + c3*ak3 + c4*ak4 + c6*ak6);
}
#endif

View file

@ -0,0 +1,882 @@
/** @file
*
* KRotation screen saver for KDE
*
* The screen saver displays a physically realistic simulation of a force free
* rotating asymmetric body. The equations of motion for such a rotation, the
* Euler equations, are integrated numerically by the Runge-Kutta method.
*
* Copyright (C) 2004 Georg Drenkhahn, Georg.Drenkhahn@gmx.net
*
* 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) version 3 or
* any later version accepted by the membership of KDE e.V. (or its successor
* approved by the membership of KDE e.V.), which shall act as a proxy defined
* in Section 14 of version 3 of the license.
*
* 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.
*/
#define QT_NO_COMPAT
// std. C++ headers
#include <cstdlib>
// STL headers
#include <deque>
// Qt headers
#include <QCheckBox>
#include <QLineEdit>
#include <QValidator>
#include <QToolTip>
#include <QResizeEvent>
// KDE headers
#include <KLocale>
#include <KGlobal>
#include <KConfig>
#include <KDebug>
#include <KMessageBox>
// Eigen2 from KDE support
#include <Eigen/Core>
#include <Eigen/Geometry>
// import all Eigen types, Transform and Quaternion are not part of the
// namespace part published by USING_PART_OF_NAMESPACE_EIGEN
using namespace Eigen;
// the screen saver preview area class
#include "sspreviewarea.h"
#include "rotation.h" // own interfaces
#include "rotation.moc"
/** Version number of this screen saver */
#define KROTATION_VERSION "2.0"
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
// libkscreensaver interface
class KRotationSaverInterface : public KScreenSaverInterface
{
public:
virtual KAboutData* aboutData()
{
return new KAboutData(
"krotation.kss", "klock",
ki18n("Simulation of a force free rotating asymmetric body"),
KROTATION_VERSION,
ki18n("Simulation of a force free rotating asymmetric body"));
}
/** function to create screen saver object */
virtual KScreenSaver* create(WId id)
{
return new KRotationSaver(id);
}
/** function to create setup dialog for screen saver */
virtual QDialog* setup()
{
return new KRotationSetup();
}
};
int main(int argc, char *argv[])
{
KRotationSaverInterface kss;
return kScreenSaverMain(argc, argv, kss);
}
//-----------------------------------------------------------------------------
// EulerOdeSolver implementation
//-----------------------------------------------------------------------------
EulerOdeSolver::EulerOdeSolver(
const double& t,
const double& dt,
const double& A,
const double& B,
const double& C,
Vector12d& y,
const double& eps)
: RkOdeSolver<double,12>(t, y, dt, eps),
m_A(A),
m_B(B),
m_C(C)
{
}
Vector12d EulerOdeSolver::f(const double& x, const Vector12d& y) const
{
// unused
(void)x;
// vec omega in body coor. sys.: omega_body = (p, q, r)
const Vector3d omega_body(y.head<3>());
// body unit vectors in fixed frame coordinates
Matrix3d e;
for (int i=0; i<3; ++i)
{
e.col(i) = y.segment<3>(3+i*3);
}
// vec omega in global fixed coor. sys.
const Vector3d omega = e * omega_body;
// return vector y'
Vector12d ypr;
// omega_body'
ypr[0] = -(m_C-m_B)/m_A * omega_body[1] * omega_body[2]; // p'
ypr[1] = -(m_A-m_C)/m_B * omega_body[2] * omega_body[0]; // q'
ypr[2] = -(m_B-m_A)/m_C * omega_body[0] * omega_body[1]; // r'
// e1', e2', e3'
for (int i=0; i<3; ++i)
{
ypr.segment<3>(3+i*3) = omega.cross(e.col(i));
}
return ypr;
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// Rotation: screen saver widget
//-----------------------------------------------------------------------------
RotationGLWidget::RotationGLWidget(
QWidget* parent,
const KRotationSaver& saver)
: QGLWidget(parent),
m_eyeR(25),
m_eyeTheta(1),
m_eyePhi(M_PI*0.25),
m_boxSize(Vector3d::Ones()),
m_fixedAxses(0),
m_bodyAxses(0),
m_lightR(10),
m_lightTheta(M_PI/4),
m_lightPhi(0),
m_bodyAxsesLength(6),
m_fixedAxsesLength(8),
m_saver(saver)
{
/* Set the box sizes from the momenta of inertia. J is the 3 vector with
* momenta of inertia with respect to the 3 figure axes. */
const Vector3d& J = m_saver.J();
/* the default values must be valid so that w,h,d are real! */
const GLfloat x2 = 6.0*(-J[0] + J[1] + J[2]);
const GLfloat y2 = 6.0*( J[0] - J[1] + J[2]);
const GLfloat z2 = 6.0*( J[0] + J[1] - J[2]);
if ((x2>=0) && (y2>=0) && (z2>=0))
{
m_boxSize = Vector3d(std::sqrt(x2), std::sqrt(y2), std::sqrt(z2));
}
else
{
kError() << "parameter error";
}
}
/* --------- protected methods ----------- */
void RotationGLWidget::initializeGL(void)
{
qglClearColor(QColor(Qt::black)); // set color to clear the background
glClearDepth(1); // depth buffer setup
glEnable(GL_DEPTH_TEST); // depth testing
glDepthFunc(GL_LEQUAL); // type of depth test
glShadeModel(GL_SMOOTH); // smooth color shading in poygons
// nice perspective calculation
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
// set up the light
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
// set position of light0
GLfloat lightPos[4]=
{m_lightR * std::sin(m_lightTheta) * std::sin(m_lightPhi),
m_lightR * std::sin(m_lightTheta) * std::cos(m_lightPhi),
m_lightR * std::cos(m_lightTheta), 1.};
glLightfv(GL_LIGHT0, GL_POSITION, lightPos);
// enable setting the material colour by glColor()
glEnable(GL_COLOR_MATERIAL);
// set up display lists
if (m_fixedAxses == 0)
{
m_fixedAxses = glGenLists(1); // list to be returned
}
glNewList(m_fixedAxses, GL_COMPILE);
// fixed coordinate system axes
glPushMatrix();
glLoadIdentity();
// z-axis, blue
qglColor(QColor(Qt::blue));
myGlArrow(m_fixedAxsesLength, 0.5f, 0.03f, 0.1f);
// x-axis, red
qglColor(QColor(Qt::red));
glRotatef(90, 0, 1, 0);
myGlArrow(m_fixedAxsesLength, 0.5f, 0.03f, 0.1f);
// y-axis, green
qglColor(QColor(Qt::green));
glLoadIdentity();
glRotatef(-90, 1, 0, 0);
myGlArrow(m_fixedAxsesLength, 0.5f, 0.03f, 0.1f);
glPopMatrix();
glEndList();
// end of axes object list
// box and box-axses
if (m_bodyAxses == 0)
{
m_bodyAxses = glGenLists(1); // list to be returned
}
glNewList(m_bodyAxses, GL_COMPILE);
// z-axis, blue
qglColor(QColor(Qt::blue));
myGlArrow(m_bodyAxsesLength, 0.5f, 0.03f, 0.1f);
// x-axis, red
qglColor(QColor(Qt::red));
glPushMatrix();
glRotatef(90, 0, 1, 0);
myGlArrow(m_bodyAxsesLength, 0.5f, 0.03f, 0.1f);
glPopMatrix();
// y-axis, green
qglColor(QColor(Qt::green));
glPushMatrix();
glRotatef(-90, 1, 0, 0);
myGlArrow(m_bodyAxsesLength, 0.5f, 0.03f, 0.1f);
glPopMatrix();
glEndList();
}
void RotationGLWidget::draw_traces(void)
{
const std::deque<Matrix3d>&e = m_saver.e();
// traces must contain at least 2 elements
if (e.size() <= 1)
{
return;
}
glPushMatrix();
glScalef(m_bodyAxsesLength, m_bodyAxsesLength, m_bodyAxsesLength);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
for (int j=0; j<3; ++j)
{
if (m_saver.traceFlag(j))
{
// emission colour
GLfloat em[4] = {0,0,0,1};
em[j] = 1; // set either red, green, blue emission colour
glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, em);
glColor4fv(em);
// set iterator of the tail part
std::deque<Matrix3d>::const_iterator eit = e.begin();
std::deque<Matrix3d>::const_iterator tail =
e.begin() +
static_cast<std::deque<Matrix3d>::difference_type>
(0.9 * e.size());
glBegin(GL_LINES);
for (; eit < e.end()-1; ++eit)
{
glVertex3f((*eit)(0,j), (*eit)(1,j), (*eit)(2,j));
// decrease transparency for tail section
if (eit > tail)
{
em[3] =
static_cast<GLfloat>
(1.0 - double(eit-tail)/(0.1 * e.size()));
}
glColor4fv(em);
glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, em);
glVertex3f((*(eit+1))(0,j), (*(eit+1))(1,j), (*(eit+1))(2,j));
}
glEnd();
}
}
glDisable(GL_BLEND);
glPopMatrix();
}
void RotationGLWidget::paintGL(void)
{
// clear color and depth buffer
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_MODELVIEW); // select modelview matrix
glLoadIdentity();
GLfloat const em[] = {0,0,0,1};
glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, em);
glPushMatrix();
// calculate the transform which rotates the unit z vector onto omega
glLoadMatrixd(
Projective3d(
Quaternion<double>()
.setFromTwoVectors(Vector3d::UnitZ(), m_saver.omega())
.toRotationMatrix())
.data());
// draw the white omega arrow
qglColor(QColor(Qt::white));
myGlArrow(7, .5f, .1f, 0.2f);
glPopMatrix();
// draw the fixed axes
glCallList(m_fixedAxses);
// create transformation/rotation matrix from the body and its unit axes
glPushMatrix();
glLoadMatrixd(
Projective3d(m_saver.e().front())
.data());
// draw the body unit axis
glCallList(m_bodyAxses);
// scaling from a cube to the rotating body
glScalef(m_boxSize[0]/2, m_boxSize[1]/2, m_boxSize[2]/2);
// paint box
glBegin(GL_QUADS);
// front (z)
qglColor(QColor(Qt::blue));
glNormal3f( 0,0,1);
glVertex3f( 1, 1, 1);
glVertex3f(-1, 1, 1);
glVertex3f(-1, -1, 1);
glVertex3f( 1, -1, 1);
// back (-z)
glNormal3f( 0,0,-1);
glVertex3f( 1, 1, -1);
glVertex3f(-1, 1, -1);
glVertex3f(-1, -1, -1);
glVertex3f( 1, -1, -1);
// top (y)
qglColor(QColor(Qt::green));
glNormal3f( 0,1,0);
glVertex3f( 1, 1, 1);
glVertex3f( 1, 1, -1);
glVertex3f(-1, 1, -1);
glVertex3f(-1, 1, 1);
// bottom (-y)
glNormal3f( 0,-1,0);
glVertex3f( 1, -1, 1);
glVertex3f( 1, -1, -1);
glVertex3f(-1, -1, -1);
glVertex3f(-1, -1, 1);
// left (-x)
qglColor(QColor(Qt::red));
glNormal3f( -1,0,0);
glVertex3f(-1, 1, 1);
glVertex3f(-1, 1, -1);
glVertex3f(-1, -1, -1);
glVertex3f(-1, -1, 1);
// right (x)
glNormal3f( 1,0,0);
glVertex3f( 1, 1, 1);
glVertex3f( 1, 1, -1);
glVertex3f( 1, -1, -1);
glVertex3f( 1, -1, 1);
glEnd();
glPopMatrix();
// draw the traces
draw_traces();
glFlush();
}
void RotationGLWidget::resizeGL(int w, int h)
{
kDebug() << "w=" << w << ", h=" << h << "\n";
// prevent division by zero
if (h == 0)
{
return;
}
// set the new view port
glViewport(0, 0, (GLint)w, (GLint)h);
// set up projection matrix
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
// Perspective view
gluPerspective(40.0f, (GLdouble)w/(GLdouble)h, 1.0, 100.0f);
// Viewing transformation, position for better view
// Theta is polar angle 0<Theta<Pi
gluLookAt(
m_eyeR * std::sin(m_eyeTheta) * std::sin(m_eyePhi),
m_eyeR * std::sin(m_eyeTheta) * std::cos(m_eyePhi),
m_eyeR * std::cos(m_eyeTheta),
0,0,0,
0,0,1);
}
/* --------- privat methods ----------- */
void RotationGLWidget::myGlArrow(
GLfloat total_length, GLfloat head_length,
GLfloat base_width, GLfloat head_width)
{
GLUquadricObj* const quadAx = gluNewQuadric();
glPushMatrix();
gluCylinder(
quadAx, base_width, base_width,
total_length - head_length, 10, 1);
glTranslatef(0, 0, total_length - head_length);
gluCylinder(quadAx, head_width, 0, head_length, 10, 1);
glPopMatrix();
gluDeleteQuadric(quadAx);
}
//-----------------------------------------------------------------------------
// KRotationSaver: screen saver class
//-----------------------------------------------------------------------------
// class methods
KRotationSaver::KRotationSaver(WId id)
: KScreenSaver(id),
m_solver(0),
m_glArea(0),
m_timer(0),
m_J(4,2,3), // fixed box sizes!
m_traceLengthSeconds(sm_traceLengthSecondsDefault),
m_Lz(sm_LzDefault),
m_initEulerPhi(0),
m_initEulerPsi(0),
m_initEulerTheta(sm_initEulerThetaDefault)
{
// no need to set our parent widget's background here, the GL widget sets its
// own background color
readSettings(); // read global settings
// init m_e1,m_e2,m_e3,m_omega, construct and init m_solver
initData();
// create gl widget w/o parent
m_glArea = new RotationGLWidget(0, *this);
embed(m_glArea); // embed gl widget and resize it
m_glArea->show(); // show embedded gl widget
// set up cyclic timer
m_timer = new QTimer(this);
m_timer->start(sm_deltaT);
connect(m_timer, SIGNAL(timeout()), this, SLOT(doTimeStep()));
}
KRotationSaver::~KRotationSaver()
{
m_timer->stop();
// m_timer is automatically deleted with parent KRotationSaver
delete m_glArea;
delete m_solver;
}
void KRotationSaver::initData()
{
// rotation by phi around z = zhat axis
Matrix3d et(AngleAxisd(m_initEulerPhi, Vector3d::UnitZ()));
// rotation by theta around new x axis
et = AngleAxisd(m_initEulerPhi, et.col(0)).toRotationMatrix() * et;
// rotation by psi around new z axis
et = AngleAxisd(m_initEulerPsi, et.col(2)).toRotationMatrix() * et;
// set first vector in deque
m_e.clear(); m_e.push_front(et);
/* calc L in body frame:
*
* determine unit-axes of fixed frame in body coordinates, invert the
* transformations above for unit vectors of the body frame */
// rotation by -psi along z axis
Matrix3d e_body(AngleAxisd(-m_initEulerPsi, Vector3d::UnitZ()));
// rotation by -theta along new x axis
e_body = AngleAxisd(-m_initEulerTheta, e_body.col(0)).toRotationMatrix() * e_body;
// omega_body = L_body * J_body^(-1)
// component-wise division because J_body is a diagonal matrix
Vector3d omega_body = (m_Lz * e_body.col(2)).cwise() / m_J;
// initial rotation vector
m_omega = et * omega_body;
// assemble initial y for solver
Vector12d y;
y.head<3>() = omega_body;
// 3 basis vectors of body system in fixed coordinates
y.segment<3>(3) = et.col(0);
y.segment<3>(6) = et.col(1);
y.segment<3>(9) = et.col(2);
if (m_solver!=0)
{
// deleting the solver is necessary when parameters are changed in the
// configuration dialog.
delete m_solver;
}
// init solver
m_solver = new EulerOdeSolver(
0.0, // t
0.01, // first dt step size estimation
m_J[0], m_J[1], m_J[2], // A,B,C
y, // omega_body,e1,e2,e3
1e-5); // eps
}
void KRotationSaver::readSettings()
{
// read configuration settings from config file
KConfigGroup config(KGlobal::config(), "Settings");
// internal saver parameters are set to stored values or left at their
// default values if stored values are out of range
setTraceFlag(0, config.readEntry("x trace", sm_traceFlagDefault[0]));
setTraceFlag(1, config.readEntry("y trace", sm_traceFlagDefault[1]));
setTraceFlag(2, config.readEntry("z trace", sm_traceFlagDefault[2]));
setRandomTraces(config.readEntry("random traces", sm_randomTracesDefault));
setTraceLengthSeconds(
config.readEntry("length", sm_traceLengthSecondsDefault));
setLz(
config.readEntry("Lz", sm_LzDefault));
setInitEulerTheta(
config.readEntry("theta", sm_initEulerThetaDefault));
}
void KRotationSaver::setTraceLengthSeconds(const double& t)
{
if ((t >= sm_traceLengthSecondsLimitLower)
&& (t <= sm_traceLengthSecondsLimitUpper))
{
m_traceLengthSeconds = t;
}
}
void KRotationSaver::setLz(const double& Lz)
{
if ((Lz >= sm_LzLimitLower) && (Lz <= sm_LzLimitUpper))
{
m_Lz = Lz;
}
}
void KRotationSaver::setInitEulerTheta(const double& theta)
{
if ((theta >= sm_initEulerThetaLimitLower)
&& (theta <= sm_initEulerThetaLimitUpper))
{
m_initEulerTheta = theta;
}
}
// public slots
void KRotationSaver::doTimeStep()
{
// integrate a step ahead
m_solver->integrate(0.001*sm_deltaT);
// read new y
Vector12d y = m_solver->Y();
std::deque<Vector3d>::size_type
max_vec_length =
static_cast<std::deque<Vector3d>::size_type>
( m_traceLengthSeconds/(0.001*sm_deltaT) );
// construct matrix from solution vector
// read out new body coordinate system
Matrix3d et;
for (int j=0; j<3; ++j)
{
et.col(j) = y.segment<3>(3*j+3);
}
m_e.push_front(et);
if (max_vec_length > 0)
{
m_e.push_front(et);
while (m_e.size() > max_vec_length)
{
m_e.pop_back();
}
}
else
{
// only set the 1. element
m_e.front() = et;
// and delete all other emements
if (m_e.size() > 1)
{
m_e.resize(1);
}
}
// current rotation vector omega
m_omega = m_e.front() * y.head<3>();
// set new random traces every 10 seconds
if (m_randomTraces)
{
static unsigned int counter=0;
++counter;
if (counter > unsigned(10.0/(0.001*sm_deltaT)))
{
counter=0;
for (int i=0; i<3; ++i)
{
m_traceFlag[i] = (rand()%2==1);
}
}
}
m_glArea->updateGL();
// no need to restart timer here, it is a cyclic timer
}
// public slot of KRotationSaver, forward resize event to public slot of glArea
// to allow the resizing of the gl area withing the setup dialog
void KRotationSaver::resizeGlArea(QResizeEvent* e)
{
m_glArea->resize(e->size());
}
// public static class members
const double KRotationSaver::sm_traceLengthSecondsLimitLower = 0.0;
const double KRotationSaver::sm_traceLengthSecondsLimitUpper = 99.0;
const double KRotationSaver::sm_traceLengthSecondsDefault = 3.0;
const bool KRotationSaver::sm_traceFlagDefault[3] = {false, false, true};
const bool KRotationSaver::sm_randomTracesDefault = true;
const double KRotationSaver::sm_LzLimitLower = 0.0;
const double KRotationSaver::sm_LzLimitUpper = 500.0;
const double KRotationSaver::sm_LzDefault = 10.0;
const double KRotationSaver::sm_initEulerThetaLimitLower = 0.0;
const double KRotationSaver::sm_initEulerThetaLimitUpper = 180.0;
const double KRotationSaver::sm_initEulerThetaDefault = 0.03;
// private static class members
const unsigned int KRotationSaver::sm_deltaT = 20;
//-----------------------------------------------------------------------------
// KRotationSetup: dialog to setup screen saver parameters
//-----------------------------------------------------------------------------
KRotationSetup::KRotationSetup(QWidget* parent)
: KDialog(parent)
{
setCaption(i18n( "KRotation Setup" ));
setButtons(Ok|Cancel|Help);
setDefaultButton(Ok);
setButtonText( Help, i18n( "A&bout" ) );
QWidget *main = new QWidget(this);
setMainWidget(main);
cfg = new RotationWidget();
cfg->setupUi( main );
// the dialog should block, no other control center input should be possible
// until the dialog is closed
setModal(true);
cfg->m_lengthEdit->setValidator(
new QDoubleValidator(
KRotationSaver::sm_traceLengthSecondsLimitLower,
KRotationSaver::sm_traceLengthSecondsLimitUpper,
3, cfg->m_lengthEdit));
cfg->m_LzEdit->setValidator(
new QDoubleValidator(
KRotationSaver::sm_LzLimitLower,
KRotationSaver::sm_LzLimitUpper,
3, cfg->m_LzEdit));
cfg->m_thetaEdit->setValidator(
new QDoubleValidator(
KRotationSaver::sm_initEulerThetaLimitLower,
KRotationSaver::sm_initEulerThetaLimitUpper,
3, cfg->m_thetaEdit));
// set tool tips of editable fields
cfg->m_lengthEdit->setToolTip(
ki18n("Length of traces in seconds of visibility.\nValid values from %1 to %2.")
.subs(KRotationSaver::sm_traceLengthSecondsLimitLower, 0, 'f', 2)
.subs(KRotationSaver::sm_traceLengthSecondsLimitUpper, 0, 'f', 2)
.toString());
cfg->m_LzEdit->setToolTip(
ki18n("Angular momentum in z direction in arbitrary units.\nValid values from %1 to %2.")
.subs(KRotationSaver::sm_LzLimitLower, 0, 'f', 2)
.subs(KRotationSaver::sm_LzLimitUpper, 0, 'f', 2)
.toString());
cfg->m_thetaEdit->setToolTip(
ki18n("Gravitational constant in arbitrary units.\nValid values from %1 to %2.")
.subs(KRotationSaver::sm_initEulerThetaLimitLower, 0, 'f', 2)
.subs(KRotationSaver::sm_initEulerThetaLimitUpper, 0, 'f', 2)
.toString());
// setting the background of m_preview widget is not necessary, it's content
// is overlayed with the embedded GL widget anyway
cfg->m_preview->show(); // otherwise saver does not get correct size initially
// create screen saver and give it the WinID of the preview area in which it
// will be embedded
m_saver = new KRotationSaver(cfg->m_preview->winId());
// read settings from saver and update GUI elements with these values, saver
// has read settings in its constructor
// set editable fields with stored values as defaults
cfg->m_xTrace->setChecked(m_saver->traceFlag(0));
cfg->m_yTrace->setChecked(m_saver->traceFlag(1));
cfg->m_zTrace->setChecked(m_saver->traceFlag(2));
cfg->m_randTraces->setChecked(m_saver->randomTraces());
QString text;
text.setNum(m_saver->traceLengthSeconds());
cfg->m_lengthEdit->setText(text);
text.setNum(m_saver->Lz());
cfg->m_LzEdit->setText(text);
text.setNum(m_saver->initEulerTheta());
cfg->m_thetaEdit->setText(text);
// if the preview area is resized it emits the resized() event which is
// caught by m_saver. The embedded GLArea is resized to fit into the preview
// area.
connect(cfg->m_preview, SIGNAL(resized(QResizeEvent*)),
m_saver, SLOT(resizeGlArea(QResizeEvent*)));
connect(this, SIGNAL(okClicked()), this, SLOT(okButtonClickedSlot()));
connect(this, SIGNAL(helpClicked()), this, SLOT(aboutButtonClickedSlot()));
connect(cfg->m_xTrace, SIGNAL(toggled(bool)), this, SLOT(xTraceToggled(bool)));
connect(cfg->m_randTraces, SIGNAL(toggled(bool)), this, SLOT(randomTracesToggled(bool)));
connect(cfg->m_yTrace, SIGNAL(toggled(bool)), this, SLOT(yTraceToggled(bool)));
connect(cfg->m_zTrace, SIGNAL(toggled(bool)), this, SLOT(zTraceToggled(bool)));
connect(cfg->m_lengthEdit, SIGNAL(textChanged(QString)), this, SLOT(lengthEnteredSlot(QString)));
connect(cfg->m_LzEdit, SIGNAL(textChanged(QString)), this, SLOT(LzEnteredSlot(QString)));
connect(cfg->m_thetaEdit, SIGNAL(textChanged(QString)), this, SLOT(thetaEnteredSlot(QString)));
}
KRotationSetup::~KRotationSetup()
{
delete m_saver;
delete cfg;
}
// Ok pressed - save settings and exit
void KRotationSetup::okButtonClickedSlot(void)
{
KConfigGroup config(KGlobal::config(), "Settings");
config.writeEntry("x trace", m_saver->traceFlag(0));
config.writeEntry("y trace", m_saver->traceFlag(1));
config.writeEntry("z trace", m_saver->traceFlag(2));
config.writeEntry("random traces", m_saver->randomTraces());
config.writeEntry("length", m_saver->traceLengthSeconds());
config.writeEntry("Lz", m_saver->Lz());
config.writeEntry("theta", m_saver->initEulerTheta());
config.sync();
accept();
}
void KRotationSetup::aboutButtonClickedSlot(void)
{
KMessageBox::about(this, i18n("\
<h3>KRotation Screen Saver for KDE</h3>\
<p>Simulation of a force free rotating asymmetric body</p>\
<p>Copyright (c) Georg&nbsp;Drenkhahn 2004</p>\
<p><tt>Georg.Drenkhahn@gmx.net</tt></p>"));
}
void KRotationSetup::xTraceToggled(bool state)
{
m_saver->setTraceFlag(0, state);
}
void KRotationSetup::yTraceToggled(bool state)
{
m_saver->setTraceFlag(1, state);
}
void KRotationSetup::zTraceToggled(bool state)
{
m_saver->setTraceFlag(2, state);
}
void KRotationSetup::randomTracesToggled(bool state)
{
m_saver->setRandomTraces(state);
if (!state)
{
// restore settings from gui if random traces are turned off
m_saver->setTraceFlag(0, cfg->m_xTrace->isChecked());
m_saver->setTraceFlag(1, cfg->m_yTrace->isChecked());
m_saver->setTraceFlag(2, cfg->m_zTrace->isChecked());
}
}
void KRotationSetup::lengthEnteredSlot(const QString& s)
{
m_saver->setTraceLengthSeconds(s.toDouble());
}
void KRotationSetup::LzEnteredSlot(const QString& s)
{
m_saver->setLz(s.toDouble());
m_saver->initData();
}
void KRotationSetup::thetaEnteredSlot(const QString& s)
{
m_saver->setInitEulerTheta(s.toDouble());
m_saver->initData();
}

View file

@ -0,0 +1,386 @@
/** @file
*
* KRotation screen saver for KDE
*
* The screen saver displays a physically realistic simulation of a force free
* rotating asymmetric body. The equations of motion for such a rotation, the
* Euler equations, are integrated numerically by the Runge-Kutta method.
*
* Copyright (C) 2004 Georg Drenkhahn, Georg.Drenkhahn@gmx.net
*
* 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) version 3 or
* any later version accepted by the membership of KDE e.V. (or its successor
* approved by the membership of KDE e.V.), which shall act as a proxy defined
* in Section 14 of version 3 of the license.
*
* 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.
*/
#ifndef ROTATION2_H
#define ROTATION2_H
// Qt headers
#include <qwidget.h>
#include <qtimer.h>
#include <qgl.h>
// GL headers
#include <GL/glu.h>
#include <GL/gl.h>
// KDE headers
#include <kscreensaver.h>
// Eigen2 from KDE support
#include <Eigen/Core>
// import most common Eigen types
using namespace Eigen;
// own extension of typdefed vector types of Eigen2
typedef Matrix<double,12,1> Vector12d;
#include "rkodesolver.h"
// KRotationSetupUi
#include "ui_rotationcfg.h"
//--------------------------------------------------------------------
/** @brief ODE solver for the Euler equations.
*
* Class implements RkOdeSolver<double> to solve the Euler equations of motion
* tor the rotating object. */
class EulerOdeSolver : public RkOdeSolver<double,12>
{
public:
/** @brief Constructor for the ODE solver for the Euler equations.
* @param t Time in seconds, integration variable
* @param dt Initial time increment in seconds for integration, auto adjusted
* later to guarantee precision
* @param A Moment of inertia along 1. figure axis
* @param B Moment of inertia along 2. figure axis
* @param C Moment of inertia along 3. figure axis
* @param y Vector of 12 elements containing the initial rotation vector
* omega (elements 0 to 2), and the initial rotating systems coordinate
* vectors e1, e2, e3 (elements 3 to 5, 6 to 8, and 9 to 11).
* @param eps Relative precision per integration step, see
* RkOdeSolver::RkOdeSolver(). */
EulerOdeSolver(
const double& t,
const double& dt,
const double& A,
const double& B,
const double& C,
Vector12d& y,
const double& eps);
protected:
/** @brief ODE function for the Euler equation system
* @param x time in seconds
* @param y Vector of 12 elements containing the rotation vector omega
* (elements 0 to 2), and the rotating systems coordinate vectors e1, e2, e3
* (elements 3 to 5, 6 to 8, and 9 to 11).
* @return derivation dy/dx */
Vector12d f(const double& x, const Vector12d& y) const;
private:
/** Moments of inertia along the three figure axes */
double m_A, m_B, m_C;
};
//--------------------------------------------------------------------
/* forward declaration */
class KRotationSaver;
//--------------------------------------------------------------------
/** @brief GL widget class for the KRotation screen saver
*
* Class implements QGLWidget to display the KRotation screen saver. */
class RotationGLWidget : public QGLWidget
{
Q_OBJECT
public:
/** @brief Constructor of KRotation's GL widget
* @param parent parent widget, passed to QGLWidget's constructor
* @param omega current rotation vector
* @param e trace data
* @param J 3 vector with momenta of inertia with respect to the 3 figure
* axes. */
RotationGLWidget(
QWidget* parent,
const KRotationSaver& saver);
protected:
/** Called if scenery (GL view) must be updated */
virtual void paintGL();
/** Called if gl widget was resized. Method makes adjustments for new
* perspective */
virtual void resizeGL(int w, int h);
/** Setup the GL environment */
virtual void initializeGL();
private:
/** @brief Draw 3D arrow
* @param total_length total length of arrow
* @param head_length length of arrow head (cone)
* @param base_width width of arrow base
* @param head_width width of arrow head (cone)
*
* The arrow is drawn from the coordinates zero point along th z direction.
* The cone's tip is located at (0,0,@a total_length). */
void myGlArrow(
GLfloat total_length,
GLfloat head_length,
GLfloat base_width,
GLfloat head_width);
/** Draw the traces in the GL area */
void draw_traces (void);
private: // Private attributes
/** Eye position distance from coordinate zero point */
GLfloat m_eyeR;
/** Eye position theta angle from z axis */
GLfloat m_eyeTheta;
/** Eye position phi angle (longitude) */
GLfloat m_eyePhi;
/** Box size */
Vector3d m_boxSize;
/** GL object list of fixed coordinate systems axses */
GLuint m_fixedAxses;
/** GL object list of rotating coordinate systems axses */
GLuint m_bodyAxses;
/** Light position distance from coordinate zero point */
GLfloat m_lightR;
/** Light position theta angle from z axis */
GLfloat m_lightTheta;
/** Light position phi angle (longitude) */
GLfloat m_lightPhi;
/** Length of the rotating coordinate system axses */
GLfloat m_bodyAxsesLength;
/** Length of the fixed coordinate system axses */
GLfloat m_fixedAxsesLength;
/** reference to screen saver */
const KRotationSaver& m_saver;
};
//--------------------------------------------------------------------
/** @brief Main class of the KRotation screen saver
*
* This class implements KScreenSaver for the KRotation screen saver. */
class KRotationSaver : public KScreenSaver
{
Q_OBJECT
public:
/* public member functions */
/** @brief Constructor of the KRotation screen saver object
* @param drawable Id of the window in which the screen saver is drawed
*
* Initial settings are read from disk, the GL widget is set up and displayed
* and the eq. of motion solver is started. */
KRotationSaver(WId drawable);
/** @brief Destructor of the KPendulum screen saver object
*
* Only KPendulumSaver::solver is destoyed. */
~KRotationSaver();
/** read the saved settings from disk */
void readSettings();
/** init physical quantities and set up the ode solver */
void initData();
/** Returns length of traces in seconds of visibility, parameter from setup
* dialog */
inline double traceLengthSeconds(void) const
{
return m_traceLengthSeconds;
}
/** Sets the length of traces in seconds of visibility. */
void setTraceLengthSeconds(const double& t);
/** Flags indicating if the traces for x,y,z are shown. Only relevant if
* ::randomTraces is not set to true. Parameter from setup dialog */
inline bool traceFlag(unsigned int n) const
{
return m_traceFlag[n];
}
/** (Un)Sets the x,y,z traces flags. */
inline void setTraceFlag(unsigned int n, const bool& flag)
{
m_traceFlag[n] = flag;
}
/** If flag is set to true the traces will be (de)activated randomly all 10
* seconds. Parameter from setup dialog */
inline bool randomTraces(void) const
{
return m_randomTraces;
}
/** (Un)Sets the random trace flag. */
inline void setRandomTraces(const bool& flag)
{
m_randomTraces = flag;
}
/** Returns the angular momentum. */
inline double Lz(void) const
{
return m_Lz;
}
/** Sets the angular momentum. */
void setLz(const double& Lz);
/** Returns initial eulerian angle theta of the top body at t=0 sec. */
inline double initEulerTheta(void) const
{
return m_initEulerTheta;
}
/** Set the initial eulerian angle theta of the top body at t=0 sec. */
void setInitEulerTheta(const double& theta);
/** Returns constant reference to m_omega */
inline const Vector3d& omega(void) const
{
return m_omega;
}
/** Returns constant reference to m_e */
inline const std::deque<Matrix3d>& e(void) const
{
return m_e;
}
/** Returns constant reference to m_J */
inline const Vector3d& J(void) const
{
return m_J;
}
/* public static class member variables */
/** Lower argument limit for setTraceLengthSeconds() */
static const double sm_traceLengthSecondsLimitLower;
/** Upper argument limit for setTraceLengthSeconds() */
static const double sm_traceLengthSecondsLimitUpper;
/** Default value of KRotationSaver::m_traceLengthSeconds */
static const double sm_traceLengthSecondsDefault;
/** Default values for KRotationSaver::m_traceFlag */
static const bool sm_traceFlagDefault[3];
/** Default value for KRotationSaver::m_randomTraces */
static const bool sm_randomTracesDefault;
/** Lower argument limit for setLz() */
static const double sm_LzLimitLower;
/** Upper argument limit for setLz() */
static const double sm_LzLimitUpper;
/** Default value for KRotationSaver::m_Lz */
static const double sm_LzDefault;
/** Lower argument limit for setInitEulerTheta() */
static const double sm_initEulerThetaLimitLower;
/** Upper argument limit for setInitEulerTheta() */
static const double sm_initEulerThetaLimitUpper;
/** Default value for KRotationSaver::m_initEulerTheta */
static const double sm_initEulerThetaDefault;
public slots:
/** slot is called if integration should proceed by ::sm_deltaT */
void doTimeStep();
/** slot is called if setup dialog changes in size and the GL area should be
* adjusted */
void resizeGlArea(QResizeEvent* e);
private:
/** Time step size for the integration in milliseconds. Used in
* ::KRotationSaver and ::RotationGLWidget. */
static const unsigned int sm_deltaT;
/** The ode solver which is used to integrate the equations of motion */
EulerOdeSolver* m_solver;
/** Gl widget of simulation */
RotationGLWidget* m_glArea;
/** Timer for the real time integration of the Euler equations */
QTimer* m_timer;
/** current rotation vector */
Vector3d m_omega;
/** deque of matrices of figure axes in fixed frame coordinates. Each matrix
* column represents an axis vector */
std::deque<Matrix3d> m_e;
/** Momentum of inertia along figure axes */
const Vector3d m_J;
/** Length of traces in seconds of visibility, parameter from setup dialog */
double m_traceLengthSeconds;
/** Flags indicating if the traces for x,y,z are shown. Only relevant if
* ::randomTraces is not set to true. Parameter from setup dialog */
bool m_traceFlag[3];
/** If flag is set to true the traces will be (de)activated randomly all 10
* seconds. Parameter from setup dialog */
bool m_randomTraces;
/** Angular momentum. This is a constant of motion and points always into
* positive z direction. Parameter from setup dialog */
double m_Lz;
/** Initial eulerian angles phi of the top body at t=0s */
double m_initEulerPhi;
/** Initial eulerian angles psi of the top body at t=0s */
double m_initEulerPsi;
/** Initial eulerian angles theta of the top body at t=0 sec. Parameter from
* setup dialog */
double m_initEulerTheta;
};
class RotationWidget : public QWidget, public Ui::RotationWidget
{
public:
RotationWidget( QWidget *parent = 0L ) : QWidget( parent ) {
setupUi( this );
}
};
//--------------------------------------------------------------------
/** @brief KRotation screen saver setup dialog.
*
* This class handles the KRotation screen saver setup dialog. */
class KRotationSetup : public KDialog
{
Q_OBJECT
public:
KRotationSetup(QWidget* parent = NULL);
~KRotationSetup();
public slots:
/// slot for the OK Button: save settings and exit
void okButtonClickedSlot(void);
/// slot for the About Button: show the About dialog
void aboutButtonClickedSlot(void);
void randomTracesToggled(bool state);
void xTraceToggled(bool state);
void yTraceToggled(bool state);
void zTraceToggled(bool state);
void lengthEnteredSlot(const QString& s);
void LzEnteredSlot(const QString& s);
void thetaEnteredSlot(const QString& s);
private:
/// the screen saver widget which is displayed in the preview area
KRotationSaver* m_saver;
RotationWidget *cfg;
};
#endif

View file

@ -0,0 +1,300 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>RotationWidget</class>
<widget class="QWidget" name="RotationWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>388</width>
<height>287</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>1200</width>
<height>900</height>
</size>
</property>
<property name="baseSize">
<size>
<width>400</width>
<height>250</height>
</size>
</property>
<layout class="QVBoxLayout">
<item>
<layout class="QHBoxLayout">
<item>
<layout class="QVBoxLayout">
<item>
<widget class="QGroupBox" name="buttonGroup1">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Traces</string>
</property>
<layout class="QGridLayout">
<item row="0" column="0" colspan="2">
<layout class="QGridLayout">
<item row="0" column="0">
<widget class="QCheckBox" name="m_xTrace">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>x</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="3">
<widget class="QCheckBox" name="m_randTraces">
<property name="text">
<string>Random</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="m_yTrace">
<property name="text">
<string>y</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QCheckBox" name="m_zTrace">
<property name="text">
<string>z</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QLabel" name="textLabel1">
<property name="text">
<string>Length:</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="m_lengthEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>40</width>
<height>32767</height>
</size>
</property>
<property name="font">
<font>
<family>Helvetica</family>
<pointsize>11</pointsize>
</font>
</property>
<property name="maxLength">
<number>2</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<layout class="QGridLayout">
<item row="0" column="1">
<widget class="QLineEdit" name="m_LzEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>32767</height>
</size>
</property>
<property name="maxLength">
<number>5</number>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="textLabel3">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Theta:</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="textLabel2">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Lz:</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="m_thetaEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>32767</height>
</size>
</property>
<property name="maxLength">
<number>5</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="spacer1">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>31</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="SsPreviewArea" name="m_preview" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>220</width>
<height>220</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>SsPreviewArea</class>
<extends>QWidget</extends>
<header location="global">sspreviewarea.h</header>
</customwidget>
</customwidgets>
<includes>
<include location="local">sspreviewarea.h</include>
</includes>
<resources/>
<connections>
<connection>
<sender>m_randTraces</sender>
<signal>toggled(bool)</signal>
<receiver>m_xTrace</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>20</x>
<y>20</y>
</hint>
<hint type="destinationlabel">
<x>20</x>
<y>20</y>
</hint>
</hints>
</connection>
<connection>
<sender>m_randTraces</sender>
<signal>toggled(bool)</signal>
<receiver>m_yTrace</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>20</x>
<y>20</y>
</hint>
<hint type="destinationlabel">
<x>20</x>
<y>20</y>
</hint>
</hints>
</connection>
<connection>
<sender>m_randTraces</sender>
<signal>toggled(bool)</signal>
<receiver>m_zTrace</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>20</x>
<y>20</y>
</hint>
<hint type="destinationlabel">
<x>20</x>
<y>20</y>
</hint>
</hints>
</connection>
</connections>
</ui>

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,148 @@
// ----------------------------------------------------------------
//
// kscience - screen saver for KDE
//
// copyright (c) Rene Beutler 1998
//
#ifndef SCIENCE_H
#define SCIENCE_H
#include <qrect.h>
#include <qtimer.h>
#include <kdialog.h>
#include <kscreensaver.h>
class QSlider;
class QCheckBox;
#define MAX_MODES 6
typedef signed int T32bit;
class KScienceSaver;
class KPreviewWidget : public QWidget
{
Q_OBJECT
public:
KPreviewWidget( QWidget *parent );
void paintEvent( QPaintEvent *event );
void notifySaver( KScienceSaver *s = 0 );
private:
KScienceSaver *saver;
};
struct KScienceData;
class KScienceSaver : public KScreenSaver
{
Q_OBJECT
public:
KScienceSaver( WId id, bool setup=false, bool gP=false);
virtual ~KScienceSaver();
void do_refresh( const QRect & rect );
void setMode ( int mode );
void setMoveX ( signed int s );
void setMoveY ( signed int s );
void setMove ( bool s );
void setSize ( signed int s );
void setIntensity ( signed int s );
void setSpeed ( signed int s );
void setInverse ( bool b );
void setGravity ( bool b );
void setHideBG ( bool b );
void myAssert( bool term, const char *sMsg );
private:
void readSettings();
void initLens();
void initialize();
void releaseLens();
void (KScienceSaver::*applyLens)(int xs, int ys, int xd, int yd, int w, int h);
protected slots:
void slotTimeout();
protected:
void grabRootWindow();
void grabPreviewWidget();
void initWhirlLens();
void initSphereLens();
void initExponentialLens();
void initWaveLens();
void initCurvatureLens();
void blackPixel( int x, int y );
void blackPixelUndo( int x, int y);
void applyLens8bpp( int xs, int ys, int xd, int yd, int w, int h);
void applyLens16bpp(int xs, int ys, int xd, int yd, int w, int h);
void applyLens24bpp(int xs, int ys, int xd, int yd, int w, int h);
void applyLens32bpp(int xs, int ys, int xd, int yd, int w, int h);
QTimer timer;
bool moveOn;
bool setup;
bool grabPixmap;
int mode;
bool inverse[MAX_MODES];
bool gravity[MAX_MODES];
bool hideBG[MAX_MODES];
signed int size[MAX_MODES];
signed int moveX[MAX_MODES];
signed int moveY[MAX_MODES];
signed int speed[MAX_MODES];
signed int intensity[MAX_MODES];
int xcoord, ycoord;
double x, y, vx, vy;
signed int bpp, side;
int border, radius, diam, origin;
int imgnext;
char blackRestore[4];
KScienceData *d;
};
class KScienceSetup : public KDialog
{
Q_OBJECT
public:
KScienceSetup(QWidget *parent=0);
~KScienceSetup();
protected:
void updateSettings();
void readSettings();
private slots:
void slotMode( int );
void slotInverse();
void slotGravity();
void slotHideBG();
void slotMoveX( int );
void slotMoveY( int );
void slotSize( int );
void slotIntensity( int );
void slotSliderPressed();
void slotSliderReleased();
void slotSpeed( int );
void slotOk();
void slotHelp();
private:
KPreviewWidget *preview;
KScienceSaver *saver;
QSlider *slideSize, *slideSpeed, *slideIntensity;
QSlider *slideMoveX, *slideMoveY;
QCheckBox *checkInverse, *checkGravity, *checkHideBG;
int mode;
bool inverse [MAX_MODES];
bool gravity [MAX_MODES];
bool hideBG [MAX_MODES];
int moveX [MAX_MODES];
int moveY [MAX_MODES];
int size [MAX_MODES];
int intensity[MAX_MODES];
int speed [MAX_MODES];
};
#endif

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,151 @@
/* Slide Show Screen Saver
* (C) 1999 Stefan Taferner <taferner@kde.org>
* (C) 2003 Sven Leiber <s.leiber@web.de>
*/
#ifndef SLIDESHOW_H
#define SLIDESHOW_H
#include <QTimer>
#include <QStringList>
#include <QPixmap>
#include <QImage>
#include <kscreensaver.h>
#include <kdialog.h>
#include "ui_slideshowcfg.h"
class SlideShowCfg : public QWidget, public Ui::SlideShowCfg
{
public:
SlideShowCfg( QWidget *parent ) : QWidget( parent ) {
setupUi( parent );
cbSpacer1->changeSize(style()->pixelMetric(QStyle::PM_IndicatorWidth) +
style()->pixelMetric(QStyle::PM_CheckBoxLabelSpacing), 1,
QSizePolicy::Fixed, QSizePolicy::Minimum);
}
};
//-----------------------------------------------------------------------------
class kSlideShowSaver: public KScreenSaver
{
Q_OBJECT
public:
kSlideShowSaver( WId id );
virtual ~kSlideShowSaver();
typedef int (kSlideShowSaver::*EffectMethod)(bool);
void readConfig();
void restart();
protected:
/** Load list of images from directory */
virtual void loadDirectory();
/** Helper for loadDirectory() */
virtual void traverseDirectory(const QString &dirName);
/** Load next image from list. If the file cannot be read
it is automatically removed from the file list.
mImage contains the image after loading. */
virtual void loadNextImage();
/** Show next screen, completely, without transition. */
virtual void showNextScreen();
/** Set loaded image to next-screen buffer. */
virtual void createNextScreen();
/** Initialize next-screen buffer. */
virtual void initNextScreen();
/** Register effect methods in effect list. */
virtual void registerEffects();
/** Various effects. If adding one, do not forget to manually
add the effect to the list in the registerEffects() method. */
int effectHorizLines(bool doInit);
int effectVertLines(bool doInit);
int effectRandom(bool doInit);
int effectGrowing(bool doInit);
int effectChessboard(bool doInit);
int effectIncomingEdges(bool doInit);
int effectBlobs(bool doInit);
int effectCircleOut(bool doInit);
int effectSweep(bool doInit);
int effectMeltdown(bool doInit);
int effectSpiralIn(bool doInit);
int effectMultiCircleOut(bool doInit);
protected:
void paintEvent(QPaintEvent *);
protected:
struct mScreenGeo {
mScreenGeo(int w, int h, int x, int y) : mW(w), mH(h), mXorg(x), mYorg(y) {};
int mW;
int mH;
int mXorg;
int mYorg;
};
QList<mScreenGeo> mGeoList;
bool mEffectRunning;
QTimer mTimer;
QStringList mFileList;
QStringList mRandomList;
int mFileIdx;
QImage mImage;
QPixmap mNextScreen;
EffectMethod* mEffectList;
EffectMethod mEffect;
int mNumEffects;
QString mImageName;
// config settings:
bool mShowRandom;
bool mZoomImages;
bool mPrintName;
bool mPrintPath;
bool mSubdirectory;
bool mRandomPosition;
bool mEffectsEnabled;
int mDelay;
QString mDirectory;
// values for state of various effects:
int mx, my, mw, mh, mdx, mdy, mix, miy, mi, mj, mSubType;
int mx0, my0, mx1, my1, mwait;
double mfx, mfy, mAlpha, mfd;
int* mIntArray;
};
//-----------------------------------------------------------------------------
class kSlideShowSetup : public KDialog
{
Q_OBJECT
public:
kSlideShowSetup(QWidget *parent=NULL);
~kSlideShowSetup();
protected:
void readSettings();
protected slots:
void slotOk();
void slotHelp();
void writeSettings();
void slotDirSelected(const QString &where);
void slotDirSelected(const KUrl &);
private:
kSlideShowSaver *mSaver;
SlideShowCfg *cfg;
};
#endif /*SLIDESHOW_H*/

Some files were not shown because too many files have changed in this diff Show more