neutrino eventlist: move and define some member variables in constructor

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1788 e54a6e83-5905-42d5-8d5c-058d10e6a962


Origin commit data
------------------
Branch: ni/coolstream
Commit: c9a5284455
Author: Thilo Graf <dbt@novatux.de>
Date: 2011-10-29 (Sat, 29 Oct 2011)

Origin message was:
------------------
*neutrino eventlist: move and define some member variables in constructor

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1788 e54a6e83-5905-42d5-8d5c-058d10e6a962


------------------
This commit was generated by Migit
This commit is contained in:
2011-10-28 22:15:49 +00:00
parent 2f037139b0
commit 7fa84cb7da
2 changed files with 13 additions and 11 deletions

View File

@@ -99,6 +99,14 @@ EventList::EventList()
m_search_epg_item = SEARCH_EPG_TITLE;
m_search_channel_id = 1;
m_search_bouquet_id= 1;
fw = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getWidth(); //font width
fh = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); //font height
width = w_max (62 * fw, 40);
height = h_max (23 * fh, 20);
x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - width) / 2;
y = frameBuffer->getScreenY() + (frameBuffer->getScreenHeight() - height) / 2;
}
EventList::~EventList()
@@ -209,10 +217,7 @@ int EventList::exec(const t_channel_id channel_id, const std::string& channelnam
neutrino_msg_t msg;
neutrino_msg_data_t data;
bool in_search = false;
int fw = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getWidth();
int fh = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight();
width = w_max (62 * fw, 40);
height = h_max (23 * fh, 20);
iheight = 30; // info bar height (see below, hard coded at this time)
if(iheight < fh)
@@ -244,9 +249,6 @@ int EventList::exec(const t_channel_id channel_id, const std::string& channelnam
listmaxshow = (height-theight-iheight-0)/fheight;
height = theight+iheight+0+listmaxshow*fheight; // recalc height
x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - width) / 2;
y = frameBuffer->getScreenY() + (frameBuffer->getScreenHeight() - height) / 2;
int res = menu_return::RETURN_REPAINT;
//printf("EventList::exec: channel_id %llx\n", channel_id);
if(m_search_list == SEARCH_LIST_NONE) // init globals once only
@@ -805,8 +807,8 @@ void EventList::paintHead(std::string _channelname, std::string _channelname_pre
short middle_len = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_TITLE]->getRenderWidth(_channelname.c_str(),true);
short middle_offset = (width- next_len- prev_len- middle_len-iw-8)/2;
if(middle_offset < 0){
int fw = g_Font[font_h]->getWidth();
int newsize = abs(middle_offset / fw) + 1;
int fw_h = g_Font[font_h]->getWidth();
int newsize = abs(middle_offset / fw_h) + 1;
if(_channelname_prev.size() > _channelname_next.size() ){
_channelname_prev.resize( _channelname_prev.size() - newsize);
}else{

View File

@@ -98,8 +98,8 @@ class EventList
int key;
std::string search_head_name;
int width;
int height;
int width, fw;
int height, fh;
int x;
int y;
int sort_mode;