コード例 #1
0
ファイル: ebutton.cpp プロジェクト: ChakaZulu/my_tuxbox_apps
void eButton::gotFocus()
{
#ifndef DISABLE_LCD
	if (parent && parent->LCDElement)
	{
		if (descr)
		{
			LCDTmp = new eLabel(parent->LCDElement);
			LCDTmp->hide();
			eSize s = parent->LCDElement->getSize();
			LCDTmp->move(ePoint(0,s.height()/2));
			LCDTmp->resize(eSize(s.width(), s.height()/2));
			LCDTmp->setText(text);
			LCDTmp->setBackgroundColor(255);
			LCDTmp->show();
			tmpDescr = new eLabel(parent->LCDElement);
			tmpDescr->hide();
			tmpDescr->move(ePoint(0,0));
			tmpDescr->resize(eSize(s.width(), s.height()/2));
			tmpDescr->setText(descr->getText());
			tmpDescr->show();
		}
		else
			parent->LCDElement->setText(text);
	}
#endif
	setForegroundColor(focusF,false);
	setBackgroundColor(focusB);
}
コード例 #2
0
RunApp::RunApp ():
eWindow (0)
{
  //setText(_("Running script"));
  printf ("%s is running, please wait\n", Executable);
  setText (eString ().sprintf ("%s is running, please wait", Executable));
  cmove (ePoint (50, 100));
  cresize (eSize (630, 400));

  bClose = new eButton (this);
  bClose->setText (_("Close"));
  bClose->setShortcut ("green");
  bClose->setShortcutPixmap ("green");
  bClose->move (ePoint (440, 10));
  bClose->resize (eSize (170, 40));
  bClose->loadDeco ();
  bClose->hide ();
  CONNECT (bClose->selected, RunApp::accept);

/*
	bCancel=new eButton(this);
	bCancel->loadDeco();
	bCancel->setText(_("abort"));
	bCancel->move(ePoint(210, 220));
	bCancel->resize(eSize(170, 40));
	bCancel->setHelpText(_("ignore changes and return"));
	CONNECT( bCancel->selected, RunApp::onCancel );
*/

  lState = new eLabel (this);
  lState->setName ("state");
  lState->move (ePoint (0, 0));
  lState->resize (eSize (630, 400));
}
コード例 #3
0
ファイル: tpeditwindow.cpp プロジェクト: backtrack2016/tdt
void eTPEditDialog::init_eTPEditDialog()
{
    setText(_("Transponder Edit"));
    cmove( ePoint( 120, 150 ) );
    cresize( eSize( 460, 300 ) );
    tpWidget=new eTransponderWidget(this, 1,
                                    eTransponderWidget::deliverySatellite|
                                    eTransponderWidget::flagNoSat|
                                    eTransponderWidget::flagNoInv);
    tpWidget->resize( eSize( 460, 130 ) );
    tpWidget->load();
    tpWidget->setTransponder( tp );
    tpWidget->move( ePoint(0,-40) );
    save=new eButton( this );
    save->setText(_("save"));
    save->setShortcut("green");
    save->setShortcutPixmap("green");
    save->setHelpText(_("save changes and return"));
    save->move(ePoint( 10, getClientSize().height()-80) );
    save->resize( eSize( 220, 40 ) );
    save->loadDeco();
    CONNECT( save->selected, eTPEditDialog::savePressed );
    eStatusBar *sbar = new eStatusBar(this);
    sbar->move( ePoint( 0, getClientSize().height()-30) );
    sbar->resize( eSize( getClientSize().width(), 30 ) );
    sbar->loadDeco();
    setHelpID(63);
}
コード例 #4
0
ファイル: setup_osd.cpp プロジェクト: ChakaZulu/tuxbox_apps
void PluginOffsetScreen::redrawWidget(gPainter *target, const eRect &where)
{
	target->setForegroundColor( foreColor );
	if ( where.intersects( eRect(	ePoint( left, top ), eSize( 100, 100 ) ) ) )
		redrawLeftTop( target );
	if ( where.intersects( eRect( ePoint( right-3, bottom-100 ), eSize( 3, 100 ) ) ) )
		redrawRightBottom( target );
}
コード例 #5
0
void eEventDisplay::init_eEventDisplay(const ePtrList<EITEvent>* e)
{
	eventlist=0;
	events=0;

	scrollbar = new eProgress(this);
	scrollbar->setName("scrollbar");
	scrollbar->setStart(0);
	scrollbar->setPerc(100);

	descr = new eWidget(this);
	descr->setName("epg_description");

	eventTime = new eLabel(this);
	eventTime->setName("time");

	eventDate = new eLabel(this);
	eventDate->setName("date");

	channel = new eLabel(this);
	channel->setName("channel");

	timer_icon = new eLabel(this);
	timer_icon->setName("timer_icon");

	eSkin *skin=eSkin::getActive();
	if (skin->build(this, "eventview"))
		eFatal("skin load of \"eventview\" failed");

	long_description=new eLabel(descr);
	long_description->setFlags(RS_WRAP);

	// try to recalc long description label... ( no broken text lines.. )
	float lineheight=fontRenderClass::getInstance()->getLineHeight( long_description->getFont() );
	int lines = (int)(descr->getSize().height() / lineheight);
	pageHeight = (int)(lines * lineheight);
	descr->resize( eSize( descr->getSize().width(), pageHeight+(int)(lineheight/6)));
	long_description->resize(eSize(descr->getSize().width(), pageHeight*16));

#ifndef DISABLE_FILE
	addActionToHelpList( &i_epgSelectorActions->addDVRTimerEvent );
#endif
#ifndef DISABLE_NETWORK
	addActionToHelpList( &i_epgSelectorActions->addNGRABTimerEvent );
#endif
	addActionToHelpList( &i_epgSelectorActions->addSwitchTimerEvent );
	addActionToHelpList( &i_epgSelectorActions->removeTimerEvent );
	addActionToHelpList( &i_enigmaEventViewActions->close );

	if (e)
		setList(*e);
	else if (evt)
		setEvent(evt);
	addActionMap( &i_enigmaEventViewActions->map );
	addActionMap( &i_epgSelectorActions->map );
	
	setHelpID(11);
}
コード例 #6
0
ファイル: elistbox.cpp プロジェクト: MOA-2011/enigma2.pli4.0
void eListbox::updateScrollBar()
{
	if (!m_content || m_scrollbar_mode == showNever )
		return;
	int entries = m_content->size();
	if (m_content_changed)
	{
		int width = size().width();
		int height = size().height();
		m_content_changed = false;
		if (m_scrollbar_mode == showLeft)
		{
			int sbarwidth = 20;
			m_content->setSize(eSize(width-sbarwidth-5, m_itemheight));
			m_scrollbar->move(ePoint(0, 0));
			m_scrollbar->resize(eSize(sbarwidth, height));
			if (entries > m_items_per_page)
			{
				m_scrollbar->show();
			}
			else
			{
				m_scrollbar->hide();
			}
		}
		else if (entries > m_items_per_page || m_scrollbar_mode == showAlways)
		{
			int sbarwidth = 20;
			m_scrollbar->move(ePoint(width-sbarwidth, 0));
			m_scrollbar->resize(eSize(sbarwidth, height));
			m_content->setSize(eSize(width-sbarwidth-5, m_itemheight));
			m_scrollbar->show();
		}
		else
		{
			m_content->setSize(eSize(width, m_itemheight));
			m_scrollbar->hide();
		}
	}
	if (m_items_per_page && entries)
	{
		int curVisiblePage = m_top / m_items_per_page;
		if (m_prev_scrollbar_page != curVisiblePage)
		{
			m_prev_scrollbar_page = curVisiblePage;
			int pages = entries / m_items_per_page;
			if ((pages*m_items_per_page) < entries)
				++pages;
			int start=(m_top*100)/(pages*m_items_per_page);
			int vis=(m_items_per_page*100+pages*m_items_per_page-1)/(pages*m_items_per_page);
			if (vis < 3)
				vis=3;
			m_scrollbar->setStartEnd(start,start+vis);
		}
	}
}
コード例 #7
0
ファイル: listbox.cpp プロジェクト: nx111/OpenPLi-1
void eListBoxBase::recalcMaxEntries()
{
		// MaxEntries is PER COLUMN
	int decoheight=0;
	if (deco_selected && have_focus)
	{
		MaxEntries = crect_selected.height();
		decoheight = height() - crect_selected.height();
	}
	else if (deco)
	{
		MaxEntries = crect.height();
		decoheight = height() - crect.height();
	}
	else
		MaxEntries = height();
	int tmp = MaxEntries;
	MaxEntries /= item_height;
	/*eDebug("height = %d, MaxEntries = %d, item height = %d",
		tmp, MaxEntries, item_height);*/
	
	// The code here is really funny times .. but works:)
	// Make list boxes are automatically resized to the height,
	// Needed so that all entrys are just visible ..
	// And no edge remains ..
	if ( tmp - ( MaxEntries*item_height ) > 0 )
	{
		
		if ( (!removed_height_pixel) || (MaxEntries && !(flags & flagShowPartial)) )
		{
			removed_height_pixel = height() - ((MaxEntries*item_height) + decoheight);
			resize( eSize( size.width(), height()-removed_height_pixel ) );
		}
		else
		{
			int newMax = (tmp + removed_height_pixel) / item_height;
			if ( newMax > MaxEntries )
			{
				removed_height_pixel -= (newMax*item_height) - tmp;
				resize( eSize( size.width(), newMax*item_height+decoheight ) );
			}
			else
			{
				int tmp = height() - ((MaxEntries*item_height) + decoheight);
				resize( eSize( size.width(), height() - tmp ) );
				removed_height_pixel += tmp;
			}
		}

	}
/*	else
		eDebug("is ok .. do nothing");*/
}
コード例 #8
0
ファイル: setup_rdg.cpp プロジェクト: GWARDAR/OpenPLi-1
SetupRdg::SetupRdg ():
eWindow (0)
{
  SetupRdg::GetCFG ();

  int fd = eSkin::getActive ()->queryValue ("fontsize", 16);
  int s_y = 130, h_x = 250;
  eLabel *l;

  setText (dgettext("plisetup", "Radegast setup"));
  cmove (ePoint (720 / 2 - h_x, 120));
  cresize (eSize (h_x * 2, 380));

  ok = new eButton (this);
  ok->setText (dgettext("plisetup", "Save"));
  ok->setShortcut ("green");
  ok->setShortcutPixmap ("green");
  ok->move (ePoint (10, 270));
  ok->resize (eSize (150, 40));
  ok->setHelpText (dgettext("plisetup", "Save changes and return"));
  ok->loadDeco ();
  CONNECT (ok->selected, SetupRdg::okPressed);

  abort = new eButton (this);
  abort->setShortcut ("red");
  abort->setShortcutPixmap ("red");
  abort->loadDeco ();
  abort->setText (dgettext("plisetup", "Abort"));
  abort->move (ePoint (180, 270));
  abort->resize (eSize (150, 40));
  abort->setHelpText (dgettext("plisetup", "Ignore changes and return"));
  CONNECT (abort->selected, SetupRdg::abortPressed);

  defaults = new eButton (this);
  defaults->setShortcut ("blue");
  defaults->setShortcutPixmap ("blue");
  defaults->loadDeco ();
  defaults->setText (dgettext("plisetup", "defaults"));
  defaults->move (ePoint (180 + 170, 270));
  defaults->resize (eSize (150, 40));
  defaults->setHelpText (dgettext("plisetup", "Load good defaults for local CS"));
  CONNECT (defaults->selected, SetupRdg::defaultsPressed);

  statusbar = new eStatusBar (this);
  statusbar->move (ePoint (0, clientrect.height () - 60));
  statusbar->resize (eSize (clientrect.width (), 50));
  statusbar->loadDeco ();
}
コード例 #9
0
ファイル: grc.cpp プロジェクト: Adga52/enigma2
void gDC::incrementSpinner()
{
	ASSERT(m_spinner_saved);

	static int blub;
	blub++;

#if 0
	int i;

	for (i = 0; i < 5; ++i)
	{
		int x = i * 20 + m_spinner_pos.left();
		int y = m_spinner_pos.top();

		int col = ((blub - i) * 30) % 256;

		m_pixmap->fill(eRect(x, y, 10, 10), gRGB(col, col, col));
	}
#endif

	m_spinner_temp->blit(*m_spinner_saved, eRect(0, 0, 0, 0), eRect(ePoint(0, 0), m_spinner_pos.size()));

	if (m_spinner_pic[m_spinner_i])
		m_spinner_temp->blit(*m_spinner_pic[m_spinner_i], eRect(0, 0, 0, 0), eRect(ePoint(0, 0), m_spinner_pos.size()), gPixmap::blitAlphaBlend);

	m_pixmap->blit(*m_spinner_temp, eRect(m_spinner_pos.topLeft(), eSize()), gRegion(m_spinner_pos), 0);
	m_spinner_i++;
	m_spinner_i %= m_spinner_num;
}
コード例 #10
0
ファイル: grc.cpp プロジェクト: Adga52/enigma2
void gDC::disableSpinner()
{
	ASSERT(m_spinner_saved);

		/* restore background */
	m_pixmap->blit(*m_spinner_saved, eRect(m_spinner_pos.topLeft(), eSize()), gRegion(m_spinner_pos), 0);
}
コード例 #11
0
ファイル: ewidget.cpp プロジェクト: BananaSamurai/Enigma2
void eWidget::resize(eSize size)
{
		/* same strategy as with move: we first check if
		   the size changed at all, and if it did, we
		   invalidate both the old and new area. 
		   TODO: check if either the old or new area
		   fits into the other completely, and invalidate
		   only once. */
	eSize old_size = m_size;
	eSize old_offset = m_client_offset;
	m_client_size = size;
	m_client_offset = eSize(0, 0);
	event(evtWillChangeSize, &size, &m_client_offset);
	if (old_size == m_size)
		return;
	move(position() - old_offset);
	invalidate();
	event(evtChangedSize);

	if (m_notify_child_on_position_change)
		for (ePtrList<eWidget>::iterator i(m_childs.begin()); i != m_childs.end(); ++i)
			i->event(evtParentChangedPosition); /* position/size is the same here */

	recalcClipRegionsWhenVisible();	invalidate();
}
コード例 #12
0
ファイル: servicedvd.cpp プロジェクト: undertaker01/stbgui
RESULT eServiceDVD::enableSubtitles(iSubtitleUser *user, SubtitleTrack &track)
{
	eSize size = eSize(720, 576);

	if (m_subtitle_widget) m_subtitle_widget->destroy();
	m_subtitle_widget = user;

	int pid = -1;

	if (track.pid >= 0)
	{
		pid = track.pid - 1;

		ddvd_set_spu(m_ddvdconfig, pid);
		m_event(this, evUser+7);
	}

	eDebug("[eServiceDVD] enableSubtitles %i", pid);

	if (!m_pixmap)
	{
		m_pixmap = new gPixmap(size, 32, 1); /* allocate accel surface (if possible) */
#ifdef DDVD_SUPPORTS_GET_BLIT_DESTINATION
		ddvd_set_lfb_ex(m_ddvdconfig, (unsigned char *)m_pixmap->surface->data, size.width(), size.height(), 4, size.width()*4, 1);
#else
		ddvd_set_lfb(m_ddvdconfig, (unsigned char *)m_pixmap->surface->data, size.width(), size.height(), 4, size.width()*4);
#warning please update libdreamdvd for fast scaling
#endif
		run(); // start the thread
	}

	return 0;
}
コード例 #13
0
enigmaCIMMI::enigmaCIMMI( eDVBCI *ci )
	:ci(ci)
{
	setText(_("Common Interface Module - mmi"));
	lText->setText(_("waiting for CI answer..."));
	int newHeight = size.height() - getClientSize().height() + lText->getExtend().height() + 10 + 20;
	resize( eSize( size.width(), newHeight ) );
}
コード例 #14
0
ファイル: grc.cpp プロジェクト: Adga52/enigma2
void gDC::enableSpinner()
{
	ASSERT(m_spinner_saved);

		/* save the background to restore it later. We need to negative position because we want to blit from the middle of the screen. */
	m_spinner_saved->blit(*m_pixmap, eRect(-m_spinner_pos.topLeft(), eSize()), gRegion(eRect(ePoint(0, 0), m_spinner_saved->size())), 0);

	incrementSpinner();
}
コード例 #15
0
ファイル: ewindowstyle.cpp プロジェクト: 1198s/enigma2
void eWindowStyleSimple::handleNewSize(eWindow *wnd, eSize &size, eSize &offset)
{
//	eDebug("handle new size: %d x %d", size.width(), size.height());
	
	eWidget *child = wnd->child();
	
	wnd->m_clip_region = eRect(ePoint(0, 0), size);
	
	child->move(ePoint(m_border_left, m_border_top));
	child->resize(eSize(size.width() - m_border_left - m_border_right, size.height() - m_border_top - m_border_bottom));
}
コード例 #16
0
void ParentalLockWindow::init_ParentalLockWindow(const char* windowText, int curNum )
{
	resize( eSize( 380, 150 ) );
	move( ePoint( 200, 200 ) );
	setText(windowText);

	lPin = new eLabel(this);
	lPin->move( ePoint( 10, 10 ) );
	lPin->resize( eSize( width()-20, 30 ) );
	lPin->setText(_("please enter pin:"));
	lPin->loadDeco();

	nPin=new eNumber(this, 4, 0, 9, 1, 0, 0, lPin, 1);
	nPin->move( ePoint( 10, 50 ) );
	nPin->resize( eSize( 100, 30 ) );
	nPin->loadDeco();
	nPin->setNumber(curNum);
	nPin->setFlags( eNumber::flagHideInput );
	CONNECT( nPin->selected, ParentalLockWindow::numEntered );
}
コード例 #17
0
ファイル: listbox.cpp プロジェクト: nx111/OpenPLi-1
void eListBoxBase::gotFocus()
{
#ifndef DISABLE_LCD
	if (parent && parent->LCDElement)  // detect if LCD Avail
		if (descr)
		{
			parent->LCDElement->setText("");
			LCDTmp = new eLabel(parent->LCDElement);
			LCDTmp->hide();
			eSize s = parent->LCDElement->getSize();
			LCDTmp->move(ePoint(0,s.height()/2));
			LCDTmp->resize(eSize(s.width(), s.height()/2));
			LCDTmp->show();
			tmpDescr = new eLabel(parent->LCDElement);
			tmpDescr->hide();
			tmpDescr->move(ePoint(0,0));
			tmpDescr->resize(eSize(s.width(), s.height()/2));
			tmpDescr->setText( descr->getText() );
			tmpDescr->show();
		}
#endif
	++have_focus;
	if (entries)
	{
		if ( newFocus() )   // recalced ?
		{
			ePtrList<eListBoxEntry>::iterator it = current;
			init();
			setCurrent(it);
		}
		else if ( isVisible() )
		{
			int i=0;
			for (ePtrList<eListBoxEntry>::iterator entry(top); entry != bottom; ++i, ++entry)
				if (entry == current)
					invalidateEntry(i);
		}
	}
	if (flags & flagShowEntryHelp)
		setHelpText( current != childs.end() ? current->getHelpText(): eString(" ")); // eString(_("no description available")));
}
コード例 #18
0
ファイル: elistbox.cpp プロジェクト: FFTEAM/enigma2-5
void eListbox::recalcSize()
{
	m_content_changed=true;
	m_prev_scrollbar_page=-1;
	if (m_content)
		m_content->setSize(eSize(size().width(), m_itemheight));
	m_items_per_page = size().height() / m_itemheight;

	if (m_items_per_page < 0) /* TODO: whyever - our size could be invalid, or itemheigh could be wrongly specified. */
 		m_items_per_page = 0;

	moveSelection(justCheck);
}
コード例 #19
0
ファイル: setup_osd.cpp プロジェクト: ChakaZulu/tuxbox_apps
void PluginOffsetScreen::init_PluginOffsetScreen()
{
	foreColor = eSkin::getActive()->queryColor("eWindow.titleBarFont");
	setForegroundColor( foreColor );
	move(ePoint(0,0));
	resize(eSize(768,576));
	descr = new eLabel( this );
	descr->setFlags( eLabel::flagVCenter|RS_WRAP );
	descr->setForegroundColor( foreColor );
	descr->resize(eSize(568,300));
	descr->move(ePoint(100,100));
	descr->setText(_("here you can center the tuxtxt rectangle...\npress red to select the left top edge\npress green to select the right bottom edge\nuse the cursor keys to move the selected edges"));
	eSize ext = descr->getExtend();
	ext+=eSize(8,4);  // the given Size of the Text is okay... but the renderer sucks...
	descr->resize( ext );
	descr->move( ePoint( (width()/2)-(ext.width()/2) , (height()/2)-(ext.height()/2) ) );
	descr->show();
	addActionMap(&i_PluginOffsetActions->map);
	addActionMap(&i_cursorActions->map);
	addActionToHelpList( &i_PluginOffsetActions->leftTop );
	addActionToHelpList( &i_PluginOffsetActions->rightBottom );
	setHelpID(96);
}
コード例 #20
0
ファイル: servicedvd.cpp プロジェクト: Caught/openpliPC
RESULT eServiceDVD::enableSubtitles(eWidget *parent, ePyObject tuple)
{
	delete m_subtitle_widget;
	eSize size = eSize(720, 576);

	m_subtitle_widget = new eSubtitleWidget(parent);
	m_subtitle_widget->resize(parent->size());

	int pid = -1;

	if ( tuple != Py_None )
	{		
		ePyObject entry;
		int tuplesize = PyTuple_Size(tuple);
		if (!PyTuple_Check(tuple))
			goto error_out;
		if (tuplesize < 1)
			goto error_out;
		entry = PyTuple_GET_ITEM(tuple, 1);
		if (!PyInt_Check(entry))
			goto error_out;
		pid = PyInt_AsLong(entry)-1;

		ddvd_set_spu(m_ddvdconfig, pid);
		m_event(this, evUser+7);
	}
	eDebug("eServiceDVD::enableSubtitles %i", pid);

	if (!m_pixmap)
	{
		m_pixmap = new gPixmap(size, 32, 1); /* allocate accel surface (if possible) */
#ifdef DDVD_SUPPORTS_GET_BLIT_DESTINATION
		ddvd_set_lfb_ex(m_ddvdconfig, (unsigned char *)m_pixmap->surface->data, size.width(), size.height(), 4, size.width()*4, 1);
#else
		ddvd_set_lfb(m_ddvdconfig, (unsigned char *)m_pixmap->surface->data, size.width(), size.height(), 4, size.width()*4);
#warning please update libdreamdvd for fast scaling
#endif
		run(); // start the thread
	}

	m_subtitle_widget->setZPosition(-1);
	m_subtitle_widget->show();

	return 0;

error_out:
	return -1;
}
コード例 #21
0
ファイル: channelinfo.cpp プロジェクト: ChakaZulu/tuxbox_apps
void eChannelInfo::getServiceInfo( const eServiceReferenceDVB& service )
{
	closeEIT();
	delete eit;
	eit=0;
	
	// eService *service=eServiceInterface::getInstance()->addRef(service);
	
	if (!service.path.size())
	{
		DescriptionForEPGSearch = "";
		cdescr.show();
		cname.setFlags(RS_FADE);
		cname.resize( eSize( clientrect.width()/8*7-4, clientrect.height()/3) );
		int opos=service.getDVBNamespace().get()>>16;
		if ( eSystemInfo::getInstance()->getFEType() == eSystemInfo::feSatellite )
			copos.setText(eString().sprintf("%d.%d\xC2\xB0%c", abs(opos / 10), abs(opos % 10), opos>0?'E':'W') );
		EITEvent *e = 0;
		e = eEPGCache::getInstance()->lookupEvent(service);
		if (e && eListBoxEntryService::nownextEPG)
		{
			time_t t = e->start_time+e->duration+61;
			delete e;
			e = eEPGCache::getInstance()->lookupEvent((const eServiceReferenceDVB&)service,t);
		}
			
		if (e)  // data is in cache...
		{
			ParseEITInfo(e);
			delete e;
		}
		else  // we parse the eit...
		{
			cname.setText(_("no data for this service avail"));
			eDVBServiceController *sapi=eDVB::getInstance()->getServiceAPI();
			if (!sapi)
				return;
			eServiceReferenceDVB &ref = sapi->service;

			int type = ((service.getTransportStreamID()==ref.getTransportStreamID())
				&&	(service.getOriginalNetworkID()==ref.getOriginalNetworkID())) ? EIT::tsActual:EIT::tsOther;

			eit = new EIT( EIT::typeNowNext, service.getServiceID().get(), type );
			CONNECT( eit->tableReady, eChannelInfo::EITready );
			eit->start();
		}
	} else
コード例 #22
0
void eIBitmapOp::_preExecute()
{
    // bitmap operators always operate on
    // smallest input bitmap operator size
    if (getAboveOpCount() > 0)
    {
        eSize size(eS32_MAX, eS32_MAX);

        for (eU32 i=0; i<getAboveOpCount(); i++)
        {
            const Result &res = ((eIBitmapOp *)getAboveOp(i))->getResult();
            size.minComponents(eSize(res.uav->tex->width, res.uav->tex->height));
        }

        _reallocate(size.x, size.y);
    }
}
コード例 #23
0
ファイル: listbox.cpp プロジェクト: nx111/OpenPLi-1
void eListBoxBase::recalcScrollBar()
{
	int scrollbarwidth=0;
	eRect rc;
	if ( have_focus && deco_selected )
		rc = crect_selected;
	else if ( deco )
		rc = crect;
	else
		rc = clientrect;
	scrollbarwidth=rc.width()/16;
	if ( scrollbarwidth < 18 )
		scrollbarwidth=18;
	if ( scrollbarwidth > 22 )
		scrollbarwidth=22;
	scrollbar->move( ePoint(rc.right() - scrollbarwidth, rc.top()) );
	scrollbar->resize( eSize( scrollbarwidth, (MaxEntries*item_height) ) );
	scrollbar->hide();
}
コード例 #24
0
ファイル: ewidget.cpp プロジェクト: BananaSamurai/Enigma2
eWidget::eWidget(eWidget *parent): m_animation(this), m_parent(parent ? parent->child() : 0)
{
	m_vis = 0;
	m_layer = 0;
	m_desktop = 0;
	m_have_background_color = 0;
	m_z_position = 0;
	m_lowered = 0;
	m_client_offset = eSize(0, 0);
	if (m_parent)
		m_vis = wVisShow;
	if (m_parent)
	{
		insertIntoParent();
		m_parent->getStyle(m_style);
	}

	m_current_focus = 0;
	m_focus_owner = 0;
	m_notify_child_on_position_change = 1;
}
コード例 #25
0
//Used to find the row of W that has the smallest norm
int get_smallest(int NUM_TX, int NUM_RX, Matrix W, Matrix picked, int & up_to)
{
	double smallest_size = 99999999;
	int smallest_int = -1;
	int temp_up_to = -1;
	for(int i = 0; i < NUM_TX; i++)
	{
		if( picked(i,0) == 0)
		{
			temp_up_to++;
			Matrix temp(NUM_RX,1);
			for(int j = 0;j< NUM_RX; j++)
				temp(j,0) = W(temp_up_to,j);
			double size = eSize(temp,NUM_RX);
			if(size < smallest_size)
			{
				smallest_int = i;
				smallest_size = size;
				up_to = temp_up_to;
			}
		}
	}
	return smallest_int;
}			
コード例 #26
0
eZapEmuSetup::eZapEmuSetup ():
eWindow (0)
{
  int i;

#ifdef DEBUG
  printf ("eZapEmuSetup::eZapEmuSetup()\n");
#endif

  Serial = NULL;

  RC->read ();

  setText (_(TITLE));
  cmove (ePoint (170, 150));
  cresize (eSize (390, 350));

  int fd = eSkin::getActive ()->queryValue ("fontsize", 16);

#ifdef OLD_CODE
  RC->Enabled = eZapEmuSetup::EmuEnabled ();
  RC->StartServer = eZapEmuSetup::EmuStartServer ();
  RC->StartDhcp = eZapEmuSetup::EmuStartDhcp ();
  RC->v_SelectedEmu = eZapEmuSetup::WichEmu ();
#endif

  eLabel *l = new eLabel (this);
  l->setText (_("Select Emu:"));
  l->move (ePoint (10, 10));
  l->resize (eSize (200, fd + 4));

  eListBoxEntryText *entrys[10];
  SelectedEmu = new eListBox < eListBoxEntryText > (this, l);
  SelectedEmu->loadDeco ();
  SelectedEmu->setFlags (eListBox < eListBoxEntryText >::flagNoUpDownMovement);
  SelectedEmu->move (ePoint (160, 10));
  SelectedEmu->resize (eSize (200, 35));
  for (i = 0; i < RC->no_emu; i++)
    {
      // printf ("R:(%s) i=%i\n", EMU[i], i);
      entrys[i] = new eListBoxEntryText (SelectedEmu, EMU[i], (void *) i);
    }
  SelectedEmu->setCurrent (entrys[RC->v_SelectedEmu]);
  SelectedEmu->setHelpText (_("choose emu ( left, right )"));
  CONNECT (SelectedEmu->selected, eZapEmuSetup::EmuSetup);

  eLabel *l2 = new eLabel (this);
  l2->setText (_("Select Server:"));
  l2->move (ePoint (10, 50));
  l2->resize (eSize (200, fd + 4));

  eListBoxEntryText *entrys2[10];
  SelectedCrdsrv = new eListBox < eListBoxEntryText > (this, l);
  SelectedCrdsrv->loadDeco ();
  SelectedCrdsrv->setFlags (eListBox < eListBoxEntryText >::flagNoUpDownMovement);
  SelectedCrdsrv->move (ePoint (160, 50));
  SelectedCrdsrv->resize (eSize (200, 35));
  for (i = 0; i < RC->no_crdsrv; i++)
    {
      // printf ("R:(%s) i=%i\n", CRDSRV[i], i);
      entrys2[i] = new eListBoxEntryText (SelectedCrdsrv, CRDSRV[i], (void *) i);
    }
  SelectedCrdsrv->setCurrent (entrys2[RC->v_SelectedCrdsrv]);
  SelectedCrdsrv->setHelpText (_("choose card server ( left, right )"));
  CONNECT (SelectedCrdsrv->selected, eZapEmuSetup::EmuSetup);


#ifdef NOT_ANY_MORE
  eEmuEnabled = new eCheckbox (this, Enabled, 1);
  eEmuEnabled->setText (_("Emu"));
  eEmuEnabled->move (ePoint (10, 50));
  eEmuEnabled->resize (eSize (fd + 4 + 150, fd + 4));
  eEmuEnabled->setHelpText (_("enable/disable emu"));
  CONNECT (eEmuEnabled->checked, eZapEmuSetup::EmuEnabledChanged);
#endif

  keyupdate = new eButton (this);
  keyupdate->setShortcut ("blue");
  keyupdate->setShortcutPixmap ("blue");
  keyupdate->setText (_("Key setting"));
  keyupdate->move (ePoint (20, 90));
  keyupdate->resize (eSize (170, 40));
  keyupdate->setHelpText (_("Launch the key update and convert plugin"));
  keyupdate->loadDeco ();
  CONNECT (keyupdate->selected, eZapEmuSetup::keyupdatePressed);

#ifdef NOT_ANY_MORE
  softcam2all = new eButton (this);
  softcam2all->setText (_("Soft -> all"));
  softcam2all->setShortcut ("yellow");
  softcam2all->setShortcutPixmap ("yellow");
  softcam2all->move (ePoint (20, 100));
  softcam2all->resize (eSize (170, 40));
  softcam2all->setHelpText (_("Convert SoftCam.Key to all other key formats"));
  softcam2all->loadDeco ();
  CONNECT (softcam2all->selected, eZapEmuSetup::softcam2allPressed);
#endif

  v_CardInfo = CardInfo ();
  if (v_CardInfo == 0)
    {
      cardinfo = new eButton (this);
      cardinfo->setShortcut ("yellow");
      cardinfo->setShortcutPixmap ("yellow");
      cardinfo->setText (_("Card info"));
      cardinfo->move (ePoint (210, 90));
      cardinfo->resize (eSize (170, 40));
      cardinfo->setHelpText (_("Show some info of seca card"));
      cardinfo->loadDeco ();
      CONNECT (cardinfo->selected, eZapEmuSetup::cardinfoPressed);
    }

#ifdef NOT_ANY_MORE
  extraset = new eButton (this);
  extraset->setShortcut ("1");
  extraset->setShortcutPixmap ("1");
  extraset->setText (_("Extra Setup"));
  extraset->move (ePoint (20, 220));
  extraset->resize (eSize (170, 40));
  extraset->setHelpText (_("Enter the extra setup menu"));
  extraset->loadDeco ();
  CONNECT (extraset->selected, eZapEmuSetup::ExtraSettings);

  v_IpInfo = IpInfo ();
  if (v_IpInfo == 0)
    {
      ipinfo = new eButton (this);
      ipinfo->setShortcut ("2");
      ipinfo->setShortcutPixmap ("2");
      ipinfo->setText (_("DHCP info"));
      ipinfo->move (ePoint (210, 220));
      ipinfo->resize (eSize (170, 40));
      ipinfo->setHelpText (_("Show some info of seca card"));
      ipinfo->loadDeco ();
      CONNECT (ipinfo->selected, eZapEmuSetup::ipinfoPressed);
    }
#endif

  ok = new eButton (this);
  ok->setText (_("save"));
  ok->setShortcut ("green");
  ok->setShortcutPixmap ("green");
  ok->move (ePoint (20, 270));
  ok->resize (eSize (170, 40));
  ok->setHelpText (_("save changes and return"));
  ok->loadDeco ();
  CONNECT (ok->selected, eZapEmuSetup::okPressed);

  abort = new eButton (this);
  abort->setShortcut ("red");
  abort->setShortcutPixmap ("red");
  abort->loadDeco ();
  abort->setText (_("abort"));
  abort->move (ePoint (210, 270));
  abort->resize (eSize (170, 40));
  abort->setHelpText (_("ignore changes and return"));
  CONNECT (abort->selected, eZapEmuSetup::abortPressed);

  statusbar = new eStatusBar (this);
  statusbar->move (ePoint (0, clientrect.height () - 30));
  statusbar->resize (eSize (clientrect.width (), 30));
  statusbar->loadDeco ();
}
コード例 #27
0
ファイル: enigma.cpp プロジェクト: st7TEAM/e2a
int main(int argc, char **argv)
{
#ifdef MEMLEAK_CHECK
	atexit(DumpUnfreed);
#endif

#ifdef OBJECT_DEBUG
	atexit(object_dump);
#endif

	gst_init(&argc, &argv);

	// set pythonpath if unset
	setenv("PYTHONPATH", eEnv::resolve("${libdir}/enigma2/python").c_str(), 0);
	printf("PYTHONPATH: %s\n", getenv("PYTHONPATH"));
	
	bsodLogInit();

	ePython python;
	eMain main;

#if 1
	ePtr<gMainDC> my_dc;
	gMainDC::getInstance(my_dc);
	
	//int double_buffer = my_dc->haveDoubleBuffering();

	ePtr<gLCDDC> my_lcd_dc;
	gLCDDC::getInstance(my_lcd_dc);


		/* ok, this is currently hardcoded for arabic. */
			/* some characters are wrong in the regular font, force them to use the replacement font */
	for (int i = 0x60c; i <= 0x66d; ++i)
		eTextPara::forceReplacementGlyph(i);
	eTextPara::forceReplacementGlyph(0xfdf2);
	for (int i = 0xfe80; i < 0xff00; ++i)
		eTextPara::forceReplacementGlyph(i);

//	eWidgetDesktop dsk(eSize(720, 576));
	eWidgetDesktop dsk(eSize(1280, 720));
	
        eWidgetDesktop dsk_lcd(my_lcd_dc->size());

	dsk.setStyleID(0);
	dsk_lcd.setStyleID(my_lcd_dc->size().width() == 96 ? 2 : 1);

/*	if (double_buffer)
	{
		eDebug(" - double buffering found, enable buffered graphics mode.");
		dsk.setCompositionMode(eWidgetDesktop::cmBuffered);
	} */
	
	wdsk = &dsk;
	lcddsk = &dsk_lcd;

	dsk.setDC(my_dc);
	dsk_lcd.setDC(my_lcd_dc);

	dsk.setBackgroundColor(gRGB(0,0,0,0xFF));
#endif

		/* redrawing is done in an idle-timer, so we have to set the context */
	dsk.setRedrawTask(main);
	dsk_lcd.setRedrawTask(main);
	
	
	eDebug("Loading spinners...");
	
	{
		int i;
#define MAX_SPINNER 64
		ePtr<gPixmap> wait[MAX_SPINNER];
		for (i=0; i<MAX_SPINNER; ++i)
		{
			char filename[64];
			std::string rfilename;
			snprintf(filename, sizeof(filename), "${datadir}/enigma2/skin_default/spinner/wait%d.png", i + 1);
			rfilename = eEnv::resolve(filename);
			loadPNG(wait[i], rfilename.c_str());
			
			if (!wait[i])
			{
				if (!i)
					eDebug("failed to load %s! (%m)", rfilename.c_str());
				else
					eDebug("found %d spinner!\n", i);
				break;
			}
		}
		if (i)
			my_dc->setSpinner(eRect(ePoint(100, 100), wait[0]->size()), wait, i);
		else
			my_dc->setSpinner(eRect(100, 100, 0, 0), wait, 1);
	}
	
	gRC::getInstance()->setSpinnerDC(my_dc);

	eRCInput::getInstance()->keyEvent.connect(slot(keyEvent));
	
	printf("executing main\n");
	
	bsodCatchSignals();

	setIoPrio(IOPRIO_CLASS_BE, 3);

//	python.execute("mytest", "__main__");
	python.execFile(eEnv::resolve("${libdir}/enigma2/python/mytest.py").c_str());

	extern void setFullsize(); // definend in lib/gui/evideo.cpp
	setFullsize();

	if (exit_code == 5) /* python crash */
	{
		eDebug("(exit code 5)");
		bsodFatal(0);
	}
	
	dsk.paint();
	dsk_lcd.paint();

	{
		gPainter p(my_lcd_dc);
		p.resetClip(eRect(ePoint(0, 0), my_lcd_dc->size()));
		p.clear();
		p.flush();
	}

	return exit_code;
}
コード例 #28
0
ファイル: grc.cpp プロジェクト: Adga52/enigma2
void *gRC::thread()
{
	int need_notify = 0;
#ifdef USE_LIBVUGLES2
	if (gles_open()) {
		gles_state_open();
		gles_viewport(720, 576, 720 * 4);
	}
#endif
#ifndef SYNC_PAINT
	while (1)
	{
#else
	while (rp != wp)
	{
#endif
#ifndef SYNC_PAINT
		pthread_mutex_lock(&mutex);
#endif
		if ( rp != wp )
		{
				/* make sure the spinner is not displayed when we something is painted */
			disableSpinner();

			gOpcode o(queue[rp++]);
			if ( rp == MAXSIZE )
				rp=0;
#ifndef SYNC_PAINT
			pthread_mutex_unlock(&mutex);
#endif
			if (o.opcode==gOpcode::shutdown)
				break;
			else if (o.opcode==gOpcode::notify)
				need_notify = 1;
			else if (o.opcode==gOpcode::setCompositing)
			{
				m_compositing = o.parm.setCompositing;
				m_compositing->Release();
			} else if(o.dc)
			{
				o.dc->exec(&o);
				// o.dc is a gDC* filled with grabref... so we must release it here
				o.dc->Release();
			}
		}
		else
		{
			if (need_notify)
			{
				need_notify = 0;
				m_notify_pump.send(1);
			}
#ifndef SYNC_PAINT
			while(rp == wp)
			{

					/* when the main thread is non-idle for a too long time without any display output,
					   we want to display a spinner. */
				struct timespec timeout;
				clock_gettime(CLOCK_REALTIME, &timeout);

				if (m_spinner_enabled)
				{
					timeout.tv_nsec += 100*1000*1000;
					/* yes, this is required. */
					if (timeout.tv_nsec > 1000*1000*1000)
					{
						timeout.tv_nsec -= 1000*1000*1000;
						timeout.tv_sec++;
					}
				}
				else
					timeout.tv_sec += 2;

				int idle = 1;

				if (pthread_cond_timedwait(&cond, &mutex, &timeout) == ETIMEDOUT)
				{
					if (eApp && !eApp->isIdle())
					{
						int idle_count = eApp->idleCount();
						if (idle_count == m_prev_idle_count)
							idle = 0;
						else
							m_prev_idle_count = idle_count;
					}
				}

				if (!idle)
				{
					if (!m_spinner_enabled)
						eDebug("main thread is non-idle! display spinner!");
					enableSpinner();
				} else
					disableSpinner();
			}
			pthread_mutex_unlock(&mutex);
#endif
		}
	}
#ifdef USE_LIBVUGLES2
	gles_state_close();
	gles_close();
#endif
#ifndef SYNC_PAINT
	pthread_exit(0);
#endif
	return 0;
}

void gRC::recv_notify(const int &i)
{
	notify();
}

gRC *gRC::getInstance()
{
	return instance;
}

void gRC::enableSpinner()
{
	if (!m_spinner_dc)
	{
		eDebug("no spinner DC!");
		return;
	}

	if (m_spinneronoff)
	{
		gOpcode o;
		o.opcode = m_spinner_enabled ? gOpcode::incrementSpinner : gOpcode::enableSpinner;
		m_spinner_dc->exec(&o);
		o.opcode = gOpcode::flush;
		m_spinner_dc->exec(&o);
	}
	m_spinner_enabled = 1;
}

void gRC::disableSpinner()
{
	if (!m_spinner_enabled)
		return;

	if (!m_spinner_dc)
	{
		eDebug("no spinner DC!");
		return;
	}

	m_spinner_enabled = 0;

	gOpcode o;
	o.opcode = gOpcode::disableSpinner;
	m_spinner_dc->exec(&o);
	o.opcode = gOpcode::flush;
	m_spinner_dc->exec(&o);
}

static int gPainter_instances;

gPainter::gPainter(gDC *dc, eRect rect): m_dc(dc), m_rc(gRC::getInstance())
{
//	ASSERT(!gPainter_instances);
	gPainter_instances++;
//	begin(rect);
}

gPainter::~gPainter()
{
	end();
	gPainter_instances--;
}

void gPainter::setBackgroundColor(const gColor &color)
{
	if ( m_dc->islocked() )
		return;
	gOpcode o;
	o.opcode = gOpcode::setBackgroundColor;
	o.dc = m_dc.grabRef();
	o.parm.setColor = new gOpcode::para::psetColor;
	o.parm.setColor->color = color;

	m_rc->submit(o);
}

void gPainter::setForegroundColor(const gColor &color)
{
	if ( m_dc->islocked() )
		return;
	gOpcode o;
	o.opcode = gOpcode::setForegroundColor;
	o.dc = m_dc.grabRef();
	o.parm.setColor = new gOpcode::para::psetColor;
	o.parm.setColor->color = color;

	m_rc->submit(o);
}

void gPainter::setBackgroundColor(const gRGB &color)
{
	if ( m_dc->islocked() )
		return;
	gOpcode o;
	o.opcode = gOpcode::setBackgroundColorRGB;
	o.dc = m_dc.grabRef();
	o.parm.setColorRGB = new gOpcode::para::psetColorRGB;
	o.parm.setColorRGB->color = color;

	m_rc->submit(o);
}

void gPainter::setForegroundColor(const gRGB &color)
{
	if ( m_dc->islocked() )
		return;
	gOpcode o;
	o.opcode = gOpcode::setForegroundColorRGB;
	o.dc = m_dc.grabRef();
	o.parm.setColorRGB = new gOpcode::para::psetColorRGB;
	o.parm.setColorRGB->color = color;

	m_rc->submit(o);
}

void gPainter::setFont(gFont *font)
{
	if ( m_dc->islocked() )
		return;
	gOpcode o;
	o.opcode = gOpcode::setFont;
	o.dc = m_dc.grabRef();
	font->AddRef();
	o.parm.setFont = new gOpcode::para::psetFont;
	o.parm.setFont->font = font;

	m_rc->submit(o);
}

void gPainter::renderText(const eRect &pos, const std::string &string, int flags, gRGB bordercolor, int border)
{
	if (string.empty()) return;
	if ( m_dc->islocked() )
		return;
	gOpcode o;
	o.opcode=gOpcode::renderText;
	o.dc = m_dc.grabRef();
	o.parm.renderText = new gOpcode::para::prenderText;
	o.parm.renderText->area = pos;
	o.parm.renderText->text = strdup(string.c_str());
	o.parm.renderText->flags = flags;
	o.parm.renderText->border = border;
	o.parm.renderText->bordercolor = bordercolor;
	m_rc->submit(o);
}

void gPainter::renderPara(eTextPara *para, ePoint offset)
{
	if ( m_dc->islocked() )
		return;
	ASSERT(para);
	gOpcode o;
	o.opcode=gOpcode::renderPara;
	o.dc = m_dc.grabRef();
	o.parm.renderPara = new gOpcode::para::prenderPara;
	o.parm.renderPara->offset = offset;

 	para->AddRef();
	o.parm.renderPara->textpara = para;
	m_rc->submit(o);
}

void gPainter::fill(const eRect &area)
{
	if ( m_dc->islocked() )
		return;
	gOpcode o;
	o.opcode=gOpcode::fill;

	o.dc = m_dc.grabRef();
	o.parm.fill = new gOpcode::para::pfillRect;
	o.parm.fill->area = area;
	m_rc->submit(o);
}

void gPainter::fill(const gRegion &region)
{
	if ( m_dc->islocked() )
		return;
	gOpcode o;
	o.opcode=gOpcode::fillRegion;

	o.dc = m_dc.grabRef();
	o.parm.fillRegion = new gOpcode::para::pfillRegion;
	o.parm.fillRegion->region = region;
	m_rc->submit(o);
}

void gPainter::clear()
{
	if ( m_dc->islocked() )
		return;
	gOpcode o;
	o.opcode=gOpcode::clear;
	o.dc = m_dc.grabRef();
	o.parm.fill = new gOpcode::para::pfillRect;
	o.parm.fill->area = eRect();
	m_rc->submit(o);
}

void gPainter::blit(gPixmap *pixmap, ePoint pos, const eRect &clip, int flags)
{
	blitScale(pixmap, eRect(pos, eSize()), clip, flags, 0);
}
コード例 #29
0
eWizardTVSystem::eWizardTVSystem(): eWindow(0)
{
	v_tvsystem=1;
	eConfig::getInstance()->getKey("/elitedvb/video/tvsystem", v_tvsystem );

	int fd=eSkin::getActive()->queryValue("fontsize", 20);

	setText(_("TV System Wizard"));
	move(ePoint(160, 120));
	cresize(eSize(390, 170));

	eLabel *l=new eLabel(this);
	l->setText(_("TV System:"));
	l->move(ePoint(20, 10));
	l->resize(eSize(150, fd+4));

	tvsystem=new eListBox<eListBoxEntryText>(this, l);
	tvsystem->loadDeco();
	tvsystem->setFlags(eListBox<eListBoxEntryText>::flagNoUpDownMovement);

	// our bitmask is:

	// have pal     1
	// have ntsc    2
	// have pal60   4  (aka. PAL-M bis wir PAL60 supporten)

	// allowed bitmasks:

	//  1    pal only, no ntsc
	//  2    ntsc only, no pal
	//  3    multinorm
	//  5    pal, pal60

	eListBoxEntryText *entrys[4];
	tvsystem->move(ePoint(180, 10));
	tvsystem->resize(eSize(170, 35));
	tvsystem->setHelpText(_("choose TV system ( left, right )"));
	entrys[0]=new eListBoxEntryText(tvsystem, "PAL", (void*)1);
	entrys[1]=new eListBoxEntryText(tvsystem, "PAL + PAL60", (void*)5);
	entrys[2]=new eListBoxEntryText(tvsystem, "Multinorm", (void*)3);
	entrys[3]=new eListBoxEntryText(tvsystem, "NTSC", (void*)2);

	int i = 0;
	switch (v_tvsystem)
	{
	case 1: i = 0; break;
	case 5: i = 1; break;
	case 3: i = 2; break;
	case 2: i = 3; break;
	}
	tvsystem->setCurrent(entrys[i]);
	CONNECT( tvsystem->selchanged, eWizardTVSystem::TVSystemChanged );

	ok=new eButton(this);
	ok->setText(_("save"));
	ok->setShortcut("green");
	ok->setShortcutPixmap("green");
	ok->move(ePoint(20, 65));
	ok->resize(eSize(220, 40));
	ok->setHelpText(_("save changes and return"));
	ok->loadDeco();
	CONNECT(ok->selected, eWizardTVSystem::okPressed);

	eStatusBar *status = new eStatusBar(this);
	status->move( ePoint(0, clientrect.height()-50) );
	status->resize( eSize( clientrect.width(), 50) );
	status->loadDeco();
}
コード例 #30
0
void eZapVideoSetup::init_eZapVideoSetup()
{
/*	eSkin *skin=eSkin::getActive();
	if (skin->build(this, "setup.video"))
		qFatal("skin load of \"setup.video\" failed");*/

/*	cresize( eSize(height(), width()) );
	cmove( ePoint(0,0) );*/

	if (eConfig::getInstance()->getKey("/elitedvb/video/colorformat", v_colorformat))
		v_colorformat = 1;

	if (eConfig::getInstance()->getKey("/elitedvb/video/pin8", v_pin8))
		v_pin8 = 0;

	if (eConfig::getInstance()->getKey("/elitedvb/video/disableWSS", v_disableWSS ))
		v_disableWSS = 0;

	if (eConfig::getInstance()->getKey("/elitedvb/video/tvsystem", v_tvsystem ))
		v_tvsystem = 1;
		
	if (!v_tvsystem)
		v_tvsystem = 1;

	if (eConfig::getInstance()->getKey("/elitedvb/video/vcr_switching", v_VCRSwitching ))
		v_VCRSwitching=1;

	int fd=eSkin::getActive()->queryValue("fontsize", 20);

	setText(_("A/V Settings"));
	move(ePoint(160, 90));
	cresize(eSize(390, 350));

	eLabel *l=new eLabel(this);
	l->setText(_("Color Format:"));
	l->move(ePoint(20, 20));
	l->resize(eSize(150, fd+4));

	colorformat=new eListBox<eListBoxEntryText>(this, l);
	colorformat->loadDeco();
	colorformat->setFlags(eListBox<eListBoxEntryText>::flagNoUpDownMovement);
	colorformat->move(ePoint(180, 20));
	colorformat->resize(eSize(120, 35));
	eListBoxEntryText* entrys[4];
	entrys[0]=new eListBoxEntryText(colorformat, _("CVBS"), (void*)1);
	entrys[1]=new eListBoxEntryText(colorformat, _("RGB"), (void*)2);
	entrys[2]=new eListBoxEntryText(colorformat, _("SVideo"), (void*)3);
	entrys[3]=new eListBoxEntryText(colorformat, _("YPbPr"), (void*)4);

/*	http://forum.tuxbox.org/forum/viewtopic.php?t=34005
	if( eSystemInfo::getInstance()->getHwType() > eSystemInfo::dbox2Philips  )
		entrys[3]=new eListBoxEntryText(colorformat, _("YPbPr"), (void*)4);*/

	colorformat->setCurrent(entrys[v_colorformat-1]);
	colorformat->setHelpText(_("choose color format ( left, right )"));
	CONNECT( colorformat->selchanged, eZapVideoSetup::CFormatChanged );

  l=new eLabel(this);
	l->setText(_("Aspect Ratio:"));
	l->move(ePoint(20, 60));
	l->resize(eSize(150, fd+4));
	
	pin8=new eListBox<eListBoxEntryText>(this, l);
	pin8->loadDeco();	
	pin8->setFlags(eListBox<eListBoxEntryText>::flagNoUpDownMovement);
	
	pin8->move(ePoint(180, 60));
	pin8->resize(eSize(170, 35));
	pin8->setHelpText(_("choose aspect ratio ( left, right )"));
	entrys[0]=new eListBoxEntryText(pin8, _("4:3 letterbox"), (void*)0);
	entrys[1]=new eListBoxEntryText(pin8, _("4:3 panscan"), (void*)1);
	entrys[2]=new eListBoxEntryText(pin8, _("16:9"), (void*)2);
	/* dbox, dm700, dm7020 can do black bars left and right of 4:3 video */
	if ( eSystemInfo::getInstance()->getHwType() <= eSystemInfo::DM7020 )
		entrys[3]=new eListBoxEntryText(pin8, _("always 16:9"), (void*)3);
	pin8->setCurrent(entrys[v_pin8]);
	CONNECT( pin8->selchanged, eZapVideoSetup::VPin8Changed );

	l=new eLabel(this);
	l->setText(_("TV System:"));
	l->move(ePoint(20, 100));
	l->resize(eSize(150, fd+4));
	
	tvsystem=new eListBox<eListBoxEntryText>(this, l);
	tvsystem->loadDeco();	
	tvsystem->setFlags(eListBox<eListBoxEntryText>::flagNoUpDownMovement);
	
	// our bitmask is:
	
	// have pal     1
	// have ntsc    2
	// have pal60   4  (aka. PAL-M bis wir PAL60 supporten)
	
	// allowed bitmasks:
	
	//  1    pal only, no ntsc
	//  2    ntsc only, no pal
	//  3    multinorm
	//  5    pal, pal60
	
	tvsystem->move(ePoint(180, 100));
	tvsystem->resize(eSize(170, 35));
	tvsystem->setHelpText(_("choose TV system ( left, right )"));
	entrys[0]=new eListBoxEntryText(tvsystem, "PAL", (void*)1);
	entrys[1]=new eListBoxEntryText(tvsystem, "PAL + PAL60", (void*)5);
	entrys[2]=new eListBoxEntryText(tvsystem, "Multinorm", (void*)3);
	entrys[3]=new eListBoxEntryText(tvsystem, "NTSC", (void*)2);
	
	int i = 0;
	switch (v_tvsystem)
	{
	case 1: i = 0; break;
	case 5: i = 1; break;
	case 3: i = 2; break;
	case 2: i = 3; break;
	}
	tvsystem->setCurrent(entrys[i]);
	CONNECT( tvsystem->selchanged, eZapVideoSetup::TVSystemChanged );

	c_disableWSS = new eCheckbox(this, v_disableWSS, 1);
	c_disableWSS->move(ePoint(20,140));
	c_disableWSS->resize(eSize(350,30));
	c_disableWSS->setText(_("Disable WSS on 4:3"));
	c_disableWSS->setHelpText(_("don't send WSS signal when A-ratio is 4:3"));
	CONNECT( c_disableWSS->checked, eZapVideoSetup::DisableWSSChanged );

	int sac3default = 0;
	sac3default=eAudio::getInstance()->getAC3default();

	ac3default=new eCheckbox(this, sac3default, 1);
	ac3default->setText(_("AC3 default output"));
	ac3default->move(ePoint(20, 175));
	ac3default->resize(eSize(350, 30));
	ac3default->setHelpText(_("enable/disable ac3 default output (ok)"));
	CONNECT( ac3default->checked, eZapVideoSetup::ac3defaultChanged );

	if ( eSystemInfo::getInstance()->hasScartSwitch() )
	{
		VCRSwitching=new eCheckbox(this, v_VCRSwitching, 1);
		VCRSwitching->setText(_("Auto VCR switching"));
		VCRSwitching->move(ePoint(20, 205));
		VCRSwitching->resize(eSize(350, 30));
		VCRSwitching->setHelpText(_("auto switch to VCR connector"));
		CONNECT( VCRSwitching->checked, eZapVideoSetup::VCRChanged );
	}

	ok=new eButton(this);
	ok->setText(_("save"));
	ok->setShortcut("green");
	ok->setShortcutPixmap("green");
	ok->move(ePoint(20, 250));
	ok->resize(eSize(220, 40));
	ok->setHelpText(_("save changes and return"));
	ok->loadDeco();

	CONNECT(ok->selected, eZapVideoSetup::okPressed);		

	testpicture=new eButton(this);
	testpicture->setText(_("test"));
	testpicture->setShortcut("blue");
	testpicture->setShortcutPixmap("blue");
	testpicture->move(ePoint(260, 250));
	testpicture->resize(eSize(100, 40));
	testpicture->setHelpText(_("show testpicture"));
	testpicture->loadDeco();

	CONNECT(testpicture->selected, eZapVideoSetup::showTestpicture);		

	status = new eStatusBar(this);	
	status->move( ePoint(0, clientrect.height()-50) );
	status->resize( eSize( clientrect.width(), 50) );
	status->loadDeco();
	setHelpID(86);
}