mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-27 15:32:52 +02:00
cc: expand cc-type with name
Required for internal operations where it is useful to have object
names and for better debugging.
Origin commit data
------------------
Commit: fd55de0ff4
Author: Thilo Graf <dbt@novatux.de>
Date: 2018-01-03 (Wed, 03 Jan 2018)
This commit is contained in:
@@ -775,7 +775,7 @@ void CCDraw::kill(const fb_pixel_t& bg_color, const int& corner_radius, const in
|
||||
v_fbdata[i].rtype);
|
||||
}
|
||||
}else
|
||||
dprintf(DEBUG_DEBUG, "\033[33m[CCDraw][%s - %d], WARNING! render with bad dimensions [dx = %d dy = %d]\033[0m\n", __func__, __LINE__, v_fbdata[i].dx, v_fbdata[i].dy );
|
||||
dprintf(DEBUG_DEBUG, "\033[33m[CCDraw]\t[%s - %d] WARNING! render with bad dimensions [dx = %d dy = %d]\033[0m\n", __func__, __LINE__, v_fbdata[i].dx, v_fbdata[i].dy );
|
||||
|
||||
v_fbdata[i].is_painted = false;
|
||||
}
|
||||
|
@@ -45,7 +45,8 @@ CComponentsForm::CComponentsForm( const int x_pos, const int y_pos, const int w,
|
||||
fb_pixel_t color_shadow)
|
||||
:CComponentsItem(parent)
|
||||
{
|
||||
cc_item_type = CC_ITEMTYPE_FRM;
|
||||
cc_item_type.id = CC_ITEMTYPE_FRM;
|
||||
cc_item_type.name= "cc_base_form";
|
||||
|
||||
Init(x_pos, y_pos, w, h, color_frame, color_body, color_shadow);
|
||||
cc_xr = x;
|
||||
@@ -186,7 +187,7 @@ void CComponentsForm::clear()
|
||||
|
||||
for(size_t i=0; i<v_cc_items.size(); i++) {
|
||||
if (v_cc_items[i]){
|
||||
dprintf(DEBUG_DEBUG, "[CComponentsForm] %s... delete form cc-item %d of %d (type=%d)\taddress = %p\n", __func__, (int)i+1, (int)v_cc_items.size(), v_cc_items[i]->getItemType(), v_cc_items[i]);
|
||||
dprintf(DEBUG_DEBUG, "[CComponentsForm]\t[%s-%d] delete form cc-item %d of %d address = %p \033[33m\t type = [%d] [%s]\033[0m\n", __func__, __LINE__, (int)i+1, (int)v_cc_items.size(), v_cc_items[i], v_cc_items[i]->getItemType(), v_cc_items[i]->getItemName().c_str());
|
||||
delete v_cc_items[i];
|
||||
v_cc_items[i] = NULL;
|
||||
}
|
||||
@@ -198,12 +199,12 @@ void CComponentsForm::clear()
|
||||
int CComponentsForm::addCCItem(CComponentsItem* cc_Item)
|
||||
{
|
||||
if (cc_Item){
|
||||
dprintf(DEBUG_DEBUG, "[CComponentsForm] %s-%d try to add cc_Item [type %d] to form [current index=%d] \n", __func__, __LINE__, cc_Item->getItemType(), cc_item_index);
|
||||
dprintf(DEBUG_DEBUG, "[CComponentsForm]\t[%s-%d] try to add cc_Item \033[33m\t type = [%d] [%s]\033[0m to form [%s -> current index=%d] \n", __func__, __LINE__, cc_Item->getItemType(), cc_Item->getItemName().c_str(), getItemName().c_str(), cc_item_index);
|
||||
|
||||
cc_Item->setParent(this);
|
||||
v_cc_items.push_back(cc_Item);
|
||||
|
||||
dprintf(DEBUG_DEBUG, "\tadded cc_Item [type %d] to form [current index=%d] \n", cc_Item->getItemType(), cc_item_index);
|
||||
dprintf(DEBUG_DEBUG, "\tadded cc_Item (type = [%d] [%s] to form [current index=%d] \n", cc_Item->getItemType(), cc_Item->getItemName().c_str(), cc_item_index);
|
||||
|
||||
//assign item index
|
||||
int new_index = genIndex();
|
||||
@@ -434,9 +435,9 @@ void CComponentsForm::paintCCItems()
|
||||
|
||||
//check item for corrupt position, skip current item if found problems
|
||||
if (ypos > height || xpos > this_w){
|
||||
dprintf(DEBUG_INFO, "[CComponentsForm] %s: [form: %d] [item-index %d] [type=%d] WARNING: item position is out of form size:\ndefinied x=%d, defined this_w=%d \ndefinied y=%d, defined height=%d \n",
|
||||
__func__, cc_item_index, cc_item->getIndex(), cc_item->getItemType(), xpos, this_w, ypos, height);
|
||||
if (this->cc_item_type != CC_ITEMTYPE_FRM_CHAIN)
|
||||
dprintf(DEBUG_INFO, "[CComponentsForm] %s: [form: %d] [item-index %d] \033[33m\t type = [%d] [%s]\033[0m WARNING: item position is out of form size:\ndefinied x=%d, defined this_w=%d \ndefinied y=%d, defined height=%d \n",
|
||||
__func__, cc_item_index, cc_item->getIndex(), cc_item->getItemType(), cc_item->getItemName().c_str(), xpos, this_w, ypos, height);
|
||||
if (this->cc_item_type.id != CC_ITEMTYPE_FRM_CHAIN)
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -497,8 +498,8 @@ void CComponentsForm::paintCCItems()
|
||||
right_item -= (new_w%2);
|
||||
w_item -= (new_w%2);
|
||||
if (right_item > right_frm){
|
||||
dprintf(DEBUG_INFO, "[CComponentsForm] %s: [form: %d] [item-index %d] [type=%d] this_w is too large, definied width=%d, possible width=%d \n",
|
||||
__func__, cc_item_index, cc_item->getIndex(), cc_item->getItemType(), w_item, new_w);
|
||||
dprintf(DEBUG_INFO, "[CComponentsForm] %s: [form: %d] [item-index %d] \033[33m\t type = [%d] [%s]\033[0m this_w is too large, definied width=%d, possible width=%d \n",
|
||||
__func__, cc_item_index, cc_item->getIndex(), cc_item->getItemType(), cc_item->getItemName().c_str(), w_item, new_w);
|
||||
cc_item->setWidth(new_w);
|
||||
}
|
||||
|
||||
@@ -511,8 +512,8 @@ void CComponentsForm::paintCCItems()
|
||||
bottom_item -= (new_h%2);
|
||||
h_item -= (new_h%2);
|
||||
if (bottom_item > bottom_frm){
|
||||
dprintf(DEBUG_INFO, "[CComponentsForm] %s: [form: %d] [item-index %d] [type=%d] height is too large, definied height=%d, possible height=%d \n",
|
||||
__func__, cc_item_index, cc_item->getIndex(), cc_item->getItemType(), h_item, new_h);
|
||||
dprintf(DEBUG_INFO, "[CComponentsForm] %s: [form: %d] [item-index %d] \033[33m\t type = [%d] [%s]\033[0m height is too large, definied height=%d, possible height=%d \n",
|
||||
__func__, cc_item_index, cc_item->getIndex(), cc_item->getItemType(), cc_item->getItemName().c_str(), h_item, new_h);
|
||||
cc_item->setHeight(new_h);
|
||||
}
|
||||
|
||||
|
@@ -94,7 +94,8 @@ void CComponentsButton::initVarButton( const int& x_pos, const int& y_pos, const
|
||||
int shadow_mode,
|
||||
fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow)
|
||||
{
|
||||
cc_item_type = CC_ITEMTYPE_BUTTON;
|
||||
cc_item_type.id = CC_ITEMTYPE_BUTTON;
|
||||
cc_item_type.name = "cc_base_button";
|
||||
|
||||
x = x_pos;
|
||||
y = y_pos;
|
||||
|
@@ -249,7 +249,8 @@ class CComponentsButtonRed : public CComponentsButton
|
||||
fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0)
|
||||
:CComponentsButton(x_pos, y_pos, w, h, caption, NEUTRINO_ICON_BUTTON_RED, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow)
|
||||
{
|
||||
cc_item_type = CC_ITEMTYPE_BUTTON_RED;
|
||||
cc_item_type.id = CC_ITEMTYPE_BUTTON_RED;
|
||||
cc_item_type.name = "cc_base_red_button";
|
||||
};
|
||||
CComponentsButtonRed( const int& x_pos, const int& y_pos, const int& w, const int& h,
|
||||
const neutrino_locale_t& caption_locale,
|
||||
@@ -260,7 +261,8 @@ class CComponentsButtonRed : public CComponentsButton
|
||||
fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0)
|
||||
:CComponentsButton(x_pos, y_pos, w, h, caption_locale, NEUTRINO_ICON_BUTTON_RED, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow)
|
||||
{
|
||||
cc_item_type = CC_ITEMTYPE_BUTTON_RED;
|
||||
cc_item_type.id = CC_ITEMTYPE_BUTTON_RED;
|
||||
cc_item_type.name = "cc_base_localized_red_button";
|
||||
};
|
||||
};
|
||||
|
||||
@@ -280,7 +282,8 @@ class CComponentsButtonGreen : public CComponentsButton
|
||||
fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0)
|
||||
:CComponentsButton(x_pos, y_pos, w, h, caption, NEUTRINO_ICON_BUTTON_GREEN, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow)
|
||||
{
|
||||
cc_item_type = CC_ITEMTYPE_BUTTON_GREEN;
|
||||
cc_item_type.id = CC_ITEMTYPE_BUTTON_GREEN;
|
||||
cc_item_type.name = "cc_base_green_button";
|
||||
|
||||
};
|
||||
CComponentsButtonGreen( const int& x_pos, const int& y_pos, const int& w, const int& h,
|
||||
@@ -292,7 +295,8 @@ class CComponentsButtonGreen : public CComponentsButton
|
||||
fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0)
|
||||
:CComponentsButton(x_pos, y_pos, w, h, caption_locale, NEUTRINO_ICON_BUTTON_GREEN, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow)
|
||||
{
|
||||
cc_item_type = CC_ITEMTYPE_BUTTON_GREEN;
|
||||
cc_item_type.id = CC_ITEMTYPE_BUTTON_GREEN;
|
||||
cc_item_type.name = "cc_base_localized_green_button";
|
||||
};
|
||||
};
|
||||
|
||||
@@ -312,7 +316,8 @@ class CComponentsButtonYellow : public CComponentsButton
|
||||
fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0)
|
||||
:CComponentsButton(x_pos, y_pos, w, h, caption, NEUTRINO_ICON_BUTTON_YELLOW, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow)
|
||||
{
|
||||
cc_item_type = CC_ITEMTYPE_BUTTON_YELLOW;
|
||||
cc_item_type.id = CC_ITEMTYPE_BUTTON_YELLOW;
|
||||
cc_item_type.name = "cc_base_yellow_button";
|
||||
};
|
||||
CComponentsButtonYellow( const int& x_pos, const int& y_pos, const int& w, const int& h,
|
||||
const neutrino_locale_t& caption_locale,
|
||||
@@ -323,7 +328,8 @@ class CComponentsButtonYellow : public CComponentsButton
|
||||
fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0)
|
||||
:CComponentsButton(x_pos, y_pos, w, h, caption_locale, NEUTRINO_ICON_BUTTON_YELLOW, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow)
|
||||
{
|
||||
cc_item_type = CC_ITEMTYPE_BUTTON_YELLOW;
|
||||
cc_item_type.id = CC_ITEMTYPE_BUTTON_YELLOW;
|
||||
cc_item_type.name = "cc_base_localized_yellow_button";
|
||||
};
|
||||
};
|
||||
|
||||
@@ -343,7 +349,8 @@ class CComponentsButtonBlue : public CComponentsButton
|
||||
fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0)
|
||||
:CComponentsButton(x_pos, y_pos, w, h, caption, NEUTRINO_ICON_BUTTON_BLUE, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow)
|
||||
{
|
||||
cc_item_type = CC_ITEMTYPE_BUTTON_BLUE;
|
||||
cc_item_type.id = CC_ITEMTYPE_BUTTON_BLUE;
|
||||
cc_item_type.name = "cc_base_blue_button";
|
||||
};
|
||||
CComponentsButtonBlue( const int& x_pos, const int& y_pos, const int& w, const int& h,
|
||||
const neutrino_locale_t& caption_locale,
|
||||
@@ -354,7 +361,8 @@ class CComponentsButtonBlue : public CComponentsButton
|
||||
fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0)
|
||||
:CComponentsButton(x_pos, y_pos, w, h, caption_locale, NEUTRINO_ICON_BUTTON_BLUE, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow)
|
||||
{
|
||||
cc_item_type = CC_ITEMTYPE_BUTTON_BLUE;
|
||||
cc_item_type.id = CC_ITEMTYPE_BUTTON_BLUE;
|
||||
cc_item_type.name = "cc_base_localized_blue_button";
|
||||
};
|
||||
};
|
||||
|
||||
|
@@ -70,7 +70,8 @@ void CComponentsFrmChain::initVarChain( const int& x_pos, const int& y_pos, cons
|
||||
fb_pixel_t& color_body,
|
||||
fb_pixel_t& color_shadow)
|
||||
{
|
||||
cc_item_type = CC_ITEMTYPE_FRM_CHAIN;
|
||||
cc_item_type.id = CC_ITEMTYPE_FRM_CHAIN;
|
||||
cc_item_type.name = "cc_chain";
|
||||
corner_rad = 0;
|
||||
|
||||
x = x_pos;
|
||||
|
@@ -57,7 +57,8 @@ CComponentsFrmClock::CComponentsFrmClock( const int& x_pos,
|
||||
)
|
||||
|
||||
{
|
||||
cc_item_type = CC_ITEMTYPE_FRM_CLOCK;
|
||||
cc_item_type.id = CC_ITEMTYPE_FRM_CLOCK;
|
||||
cc_item_type.name = "cc_clock";
|
||||
|
||||
x = cc_xr = x_old = x_pos;
|
||||
y = cc_yr = y_old = y_pos;
|
||||
|
@@ -80,7 +80,8 @@ void CComponentsExtTextForm::initVarExtTextForm(const int& x_pos, const int& y_p
|
||||
fb_pixel_t text_color,
|
||||
fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow)
|
||||
{
|
||||
cc_item_type = CC_ITEMTYPE_FRM_EXT_TEXT;
|
||||
cc_item_type.id = CC_ITEMTYPE_FRM_EXT_TEXT;
|
||||
cc_item_type.name = "cc_extended_text";
|
||||
x = x_pos;
|
||||
y = y_pos;
|
||||
|
||||
|
@@ -61,7 +61,8 @@ void CComponentsFooter::initVarFooter( const int& x_pos, const int& y_pos, const
|
||||
fb_pixel_t color_body,
|
||||
fb_pixel_t color_shadow )
|
||||
{
|
||||
cc_item_type = CC_ITEMTYPE_FOOTER;
|
||||
cc_item_type.id = CC_ITEMTYPE_FOOTER;
|
||||
cc_item_type.name = "cc_footer";
|
||||
|
||||
x = x_old = x_pos;
|
||||
y = y_old = y_pos;
|
||||
|
@@ -88,7 +88,8 @@ void CComponentsHeader::initVarHeader( const int& x_pos, const int& y_pos, const
|
||||
fb_pixel_t color_body,
|
||||
fb_pixel_t color_shadow)
|
||||
{
|
||||
cc_item_type = CC_ITEMTYPE_FRM_HEADER;
|
||||
cc_item_type.id = CC_ITEMTYPE_FRM_HEADER;
|
||||
cc_item_type.name = "cc_header";
|
||||
clear();
|
||||
cc_txt_save_screen = false;
|
||||
x = cc_xr = x_old = x_pos;
|
||||
|
@@ -53,7 +53,8 @@ void CComponentsIconForm::initVarIconForm( const int &x_pos, const int &y_pos, c
|
||||
int shadow_mode,
|
||||
fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow)
|
||||
{
|
||||
cc_item_type = CC_ITEMTYPE_FRM_ICONFORM;
|
||||
cc_item_type.id = CC_ITEMTYPE_FRM_ICONFORM;
|
||||
cc_item_type.name = "cc_icon_container";
|
||||
|
||||
x = x_pos;
|
||||
y = y_pos;
|
||||
|
@@ -84,7 +84,9 @@ CComponentsScrollBar::CComponentsScrollBar( const int &x_pos, const int &y_pos,
|
||||
|
||||
void CComponentsScrollBar::initVarSbForm(const int& count, const fb_pixel_t& color_select, const fb_pixel_t& color_passive)
|
||||
{
|
||||
cc_item_type = CC_ITEMTYPE_FRM_SCROLLBAR;
|
||||
cc_item_type.id = CC_ITEMTYPE_FRM_SCROLLBAR;
|
||||
cc_item_type.name = "cc_scrollbar";
|
||||
|
||||
fr_thickness = 0;
|
||||
|
||||
append_x_offset = OFFSET_INNER_MIN;
|
||||
|
@@ -51,7 +51,8 @@ CSignalBar::CSignalBar(const int& xpos, const int& ypos, const int& w, const int
|
||||
|
||||
void CSignalBar::initVarSigBar(const int& xpos, const int& ypos, const int& w, const int& h, CFrontend *frontend_ref, const std::string& sbname, CComponentsForm *parent)
|
||||
{
|
||||
cc_item_type = CC_ITEMTYPE_FRM_SIGNALBAR;
|
||||
cc_item_type.id = CC_ITEMTYPE_FRM_SIGNALBAR;
|
||||
cc_item_type.name = "cc_signal_bar";
|
||||
|
||||
corner_rad = 0;
|
||||
corner_type = 0;
|
||||
|
@@ -39,7 +39,8 @@ CComponentsSlider::CComponentsSlider( const int& x_pos, const int& y_pos, const
|
||||
fb_pixel_t& color_body,
|
||||
fb_pixel_t& color_shadow)
|
||||
{
|
||||
cc_item_type = CC_ITEMTYPE_SLIDER;
|
||||
cc_item_type.id = CC_ITEMTYPE_SLIDER;
|
||||
cc_item_type.name = "cc_slider";
|
||||
corner_rad = 0;
|
||||
|
||||
x = x_pos;
|
||||
|
@@ -95,7 +95,11 @@ CComponentsWindowMax::CComponentsWindowMax( const string& caption,
|
||||
fb_pixel_t color_body,
|
||||
fb_pixel_t color_shadow)
|
||||
:CComponentsWindow(0, 0, 0, 0, caption,
|
||||
iconname, parent, shadow_mode, color_frame, color_body, color_shadow){};
|
||||
iconname, parent, shadow_mode, color_frame, color_body, color_shadow)
|
||||
{
|
||||
cc_item_type.id = CC_ITEMTYPE_FRM_WINDOW_MAX;
|
||||
cc_item_type.name = "cc_window_max";
|
||||
}
|
||||
|
||||
CComponentsWindowMax::CComponentsWindowMax( neutrino_locale_t locale_caption,
|
||||
const string& iconname,
|
||||
@@ -106,7 +110,11 @@ CComponentsWindowMax::CComponentsWindowMax( neutrino_locale_t locale_caption,
|
||||
fb_pixel_t color_shadow)
|
||||
:CComponentsWindow(0, 0, 0, 0,
|
||||
locale_caption != NONEXISTANT_LOCALE ? g_Locale->getText(locale_caption) : "",
|
||||
iconname, parent, shadow_mode, color_frame, color_body, color_shadow){};
|
||||
iconname, parent, shadow_mode, color_frame, color_body, color_shadow)
|
||||
{
|
||||
cc_item_type.id = CC_ITEMTYPE_FRM_WINDOW_MAX;
|
||||
cc_item_type.name = "cc_window_max_localized";
|
||||
}
|
||||
|
||||
void CComponentsWindow::initVarWindow( const int& x_pos, const int& y_pos, const int& w, const int& h,
|
||||
const string& caption,
|
||||
@@ -118,7 +126,8 @@ void CComponentsWindow::initVarWindow( const int& x_pos, const int& y_pos, const
|
||||
fb_pixel_t color_shadow)
|
||||
{
|
||||
//CComponentsForm
|
||||
cc_item_type = CC_ITEMTYPE_FRM_WINDOW;
|
||||
cc_item_type.id = CC_ITEMTYPE_FRM_WINDOW;
|
||||
cc_item_type.name = "cc_base_window";
|
||||
|
||||
//using current screen settings for default dimensions,
|
||||
//do use full screen (from osd-settings) if default values for width/height = 0
|
||||
|
@@ -44,7 +44,8 @@ using namespace std;
|
||||
//abstract sub class CComponentsItem from CComponents
|
||||
CComponentsItem::CComponentsItem(CComponentsForm* parent)
|
||||
{
|
||||
cc_item_type = CC_ITEMTYPE_GENERIC;
|
||||
cc_item_type.id = CC_ITEMTYPE_GENERIC;
|
||||
cc_item_type.name = "cc_base_item";
|
||||
cc_item_index = CC_NO_INDEX;
|
||||
cc_item_enabled = true;
|
||||
cc_item_selected = false;
|
||||
@@ -213,6 +214,7 @@ void CComponentsItem::paintInit(bool do_save_bg)
|
||||
}
|
||||
}
|
||||
}
|
||||
dprintf(DEBUG_DEBUG, "\033[1;32m[CComponentsItem]\t[%s - %d], init and paint item type = %d [%s]...\033[0m\n", __func__, __LINE__, cc_item_type.id, cc_item_type.name.c_str());
|
||||
paintFbItems(do_save_bg);
|
||||
}
|
||||
|
||||
@@ -243,7 +245,7 @@ void CComponentsItem::syncSysColors()
|
||||
int CComponentsItem::getItemType()
|
||||
{
|
||||
for(int i =0; i< (CC_ITEMTYPES) ;i++){
|
||||
if (i == cc_item_type)
|
||||
if (i == cc_item_type.id)
|
||||
return i;
|
||||
}
|
||||
|
||||
@@ -329,3 +331,13 @@ void CComponentsItem::setSelected(bool selected, const fb_pixel_t& sel_frame_col
|
||||
col_body = cc_item_selected ? sel_body_col : body_col;
|
||||
col_frame = cc_item_selected ? sel_frame_col : frame_col;
|
||||
}
|
||||
|
||||
void CComponentsItem::setItemName(const std::string& name)
|
||||
{
|
||||
cc_item_type.name = name;
|
||||
}
|
||||
|
||||
std::string CComponentsItem::getItemName()
|
||||
{
|
||||
return cc_item_type.name;
|
||||
}
|
||||
|
@@ -41,7 +41,7 @@ class CComponentsItem : public CComponents
|
||||
///see also getIndex(), setIndex()
|
||||
int cc_item_index;
|
||||
///property: define of item type, see cc_types.h for possible types
|
||||
int cc_item_type;
|
||||
cc_type_t cc_item_type;
|
||||
///property: default enabled
|
||||
bool cc_item_enabled;
|
||||
///property: default not selected
|
||||
@@ -103,7 +103,12 @@ class CComponentsItem : public CComponents
|
||||
virtual void kill(const fb_pixel_t& bg_color = COL_BACKGROUND_PLUS_0, bool ignore_parent = false, const int& fblayer_type = ~CC_FBDATA_TYPES);
|
||||
|
||||
///get the current item type, see attribute cc_item_type above
|
||||
virtual int getItemType();
|
||||
int getItemType();
|
||||
//sets item name
|
||||
void setItemName(const std::string& name);
|
||||
//gets item name
|
||||
std::string getItemName();
|
||||
|
||||
///syncronizes item colors with current color settings if required, NOTE: overwrites internal values!
|
||||
virtual void syncSysColors();
|
||||
|
||||
|
@@ -49,7 +49,8 @@ CComponentsInfoBox::CComponentsInfoBox( const int& x_pos,
|
||||
fb_pixel_t color_body,
|
||||
fb_pixel_t color_shadow)
|
||||
{
|
||||
cc_item_type = CC_ITEMTYPE_TEXT_INFOBOX;
|
||||
cc_item_type.id = CC_ITEMTYPE_TEXT_INFOBOX;
|
||||
cc_item_type.name = "cc_info_box";
|
||||
|
||||
x = x_old = x_pos;
|
||||
y = y_old = y_pos;
|
||||
|
@@ -69,7 +69,8 @@ void CComponentsPicture::init( const int &x_pos, const int &y_pos, const int &w,
|
||||
bool allow_scale)
|
||||
{
|
||||
//CComponents, CComponentsItem
|
||||
cc_item_type = CC_ITEMTYPE_PICTURE;
|
||||
cc_item_type.id = CC_ITEMTYPE_PICTURE;
|
||||
cc_item_type.name = "cc_image_box";
|
||||
|
||||
//CComponents
|
||||
x = x_old = x_pos;
|
||||
@@ -399,7 +400,8 @@ CComponentsChannelLogo::CComponentsChannelLogo( const int &x_pos, const int &y_p
|
||||
|
||||
void CComponentsChannelLogo::init(const uint64_t& channelId, const std::string& channelName, bool allow_scale)
|
||||
{
|
||||
cc_item_type = CC_ITEMTYPE_CHANNEL_LOGO;
|
||||
cc_item_type.id = CC_ITEMTYPE_CHANNEL_LOGO;
|
||||
cc_item_type.name = "cc_channel_logo_box";
|
||||
channel_name = "";
|
||||
channel_id = 0;
|
||||
alt_pic_name = "";
|
||||
|
@@ -209,7 +209,10 @@ class CComponentsPictureScalable : public CComponentsPicture
|
||||
fb_pixel_t color_shadow = COL_SHADOW_PLUS_0,
|
||||
int transparent = CFrameBuffer::TM_NONE)
|
||||
: CComponentsPicture(x_pos, y_pos, 0, 0, image_name, parent, shadow_mode, color_frame, color_background, color_shadow, transparent)
|
||||
{cc_item_type = CC_ITEMTYPE_PICTURE_SCALABLE;};
|
||||
{
|
||||
cc_item_type.id = CC_ITEMTYPE_PICTURE_SCALABLE;
|
||||
cc_item_type.name = "cc_scalable_image_box";
|
||||
};
|
||||
};
|
||||
|
||||
class CComponentsChannelLogo : public CComponentsPicture
|
||||
@@ -294,7 +297,10 @@ class CComponentsChannelLogoScalable : public CComponentsChannelLogo
|
||||
fb_pixel_t color_shadow = COL_SHADOW_PLUS_0,
|
||||
int transparent = CFrameBuffer::TM_BLACK)
|
||||
: CComponentsChannelLogo(x_pos, y_pos, 0, 0, channelName, channelId, parent, shadow_mode, color_frame, color_background, color_shadow, transparent)
|
||||
{cc_item_type = CC_ITEMTYPE_CHANNEL_LOGO_SCALABLE;};
|
||||
{
|
||||
cc_item_type.id = CC_ITEMTYPE_CHANNEL_LOGO_SCALABLE;
|
||||
cc_item_type.name = "cc_scalable_channellogo_box";
|
||||
};
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -58,7 +58,8 @@ CProgressBar::CProgressBar( const int x_pos,
|
||||
CComponentsForm *parent)
|
||||
{
|
||||
//CComponentsItem
|
||||
cc_item_type = CC_ITEMTYPE_PROGRESSBAR;
|
||||
cc_item_type.id = CC_ITEMTYPE_PROGRESSBAR;
|
||||
cc_item_type.name ="cc_progressbar";
|
||||
|
||||
//CComponents
|
||||
x = x_old = x_pos;
|
||||
|
@@ -41,7 +41,8 @@ CComponentsShapeSquare::CComponentsShapeSquare( const int x_pos, const int y_pos
|
||||
fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow)
|
||||
{
|
||||
//CComponentsItem
|
||||
cc_item_type = CC_ITEMTYPE_SHAPE_SQUARE;
|
||||
cc_item_type.id = CC_ITEMTYPE_SHAPE_SQUARE;
|
||||
cc_item_type.name ="cc_box";
|
||||
|
||||
x = x_old = x_pos;
|
||||
y = y_old = y_pos;
|
||||
@@ -69,7 +70,8 @@ CComponentsShapeCircle::CComponentsShapeCircle( int x_pos, int y_pos, int diam,
|
||||
fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow)
|
||||
{
|
||||
//CComponents, CComponentsItem
|
||||
cc_item_type = CC_ITEMTYPE_SHAPE_CIRCLE;
|
||||
cc_item_type.id = CC_ITEMTYPE_SHAPE_CIRCLE;
|
||||
cc_item_type.name ="cc_circle";
|
||||
|
||||
//CComponents
|
||||
x = x_pos;
|
||||
|
@@ -80,7 +80,9 @@ void CComponentsText::initVarText( const int x_pos, const int y_pos, const int w
|
||||
int shadow_mode,
|
||||
fb_pixel_t color_text, fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow)
|
||||
{
|
||||
cc_item_type = CC_ITEMTYPE_TEXT;
|
||||
cc_item_type.id = CC_ITEMTYPE_TEXT;
|
||||
cc_item_type.name ="cc_text_box";
|
||||
|
||||
ct_font = font_text;
|
||||
ct_textbox = NULL;
|
||||
ct_text = text;
|
||||
|
@@ -277,7 +277,8 @@ class CComponentsLabel : public CComponentsText
|
||||
fb_pixel_t color_shadow = COL_SHADOW_PLUS_0)
|
||||
:CComponentsText(x_pos, y_pos, w, h, text, mode, font_text, font_style, parent, shadow_mode, color_text, color_frame, color_body, color_shadow)
|
||||
{
|
||||
cc_item_type = CC_ITEMTYPE_LABEL;
|
||||
cc_item_type.id = CC_ITEMTYPE_LABEL;
|
||||
cc_item_type.name ="cc_label_box";
|
||||
};
|
||||
|
||||
CComponentsLabel( CComponentsForm *parent,
|
||||
@@ -293,7 +294,8 @@ class CComponentsLabel : public CComponentsText
|
||||
fb_pixel_t color_shadow = COL_SHADOW_PLUS_0)
|
||||
:CComponentsText(x_pos, y_pos, w, h, text, mode, font_text, font_style, parent, shadow_mode, color_text, color_frame, color_body, color_shadow)
|
||||
{
|
||||
cc_item_type = CC_ITEMTYPE_LABEL;
|
||||
cc_item_type.id = CC_ITEMTYPE_LABEL;
|
||||
cc_item_type.name ="cc_label_box";
|
||||
};
|
||||
};
|
||||
|
||||
|
@@ -46,7 +46,8 @@ CComponentsPIP::CComponentsPIP( const int x_pos, const int y_pos, const int perc
|
||||
fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow)
|
||||
{
|
||||
//CComponents, CComponentsItem
|
||||
cc_item_type = CC_ITEMTYPE_PIP;
|
||||
cc_item_type.id = CC_ITEMTYPE_PIP;
|
||||
cc_item_type.name ="cc_pip_box";
|
||||
|
||||
//CComponentsPIP
|
||||
screen_w = frameBuffer->getScreenWidth(true);
|
||||
|
@@ -37,6 +37,12 @@ class CComponentsScrollBar;
|
||||
class CCButtonSelect;
|
||||
|
||||
///cc item types
|
||||
typedef struct cc_type_t
|
||||
{
|
||||
int id;
|
||||
std::string name;
|
||||
} cc_type_struct_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
CC_ITEMTYPE_GENERIC,
|
||||
@@ -57,6 +63,7 @@ typedef enum
|
||||
CC_ITEMTYPE_FOOTER,
|
||||
CC_ITEMTYPE_FRM_ICONFORM,
|
||||
CC_ITEMTYPE_FRM_WINDOW,
|
||||
CC_ITEMTYPE_FRM_WINDOW_MAX,
|
||||
CC_ITEMTYPE_FRM_EXT_TEXT,
|
||||
CC_ITEMTYPE_LABEL,
|
||||
CC_ITEMTYPE_PROGRESSBAR,
|
||||
|
@@ -46,6 +46,7 @@ CTimeOSD::CTimeOSD():CComponentsFrmClock( 1, 1, NULL, "%H:%M:%S", NULL, false, 1
|
||||
tmp_mode = MODE_HIDE;
|
||||
m_restore = false;
|
||||
mp_time_forced = false;
|
||||
cc_item_type.name = "time_osd_box";
|
||||
Init();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user