From 749694a3f2fecddf44633067c24851d8719b181e Mon Sep 17 00:00:00 2001 From: gregory guy Date: Mon, 26 Apr 2021 18:43:25 +0200 Subject: [PATCH] asciiquarium: Add cmake build support, app is renamed tdeasciiquarium. Signed-off-by: gregory guy --- CMakeLists.txt | 117 +++++++++--------- ConfigureChecks.cmake | 4 + asciiquarium/src/sprite.cpp | 94 -------------- tdescreensaver/kdesavers/CMakeLists.txt | 5 + .../tdeasciiquarium}/AASaverConfig.kcfgc | 0 .../kdesavers/tdeasciiquarium/CMakeLists.txt | 42 +++++++ .../kdesavers/tdeasciiquarium/COPYRIGHT | 26 ++++ .../kdesavers/tdeasciiquarium}/Doxyfile | 0 .../kdesavers/tdeasciiquarium/README | 1 + .../kdesavers/tdeasciiquarium}/aasaver.cpp | 48 +------ .../kdesavers/tdeasciiquarium}/aasaver.h | 29 ----- .../tdeasciiquarium}/asciiquarium.kcfg | 2 +- .../tdeasciiquarium}/doxygen-stylesheet.css | 0 .../kdesavers/tdeasciiquarium}/frame.cpp | 41 +----- .../kdesavers/tdeasciiquarium}/frame.h | 35 +----- .../kdesavers/tdeasciiquarium}/screen.cpp | 41 +----- .../kdesavers/tdeasciiquarium}/screen.h | 39 +----- .../tdeasciiquarium}/settingswidget.ui | 0 .../kdesavers/tdeasciiquarium/sprite.cpp | 64 ++++++++++ .../kdesavers/tdeasciiquarium}/sprite.h | 31 +---- .../tdeasciiquarium/tdeasciiquarium.desktop | 10 +- 21 files changed, 236 insertions(+), 393 deletions(-) delete mode 100644 asciiquarium/src/sprite.cpp rename {asciiquarium/src => tdescreensaver/kdesavers/tdeasciiquarium}/AASaverConfig.kcfgc (100%) create mode 100644 tdescreensaver/kdesavers/tdeasciiquarium/CMakeLists.txt create mode 100644 tdescreensaver/kdesavers/tdeasciiquarium/COPYRIGHT rename {asciiquarium/src => tdescreensaver/kdesavers/tdeasciiquarium}/Doxyfile (100%) create mode 100644 tdescreensaver/kdesavers/tdeasciiquarium/README rename {asciiquarium/src => tdescreensaver/kdesavers/tdeasciiquarium}/aasaver.cpp (94%) rename {asciiquarium/src => tdescreensaver/kdesavers/tdeasciiquarium}/aasaver.h (80%) rename {asciiquarium/src => tdescreensaver/kdesavers/tdeasciiquarium}/asciiquarium.kcfg (92%) rename {asciiquarium/src => tdescreensaver/kdesavers/tdeasciiquarium}/doxygen-stylesheet.css (100%) rename {asciiquarium/src => tdescreensaver/kdesavers/tdeasciiquarium}/frame.cpp (77%) rename {asciiquarium/src => tdescreensaver/kdesavers/tdeasciiquarium}/frame.h (75%) rename {asciiquarium/src => tdescreensaver/kdesavers/tdeasciiquarium}/screen.cpp (80%) rename {asciiquarium/src => tdescreensaver/kdesavers/tdeasciiquarium}/screen.h (74%) rename {asciiquarium/src => tdescreensaver/kdesavers/tdeasciiquarium}/settingswidget.ui (100%) create mode 100644 tdescreensaver/kdesavers/tdeasciiquarium/sprite.cpp rename {asciiquarium/src => tdescreensaver/kdesavers/tdeasciiquarium}/sprite.h (80%) rename asciiquarium/src/asciiquarium.desktop => tdescreensaver/kdesavers/tdeasciiquarium/tdeasciiquarium.desktop (69%) diff --git a/CMakeLists.txt b/CMakeLists.txt index f1960221..0423fce3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,18 +1,18 @@ -################################################# -# -# (C) 2011 Golubev Alexander -# fatzer2 (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# +########################################### +# # +# (C) 2011 Golubev Alexander # +# fatzer2 (AT) gmail.com # +# # +# Improvements and feedback are welcome # +# # +# This file is released under GPL >= 2 # +# # +########################################### cmake_minimum_required( VERSION 2.8.12 ) -##### general package setup ##################### +##### general package setup project( tdeartwork ) @@ -20,7 +20,7 @@ set( PACKAGE tdeartwork ) set( VERSION R14.1.0 ) -##### include essential cmake modules ########### +##### include essential cmake modules include( FindPkgConfig ) include( CheckIncludeFile ) @@ -29,79 +29,84 @@ include( CheckCXXSourceCompiles ) include( CheckSymbolExists ) -##### include our cmake modules ################# +##### include our cmake modules set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" ) include( TDEMacros ) -##### setup install paths ####################### +##### setup install paths include( TDESetupPaths ) tde_setup_paths( ) -##### optional stuff ############################ +##### optional stuff -option( WITH_ALL_OPTIONS "Enable all optional support" OFF ) +option( WITH_ALL_OPTIONS "Enable all optional support" OFF ) +option( WITH_XSCREENSAVER "Enable xscreensavers support" ${WITH_ALL_OPTIONS} ) +option( WITH_ALL_INCLUDED_XSCREENSAVERS "Install all included desktop files" OFF ) #regardless of the presence of XML +option( WITH_LIBART "Enable libart support" ${WITH_ALL_OPTIONS} ) +option( WITH_OPENGL "Enable 3D GL modes" ${WITH_ALL_OPTIONS} ) +option( WITH_ARTS "Enable aRts support" OFF ) -option( WITH_XSCREENSAVER "Enable xscreensavers support" ${WITH_ALL_OPTIONS} ) -option( WITH_ALL_INCLUDED_XSCREENSAVERS - "Install all included desktop files regardless of the presence of XML" OFF ) -option( WITH_LIBART "Enable libart support" ${WITH_ALL_OPTIONS} ) -option( WITH_OPENGL "Enable 3D GL modes" ${WITH_ALL_OPTIONS} ) -option( WITH_ARTS "Enable aRts support" OFF ) +########### options comments ############## +# # +# affects tdescreensaver build: # +# # +# WITH_XSCREENSAVER # +# WITH_ALL_INCLUDED_XSCREENSAVERS # +# WITH_LIBART # +# WITH_OPENGL # +# WITH_ARTS # +# # +############################################## -##### options comments ########################## - -# WITH_XSCREENSAVER affects tdescreensaver -# WITH_ALL_INCLUDED_XSCREENSAVERS affects tdescreensaver -# WITH_LIBART affects tdescreensaver -# WITH_OPENGL affects tdescreensaver -# WITH_ARTS affects tdescreensaver # NOTE: These flags control which screensavers are compiled/installed. -##### user requested modules #################### +##### user requested modules + +option( BUILD_ALL "Build all" ON ) +option( BUILD_EMOTICONS "Build emoticons" ${BUILD_ALL} ) +option( BUILD_ICEWM_THEMES "Build icewm-themes" ${BUILD_ALL} ) +option( BUILD_ICON_THEMES "Build icon themes" ${BUILD_ALL} ) +option( BUILD_TDESCREENSAVER "Build tdescreensaver" ${BUILD_ALL} ) +option( BUILD_TWIN_STYLES "Build twin styles" ${BUILD_ALL} ) +option( BUILD_KWORLDCLOCK "Build kworldclock" ${BUILD_ALL} ) +option( BUILD_SOUNDS "Build sounds" ${BUILD_ALL} ) +option( BUILD_STYLES "Build styles" ${BUILD_ALL} ) +option( BUILD_WALLPAPERS "Build wallpapers" ${BUILD_ALL} ) +option( BUILD_TDEASCIIQUARIUM "Build tdeasciiquarium screen saver" ${BUILD_ALL} ) -option( BUILD_ALL "Build all" OFF ) -option( BUILD_EMOTICONS "Build emoticons" ${BUILD_ALL} ) -option( BUILD_ICEWM_THEMES "Build icewm-themes" ${BUILD_ALL} ) -option( BUILD_ICON_THEMES "Build icon themes" ${BUILD_ALL} ) -option( BUILD_TDESCREENSAVER "Build tdescreensaver" ${BUILD_ALL} ) -option( BUILD_TWIN_STYLES "Build twin styles" ${BUILD_ALL} ) -option( BUILD_KWORLDCLOCK "Build kworldclock" ${BUILD_ALL} ) -option( BUILD_SOUNDS "Build sounds" ${BUILD_ALL} ) -option( BUILD_STYLES "Build styles" ${BUILD_ALL} ) -option( BUILD_WALLPAPERS "Build wallpapers" ${BUILD_ALL} ) -##### configure checks ########################## +##### configure checks include( ConfigureChecks.cmake ) -###### global compiler settings ################# -add_definitions( - -DHAVE_CONFIG_H -) +###### global compiler settings + +add_definitions( -DHAVE_CONFIG_H ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" ) set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" ) set( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined" ) -##### tdenetwork directories #################### +##### tdenetwork directories + +tde_conditional_add_subdirectory( BUILD_EMOTICONS emoticons ) +tde_conditional_add_subdirectory( BUILD_ICEWM_THEMES icewm-themes ) +tde_conditional_add_subdirectory( BUILD_ICON_THEMES IconThemes ) +tde_conditional_add_subdirectory( BUILD_TDESCREENSAVER tdescreensaver ) +tde_conditional_add_subdirectory( BUILD_TWIN_STYLES twin-styles ) +tde_conditional_add_subdirectory( BUILD_KWORLDCLOCK kworldclock ) +tde_conditional_add_subdirectory( BUILD_SOUNDS sounds ) +tde_conditional_add_subdirectory( BUILD_STYLES styles ) +tde_conditional_add_subdirectory( BUILD_WALLPAPERS wallpapers ) -tde_conditional_add_subdirectory( BUILD_EMOTICONS emoticons ) -tde_conditional_add_subdirectory( BUILD_ICEWM_THEMES icewm-themes ) -tde_conditional_add_subdirectory( BUILD_ICON_THEMES IconThemes ) -tde_conditional_add_subdirectory( BUILD_TDESCREENSAVER tdescreensaver ) -tde_conditional_add_subdirectory( BUILD_TWIN_STYLES twin-styles ) -tde_conditional_add_subdirectory( BUILD_KWORLDCLOCK kworldclock ) -tde_conditional_add_subdirectory( BUILD_SOUNDS sounds ) -tde_conditional_add_subdirectory( BUILD_STYLES styles ) -tde_conditional_add_subdirectory( BUILD_WALLPAPERS wallpapers ) -##### write configure files ##################### +##### write configure files configure_file( config.h.cmake config.h @ONLY ) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 28079e4c..592333db 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -95,3 +95,7 @@ if( BUILD_TDESCREENSAVER ) endif( ) endif( WITH_XSCREENSAVER ) endif( BUILD_TDESCREENSAVER ) + +if( BUILD_TDEASCIIQUARIUM AND (NOT BUILD_TDESCREENSAVER) ) + tde_message_fatal( "tdescreensaver build is mandatory for tdeasciiquarium" ) +endif() diff --git a/asciiquarium/src/sprite.cpp b/asciiquarium/src/sprite.cpp deleted file mode 100644 index 5606e489..00000000 --- a/asciiquarium/src/sprite.cpp +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Asciiquarium - Native KDE Screensaver based on the Asciiquarium program - * (c) Kirk Baucom , which you can find at - * http://www.robobunny.com/projects/asciiquarium/ - * - * Ported to KDE by Maksim Orlovich and - * Michael Pyne . - * - * Copyright (c) 2003 Kirk Baucom - * Copyright (c) 2005 Maksim Orlovich - * Copyright (c) 2005 Michael Pyne - * - * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#include "sprite.h" - -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; -} - -TQRect Sprite::geom() const -{ - return TQRect(m_x, m_y, m_frames[0].width(), m_frames[0].height()); -} - - -// vim: set et ts=8 sw=4: diff --git a/tdescreensaver/kdesavers/CMakeLists.txt b/tdescreensaver/kdesavers/CMakeLists.txt index 0f479186..0246a974 100644 --- a/tdescreensaver/kdesavers/CMakeLists.txt +++ b/tdescreensaver/kdesavers/CMakeLists.txt @@ -9,6 +9,11 @@ # ################################################# +if( BUILD_TDEASCIIQUARIUM AND BUILD_TDESCREENSAVER ) + add_subdirectory( tdeasciiquarium ) +endif() + + include_directories( ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/asciiquarium/src/AASaverConfig.kcfgc b/tdescreensaver/kdesavers/tdeasciiquarium/AASaverConfig.kcfgc similarity index 100% rename from asciiquarium/src/AASaverConfig.kcfgc rename to tdescreensaver/kdesavers/tdeasciiquarium/AASaverConfig.kcfgc diff --git a/tdescreensaver/kdesavers/tdeasciiquarium/CMakeLists.txt b/tdescreensaver/kdesavers/tdeasciiquarium/CMakeLists.txt new file mode 100644 index 00000000..701b26e1 --- /dev/null +++ b/tdescreensaver/kdesavers/tdeasciiquarium/CMakeLists.txt @@ -0,0 +1,42 @@ +include_directories( + ${CMAKE_BINARY_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${TDE_INCLUDE_DIR} + ${TQT_INCLUDE_DIRS} +) + +link_directories( + ${TQT_LIBRARY_DIRS} + ${TDE_LIB_DIR} +) + + +##### tdeasciiquarium (executable) + +tde_add_executable( tdeasciiquarium.kss AUTOMOC + + SOURCES + aasaver.cpp + screen.cpp + frame.cpp + sprite.cpp + AASaverConfig.kcfgc + settingswidget.ui + LINK + tdecore-shared + tdeui-shared + tdescreensaver-shared + + DESTINATION ${BIN_INSTALL_DIR} +) +set_source_files_properties( aasaver.cpp PROPERTIES COMPILE_FLAGS -Wno-trigraphs ) + + +##### other data + +tde_create_translated_desktop( + SOURCE tdeasciiquarium.desktop + DESTINATION ${APPS_INSTALL_DIR}/System/ScreenSavers + PO_DIR tdescreensaver-desktops +) diff --git a/tdescreensaver/kdesavers/tdeasciiquarium/COPYRIGHT b/tdescreensaver/kdesavers/tdeasciiquarium/COPYRIGHT new file mode 100644 index 00000000..295d84d2 --- /dev/null +++ b/tdescreensaver/kdesavers/tdeasciiquarium/COPYRIGHT @@ -0,0 +1,26 @@ +/* + * Asciiquarium - Native KDE Screensaver based on the Asciiquarium program + * (c) Kirk Baucom , which you can find at + * http://www.robobunny.com/projects/asciiquarium/ + * + * Ported to KDE by Maksim Orlovich and + * Michael Pyne . + * + * Copyright (c) 2003 Kirk Baucom + * Copyright (c) 2005 Maksim Orlovich + * Copyright (c) 2005 Michael Pyne + * + * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ diff --git a/asciiquarium/src/Doxyfile b/tdescreensaver/kdesavers/tdeasciiquarium/Doxyfile similarity index 100% rename from asciiquarium/src/Doxyfile rename to tdescreensaver/kdesavers/tdeasciiquarium/Doxyfile diff --git a/tdescreensaver/kdesavers/tdeasciiquarium/README b/tdescreensaver/kdesavers/tdeasciiquarium/README new file mode 100644 index 00000000..266dd5f9 --- /dev/null +++ b/tdescreensaver/kdesavers/tdeasciiquarium/README @@ -0,0 +1 @@ +TDEAsciiquarium gets registered as Miscellaneous from the Trinity Control Center - Screen Saver option diff --git a/asciiquarium/src/aasaver.cpp b/tdescreensaver/kdesavers/tdeasciiquarium/aasaver.cpp similarity index 94% rename from asciiquarium/src/aasaver.cpp rename to tdescreensaver/kdesavers/tdeasciiquarium/aasaver.cpp index 0fba1340..daf09d97 100644 --- a/asciiquarium/src/aasaver.cpp +++ b/tdescreensaver/kdesavers/tdeasciiquarium/aasaver.cpp @@ -1,36 +1,3 @@ -/* - * Asciiquarium - Native KDE Screensaver based on the Asciiquarium program - * (c) Kirk Baucom , which you can find at - * http://www.robobunny.com/projects/asciiquarium/ - * - * Ported to KDE by Maksim Orlovich and - * Michael Pyne . - * - * Copyright (c) 2003 Kirk Baucom - * Copyright (c) 2005 Maksim Orlovich - * Copyright (c) 2005 Michael Pyne - * - * ASCII Art was mostly created by Joan Stark: - * http://www.geocities.com/SoHo/7373/ - * - * the rest was crafted by Kirk Baucom, and all of it was edited by - * Maksim Orlovich and Michael Pyne to adopt to C++ formatting. - * - * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - //Stub stolen from: // klines 0.1.1 - Basic screen saver for KDE // by Dirk Staneker 1997 @@ -39,9 +6,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include "screen.h" #include "frame.h" @@ -1228,8 +1195,8 @@ void AASaver::paintEvent(TQPaintEvent* pe) // libkscreensaver interface extern "C" { - KDE_EXPORT const char *kss_applicationName = "asciiquarium.kss"; - KDE_EXPORT const char *kss_description = I18N_NOOP( "Asciiquarium" ); + KDE_EXPORT const char *kss_applicationName = "tdeasciiquarium.kss"; + KDE_EXPORT const char *kss_description = I18N_NOOP( "TDEAsciiquarium" ); KDE_EXPORT const char *kss_version = "0.3.2"; KDE_EXPORT KScreenSaver *kss_create( WId id ) @@ -1246,11 +1213,8 @@ extern "C" dialog = new TDEConfigDialog(0, "settings", AASaverConfig::self()); SettingsWidget *settings = new SettingsWidget(0, "settings_widget"); - dialog->addPage(settings, i18n("Asciiquarium Settings"), "tdescreensaver"); + dialog->addPage(settings, i18n("TDEAsciiquarium Settings"), "tdescreensaver"); return dialog; } } - - -// vim: set et ts=8 sw=4: diff --git a/asciiquarium/src/aasaver.h b/tdescreensaver/kdesavers/tdeasciiquarium/aasaver.h similarity index 80% rename from asciiquarium/src/aasaver.h rename to tdescreensaver/kdesavers/tdeasciiquarium/aasaver.h index 94a95b36..ce0d3faa 100644 --- a/asciiquarium/src/aasaver.h +++ b/tdescreensaver/kdesavers/tdeasciiquarium/aasaver.h @@ -1,30 +1,3 @@ -/* - * Asciiquarium - Native KDE Screensaver based on the Asciiquarium program - * (c) Kirk Baucom , which you can find at - * http://www.robobunny.com/projects/asciiquarium/ - * - * Ported to KDE by Maksim Orlovich and - * Michael Pyne . - * - * Copyright (c) 2003 Kirk Baucom - * Copyright (c) 2005 Maksim Orlovich - * Copyright (c) 2005 Michael Pyne - * - * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - #ifndef AA_AASAVER_H #define AA_AASAVER_H @@ -195,5 +168,3 @@ public: }; #endif /* AA_AASAVER_H */ - -// vim: set et ts=8 sw=4: diff --git a/asciiquarium/src/asciiquarium.kcfg b/tdescreensaver/kdesavers/tdeasciiquarium/asciiquarium.kcfg similarity index 92% rename from asciiquarium/src/asciiquarium.kcfg rename to tdescreensaver/kdesavers/tdeasciiquarium/asciiquarium.kcfg index 244a1197..87701bce 100644 --- a/asciiquarium/src/asciiquarium.kcfg +++ b/tdescreensaver/kdesavers/tdeasciiquarium/asciiquarium.kcfg @@ -1,7 +1,7 @@ - + diff --git a/asciiquarium/src/doxygen-stylesheet.css b/tdescreensaver/kdesavers/tdeasciiquarium/doxygen-stylesheet.css similarity index 100% rename from asciiquarium/src/doxygen-stylesheet.css rename to tdescreensaver/kdesavers/tdeasciiquarium/doxygen-stylesheet.css diff --git a/asciiquarium/src/frame.cpp b/tdescreensaver/kdesavers/tdeasciiquarium/frame.cpp similarity index 77% rename from asciiquarium/src/frame.cpp rename to tdescreensaver/kdesavers/tdeasciiquarium/frame.cpp index ef5997f1..65d77de0 100644 --- a/asciiquarium/src/frame.cpp +++ b/tdescreensaver/kdesavers/tdeasciiquarium/frame.cpp @@ -1,39 +1,12 @@ -/* - * Asciiquarium - Native KDE Screensaver based on the Asciiquarium program - * (c) Kirk Baucom , which you can find at - * http://www.robobunny.com/projects/asciiquarium/ - * - * Ported to KDE by Maksim Orlovich and - * Michael Pyne . - * - * Copyright (c) 2003 Kirk Baucom - * Copyright (c) 2005 Maksim Orlovich - * Copyright (c) 2005 Michael Pyne - * - * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include "frame.h" @@ -200,5 +173,3 @@ void Frame::erase(Screen* scr, int x, int y) scr->clearSpan(x, y, m_erasePixmap); } - -// vim: set et ts=8 sw=4: diff --git a/asciiquarium/src/frame.h b/tdescreensaver/kdesavers/tdeasciiquarium/frame.h similarity index 75% rename from asciiquarium/src/frame.h rename to tdescreensaver/kdesavers/tdeasciiquarium/frame.h index 915b58ca..ca62bbab 100644 --- a/asciiquarium/src/frame.h +++ b/tdescreensaver/kdesavers/tdeasciiquarium/frame.h @@ -1,36 +1,9 @@ -/* - * Asciiquarium - Native KDE Screensaver based on the Asciiquarium program - * (c) Kirk Baucom , which you can find at - * http://www.robobunny.com/projects/asciiquarium/ - * - * Ported to KDE by Maksim Orlovich and - * Michael Pyne . - * - * Copyright (c) 2003 Kirk Baucom - * Copyright (c) 2005 Maksim Orlovich - * Copyright (c) 2005 Michael Pyne - * - * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - #ifndef AA_FRAME_H #define AA_FRAME_H -#include -#include -#include +#include +#include +#include #include "screen.h" /** @@ -146,5 +119,3 @@ protected: }; #endif - -// vim: set et ts=8 sw=4: diff --git a/asciiquarium/src/screen.cpp b/tdescreensaver/kdesavers/tdeasciiquarium/screen.cpp similarity index 80% rename from asciiquarium/src/screen.cpp rename to tdescreensaver/kdesavers/tdeasciiquarium/screen.cpp index 534e8b07..ade5abc1 100644 --- a/asciiquarium/src/screen.cpp +++ b/tdescreensaver/kdesavers/tdeasciiquarium/screen.cpp @@ -1,36 +1,9 @@ -/* - * Asciiquarium - Native KDE Screensaver based on the Asciiquarium program - * (c) Kirk Baucom , which you can find at - * http://www.robobunny.com/projects/asciiquarium/ - * - * Ported to KDE by Maksim Orlovich and - * Michael Pyne . - * - * Copyright (c) 2003 Kirk Baucom - * Copyright (c) 2005 Maksim Orlovich - * Copyright (c) 2005 Michael Pyne - * - * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include @@ -247,5 +220,3 @@ void Screen::doAnimate() } #include "screen.moc" - -// vim: set et ts=8 sw=4: diff --git a/asciiquarium/src/screen.h b/tdescreensaver/kdesavers/tdeasciiquarium/screen.h similarity index 74% rename from asciiquarium/src/screen.h rename to tdescreensaver/kdesavers/tdeasciiquarium/screen.h index 26fa3efd..b6e7f92b 100644 --- a/asciiquarium/src/screen.h +++ b/tdescreensaver/kdesavers/tdeasciiquarium/screen.h @@ -1,38 +1,11 @@ -/* - * Asciiquarium - Native KDE Screensaver based on the Asciiquarium program - * (c) Kirk Baucom , which you can find at - * http://www.robobunny.com/projects/asciiquarium/ - * - * Ported to KDE by Maksim Orlovich and - * Michael Pyne . - * - * Copyright (c) 2003 Kirk Baucom - * Copyright (c) 2005 Maksim Orlovich - * Copyright (c) 2005 Michael Pyne - * - * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - #ifndef AA_SCREEN_H #define AA_SCREEN_H -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include class Sprite; class AASaver; @@ -167,5 +140,3 @@ public: }; #endif - -// vim: set et ts=8 sw=4: diff --git a/asciiquarium/src/settingswidget.ui b/tdescreensaver/kdesavers/tdeasciiquarium/settingswidget.ui similarity index 100% rename from asciiquarium/src/settingswidget.ui rename to tdescreensaver/kdesavers/tdeasciiquarium/settingswidget.ui diff --git a/tdescreensaver/kdesavers/tdeasciiquarium/sprite.cpp b/tdescreensaver/kdesavers/tdeasciiquarium/sprite.cpp new file mode 100644 index 00000000..11d7d360 --- /dev/null +++ b/tdescreensaver/kdesavers/tdeasciiquarium/sprite.cpp @@ -0,0 +1,64 @@ +#include "sprite.h" + +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; +} + +TQRect Sprite::geom() const +{ + return TQRect(m_x, m_y, m_frames[0].width(), m_frames[0].height()); +} diff --git a/asciiquarium/src/sprite.h b/tdescreensaver/kdesavers/tdeasciiquarium/sprite.h similarity index 80% rename from asciiquarium/src/sprite.h rename to tdescreensaver/kdesavers/tdeasciiquarium/sprite.h index 927c149c..0eb3a0a7 100644 --- a/asciiquarium/src/sprite.h +++ b/tdescreensaver/kdesavers/tdeasciiquarium/sprite.h @@ -1,34 +1,7 @@ -/* - * Asciiquarium - Native KDE Screensaver based on the Asciiquarium program - * (c) Kirk Baucom , which you can find at - * http://www.robobunny.com/projects/asciiquarium/ - * - * Ported to KDE by Maksim Orlovich and - * Michael Pyne . - * - * Copyright (c) 2003 Kirk Baucom - * Copyright (c) 2005 Maksim Orlovich - * Copyright (c) 2005 Michael Pyne - * - * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - #ifndef AA_SPRITE_H #define AA_SPRITE_H -#include +#include #include "frame.h" /** @@ -203,5 +176,3 @@ public: }; #endif - -// vim: set et ts=8 sw=4: diff --git a/asciiquarium/src/asciiquarium.desktop b/tdescreensaver/kdesavers/tdeasciiquarium/tdeasciiquarium.desktop similarity index 69% rename from asciiquarium/src/asciiquarium.desktop rename to tdescreensaver/kdesavers/tdeasciiquarium/tdeasciiquarium.desktop index 1bdbc754..65a4e90e 100644 --- a/asciiquarium/src/asciiquarium.desktop +++ b/tdescreensaver/kdesavers/tdeasciiquarium/tdeasciiquarium.desktop @@ -1,23 +1,23 @@ [Desktop Entry] Encoding=UTF-8 -Exec=asciiquarium.kss +Exec=tdeasciiquarium.kss Icon=tdescreensaver Type=Application Actions=InWindow;Root;Setup -Name=Asciiquarium +Name=TDEAsciiquarium X-TDE-Category=Miscellaneous [Desktop Action InWindow] -Exec=asciiquarium.kss -window-id %w +Exec=tdeasciiquarium.kss -window-id %w Name=Display in specified window NoDisplay=true [Desktop Action Root] -Exec=asciiquarium.kss -root +Exec=tdeasciiquarium.kss -root Name=Display in root window NoDisplay=true [Desktop Action Setup] -Exec=asciiquarium.kss -setup +Exec=tdeasciiquarium.kss -setup Name=Display setup dialog NoDisplay=true