components: rework classes

- outsourced some classes cc_item.cpp/h, cc_draw.cpp/h
- added extra methodes for simple use of some basic components extra.cpp/h
- rework clock handling: use timer class, reworked members for
  enable/disable clock with external timer events,
  tryed to fix some display issues related with infoclock and
  time osd clock in moviebrowser, channellist, menuus
- reworked hide/kill handling, removed parameter for hide(), try to use
  cached backgrounds for other constallations, paint cache, image cache (all beta)
- reworked shadow/frame handling, add shadow modes for left/right
  arrangement, TODO: repaint for existant instances required
- reworked color gradient assignment (beta)

... Note: I had a data crash in my local git tree
and i tryed to restore my historie, but most was lost. Therefore here
the commit is large
This commit is contained in:
2015-11-18 18:08:23 +01:00
parent a2171dad4a
commit 0146511f38
68 changed files with 3207 additions and 1682 deletions

View File

@@ -32,6 +32,7 @@
#endif
#include "cc_base.h"
#include "cc_item.h"
#include <string>
#include <driver/pictureviewer/pictureviewer.h>
@@ -49,11 +50,16 @@ class CComponentsPicture : public CComponentsItem
///possible image formats
std::vector<std::string> v_ext;
///option to enable disable cache, default = false
bool enable_cache;
///screen cache content for painted image
fb_pixel_t *image_cache;
///current original image dimensions
int dx, dy;
///property: name of image (without extensionn) full path to image (with extension), icon names to find in /widget/icons.h, icons will paint never scaled
std::string pic_name;
std::string pic_name, pic_name_old;
///indicate that image was sucessful painted
bool is_image_painted;
@@ -73,7 +79,7 @@ class CComponentsPicture : public CComponentsItem
void init( const int &x_pos, const int &y_pos, const int &w, const int &h,
const std::string& image_name,
CComponentsForm *parent,
bool has_shadow,
int shadow_mode,
fb_pixel_t color_frame,
fb_pixel_t color_background,
fb_pixel_t color_shadow,
@@ -104,7 +110,7 @@ class CComponentsPicture : public CComponentsItem
CComponentsPicture( const int &x_pos, const int &y_pos, const int &w, const int &h,
const std::string& image_name,
CComponentsForm *parent = NULL,
bool has_shadow = CC_SHADOW_OFF,
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6,
fb_pixel_t color_background = 0,
fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0,
@@ -120,11 +126,15 @@ class CComponentsPicture : public CComponentsItem
CComponentsPicture( const int &x_pos, const int &y_pos,
const std::string& image_name,
CComponentsForm *parent = NULL,
bool has_shadow = CC_SHADOW_OFF,
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6,
fb_pixel_t color_background = 0,
fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0,
int transparent = CFrameBuffer::TM_NONE);
virtual~CComponentsPicture()
{
delete[]image_cache;
}
///sets an image name (unscaled icons only), full image path or url to an image file
virtual void setPicture(const std::string& picture_name);
@@ -152,8 +162,17 @@ class CComponentsPicture : public CComponentsItem
///paint item
virtual void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
///hide item
virtual void hide(bool no_restore = false);
///hide item, see also CComponents::hide();
virtual void hide();
virtual bool hasChanges();
///remove possible cache
virtual void clearCache();
///enable/disable image cache
virtual void enableCache(bool enable = true){if (enable_cache == enable) return; enable_cache = enable; if (!enable_cache) clearCache();}
///disable image cache, makes clean up too
virtual void disableCache(){enableCache(false);}
};
class CComponentsPictureScalable : public CComponentsPicture
@@ -166,12 +185,12 @@ class CComponentsPictureScalable : public CComponentsPicture
CComponentsPictureScalable( const int &x_pos, const int &y_pos,
const std::string& image_name,
CComponentsForm *parent = NULL,
bool has_shadow = CC_SHADOW_OFF,
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6,
fb_pixel_t color_background = 0,
fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0,
int transparent = CFrameBuffer::TM_NONE)
: CComponentsPicture(x_pos, y_pos, 0, 0, image_name, parent, has_shadow, color_frame, color_background, color_shadow, transparent){};
: CComponentsPicture(x_pos, y_pos, 0, 0, image_name, parent, shadow_mode, color_frame, color_background, color_shadow, transparent){};
};
class CComponentsChannelLogo : public CComponentsPicture
@@ -201,7 +220,7 @@ class CComponentsChannelLogo : public CComponentsPicture
const std::string& channelName = "",
const uint64_t& channelId =0,
CComponentsForm *parent = NULL,
bool has_shadow = CC_SHADOW_OFF,
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6,
fb_pixel_t color_background = 0,
fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0,
@@ -217,7 +236,7 @@ class CComponentsChannelLogo : public CComponentsPicture
const std::string& channelName = "",
const uint64_t& channelId =0,
CComponentsForm *parent = NULL,
bool has_shadow = CC_SHADOW_OFF,
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6,
fb_pixel_t color_background = 0,
fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0,
@@ -249,12 +268,12 @@ class CComponentsChannelLogoScalable : public CComponentsChannelLogo
const std::string& channelName = "",
const uint64_t& channelId =0,
CComponentsForm *parent = NULL,
bool has_shadow = CC_SHADOW_OFF,
int shadow_mode = CC_SHADOW_OFF,
fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6,
fb_pixel_t color_background = 0,
fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0,
int transparent = CFrameBuffer::TM_BLACK)
: CComponentsChannelLogo(x_pos, y_pos, 0, 0, channelName, channelId, parent, has_shadow, color_frame, color_background, color_shadow, transparent){};
: CComponentsChannelLogo(x_pos, y_pos, 0, 0, channelName, channelId, parent, shadow_mode, color_frame, color_background, color_shadow, transparent){};
};
#endif