CComponents: add own header file for unused experimental classes

Origin commit data
------------------
Branch: ni/coolstream
Commit: 4317b0b4fb
Author: Thilo Graf <dbt@novatux.de>
Date: 2013-04-15 (Mon, 15 Apr 2013)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
2013-04-15 10:08:49 +02:00
parent 3ef246a468
commit 9e40ad9e1b
3 changed files with 116 additions and 80 deletions

View File

@@ -15,7 +15,7 @@
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details. General Public License for more details.
You should have received a copy of the GNU General Public You should have received a copy of the GNU General Public
License along with this program; if not, write to the License along with this program; if not, write to the
@@ -323,81 +323,4 @@ class CComponentsDetailLine : public CComponents
inline void setHMarkDown(const int& h_mark_down_){h_mark_down = h_mark_down_;}; inline void setHMarkDown(const int& h_mark_down_){h_mark_down = h_mark_down_;};
}; };
#define FIRST_ELEMENT_INIT 10000
#define LOGO_MAX_WIDTH width/4
class CComponentsItemBox : public CComponentsItem
{
protected:
int hSpacer;
int hOffset;
int vOffset;
int digit_offset, digit_h;
bool paintElements;
bool onlyOneTextElement;
fb_pixel_t it_col_text;
Font* font_text;
int hMax;
bool has_TextElement;
size_t firstElementLeft;
size_t firstElementRight;
size_t prevElementLeft;
size_t prevElementRight;
std::vector<comp_element_data_t> v_element_data;
bool isCalculated;
void clearElements();
void initVarItemBox();
void calSizeOfElements();
void calPositionOfElements();
void paintItemBox(bool do_save_bg = CC_SAVE_SCREEN_YES);
void calculateElements();
bool addElement(int align, int type, const std::string& element="", size_t *index=NULL);
void paintImage(size_t index, bool newElement);
void paintText(size_t index, bool newElement);
public:
CComponentsItemBox();
virtual ~CComponentsItemBox();
inline virtual void setTextFont(Font* font){font_text = font;};
inline virtual void setTextColor(fb_pixel_t color_text){ it_col_text = color_text;};
virtual void refreshElement(size_t index, const std::string& element);
virtual void paintElement(size_t index, bool newElement= false);
virtual bool addLogoOrText(int align, const std::string& logo, const std::string& text, size_t *index=NULL);
virtual void clearTitlebar();
virtual void addText(const std::string& s_text, const int align=CC_ALIGN_LEFT, size_t *index=NULL);
virtual void addText(neutrino_locale_t locale_text, const int align=CC_ALIGN_LEFT, size_t *index=NULL);
virtual void addIcon(const std::string& s_icon_name, const int align=CC_ALIGN_LEFT, size_t *index=NULL);
virtual void addPicture(const std::string& s_picture_path, const int align=CC_ALIGN_LEFT, size_t *index=NULL);
virtual void addClock(const int align=CC_ALIGN_RIGHT, size_t *index=NULL);
virtual int getHeight();
};
class CComponentsTitleBar : public CComponentsItemBox
{
private:
const char* tb_c_text;
std::string tb_s_text, tb_icon_name;
neutrino_locale_t tb_locale_text;
int tb_text_align, tb_icon_align;
void initText();
void initIcon();
void initElements();
void initVarTitleBar();
public:
CComponentsTitleBar();
CComponentsTitleBar( const int x_pos, const int y_pos, const int w, const int h, const char* c_text = NULL, const std::string& s_icon ="",
fb_pixel_t color_text = COL_MENUHEAD, fb_pixel_t color_body = COL_MENUHEAD_PLUS_0);
CComponentsTitleBar( const int x_pos, const int y_pos, const int w, const int h, const std::string& s_text ="", const std::string& s_icon ="",
fb_pixel_t color_text = COL_MENUHEAD, fb_pixel_t color_body = COL_MENUHEAD_PLUS_0);
CComponentsTitleBar( const int x_pos, const int y_pos, const int w, const int h, neutrino_locale_t locale_text = NONEXISTANT_LOCALE, const std::string& s_icon ="",
fb_pixel_t color_text = COL_MENUHEAD, fb_pixel_t color_body = COL_MENUHEAD_PLUS_0);
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
};
#endif #endif

View File

