From cc338db2730470029ae4e3c9f28aafc3925ca0d2 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Thu, 8 Dec 2016 17:49:47 +0100 Subject: [PATCH] - widgets: remove obsolete drawable wrapper sources --- src/gui/widget/Makefile.am | 1 - src/gui/widget/drawable.cpp | 150 --------------------------------- src/gui/widget/drawable.h | 164 ------------------------------------ 3 files changed, 315 deletions(-) delete mode 100644 src/gui/widget/drawable.cpp delete mode 100644 src/gui/widget/drawable.h diff --git a/src/gui/widget/Makefile.am b/src/gui/widget/Makefile.am index 17a932b04..5da8d7ebe 100644 --- a/src/gui/widget/Makefile.am +++ b/src/gui/widget/Makefile.am @@ -17,7 +17,6 @@ noinst_LIBRARIES = libneutrino_gui_widget.a libneutrino_gui_widget2.a libneutrino_gui_widget_a_SOURCES = \ buttons.cpp \ colorchooser.cpp \ - drawable.cpp \ helpbox.cpp \ hintbox.cpp \ keychooser.cpp \ diff --git a/src/gui/widget/drawable.cpp b/src/gui/widget/drawable.cpp deleted file mode 100644 index 0319e34ff..000000000 --- a/src/gui/widget/drawable.cpp +++ /dev/null @@ -1,150 +0,0 @@ -/* - Neutrino-GUI - DBoxII-Project - - Copyright (C) 2001 Steffen Hehn 'McClean' - Homepage: http://dbox.cyberphoria.org/ - - Kommentar: - - Diese GUI wurde von Grund auf neu programmiert und sollte nun vom - Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert - auf der Client-Server Idee, diese GUI ist also von der direkten DBox- - Steuerung getrennt. Diese wird dann von Daemons uebernommen. - - - License: GPL - - 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., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include - -#include - -#include -#include - -Drawable::Drawable() -{ -} - -Drawable::~Drawable() -{ -} - -int Drawable::getWidth(void) -{ - return m_width; -} - -int Drawable::getHeight(void) -{ - return m_height; -} - -Drawable::DType Drawable::getType(void) -{ - return Drawable::DTYPE_DRAWABLE; -} - - -// ------------------------------------------------------------------------------ -DText::DText(std::string& text) -{ - m_text = text; - init(); -} - -DText::DText(const char *text) -{ - m_text = std::string(text); - init(); -} - -void DText::init() -{ - m_width = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(m_text); - m_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); -} - - -void DText::draw(CFBWindow *window, int x, int y, int width) -{ - window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU], x, y + m_height, width, - m_text.c_str(), COL_MENUCONTENT_TEXT); -} - -void DText::print(void) -{ - std::cout << " text: " << m_text; -} - -// ------------------------------------------------------------------------------ -DIcon::DIcon(std::string& icon) -{ - m_icon = icon; - init(); -} - -DIcon::DIcon(const char *icon) -{ - m_icon = std::string(icon); - init(); -} - -void DIcon::init() -{ - m_height = 16; - m_width = 16; -} - -void DIcon::draw(CFBWindow *window, int x, int y, int /*width*/) -{ - window->paintIcon(m_icon.c_str(), x, y); -} - -void DIcon::print(void) -{ - std::cout << " icon: " << m_icon; -} - -// ------------------------------------------------------------------------------ -DPagebreak::DPagebreak() -{ - m_height = 0; - m_width = 0; -} - -void DPagebreak::draw(CFBWindow */*window*/, int /*x*/, int /*y*/, int /*width*/) -{ -// window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU], -// x, y + m_height, width, "", -// COL_MENUCONTENT_TEXT); -} - -void DPagebreak::print(void) -{ - std::cout << ""; -} - -Drawable::DType DPagebreak::getType(void) -{ - return Drawable::DTYPE_PAGEBREAK; -} diff --git a/src/gui/widget/drawable.h b/src/gui/widget/drawable.h deleted file mode 100644 index 744f4446e..000000000 --- a/src/gui/widget/drawable.h +++ /dev/null @@ -1,164 +0,0 @@ -/* - Neutrino-GUI - DBoxII-Project - - Copyright (C) 2001 Steffen Hehn 'McClean' - Homepage: http://dbox.cyberphoria.org/ - - Kommentar: - - Diese GUI wurde von Grund auf neu programmiert und sollte nun vom - Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert - auf der Client-Server Idee, diese GUI ist also von der direkten DBox- - Steuerung getrennt. Diese wird dann von Daemons uebernommen. - - - License: GPL - - 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., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - - -#ifndef __drawable__ -#define __drawable__ - -#include -#include - -#include -#include - -class Drawable; - -typedef std::vector > ContentLines; - - -/** - * The base class for items which can be drawn on a CFBWindow. - */ -class Drawable -{ -public: - - enum DType { - DTYPE_DRAWABLE, - DTYPE_PAGEBREAK - }; - - virtual ~Drawable(); - - /** - * Overwrite this method in subclasses to draw on the window - * - * @param window the window to draw on - * @param x x component of the top left corner - * @param y y component of the top left corner - */ - virtual void draw(CFBWindow *window, int x, int y, int width) = 0; - - virtual int getWidth(void); - - virtual int getHeight(void); - - /** - * Overwrite this method in subclasses to print some info - * about the content. Mainly used for debuging ;) - */ - virtual void print(void) = 0; - - /** - * Returns the type of this drawable. Used to distinguish between - * drawing objects and control objects like pagebreaks. - * @return the type of this drawable. - */ - virtual DType getType(); - -protected: - - Drawable(); - - int m_height; - - int m_width; - -private: - -}; - -/** - * This class draws a given string. - */ -class DText : public Drawable -{ -public: - DText(std::string& text); - - DText(const char *text); - - void init(); - - void draw(CFBWindow *window, int x, int y, int width); - - void print(); - -protected: - - std::string m_text; - -}; - - -/** - * This class draws a given icon. - */ -class DIcon : public Drawable -{ -public: - DIcon(std::string& icon); - - DIcon(const char *icon); - - void init(); - - void draw(CFBWindow *window, int x, int y, int width); - - void print(); - -protected: - - std::string m_icon; -}; - -/** - * This class is used as a control object and forces a new page - * in scrollable windows. - */ -class DPagebreak : public Drawable -{ -public: - DPagebreak(); - - void draw(CFBWindow *window, int x, int y, int width); - - void print(); - - DType getType(); - -protected: - -private: - -}; - -#endif