From 032f8d3e72d70948b201a7cd5a3f5ee536ba0e99 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 27 Apr 2013 15:32:22 +0200 Subject: [PATCH] CComponentsPicture: use members as virtual members Makes members ready for use in subclasses Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/e84ac6f3a12097818e3f5490cf12451b7c543aa2 Author: Thilo Graf Date: 2013-04-27 (Sat, 27 Apr 2013) ------------------ This commit was generated by Migit --- src/gui/components/cc.h | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/gui/components/cc.h b/src/gui/components/cc.h index d3161d811..f38e65e84 100644 --- a/src/gui/components/cc.h +++ b/src/gui/components/cc.h @@ -141,7 +141,9 @@ class CComponentsItem : public CComponents class CComponentsPicture : public CComponentsItem { - private: + protected: + void initVarPicture(); + enum { CC_PIC_IMAGE_MODE_OFF = 0, //paint pictures in icon mode, mainly not scaled @@ -155,7 +157,6 @@ class CComponentsPicture : public CComponentsItem int pic_align, pic_x, pic_y, pic_width, pic_height; int pic_max_w, pic_max_h, pic_paint_mode; - void initVarPicture(); void init( const int x_pos, const int y_pos, const std::string& image_name, const int alignment, bool has_shadow, fb_pixel_t color_frame, fb_pixel_t color_background, fb_pixel_t color_shadow); @@ -164,18 +165,18 @@ class CComponentsPicture : public CComponentsItem const std::string& image_name, const int alignment = CC_ALIGN_HOR_CENTER | CC_ALIGN_VER_CENTER, bool has_shadow = 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); - inline void setPictureOffset(const unsigned char offset){pic_offset = offset;}; - inline void setPicturePaint(bool paint_p){pic_paint = paint_p;}; - inline void setPicturePaintBackground(bool paintBg){pic_paintBg = paintBg;}; - void setPicture(const std::string& picture_name); - void setPictureAlign(const int alignment); + virtual inline void setPictureOffset(const unsigned char offset){pic_offset = offset;}; + virtual inline void setPicturePaint(bool paint_p){pic_paint = paint_p;}; + virtual inline void setPicturePaintBackground(bool paintBg){pic_paintBg = paintBg;}; + virtual void setPicture(const std::string& picture_name); + virtual void setPictureAlign(const int alignment); - inline bool isPicPainted(){return pic_painted;}; - void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); - void hide(bool no_restore = false); - inline void getPictureSize(int *pwidth, int *pheight){*pwidth=pic_width; *pheight=pic_height;}; - void setMaxWidth(const int w_max){pic_max_w = w_max;}; - void setMaxHeight(const int h_max){pic_max_h = h_max;}; + virtual inline bool isPicPainted(){return pic_painted;}; + virtual void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); + virtual void hide(bool no_restore = false); + virtual inline void getPictureSize(int *pwidth, int *pheight){*pwidth=pic_width; *pheight=pic_height;}; + virtual void setMaxWidth(const int w_max){pic_max_w = w_max;}; + virtual void setMaxHeight(const int h_max){pic_max_h = h_max;}; }; class CComponentsText : public CComponentsItem