@@ -16,7 +16,7 @@
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details. General Public License for more details.
You should have received a copy of the GNU General Public You should have received a copy of the GNU General Public
License along with this program; if not, write to the License along with this program; if not, write to the
@@ -30,7 +30,7 @@
#include <global.h> #include <global.h>
#include <neutrino.h> #include <neutrino.h>
#include "cc.h" #include "cc_misc.h"
using namespace std; using namespace std;

View File

@@ -0,0 +1,113 @@
/*
Based up Neutrino-GUI - Tuxbox-Project
Copyright (C) 2001 by Steffen Hehn 'McClean'
Experimental Classes for generic GUI-related components. Not really used.
Copyright (C) 2012, Michael Liebmann 'micha-bbg
Copyright (C) 2012, Thilo Graf 'dbt'
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., 51 Franklin St, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef __CC_MISC__
#define __CC_MISC__
#include "config.h"
#include <gui/components/cc.h>
#include <vector>
#include <string>
#define FIRST_ELEMENT_INIT 10000
#define LOGO_MAX_WIDTH width/4
class CComponentsItemBox : public CComponentsItem
{
protected:
int hSpacer;
int hOffset;
int vOffset;
int digit_offset, digit_h;
bool paintElements;
bool onlyOneTextElement;
fb_pixel_t it_col_text;
Font* font_text;
int hMax;
bool has_TextElement;
size_t firstElementLeft;
size_t firstElementRight;
size_t prevElementLeft;
size_t prevElementRight;
std::vector<comp_element_data_t> v_element_data;
bool isCalculated;
void clearElements();
void initVarItemBox();
void calSizeOfElements();
void calPositionOfElements();
void paintItemBox(bool do_save_bg = CC_SAVE_SCREEN_YES);
void calculateElements();
bool addElement(int align, int type, const std::string& element="", size_t *index=NULL);
void paintImage(size_t index, bool newElement);
void paintText(size_t index, bool newElement);
public:
CComponentsItemBox();
virtual ~CComponentsItemBox();
inline virtual void setTextFont(Font* font){font_text = font;};
inline virtual void setTextColor(fb_pixel_t color_text){ it_col_text = color_text;};
virtual void refreshElement(size_t index, const std::string& element);
virtual void paintElement(size_t index, bool newElement= false);
virtual bool addLogoOrText(int align, const std::string& logo, const std::string& text, size_t *index=NULL);
virtual void clearTitlebar();
virtual void addText(const std::string& s_text, const int align=CC_ALIGN_LEFT, size_t *index=NULL);
virtual void addText(neutrino_locale_t locale_text, const int align=CC_ALIGN_LEFT, size_t *index=NULL);
virtual void addIcon(const std::string& s_icon_name, const int align=CC_ALIGN_LEFT, size_t *index=NULL);
virtual void addPicture(const std::string& s_picture_path, const int align=CC_ALIGN_LEFT, size_t *index=NULL);
virtual void addClock(const int align=CC_ALIGN_RIGHT, size_t *index=NULL);
virtual int getHeight();
};
class CComponentsTitleBar : public CComponentsItemBox
{
private:
const char* tb_c_text;
std::string tb_s_text, tb_icon_name;
neutrino_locale_t tb_locale_text;
int tb_text_align, tb_icon_align;
void initText();
void initIcon();
void initElements();
void initVarTitleBar();
public:
CComponentsTitleBar();
CComponentsTitleBar( const int x_pos, const int y_pos, const int w, const int h, const char* c_text = NULL, const std::string& s_icon ="",
fb_pixel_t color_text = COL_MENUHEAD, fb_pixel_t color_body = COL_MENUHEAD_PLUS_0);
CComponentsTitleBar( const int x_pos, const int y_pos, const int w, const int h, const std::string& s_text ="", const std::string& s_icon ="",
fb_pixel_t color_text = COL_MENUHEAD, fb_pixel_t color_body = COL_MENUHEAD_PLUS_0);
CComponentsTitleBar( const int x_pos, const int y_pos, const int w, const int h, neutrino_locale_t locale_text = NONEXISTANT_LOCALE, const std::string& s_icon ="",
fb_pixel_t color_text = COL_MENUHEAD, fb_pixel_t color_body = COL_MENUHEAD_PLUS_0);
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
};
#endif /*__CC_MISC__*/