From f7798affc63c5ba4be5f76816a30e962da664604 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 24 Oct 2013 20:00:05 +0200 Subject: [PATCH] CComponents: add unfied header file for general include of cc classes Provides a unified header file, so it is not required to select a certain header file. --- src/gui/audiomute.h | 2 +- src/gui/audioplayer.cpp | 2 +- src/gui/bedit/bouqueteditor_bouquets.cpp | 2 +- src/gui/bedit/bouqueteditor_channels.cpp | 2 +- src/gui/bedit/bouqueteditor_channels.h | 3 +- src/gui/bedit/bouqueteditor_chanselect.h | 3 +- src/gui/bookmarkmanager.cpp | 2 +- src/gui/bouquetlist.cpp | 2 +- src/gui/channellist.cpp | 3 - src/gui/channellist.h | 2 - src/gui/components/cc.h | 259 ++------------------ src/gui/components/cc_base.cpp | 2 +- src/gui/components/cc_base.h | 278 ++++++++++++++++++++++ src/gui/components/cc_detailsline.h | 2 +- src/gui/components/cc_frm.h | 2 +- src/gui/components/cc_frm_button.h | 2 +- src/gui/components/cc_frm_clock.h | 2 +- src/gui/components/cc_frm_signalbars.h | 4 +- src/gui/components/cc_item.cpp | 2 +- src/gui/components/cc_item_picture.h | 2 +- src/gui/components/cc_item_progressbar.h | 2 +- src/gui/components/cc_item_shapes.h | 2 +- src/gui/components/cc_item_text.h | 2 +- src/gui/components/cc_item_tvpic.h | 2 +- src/gui/components/unmaintained/cc_misc.h | 2 +- src/gui/dboxinfo.cpp | 2 +- src/gui/epgview.cpp | 2 +- src/gui/eventlist.h | 2 +- src/gui/filebrowser.cpp | 2 +- src/gui/imageinfo.cpp | 1 - src/gui/imageinfo.h | 3 +- src/gui/infoviewer_bb.h | 2 +- src/gui/motorcontrol.cpp | 1 - src/gui/motorcontrol.h | 2 +- src/gui/moviebrowser.cpp | 2 +- src/gui/osd_setup.h | 2 +- src/gui/pictureviewer.cpp | 2 +- src/gui/pluginlist.cpp | 2 +- src/gui/scan.cpp | 3 +- src/gui/scan.h | 2 +- src/gui/streaminfo2.h | 3 +- src/gui/test_menu.h | 7 +- src/gui/timeosd.h | 2 +- src/gui/timerlist.cpp | 2 +- src/gui/upnpbrowser.cpp | 2 +- src/gui/volumebar.h | 4 +- src/gui/widget/menue.cpp | 9 +- src/gui/widget/menue.h | 4 +- 48 files changed, 342 insertions(+), 309 deletions(-) create mode 100644 src/gui/components/cc_base.h diff --git a/src/gui/audiomute.h b/src/gui/audiomute.h index 2c2310c0e..406483f18 100644 --- a/src/gui/audiomute.h +++ b/src/gui/audiomute.h @@ -27,7 +27,7 @@ #ifndef __CAUDIOMUTE__ #define __CAUDIOMUTE__ -#include +#include class CAudioMute : public CComponentsPicture { diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index f8df608cb..e202f6d88 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -57,7 +57,7 @@ #include #endif -#include +#include #include #include #include diff --git a/src/gui/bedit/bouqueteditor_bouquets.cpp b/src/gui/bedit/bouqueteditor_bouquets.cpp index ded93358f..91a9700e9 100644 --- a/src/gui/bedit/bouqueteditor_bouquets.cpp +++ b/src/gui/bedit/bouqueteditor_bouquets.cpp @@ -40,7 +40,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/gui/bedit/bouqueteditor_channels.cpp b/src/gui/bedit/bouqueteditor_channels.cpp index 049eb9036..9b87c2a3b 100644 --- a/src/gui/bedit/bouqueteditor_channels.cpp +++ b/src/gui/bedit/bouqueteditor_channels.cpp @@ -44,7 +44,7 @@ #include #include #include "bouqueteditor_chanselect.h" -#include +#include #include #include diff --git a/src/gui/bedit/bouqueteditor_channels.h b/src/gui/bedit/bouqueteditor_channels.h index afc74a4b1..90d4d03d4 100644 --- a/src/gui/bedit/bouqueteditor_channels.h +++ b/src/gui/bedit/bouqueteditor_channels.h @@ -35,8 +35,7 @@ #include #include -#include -#include +#include #include #include diff --git a/src/gui/bedit/bouqueteditor_chanselect.h b/src/gui/bedit/bouqueteditor_chanselect.h index 6ae293c87..729c3d7af 100644 --- a/src/gui/bedit/bouqueteditor_chanselect.h +++ b/src/gui/bedit/bouqueteditor_chanselect.h @@ -34,8 +34,7 @@ #include #include -#include -#include +#include #include #include diff --git a/src/gui/bookmarkmanager.cpp b/src/gui/bookmarkmanager.cpp index 996d529b4..228b136fb 100644 --- a/src/gui/bookmarkmanager.cpp +++ b/src/gui/bookmarkmanager.cpp @@ -36,7 +36,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index 16353856a..594de4822 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -41,7 +41,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 6e9b8d611..6864276e2 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -54,9 +54,6 @@ #include #include #include -#include -#include -#include #include #include diff --git a/src/gui/channellist.h b/src/gui/channellist.h index da8600dfc..c6e3f310c 100644 --- a/src/gui/channellist.h +++ b/src/gui/channellist.h @@ -36,8 +36,6 @@ #include #include #include -#include -#include #include #include diff --git a/src/gui/components/cc.h b/src/gui/components/cc.h index 6426285fe..9f13752e2 100644 --- a/src/gui/components/cc.h +++ b/src/gui/components/cc.h @@ -3,7 +3,7 @@ Copyright (C) 2001 by Steffen Hehn 'McClean' Classes for generic GUI-related components. - Copyright (C) 2012, 2013, Thilo Graf 'dbt' + Copyright (C) 2013, Thilo Graf 'dbt' License: GPL @@ -23,255 +23,30 @@ Boston, MA 02110-1301, USA. */ -#ifndef __COMPONENTS__ -#define __COMPONENTS__ - -#include "cc_types.h" -#include -#include -#include -#include - -//#define DEBUG_CC - -/// Basic component class. +/// Basic CComponent class header. /*! Basic attributes and member functions for component sub classes */ -class CComponents -{ - private: - ///pixel buffer handling, returns pixel buffer depends of given parameters - fb_pixel_t* getScreen(int ax, int ay, int dx, int dy); - - protected: - ///object: framebuffer object, usable in all sub classes - CFrameBuffer * frameBuffer; - ///container: for frambuffer properties and pixel buffer - std::vector v_fbdata; +#ifndef __N_COMPONENTS__ +#define __N_COMPONENTS__ - ///property: x-position on screen, to alter with setPos() or setDimensionsAll(), see also defines CC_APPEND, CC_CENTERED - int x; - ///property: y-position on screen, to alter setPos() or setDimensionsAll(), see also defines CC_APPEND, CC_CENTERED - int y; - ///property: contains real x-position on screen - int cc_xr; - ///property: contains real y-position on screen - int cc_yr; - ///property: height-dimension on screen, to alter with setHeight() or setDimensionsAll() - int height; - ///property: width-dimension on screen, to alter with setWidth() or setDimensionsAll() - int width; - ///property: has corners with definied type, types are defined in /driver/frambuffer.h, without effect, if corner_radius=0 - int corner_type; - ///property: defined radius of corner, without effect, if corner_type=0 - int corner_rad; - - ///property: color of body - fb_pixel_t col_body; - ///property: color of shadow - fb_pixel_t col_shadow; - ///property: color of frame - fb_pixel_t col_frame; - ///property: color of frame if component is selected, Note: fr_thickness_sel must be set - fb_pixel_t col_frame_sel; +#include "cc_base.h" +#include "cc_types.h" - ///property: true=component has shadow - bool shadow; - ///property: width of shadow - int shadow_w; +#include "cc_item_infobox.h" +#include "cc_item_picture.h" +#include "cc_item_progressbar.h" +#include "cc_item_shapes.h" +#include "cc_item_tvpic.h" - ///property: frame thickness - int fr_thickness; - ///property: frame thickness of selected component - int fr_thickness_sel; +#include "cc_detailsline.h" - ///status: true=component was painted for 1st time - bool firstPaint; - ///status: true=component was rendered - bool is_painted; - ///mode: true=activate rendering of basic elements (frame, shadow and body) - bool paint_bg; +#include "cc_frm.h" +#include "cc_frm_button.h" +#include "cc_frm_clock.h" +#include "cc_frm_signalbars.h" - ///initialize of basic attributes, no parameters required - void initVarBasic(); - ///rendering of framebuffer elements at once, - ///elements are contained in v_fbdata, presumes added frambuffer elements with paintInit(), - ///parameter do_save_bg=true, saves background of element to pixel buffer, this can be restore with hide() - void paintFbItems(bool do_save_bg = true); - ///clean up old screen buffer saved in v_fbdata - virtual void clear(); - ///container: contains saved pixel buffer with position and dimensions - comp_screen_data_t saved_screen; - ///cleans saved pixel buffer - void clearSavedScreen(); - - public: - ///basic component class constructor. - CComponents(); - virtual~CComponents(); - - ///set screen x-position - inline virtual void setXPos(const int& xpos){x = xpos;}; - ///set screen y-position, - inline virtual void setYPos(const int& ypos){y = ypos;}; - ///set x and y position - ///Note: position of bound components (items) means position related within parent form, not for screen! - ///to set the real screen position, look at setRealPos() - inline virtual void setPos(const int& xpos, const int& ypos){x = xpos; y = ypos;}; - - ///sets real x position on screen. Use this, if item is added to a parent form - virtual void setRealXPos(const int& xr){cc_xr = xr;}; - ///sets real y position on screen. Use this, if item is added to a parent form - virtual void setRealYPos(const int& yr){cc_yr = yr;}; - ///sets real x and y position on screen at once. Use this, if item is added to a parent form - virtual void setRealPos(const int& xr, const int& yr){cc_xr = xr; cc_yr = yr;}; - ///get real x-position on screen. Use this, if item contains own render methods and item is bound to a form - virtual int getRealXPos(){return cc_xr;}; - ///get real y-position on screen. Use this, if item contains own render methods and item is bound to a form - virtual int getRealYPos(){return cc_yr;}; - - ///set height of component on screen - inline virtual void setHeight(const int& h){height = h;}; - ///set width of component on screen - inline virtual void setWidth(const int& w){width = w;}; - ///set all positions and dimensions of component at once - inline virtual void setDimensionsAll(const int& xpos, const int& ypos, const int& w, const int& h){x = xpos; y = ypos; width = w; height = h;}; - - ///return screen x-position of component - ///Note: position of bound components (items) means position related within parent form, not for screen! - ///to get the real screen position, use getRealXPos(), to find in CComponentsItem sub classes - inline virtual int getXPos(){return x;}; - ///return screen y-position of component - ///Note: position of bound components (items) means position related within parent form, not for screen! - ///to get the real screen position, use getRealYPos(), to find in CComponentsItem sub classes - inline virtual int getYPos(){return y;}; - ///return height of component - inline virtual int getHeight(){return height;}; - ///return width of component - inline virtual int getWidth(){return width;}; - ///return of frame thickness - inline virtual int getFrameThickness(){return fr_thickness;}; - - ///return/set (pass through) width and height of component - inline virtual void getSize(int* w, int* h){*w=width; *h=height;}; - ///return/set (pass through) position and dimensions of component at once - inline virtual void getDimensions(int* xpos, int* ypos, int* w, int* h){*xpos=x; *ypos=y; *w=width; *h=height;}; - - ///set frame color - inline virtual void setColorFrame(fb_pixel_t color){col_frame = color;}; - ///set body color - inline virtual void setColorBody(fb_pixel_t color){col_body = color;}; - ///set shadow color - inline virtual void setColorShadow(fb_pixel_t color){col_shadow = color;}; - ///set all basic framebuffer element colors at once - ///Note: Possible color values are defined in "gui/color.h" and "gui/customcolor.h" - inline virtual void setColorAll(fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow){col_frame = color_frame; col_body = color_body; col_shadow = color_shadow;}; - - ///get frame color - inline virtual fb_pixel_t getColorFrame(){return col_frame;}; - ///get body color - inline virtual fb_pixel_t getColorBody(){return col_body;}; - ///get shadow color - inline virtual fb_pixel_t getColorShadow(){return col_shadow;}; - - ///set corner types - ///Possible corner types are defined in CFrameBuffer (see: driver/framebuffer.h) - ///Note: default values are given from settings - inline virtual void setCornerType(const int& type){corner_type = type;}; - ///set corner radius and type - inline virtual void setCorner(const int& radius, const int& type = CORNER_ALL){corner_rad = radius; corner_type = type;}; - ///get corner types - inline virtual int getCornerType(){return corner_type;}; - ///get corner radius - inline virtual int getCornerRadius(){return corner_rad;}; - - ///set frame thickness - inline virtual void setFrameThickness(const int& thickness){fr_thickness = thickness;}; - ///switch shadow on/off - ///Note: it's recommended to use #defines: CC_SHADOW_ON=true or CC_SHADOW_OFF=false as parameter, see also cc_types.h - inline virtual void setShadowOnOff(bool has_shadow){shadow = has_shadow;}; - - ///hide current screen and restore background - virtual void hide(); - ///erase current screen without restore of background, it's similar to paintBackgroundBoxRel() from CFrameBuffer - virtual void kill(); - ///returns paint mode, true=item was painted - virtual bool isPainted(){return is_painted;} - ///allows paint of elementary item parts (shadow, frame and body), similar as background, set it usually to false, if item used in a form - virtual void doPaintBg(bool do_paint){paint_bg = do_paint;}; - -}; - -class CComponentsItem : public CComponents -{ - protected: - ///property: define of item type, see cc_types.h for possible types - int cc_item_type; - ///property: define of item index, all bound items get an index, - ///default: CC_NO_INDEX as identifer for not embedded item and default index=0 for form as main parent - ///see also getIndex(), setIndex() - int cc_item_index; - ///property: default enabled - bool cc_item_enabled; - ///property: default not selected - bool cc_item_selected; - - ///Pointer to the form object in which this item is embedded. - ///Is typically the type CComponentsForm or derived classes, default intialized with NULL - CComponentsItem *cc_parent; - - ///hides item, arg: no_restore=true causes no restore of background, but clean up pixel buffer if required - void hideCCItem(bool no_restore = false); - - ///initialze of basic framebuffer elements with shadow, background and frame. - ///must be called first in all paint() members before paint any item, - ///If backround is not required, it's possible to override this with variable paint_bg=false, use doPaintBg(true/false) to set this! - ///arg do_save_bg=false avoids using of unnecessary pixel memory, eg. if no hide with restore is provided. This is mostly the case whenever - ///an item will be hide or overpainted with other methods, or it's embedded (bound) in a parent form. - void paintInit(bool do_save_bg); - - ///initialize all required attributes - void initVarItem(); - - public: - CComponentsItem(); - - ///sets pointer to the form object in which this item is embedded. - virtual void setParent(CComponentsItem *parent){cc_parent = parent;}; - ///returns pointer to the form object in which this item is embedded. - virtual CComponentsItem * getParent(){return cc_parent;}; - ///property: returns true if item is added to a form - virtual bool isAdded(); - - ///abstract: paint item, arg: do_save_bg see paintInit() above - virtual void paint(bool do_save_bg = CC_SAVE_SCREEN_YES) = 0; - ///hides item, arg: no_restore see hideCCItem() above - virtual void hide(bool no_restore = false); - - ///get the current item type, see attribute cc_item_type above - virtual int getItemType(); - ///syncronizes item colors with current color settings if required, NOTE: overwrites internal values! - virtual void syncSysColors(); - - ///set select mode, see also col_frame_sel - virtual void setSelected(bool selected){cc_item_selected = selected;}; - ///set enable mode, see also cc_item_enabled - virtual void setEnable(bool enabled){cc_item_enabled = enabled;}; - - ///get select mode, see also setSelected() above - virtual bool isSelected(){return cc_item_selected;}; - ///get enable mode, see also setEnable() above - virtual bool isEnabled(){return cc_item_enabled;}; - - ///get current index of item, see also attribut cc_item_index - virtual int getIndex(){return cc_item_index;}; - ///set an index to item, see also attribut cc_item_index. - ///To generate an index, use genIndex() - virtual void setIndex(const int& index){cc_item_index = index;}; -}; - -#endif +#endif /*__N_COMPONENTS__*/ diff --git a/src/gui/components/cc_base.cpp b/src/gui/components/cc_base.cpp index bbebf1cd6..94693d13e 100644 --- a/src/gui/components/cc_base.cpp +++ b/src/gui/components/cc_base.cpp @@ -30,7 +30,7 @@ #include #include -#include "cc.h" +#include "cc_base.h" using namespace std; diff --git a/src/gui/components/cc_base.h b/src/gui/components/cc_base.h new file mode 100644 index 000000000..32605b04d --- /dev/null +++ b/src/gui/components/cc_base.h @@ -0,0 +1,278 @@ +/* + Based up Neutrino-GUI - Tuxbox-Project + Copyright (C) 2001 by Steffen Hehn 'McClean' + + Classes for generic GUI-related components. + Copyright (C) 2012, 2013, 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 __COMPONENTS__ +#define __COMPONENTS__ + +#include "cc_types.h" +#include +#include +#include +#include +#include + +//#define DEBUG_CC + +/// Basic component class. +/*! +Basic attributes and member functions for component sub classes +*/ + +class CComponents +{ + private: + ///pixel buffer handling, returns pixel buffer depends of given parameters + fb_pixel_t* getScreen(int ax, int ay, int dx, int dy); + + protected: + ///object: framebuffer object, usable in all sub classes + CFrameBuffer * frameBuffer; + ///container: for frambuffer properties and pixel buffer + std::vector v_fbdata; + + ///property: x-position on screen, to alter with setPos() or setDimensionsAll(), see also defines CC_APPEND, CC_CENTERED + int x; + ///property: y-position on screen, to alter setPos() or setDimensionsAll(), see also defines CC_APPEND, CC_CENTERED + int y; + ///property: contains real x-position on screen + int cc_xr; + ///property: contains real y-position on screen + int cc_yr; + ///property: height-dimension on screen, to alter with setHeight() or setDimensionsAll() + int height; + ///property: width-dimension on screen, to alter with setWidth() or setDimensionsAll() + int width; + ///property: has corners with definied type, types are defined in /driver/frambuffer.h, without effect, if corner_radius=0 + int corner_type; + ///property: defined radius of corner, without effect, if corner_type=0 + int corner_rad; + + ///property: color of body + fb_pixel_t col_body; + ///property: color of shadow + fb_pixel_t col_shadow; + ///property: color of frame + fb_pixel_t col_frame; + ///property: color of frame if component is selected, Note: fr_thickness_sel must be set + fb_pixel_t col_frame_sel; + + ///property: true=component has shadow + bool shadow; + ///property: width of shadow + int shadow_w; + + ///property: frame thickness + int fr_thickness; + ///property: frame thickness of selected component + int fr_thickness_sel; + + ///status: true=component was painted for 1st time + bool firstPaint; + ///status: true=component was rendered + bool is_painted; + ///mode: true=activate rendering of basic elements (frame, shadow and body) + bool paint_bg; + + ///initialize of basic attributes, no parameters required + void initVarBasic(); + ///rendering of framebuffer elements at once, + ///elements are contained in v_fbdata, presumes added frambuffer elements with paintInit(), + ///parameter do_save_bg=true, saves background of element to pixel buffer, this can be restore with hide() + void paintFbItems(bool do_save_bg = true); + + ///clean up old screen buffer saved in v_fbdata + virtual void clear(); + + ///container: contains saved pixel buffer with position and dimensions + comp_screen_data_t saved_screen; + ///cleans saved pixel buffer + void clearSavedScreen(); + + public: + ///basic component class constructor. + CComponents(); + virtual~CComponents(); + + ///set screen x-position + inline virtual void setXPos(const int& xpos){x = xpos;}; + ///set screen y-position, + inline virtual void setYPos(const int& ypos){y = ypos;}; + ///set x and y position + ///Note: position of bound components (items) means position related within parent form, not for screen! + ///to set the real screen position, look at setRealPos() + inline virtual void setPos(const int& xpos, const int& ypos){x = xpos; y = ypos;}; + + ///sets real x position on screen. Use this, if item is added to a parent form + virtual void setRealXPos(const int& xr){cc_xr = xr;}; + ///sets real y position on screen. Use this, if item is added to a parent form + virtual void setRealYPos(const int& yr){cc_yr = yr;}; + ///sets real x and y position on screen at once. Use this, if item is added to a parent form + virtual void setRealPos(const int& xr, const int& yr){cc_xr = xr; cc_yr = yr;}; + ///get real x-position on screen. Use this, if item contains own render methods and item is bound to a form + virtual int getRealXPos(){return cc_xr;}; + ///get real y-position on screen. Use this, if item contains own render methods and item is bound to a form + virtual int getRealYPos(){return cc_yr;}; + + ///set height of component on screen + inline virtual void setHeight(const int& h){height = h;}; + ///set width of component on screen + inline virtual void setWidth(const int& w){width = w;}; + ///set all positions and dimensions of component at once + inline virtual void setDimensionsAll(const int& xpos, const int& ypos, const int& w, const int& h){x = xpos; y = ypos; width = w; height = h;}; + + ///return screen x-position of component + ///Note: position of bound components (items) means position related within parent form, not for screen! + ///to get the real screen position, use getRealXPos(), to find in CComponentsItem sub classes + inline virtual int getXPos(){return x;}; + ///return screen y-position of component + ///Note: position of bound components (items) means position related within parent form, not for screen! + ///to get the real screen position, use getRealYPos(), to find in CComponentsItem sub classes + inline virtual int getYPos(){return y;}; + ///return height of component + inline virtual int getHeight(){return height;}; + ///return width of component + inline virtual int getWidth(){return width;}; + ///return of frame thickness + inline virtual int getFrameThickness(){return fr_thickness;}; + + ///return/set (pass through) width and height of component + inline virtual void getSize(int* w, int* h){*w=width; *h=height;}; + ///return/set (pass through) position and dimensions of component at once + inline virtual void getDimensions(int* xpos, int* ypos, int* w, int* h){*xpos=x; *ypos=y; *w=width; *h=height;}; + + ///set frame color + inline virtual void setColorFrame(fb_pixel_t color){col_frame = color;}; + ///set body color + inline virtual void setColorBody(fb_pixel_t color){col_body = color;}; + ///set shadow color + inline virtual void setColorShadow(fb_pixel_t color){col_shadow = color;}; + ///set all basic framebuffer element colors at once + ///Note: Possible color values are defined in "gui/color.h" and "gui/customcolor.h" + inline virtual void setColorAll(fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow){col_frame = color_frame; col_body = color_body; col_shadow = color_shadow;}; + + ///get frame color + inline virtual fb_pixel_t getColorFrame(){return col_frame;}; + ///get body color + inline virtual fb_pixel_t getColorBody(){return col_body;}; + ///get shadow color + inline virtual fb_pixel_t getColorShadow(){return col_shadow;}; + + ///set corner types + ///Possible corner types are defined in CFrameBuffer (see: driver/framebuffer.h) + ///Note: default values are given from settings + inline virtual void setCornerType(const int& type){corner_type = type;}; + ///set corner radius and type + inline virtual void setCorner(const int& radius, const int& type = CORNER_ALL){corner_rad = radius; corner_type = type;}; + ///get corner types + inline virtual int getCornerType(){return corner_type;}; + ///get corner radius + inline virtual int getCornerRadius(){return corner_rad;}; + + ///set frame thickness + inline virtual void setFrameThickness(const int& thickness){fr_thickness = thickness;}; + ///switch shadow on/off + ///Note: it's recommended to use #defines: CC_SHADOW_ON=true or CC_SHADOW_OFF=false as parameter, see also cc_types.h + inline virtual void setShadowOnOff(bool has_shadow){shadow = has_shadow;}; + + ///hide current screen and restore background + virtual void hide(); + ///erase current screen without restore of background, it's similar to paintBackgroundBoxRel() from CFrameBuffer + virtual void kill(); + ///returns paint mode, true=item was painted + virtual bool isPainted(){return is_painted;} + ///allows paint of elementary item parts (shadow, frame and body), similar as background, set it usually to false, if item used in a form + virtual void doPaintBg(bool do_paint){paint_bg = do_paint;}; + +}; + +class CComponentsItem : public CComponents +{ + protected: + ///property: define of item type, see cc_types.h for possible types + int cc_item_type; + ///property: define of item index, all bound items get an index, + ///default: CC_NO_INDEX as identifer for not embedded item and default index=0 for form as main parent + ///see also getIndex(), setIndex() + int cc_item_index; + ///property: default enabled + bool cc_item_enabled; + ///property: default not selected + bool cc_item_selected; + + ///Pointer to the form object in which this item is embedded. + ///Is typically the type CComponentsForm or derived classes, default intialized with NULL + CComponentsItem *cc_parent; + + ///hides item, arg: no_restore=true causes no restore of background, but clean up pixel buffer if required + void hideCCItem(bool no_restore = false); + + ///initialze of basic framebuffer elements with shadow, background and frame. + ///must be called first in all paint() members before paint any item, + ///If backround is not required, it's possible to override this with variable paint_bg=false, use doPaintBg(true/false) to set this! + ///arg do_save_bg=false avoids using of unnecessary pixel memory, eg. if no hide with restore is provided. This is mostly the case whenever + ///an item will be hide or overpainted with other methods, or it's embedded (bound) in a parent form. + void paintInit(bool do_save_bg); + + ///initialize all required attributes + void initVarItem(); + + public: + CComponentsItem(); + + ///sets pointer to the form object in which this item is embedded. + virtual void setParent(CComponentsItem *parent){cc_parent = parent;}; + ///returns pointer to the form object in which this item is embedded. + virtual CComponentsItem * getParent(){return cc_parent;}; + ///property: returns true if item is added to a form + virtual bool isAdded(); + + ///abstract: paint item, arg: do_save_bg see paintInit() above + virtual void paint(bool do_save_bg = CC_SAVE_SCREEN_YES) = 0; + ///hides item, arg: no_restore see hideCCItem() above + virtual void hide(bool no_restore = false); + + ///get the current item type, see attribute cc_item_type above + virtual int getItemType(); + ///syncronizes item colors with current color settings if required, NOTE: overwrites internal values! + virtual void syncSysColors(); + + ///set select mode, see also col_frame_sel + virtual void setSelected(bool selected){cc_item_selected = selected;}; + ///set enable mode, see also cc_item_enabled + virtual void setEnable(bool enabled){cc_item_enabled = enabled;}; + + ///get select mode, see also setSelected() above + virtual bool isSelected(){return cc_item_selected;}; + ///get enable mode, see also setEnable() above + virtual bool isEnabled(){return cc_item_enabled;}; + + ///get current index of item, see also attribut cc_item_index + virtual int getIndex(){return cc_item_index;}; + ///set an index to item, see also attribut cc_item_index. + ///To generate an index, use genIndex() + virtual void setIndex(const int& index){cc_item_index = index;}; +}; + +#endif diff --git a/src/gui/components/cc_detailsline.h b/src/gui/components/cc_detailsline.h index f35cbf745..5276cf75e 100644 --- a/src/gui/components/cc_detailsline.h +++ b/src/gui/components/cc_detailsline.h @@ -30,7 +30,7 @@ #include #endif -#include "cc.h" +#include "cc_base.h" //! Sub class of CComponents. Shows a connectline with given dimensions and color on screen. /*! diff --git a/src/gui/components/cc_frm.h b/src/gui/components/cc_frm.h index d2f979d44..e00ae07d0 100644 --- a/src/gui/components/cc_frm.h +++ b/src/gui/components/cc_frm.h @@ -28,7 +28,7 @@ #include "config.h" -#include +#include #include #include #include diff --git a/src/gui/components/cc_frm_button.h b/src/gui/components/cc_frm_button.h index 65cc918ee..f435c8e44 100644 --- a/src/gui/components/cc_frm_button.h +++ b/src/gui/components/cc_frm_button.h @@ -27,7 +27,7 @@ #define __CC_BUTTONS_H__ #include -#include "cc.h" +#include "cc_base.h" #include "cc_frm.h" #include #include diff --git a/src/gui/components/cc_frm_clock.h b/src/gui/components/cc_frm_clock.h index 1ca1a8fa5..1af9d2580 100644 --- a/src/gui/components/cc_frm_clock.h +++ b/src/gui/components/cc_frm_clock.h @@ -31,7 +31,7 @@ #include #endif -#include "cc.h" +#include "cc_base.h" #include "cc_frm.h" diff --git a/src/gui/components/cc_frm_signalbars.h b/src/gui/components/cc_frm_signalbars.h index 0e8268b6c..460270f12 100644 --- a/src/gui/components/cc_frm_signalbars.h +++ b/src/gui/components/cc_frm_signalbars.h @@ -31,8 +31,8 @@ #include #endif -#include -#include +// #include +// #include #include #include #include diff --git a/src/gui/components/cc_item.cpp b/src/gui/components/cc_item.cpp index d8d4fbbf0..07d621e96 100644 --- a/src/gui/components/cc_item.cpp +++ b/src/gui/components/cc_item.cpp @@ -30,7 +30,7 @@ #include #include -#include "cc.h" +#include "cc_base.h" using namespace std; diff --git a/src/gui/components/cc_item_picture.h b/src/gui/components/cc_item_picture.h index 2b74c1709..dd45ec449 100644 --- a/src/gui/components/cc_item_picture.h +++ b/src/gui/components/cc_item_picture.h @@ -31,7 +31,7 @@ #include #endif -#include "cc.h" +#include "cc_base.h" #include #include diff --git a/src/gui/components/cc_item_progressbar.h b/src/gui/components/cc_item_progressbar.h index eb22f8bf7..90fb2a7a0 100644 --- a/src/gui/components/cc_item_progressbar.h +++ b/src/gui/components/cc_item_progressbar.h @@ -50,7 +50,7 @@ #define __CC_PROGRESSBAR_H__ #include "config.h" -#include +#include #include class CProgressBar : public CComponentsItem diff --git a/src/gui/components/cc_item_shapes.h b/src/gui/components/cc_item_shapes.h index b6900c820..e9e879033 100644 --- a/src/gui/components/cc_item_shapes.h +++ b/src/gui/components/cc_item_shapes.h @@ -30,7 +30,7 @@ #include #endif -#include "cc.h" +#include "cc_base.h" //! Sub class of CComponentsItem. Shows a shape with given dimensions and color on screen. /*! diff --git a/src/gui/components/cc_item_text.h b/src/gui/components/cc_item_text.h index 8c87b8d5e..2661641eb 100644 --- a/src/gui/components/cc_item_text.h +++ b/src/gui/components/cc_item_text.h @@ -26,7 +26,7 @@ #ifndef __CC_ITEM_TEXT_H__ #define __CC_ITEM_TEXT_H__ -#include "cc.h" +#include "cc_base.h" #include #include diff --git a/src/gui/components/cc_item_tvpic.h b/src/gui/components/cc_item_tvpic.h index 6634b15b2..fef5a23b8 100644 --- a/src/gui/components/cc_item_tvpic.h +++ b/src/gui/components/cc_item_tvpic.h @@ -30,7 +30,7 @@ #include #endif -#include "cc.h" +#include "cc_base.h" #include //! Sub class of CComponentsItem. Shows a mini tv box, similar to a PIP-Feature with current tv-channel. diff --git a/src/gui/components/unmaintained/cc_misc.h b/src/gui/components/unmaintained/cc_misc.h index cda11f389..2c050859c 100644 --- a/src/gui/components/unmaintained/cc_misc.h +++ b/src/gui/components/unmaintained/cc_misc.h @@ -28,7 +28,7 @@ #define __CC_MISC__ #include "config.h" -#include +#include #include #include diff --git a/src/gui/dboxinfo.cpp b/src/gui/dboxinfo.cpp index 45c2486e1..03ed078d3 100644 --- a/src/gui/dboxinfo.cpp +++ b/src/gui/dboxinfo.cpp @@ -40,7 +40,7 @@ #include #include -#include +#include #include #include diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 1601220e2..747633e61 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/gui/eventlist.h b/src/gui/eventlist.h index 621581fbc..8eff085db 100644 --- a/src/gui/eventlist.h +++ b/src/gui/eventlist.h @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include "color.h" #include "infoviewer.h" diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index 23be35ce4..01614f2fc 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -28,7 +28,7 @@ /* include before to enable 64 bit file offsets */ #include -#include +#include #include #include #include diff --git a/src/gui/imageinfo.cpp b/src/gui/imageinfo.cpp index 3a75b43c2..7254860ca 100644 --- a/src/gui/imageinfo.cpp +++ b/src/gui/imageinfo.cpp @@ -38,7 +38,6 @@ #include #include #include -#include #include "version.h" #define LICENSEDIR DATADIR "/neutrino/license/" diff --git a/src/gui/imageinfo.h b/src/gui/imageinfo.h index 367d7ee91..2a5b671da 100644 --- a/src/gui/imageinfo.h +++ b/src/gui/imageinfo.h @@ -32,8 +32,7 @@ #endif #include -#include -#include +#include #include typedef struct image_info_t diff --git a/src/gui/infoviewer_bb.h b/src/gui/infoviewer_bb.h index d47e64409..cdace0147 100644 --- a/src/gui/infoviewer_bb.h +++ b/src/gui/infoviewer_bb.h @@ -41,7 +41,7 @@ #include #include #include "widget/menue.h" -#include +#include #include class CInfoViewerBB diff --git a/src/gui/motorcontrol.cpp b/src/gui/motorcontrol.cpp index 43ff2038d..68ae0add9 100644 --- a/src/gui/motorcontrol.cpp +++ b/src/gui/motorcontrol.cpp @@ -38,7 +38,6 @@ #include #include #include -#include #include #include #include diff --git a/src/gui/motorcontrol.h b/src/gui/motorcontrol.h index fb4b74dc4..c595308ee 100644 --- a/src/gui/motorcontrol.h +++ b/src/gui/motorcontrol.h @@ -34,7 +34,7 @@ #define __motorcontrol__ #include -#include +#include #include #include #include diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 71db7906c..39c57743f 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -48,7 +48,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/gui/osd_setup.h b/src/gui/osd_setup.h index d392d4cd7..3b50a4593 100644 --- a/src/gui/osd_setup.h +++ b/src/gui/osd_setup.h @@ -31,7 +31,7 @@ #ifndef __osd_setup__ #define __osd_setup__ -#include +#include #include #include diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index cc7ddafd4..742080811 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -50,7 +50,7 @@ #include #endif -#include +#include #include #include #include diff --git a/src/gui/pluginlist.cpp b/src/gui/pluginlist.cpp index 470e40ab5..6d0c5f1c1 100644 --- a/src/gui/pluginlist.cpp +++ b/src/gui/pluginlist.cpp @@ -36,7 +36,7 @@ #include #include -#include +#include #include #include diff --git a/src/gui/scan.cpp b/src/gui/scan.cpp index 5d4b79902..a2f9c6654 100644 --- a/src/gui/scan.cpp +++ b/src/gui/scan.cpp @@ -49,8 +49,7 @@ #include #include -#include -#include +#include #include #include diff --git a/src/gui/scan.h b/src/gui/scan.h index 073ba4a4d..0a7288f5f 100644 --- a/src/gui/scan.h +++ b/src/gui/scan.h @@ -33,7 +33,7 @@ #define __scants__ #include -#include +#include #include #include #include diff --git a/src/gui/streaminfo2.h b/src/gui/streaminfo2.h index cbdded7f7..cbd0a45b0 100644 --- a/src/gui/streaminfo2.h +++ b/src/gui/streaminfo2.h @@ -27,8 +27,7 @@ #include #include -#include -#include +#include #include diff --git a/src/gui/test_menu.h b/src/gui/test_menu.h index e595794c6..38a69968d 100644 --- a/src/gui/test_menu.h +++ b/src/gui/test_menu.h @@ -32,11 +32,8 @@ #include #include #include -#include -#include -#include -#include -// #define TEST_MENU + +#define TEST_MENU #include diff --git a/src/gui/timeosd.h b/src/gui/timeosd.h index 078b723b7..e986fed2e 100644 --- a/src/gui/timeosd.h +++ b/src/gui/timeosd.h @@ -27,7 +27,7 @@ #include #include -#include +#include class CTimeOSD { diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index c5fa8e6f9..0aeeaed11 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -52,7 +52,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index a83460335..ef771c75b 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -53,7 +53,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/gui/volumebar.h b/src/gui/volumebar.h index 3903d4ac8..c19b04424 100644 --- a/src/gui/volumebar.h +++ b/src/gui/volumebar.h @@ -29,9 +29,7 @@ #include #include -#include //CComponentsForm -#include //CProgressBar -#include //CComponentsLabel +#include class CVolumeBar : public CComponentsForm { diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index cfa89de98..940c4a1fa 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -28,16 +28,15 @@ #include #endif + +#include +#include #include #include #include - -#include #include -#include -#include -#include + #include #include diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h index d23c03655..7ae164a20 100644 --- a/src/gui/widget/menue.h +++ b/src/gui/widget/menue.h @@ -41,9 +41,7 @@ #include #include #include -#include -#include - +#include #include #include